From f8181d422aa82955fbf1ab00fe2003fe1e85d50e Mon Sep 17 00:00:00 2001
From: zju_wyx <22125041@zju.edu.cn>
Date: Tue, 15 Jul 2025 11:53:40 +0800
Subject: [PATCH 01/10] support overload
Signed-off-by: zju_wyx <22125041@zju.edu.cn>
Change-Id: I61c5cf94022919283d14925859f218f1ea5e64d1
---
lib/tsc.js | 9787 +++++------
lib/tsserver.js | 13676 ++++++++--------
lib/tsserverlibrary.d.ts | 464 +-
lib/tsserverlibrary.js | 13676 ++++++++--------
lib/typescript.d.ts | 464 +-
lib/typescript.js | 13671 +++++++--------
lib/typingsInstaller.js | 4289 ++---
src/compiler/binder.ts | 30 +-
src/compiler/checker.ts | 14 +-
src/compiler/emitter.ts | 36 +-
src/compiler/factory/nodeFactory.ts | 88 +-
src/compiler/factory/nodeTests.ts | 10 +-
src/compiler/parser.ts | 108 +-
src/compiler/scanner.ts | 1 +
src/compiler/transformers/classFields.ts | 4 +
src/compiler/transformers/declarations.ts | 38 +-
.../transformers/declarations/diagnostics.ts | 7 +-
src/compiler/transformers/ts.ts | 4 +
src/compiler/types.ts | 48 +-
src/compiler/utilities.ts | 1 +
src/compiler/utilitiesPublic.ts | 9 +-
src/compiler/visitorPublic.ts | 17 +-
22 files changed, 29064 insertions(+), 27378 deletions(-)
diff --git a/lib/tsc.js b/lib/tsc.js
index 2380a0561b..23c50d749b 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -3871,208 +3871,211 @@ var SyntaxKind2 = /* @__PURE__ */ ((SyntaxKind4) => {
SyntaxKind4[SyntaxKind4["GlobalKeyword"] = 161] = "GlobalKeyword";
SyntaxKind4[SyntaxKind4["BigIntKeyword"] = 162] = "BigIntKeyword";
SyntaxKind4[SyntaxKind4["OverrideKeyword"] = 163] = "OverrideKeyword";
- SyntaxKind4[SyntaxKind4["OfKeyword"] = 164] = "OfKeyword";
- SyntaxKind4[SyntaxKind4["QualifiedName"] = 165] = "QualifiedName";
- SyntaxKind4[SyntaxKind4["ComputedPropertyName"] = 166] = "ComputedPropertyName";
- SyntaxKind4[SyntaxKind4["TypeParameter"] = 167] = "TypeParameter";
- SyntaxKind4[SyntaxKind4["Parameter"] = 168] = "Parameter";
- SyntaxKind4[SyntaxKind4["Decorator"] = 169] = "Decorator";
- SyntaxKind4[SyntaxKind4["PropertySignature"] = 170] = "PropertySignature";
- SyntaxKind4[SyntaxKind4["PropertyDeclaration"] = 171] = "PropertyDeclaration";
- SyntaxKind4[SyntaxKind4["AnnotationPropertyDeclaration"] = 172] = "AnnotationPropertyDeclaration";
- SyntaxKind4[SyntaxKind4["MethodSignature"] = 173] = "MethodSignature";
- SyntaxKind4[SyntaxKind4["MethodDeclaration"] = 174] = "MethodDeclaration";
- SyntaxKind4[SyntaxKind4["ClassStaticBlockDeclaration"] = 175] = "ClassStaticBlockDeclaration";
- SyntaxKind4[SyntaxKind4["Constructor"] = 176] = "Constructor";
- SyntaxKind4[SyntaxKind4["GetAccessor"] = 177] = "GetAccessor";
- SyntaxKind4[SyntaxKind4["SetAccessor"] = 178] = "SetAccessor";
- SyntaxKind4[SyntaxKind4["CallSignature"] = 179] = "CallSignature";
- SyntaxKind4[SyntaxKind4["ConstructSignature"] = 180] = "ConstructSignature";
- SyntaxKind4[SyntaxKind4["IndexSignature"] = 181] = "IndexSignature";
- SyntaxKind4[SyntaxKind4["TypePredicate"] = 182] = "TypePredicate";
- SyntaxKind4[SyntaxKind4["TypeReference"] = 183] = "TypeReference";
- SyntaxKind4[SyntaxKind4["FunctionType"] = 184] = "FunctionType";
- SyntaxKind4[SyntaxKind4["ConstructorType"] = 185] = "ConstructorType";
- SyntaxKind4[SyntaxKind4["TypeQuery"] = 186] = "TypeQuery";
- SyntaxKind4[SyntaxKind4["TypeLiteral"] = 187] = "TypeLiteral";
- SyntaxKind4[SyntaxKind4["ArrayType"] = 188] = "ArrayType";
- SyntaxKind4[SyntaxKind4["TupleType"] = 189] = "TupleType";
- SyntaxKind4[SyntaxKind4["OptionalType"] = 190] = "OptionalType";
- SyntaxKind4[SyntaxKind4["RestType"] = 191] = "RestType";
- SyntaxKind4[SyntaxKind4["UnionType"] = 192] = "UnionType";
- SyntaxKind4[SyntaxKind4["IntersectionType"] = 193] = "IntersectionType";
- SyntaxKind4[SyntaxKind4["ConditionalType"] = 194] = "ConditionalType";
- SyntaxKind4[SyntaxKind4["InferType"] = 195] = "InferType";
- SyntaxKind4[SyntaxKind4["ParenthesizedType"] = 196] = "ParenthesizedType";
- SyntaxKind4[SyntaxKind4["ThisType"] = 197] = "ThisType";
- SyntaxKind4[SyntaxKind4["TypeOperator"] = 198] = "TypeOperator";
- SyntaxKind4[SyntaxKind4["IndexedAccessType"] = 199] = "IndexedAccessType";
- SyntaxKind4[SyntaxKind4["MappedType"] = 200] = "MappedType";
- SyntaxKind4[SyntaxKind4["LiteralType"] = 201] = "LiteralType";
- SyntaxKind4[SyntaxKind4["NamedTupleMember"] = 202] = "NamedTupleMember";
- SyntaxKind4[SyntaxKind4["TemplateLiteralType"] = 203] = "TemplateLiteralType";
- SyntaxKind4[SyntaxKind4["TemplateLiteralTypeSpan"] = 204] = "TemplateLiteralTypeSpan";
- SyntaxKind4[SyntaxKind4["ImportType"] = 205] = "ImportType";
- SyntaxKind4[SyntaxKind4["ObjectBindingPattern"] = 206] = "ObjectBindingPattern";
- SyntaxKind4[SyntaxKind4["ArrayBindingPattern"] = 207] = "ArrayBindingPattern";
- SyntaxKind4[SyntaxKind4["BindingElement"] = 208] = "BindingElement";
- SyntaxKind4[SyntaxKind4["ArrayLiteralExpression"] = 209] = "ArrayLiteralExpression";
- SyntaxKind4[SyntaxKind4["ObjectLiteralExpression"] = 210] = "ObjectLiteralExpression";
- SyntaxKind4[SyntaxKind4["PropertyAccessExpression"] = 211] = "PropertyAccessExpression";
- SyntaxKind4[SyntaxKind4["ElementAccessExpression"] = 212] = "ElementAccessExpression";
- SyntaxKind4[SyntaxKind4["CallExpression"] = 213] = "CallExpression";
- SyntaxKind4[SyntaxKind4["NewExpression"] = 214] = "NewExpression";
- SyntaxKind4[SyntaxKind4["TaggedTemplateExpression"] = 215] = "TaggedTemplateExpression";
- SyntaxKind4[SyntaxKind4["TypeAssertionExpression"] = 216] = "TypeAssertionExpression";
- SyntaxKind4[SyntaxKind4["ParenthesizedExpression"] = 217] = "ParenthesizedExpression";
- SyntaxKind4[SyntaxKind4["FunctionExpression"] = 218] = "FunctionExpression";
- SyntaxKind4[SyntaxKind4["ArrowFunction"] = 219] = "ArrowFunction";
- SyntaxKind4[SyntaxKind4["EtsComponentExpression"] = 220] = "EtsComponentExpression";
- SyntaxKind4[SyntaxKind4["DeleteExpression"] = 221] = "DeleteExpression";
- SyntaxKind4[SyntaxKind4["TypeOfExpression"] = 222] = "TypeOfExpression";
- SyntaxKind4[SyntaxKind4["VoidExpression"] = 223] = "VoidExpression";
- SyntaxKind4[SyntaxKind4["AwaitExpression"] = 224] = "AwaitExpression";
- SyntaxKind4[SyntaxKind4["PrefixUnaryExpression"] = 225] = "PrefixUnaryExpression";
- SyntaxKind4[SyntaxKind4["PostfixUnaryExpression"] = 226] = "PostfixUnaryExpression";
- SyntaxKind4[SyntaxKind4["BinaryExpression"] = 227] = "BinaryExpression";
- SyntaxKind4[SyntaxKind4["ConditionalExpression"] = 228] = "ConditionalExpression";
- SyntaxKind4[SyntaxKind4["TemplateExpression"] = 229] = "TemplateExpression";
- SyntaxKind4[SyntaxKind4["YieldExpression"] = 230] = "YieldExpression";
- SyntaxKind4[SyntaxKind4["SpreadElement"] = 231] = "SpreadElement";
- SyntaxKind4[SyntaxKind4["ClassExpression"] = 232] = "ClassExpression";
- SyntaxKind4[SyntaxKind4["OmittedExpression"] = 233] = "OmittedExpression";
- SyntaxKind4[SyntaxKind4["ExpressionWithTypeArguments"] = 234] = "ExpressionWithTypeArguments";
- SyntaxKind4[SyntaxKind4["AsExpression"] = 235] = "AsExpression";
- SyntaxKind4[SyntaxKind4["NonNullExpression"] = 236] = "NonNullExpression";
- SyntaxKind4[SyntaxKind4["MetaProperty"] = 237] = "MetaProperty";
- SyntaxKind4[SyntaxKind4["SyntheticExpression"] = 238] = "SyntheticExpression";
- SyntaxKind4[SyntaxKind4["SatisfiesExpression"] = 239] = "SatisfiesExpression";
- SyntaxKind4[SyntaxKind4["TemplateSpan"] = 240] = "TemplateSpan";
- SyntaxKind4[SyntaxKind4["SemicolonClassElement"] = 241] = "SemicolonClassElement";
- SyntaxKind4[SyntaxKind4["Block"] = 242] = "Block";
- SyntaxKind4[SyntaxKind4["EmptyStatement"] = 243] = "EmptyStatement";
- SyntaxKind4[SyntaxKind4["VariableStatement"] = 244] = "VariableStatement";
- SyntaxKind4[SyntaxKind4["ExpressionStatement"] = 245] = "ExpressionStatement";
- SyntaxKind4[SyntaxKind4["IfStatement"] = 246] = "IfStatement";
- SyntaxKind4[SyntaxKind4["DoStatement"] = 247] = "DoStatement";
- SyntaxKind4[SyntaxKind4["WhileStatement"] = 248] = "WhileStatement";
- SyntaxKind4[SyntaxKind4["ForStatement"] = 249] = "ForStatement";
- SyntaxKind4[SyntaxKind4["ForInStatement"] = 250] = "ForInStatement";
- SyntaxKind4[SyntaxKind4["ForOfStatement"] = 251] = "ForOfStatement";
- SyntaxKind4[SyntaxKind4["ContinueStatement"] = 252] = "ContinueStatement";
- SyntaxKind4[SyntaxKind4["BreakStatement"] = 253] = "BreakStatement";
- SyntaxKind4[SyntaxKind4["ReturnStatement"] = 254] = "ReturnStatement";
- SyntaxKind4[SyntaxKind4["WithStatement"] = 255] = "WithStatement";
- SyntaxKind4[SyntaxKind4["SwitchStatement"] = 256] = "SwitchStatement";
- SyntaxKind4[SyntaxKind4["LabeledStatement"] = 257] = "LabeledStatement";
- SyntaxKind4[SyntaxKind4["ThrowStatement"] = 258] = "ThrowStatement";
- SyntaxKind4[SyntaxKind4["TryStatement"] = 259] = "TryStatement";
- SyntaxKind4[SyntaxKind4["DebuggerStatement"] = 260] = "DebuggerStatement";
- SyntaxKind4[SyntaxKind4["VariableDeclaration"] = 261] = "VariableDeclaration";
- SyntaxKind4[SyntaxKind4["VariableDeclarationList"] = 262] = "VariableDeclarationList";
- SyntaxKind4[SyntaxKind4["FunctionDeclaration"] = 263] = "FunctionDeclaration";
- SyntaxKind4[SyntaxKind4["ClassDeclaration"] = 264] = "ClassDeclaration";
- SyntaxKind4[SyntaxKind4["StructDeclaration"] = 265] = "StructDeclaration";
- SyntaxKind4[SyntaxKind4["AnnotationDeclaration"] = 266] = "AnnotationDeclaration";
- SyntaxKind4[SyntaxKind4["InterfaceDeclaration"] = 267] = "InterfaceDeclaration";
- SyntaxKind4[SyntaxKind4["TypeAliasDeclaration"] = 268] = "TypeAliasDeclaration";
- SyntaxKind4[SyntaxKind4["EnumDeclaration"] = 269] = "EnumDeclaration";
- SyntaxKind4[SyntaxKind4["ModuleDeclaration"] = 270] = "ModuleDeclaration";
- SyntaxKind4[SyntaxKind4["ModuleBlock"] = 271] = "ModuleBlock";
- SyntaxKind4[SyntaxKind4["CaseBlock"] = 272] = "CaseBlock";
- SyntaxKind4[SyntaxKind4["NamespaceExportDeclaration"] = 273] = "NamespaceExportDeclaration";
- SyntaxKind4[SyntaxKind4["ImportEqualsDeclaration"] = 274] = "ImportEqualsDeclaration";
- SyntaxKind4[SyntaxKind4["ImportDeclaration"] = 275] = "ImportDeclaration";
- SyntaxKind4[SyntaxKind4["ImportClause"] = 276] = "ImportClause";
- SyntaxKind4[SyntaxKind4["NamespaceImport"] = 277] = "NamespaceImport";
- SyntaxKind4[SyntaxKind4["NamedImports"] = 278] = "NamedImports";
- SyntaxKind4[SyntaxKind4["ImportSpecifier"] = 279] = "ImportSpecifier";
- SyntaxKind4[SyntaxKind4["ExportAssignment"] = 280] = "ExportAssignment";
- SyntaxKind4[SyntaxKind4["ExportDeclaration"] = 281] = "ExportDeclaration";
- SyntaxKind4[SyntaxKind4["NamedExports"] = 282] = "NamedExports";
- SyntaxKind4[SyntaxKind4["NamespaceExport"] = 283] = "NamespaceExport";
- SyntaxKind4[SyntaxKind4["ExportSpecifier"] = 284] = "ExportSpecifier";
- SyntaxKind4[SyntaxKind4["MissingDeclaration"] = 285] = "MissingDeclaration";
- SyntaxKind4[SyntaxKind4["ExternalModuleReference"] = 286] = "ExternalModuleReference";
- SyntaxKind4[SyntaxKind4["JsxElement"] = 287] = "JsxElement";
- SyntaxKind4[SyntaxKind4["JsxSelfClosingElement"] = 288] = "JsxSelfClosingElement";
- SyntaxKind4[SyntaxKind4["JsxOpeningElement"] = 289] = "JsxOpeningElement";
- SyntaxKind4[SyntaxKind4["JsxClosingElement"] = 290] = "JsxClosingElement";
- SyntaxKind4[SyntaxKind4["JsxFragment"] = 291] = "JsxFragment";
- SyntaxKind4[SyntaxKind4["JsxOpeningFragment"] = 292] = "JsxOpeningFragment";
- SyntaxKind4[SyntaxKind4["JsxClosingFragment"] = 293] = "JsxClosingFragment";
- SyntaxKind4[SyntaxKind4["JsxAttribute"] = 294] = "JsxAttribute";
- SyntaxKind4[SyntaxKind4["JsxAttributes"] = 295] = "JsxAttributes";
- SyntaxKind4[SyntaxKind4["JsxSpreadAttribute"] = 296] = "JsxSpreadAttribute";
- SyntaxKind4[SyntaxKind4["JsxExpression"] = 297] = "JsxExpression";
- SyntaxKind4[SyntaxKind4["CaseClause"] = 298] = "CaseClause";
- SyntaxKind4[SyntaxKind4["DefaultClause"] = 299] = "DefaultClause";
- SyntaxKind4[SyntaxKind4["HeritageClause"] = 300] = "HeritageClause";
- SyntaxKind4[SyntaxKind4["CatchClause"] = 301] = "CatchClause";
- SyntaxKind4[SyntaxKind4["AssertClause"] = 302] = "AssertClause";
- SyntaxKind4[SyntaxKind4["AssertEntry"] = 303] = "AssertEntry";
- SyntaxKind4[SyntaxKind4["ImportTypeAssertionContainer"] = 304] = "ImportTypeAssertionContainer";
- SyntaxKind4[SyntaxKind4["PropertyAssignment"] = 305] = "PropertyAssignment";
- SyntaxKind4[SyntaxKind4["ShorthandPropertyAssignment"] = 306] = "ShorthandPropertyAssignment";
- SyntaxKind4[SyntaxKind4["SpreadAssignment"] = 307] = "SpreadAssignment";
- SyntaxKind4[SyntaxKind4["EnumMember"] = 308] = "EnumMember";
- SyntaxKind4[SyntaxKind4["UnparsedPrologue"] = 309] = "UnparsedPrologue";
- SyntaxKind4[SyntaxKind4["UnparsedPrepend"] = 310] = "UnparsedPrepend";
- SyntaxKind4[SyntaxKind4["UnparsedText"] = 311] = "UnparsedText";
- SyntaxKind4[SyntaxKind4["UnparsedInternalText"] = 312] = "UnparsedInternalText";
- SyntaxKind4[SyntaxKind4["UnparsedSyntheticReference"] = 313] = "UnparsedSyntheticReference";
- SyntaxKind4[SyntaxKind4["SourceFile"] = 314] = "SourceFile";
- SyntaxKind4[SyntaxKind4["Bundle"] = 315] = "Bundle";
- SyntaxKind4[SyntaxKind4["UnparsedSource"] = 316] = "UnparsedSource";
- SyntaxKind4[SyntaxKind4["InputFiles"] = 317] = "InputFiles";
- SyntaxKind4[SyntaxKind4["JSDocTypeExpression"] = 318] = "JSDocTypeExpression";
- SyntaxKind4[SyntaxKind4["JSDocNameReference"] = 319] = "JSDocNameReference";
- SyntaxKind4[SyntaxKind4["JSDocMemberName"] = 320] = "JSDocMemberName";
- SyntaxKind4[SyntaxKind4["JSDocAllType"] = 321] = "JSDocAllType";
- SyntaxKind4[SyntaxKind4["JSDocUnknownType"] = 322] = "JSDocUnknownType";
- SyntaxKind4[SyntaxKind4["JSDocNullableType"] = 323] = "JSDocNullableType";
- SyntaxKind4[SyntaxKind4["JSDocNonNullableType"] = 324] = "JSDocNonNullableType";
- SyntaxKind4[SyntaxKind4["JSDocOptionalType"] = 325] = "JSDocOptionalType";
- SyntaxKind4[SyntaxKind4["JSDocFunctionType"] = 326] = "JSDocFunctionType";
- SyntaxKind4[SyntaxKind4["JSDocVariadicType"] = 327] = "JSDocVariadicType";
- SyntaxKind4[SyntaxKind4["JSDocNamepathType"] = 328] = "JSDocNamepathType";
- SyntaxKind4[SyntaxKind4["JSDoc"] = 329] = "JSDoc";
- SyntaxKind4[SyntaxKind4["JSDocComment"] = 329 /* JSDoc */] = "JSDocComment";
- SyntaxKind4[SyntaxKind4["JSDocText"] = 330] = "JSDocText";
- SyntaxKind4[SyntaxKind4["JSDocTypeLiteral"] = 331] = "JSDocTypeLiteral";
- SyntaxKind4[SyntaxKind4["JSDocSignature"] = 332] = "JSDocSignature";
- SyntaxKind4[SyntaxKind4["JSDocLink"] = 333] = "JSDocLink";
- SyntaxKind4[SyntaxKind4["JSDocLinkCode"] = 334] = "JSDocLinkCode";
- SyntaxKind4[SyntaxKind4["JSDocLinkPlain"] = 335] = "JSDocLinkPlain";
- SyntaxKind4[SyntaxKind4["JSDocTag"] = 336] = "JSDocTag";
- SyntaxKind4[SyntaxKind4["JSDocAugmentsTag"] = 337] = "JSDocAugmentsTag";
- SyntaxKind4[SyntaxKind4["JSDocImplementsTag"] = 338] = "JSDocImplementsTag";
- SyntaxKind4[SyntaxKind4["JSDocAuthorTag"] = 339] = "JSDocAuthorTag";
- SyntaxKind4[SyntaxKind4["JSDocDeprecatedTag"] = 340] = "JSDocDeprecatedTag";
- SyntaxKind4[SyntaxKind4["JSDocClassTag"] = 341] = "JSDocClassTag";
- SyntaxKind4[SyntaxKind4["JSDocPublicTag"] = 342] = "JSDocPublicTag";
- SyntaxKind4[SyntaxKind4["JSDocPrivateTag"] = 343] = "JSDocPrivateTag";
- SyntaxKind4[SyntaxKind4["JSDocProtectedTag"] = 344] = "JSDocProtectedTag";
- SyntaxKind4[SyntaxKind4["JSDocReadonlyTag"] = 345] = "JSDocReadonlyTag";
- SyntaxKind4[SyntaxKind4["JSDocOverrideTag"] = 346] = "JSDocOverrideTag";
- SyntaxKind4[SyntaxKind4["JSDocCallbackTag"] = 347] = "JSDocCallbackTag";
- SyntaxKind4[SyntaxKind4["JSDocEnumTag"] = 348] = "JSDocEnumTag";
- SyntaxKind4[SyntaxKind4["JSDocParameterTag"] = 349] = "JSDocParameterTag";
- SyntaxKind4[SyntaxKind4["JSDocReturnTag"] = 350] = "JSDocReturnTag";
- SyntaxKind4[SyntaxKind4["JSDocThisTag"] = 351] = "JSDocThisTag";
- SyntaxKind4[SyntaxKind4["JSDocTypeTag"] = 352] = "JSDocTypeTag";
- SyntaxKind4[SyntaxKind4["JSDocTemplateTag"] = 353] = "JSDocTemplateTag";
- SyntaxKind4[SyntaxKind4["JSDocTypedefTag"] = 354] = "JSDocTypedefTag";
- SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 355] = "JSDocSeeTag";
- SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 356] = "JSDocPropertyTag";
- SyntaxKind4[SyntaxKind4["SyntaxList"] = 357] = "SyntaxList";
- SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 358] = "NotEmittedStatement";
- SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 359] = "PartiallyEmittedExpression";
- SyntaxKind4[SyntaxKind4["CommaListExpression"] = 360] = "CommaListExpression";
- SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 361] = "MergeDeclarationMarker";
- SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 362] = "EndOfDeclarationMarker";
- SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 363] = "SyntheticReferenceExpression";
- SyntaxKind4[SyntaxKind4["Count"] = 364] = "Count";
+ SyntaxKind4[SyntaxKind4["OverloadKeyword"] = 164] = "OverloadKeyword";
+ SyntaxKind4[SyntaxKind4["OfKeyword"] = 165] = "OfKeyword";
+ SyntaxKind4[SyntaxKind4["QualifiedName"] = 166] = "QualifiedName";
+ SyntaxKind4[SyntaxKind4["ComputedPropertyName"] = 167] = "ComputedPropertyName";
+ SyntaxKind4[SyntaxKind4["TypeParameter"] = 168] = "TypeParameter";
+ SyntaxKind4[SyntaxKind4["Parameter"] = 169] = "Parameter";
+ SyntaxKind4[SyntaxKind4["Decorator"] = 170] = "Decorator";
+ SyntaxKind4[SyntaxKind4["PropertySignature"] = 171] = "PropertySignature";
+ SyntaxKind4[SyntaxKind4["PropertyDeclaration"] = 172] = "PropertyDeclaration";
+ SyntaxKind4[SyntaxKind4["AnnotationPropertyDeclaration"] = 173] = "AnnotationPropertyDeclaration";
+ SyntaxKind4[SyntaxKind4["OverloadPropertyDeclaration"] = 174] = "OverloadPropertyDeclaration";
+ SyntaxKind4[SyntaxKind4["MethodSignature"] = 175] = "MethodSignature";
+ SyntaxKind4[SyntaxKind4["MethodDeclaration"] = 176] = "MethodDeclaration";
+ SyntaxKind4[SyntaxKind4["ClassStaticBlockDeclaration"] = 177] = "ClassStaticBlockDeclaration";
+ SyntaxKind4[SyntaxKind4["Constructor"] = 178] = "Constructor";
+ SyntaxKind4[SyntaxKind4["GetAccessor"] = 179] = "GetAccessor";
+ SyntaxKind4[SyntaxKind4["SetAccessor"] = 180] = "SetAccessor";
+ SyntaxKind4[SyntaxKind4["CallSignature"] = 181] = "CallSignature";
+ SyntaxKind4[SyntaxKind4["ConstructSignature"] = 182] = "ConstructSignature";
+ SyntaxKind4[SyntaxKind4["IndexSignature"] = 183] = "IndexSignature";
+ SyntaxKind4[SyntaxKind4["TypePredicate"] = 184] = "TypePredicate";
+ SyntaxKind4[SyntaxKind4["TypeReference"] = 185] = "TypeReference";
+ SyntaxKind4[SyntaxKind4["FunctionType"] = 186] = "FunctionType";
+ SyntaxKind4[SyntaxKind4["ConstructorType"] = 187] = "ConstructorType";
+ SyntaxKind4[SyntaxKind4["TypeQuery"] = 188] = "TypeQuery";
+ SyntaxKind4[SyntaxKind4["TypeLiteral"] = 189] = "TypeLiteral";
+ SyntaxKind4[SyntaxKind4["ArrayType"] = 190] = "ArrayType";
+ SyntaxKind4[SyntaxKind4["TupleType"] = 191] = "TupleType";
+ SyntaxKind4[SyntaxKind4["OptionalType"] = 192] = "OptionalType";
+ SyntaxKind4[SyntaxKind4["RestType"] = 193] = "RestType";
+ SyntaxKind4[SyntaxKind4["UnionType"] = 194] = "UnionType";
+ SyntaxKind4[SyntaxKind4["IntersectionType"] = 195] = "IntersectionType";
+ SyntaxKind4[SyntaxKind4["ConditionalType"] = 196] = "ConditionalType";
+ SyntaxKind4[SyntaxKind4["InferType"] = 197] = "InferType";
+ SyntaxKind4[SyntaxKind4["ParenthesizedType"] = 198] = "ParenthesizedType";
+ SyntaxKind4[SyntaxKind4["ThisType"] = 199] = "ThisType";
+ SyntaxKind4[SyntaxKind4["TypeOperator"] = 200] = "TypeOperator";
+ SyntaxKind4[SyntaxKind4["IndexedAccessType"] = 201] = "IndexedAccessType";
+ SyntaxKind4[SyntaxKind4["MappedType"] = 202] = "MappedType";
+ SyntaxKind4[SyntaxKind4["LiteralType"] = 203] = "LiteralType";
+ SyntaxKind4[SyntaxKind4["NamedTupleMember"] = 204] = "NamedTupleMember";
+ SyntaxKind4[SyntaxKind4["TemplateLiteralType"] = 205] = "TemplateLiteralType";
+ SyntaxKind4[SyntaxKind4["TemplateLiteralTypeSpan"] = 206] = "TemplateLiteralTypeSpan";
+ SyntaxKind4[SyntaxKind4["ImportType"] = 207] = "ImportType";
+ SyntaxKind4[SyntaxKind4["ObjectBindingPattern"] = 208] = "ObjectBindingPattern";
+ SyntaxKind4[SyntaxKind4["ArrayBindingPattern"] = 209] = "ArrayBindingPattern";
+ SyntaxKind4[SyntaxKind4["BindingElement"] = 210] = "BindingElement";
+ SyntaxKind4[SyntaxKind4["ArrayLiteralExpression"] = 211] = "ArrayLiteralExpression";
+ SyntaxKind4[SyntaxKind4["ObjectLiteralExpression"] = 212] = "ObjectLiteralExpression";
+ SyntaxKind4[SyntaxKind4["PropertyAccessExpression"] = 213] = "PropertyAccessExpression";
+ SyntaxKind4[SyntaxKind4["ElementAccessExpression"] = 214] = "ElementAccessExpression";
+ SyntaxKind4[SyntaxKind4["CallExpression"] = 215] = "CallExpression";
+ SyntaxKind4[SyntaxKind4["NewExpression"] = 216] = "NewExpression";
+ SyntaxKind4[SyntaxKind4["TaggedTemplateExpression"] = 217] = "TaggedTemplateExpression";
+ SyntaxKind4[SyntaxKind4["TypeAssertionExpression"] = 218] = "TypeAssertionExpression";
+ SyntaxKind4[SyntaxKind4["ParenthesizedExpression"] = 219] = "ParenthesizedExpression";
+ SyntaxKind4[SyntaxKind4["FunctionExpression"] = 220] = "FunctionExpression";
+ SyntaxKind4[SyntaxKind4["ArrowFunction"] = 221] = "ArrowFunction";
+ SyntaxKind4[SyntaxKind4["EtsComponentExpression"] = 222] = "EtsComponentExpression";
+ SyntaxKind4[SyntaxKind4["DeleteExpression"] = 223] = "DeleteExpression";
+ SyntaxKind4[SyntaxKind4["TypeOfExpression"] = 224] = "TypeOfExpression";
+ SyntaxKind4[SyntaxKind4["VoidExpression"] = 225] = "VoidExpression";
+ SyntaxKind4[SyntaxKind4["AwaitExpression"] = 226] = "AwaitExpression";
+ SyntaxKind4[SyntaxKind4["PrefixUnaryExpression"] = 227] = "PrefixUnaryExpression";
+ SyntaxKind4[SyntaxKind4["PostfixUnaryExpression"] = 228] = "PostfixUnaryExpression";
+ SyntaxKind4[SyntaxKind4["BinaryExpression"] = 229] = "BinaryExpression";
+ SyntaxKind4[SyntaxKind4["ConditionalExpression"] = 230] = "ConditionalExpression";
+ SyntaxKind4[SyntaxKind4["TemplateExpression"] = 231] = "TemplateExpression";
+ SyntaxKind4[SyntaxKind4["YieldExpression"] = 232] = "YieldExpression";
+ SyntaxKind4[SyntaxKind4["SpreadElement"] = 233] = "SpreadElement";
+ SyntaxKind4[SyntaxKind4["ClassExpression"] = 234] = "ClassExpression";
+ SyntaxKind4[SyntaxKind4["OmittedExpression"] = 235] = "OmittedExpression";
+ SyntaxKind4[SyntaxKind4["ExpressionWithTypeArguments"] = 236] = "ExpressionWithTypeArguments";
+ SyntaxKind4[SyntaxKind4["AsExpression"] = 237] = "AsExpression";
+ SyntaxKind4[SyntaxKind4["NonNullExpression"] = 238] = "NonNullExpression";
+ SyntaxKind4[SyntaxKind4["MetaProperty"] = 239] = "MetaProperty";
+ SyntaxKind4[SyntaxKind4["SyntheticExpression"] = 240] = "SyntheticExpression";
+ SyntaxKind4[SyntaxKind4["SatisfiesExpression"] = 241] = "SatisfiesExpression";
+ SyntaxKind4[SyntaxKind4["TemplateSpan"] = 242] = "TemplateSpan";
+ SyntaxKind4[SyntaxKind4["SemicolonClassElement"] = 243] = "SemicolonClassElement";
+ SyntaxKind4[SyntaxKind4["Block"] = 244] = "Block";
+ SyntaxKind4[SyntaxKind4["EmptyStatement"] = 245] = "EmptyStatement";
+ SyntaxKind4[SyntaxKind4["VariableStatement"] = 246] = "VariableStatement";
+ SyntaxKind4[SyntaxKind4["ExpressionStatement"] = 247] = "ExpressionStatement";
+ SyntaxKind4[SyntaxKind4["IfStatement"] = 248] = "IfStatement";
+ SyntaxKind4[SyntaxKind4["DoStatement"] = 249] = "DoStatement";
+ SyntaxKind4[SyntaxKind4["WhileStatement"] = 250] = "WhileStatement";
+ SyntaxKind4[SyntaxKind4["ForStatement"] = 251] = "ForStatement";
+ SyntaxKind4[SyntaxKind4["ForInStatement"] = 252] = "ForInStatement";
+ SyntaxKind4[SyntaxKind4["ForOfStatement"] = 253] = "ForOfStatement";
+ SyntaxKind4[SyntaxKind4["ContinueStatement"] = 254] = "ContinueStatement";
+ SyntaxKind4[SyntaxKind4["BreakStatement"] = 255] = "BreakStatement";
+ SyntaxKind4[SyntaxKind4["ReturnStatement"] = 256] = "ReturnStatement";
+ SyntaxKind4[SyntaxKind4["WithStatement"] = 257] = "WithStatement";
+ SyntaxKind4[SyntaxKind4["SwitchStatement"] = 258] = "SwitchStatement";
+ SyntaxKind4[SyntaxKind4["LabeledStatement"] = 259] = "LabeledStatement";
+ SyntaxKind4[SyntaxKind4["ThrowStatement"] = 260] = "ThrowStatement";
+ SyntaxKind4[SyntaxKind4["TryStatement"] = 261] = "TryStatement";
+ SyntaxKind4[SyntaxKind4["DebuggerStatement"] = 262] = "DebuggerStatement";
+ SyntaxKind4[SyntaxKind4["VariableDeclaration"] = 263] = "VariableDeclaration";
+ SyntaxKind4[SyntaxKind4["VariableDeclarationList"] = 264] = "VariableDeclarationList";
+ SyntaxKind4[SyntaxKind4["FunctionDeclaration"] = 265] = "FunctionDeclaration";
+ SyntaxKind4[SyntaxKind4["ClassDeclaration"] = 266] = "ClassDeclaration";
+ SyntaxKind4[SyntaxKind4["StructDeclaration"] = 267] = "StructDeclaration";
+ SyntaxKind4[SyntaxKind4["AnnotationDeclaration"] = 268] = "AnnotationDeclaration";
+ SyntaxKind4[SyntaxKind4["OverloadDeclaration"] = 269] = "OverloadDeclaration";
+ SyntaxKind4[SyntaxKind4["InterfaceDeclaration"] = 270] = "InterfaceDeclaration";
+ SyntaxKind4[SyntaxKind4["TypeAliasDeclaration"] = 271] = "TypeAliasDeclaration";
+ SyntaxKind4[SyntaxKind4["EnumDeclaration"] = 272] = "EnumDeclaration";
+ SyntaxKind4[SyntaxKind4["ModuleDeclaration"] = 273] = "ModuleDeclaration";
+ SyntaxKind4[SyntaxKind4["ModuleBlock"] = 274] = "ModuleBlock";
+ SyntaxKind4[SyntaxKind4["CaseBlock"] = 275] = "CaseBlock";
+ SyntaxKind4[SyntaxKind4["NamespaceExportDeclaration"] = 276] = "NamespaceExportDeclaration";
+ SyntaxKind4[SyntaxKind4["ImportEqualsDeclaration"] = 277] = "ImportEqualsDeclaration";
+ SyntaxKind4[SyntaxKind4["ImportDeclaration"] = 278] = "ImportDeclaration";
+ SyntaxKind4[SyntaxKind4["ImportClause"] = 279] = "ImportClause";
+ SyntaxKind4[SyntaxKind4["NamespaceImport"] = 280] = "NamespaceImport";
+ SyntaxKind4[SyntaxKind4["NamedImports"] = 281] = "NamedImports";
+ SyntaxKind4[SyntaxKind4["ImportSpecifier"] = 282] = "ImportSpecifier";
+ SyntaxKind4[SyntaxKind4["ExportAssignment"] = 283] = "ExportAssignment";
+ SyntaxKind4[SyntaxKind4["ExportDeclaration"] = 284] = "ExportDeclaration";
+ SyntaxKind4[SyntaxKind4["NamedExports"] = 285] = "NamedExports";
+ SyntaxKind4[SyntaxKind4["NamespaceExport"] = 286] = "NamespaceExport";
+ SyntaxKind4[SyntaxKind4["ExportSpecifier"] = 287] = "ExportSpecifier";
+ SyntaxKind4[SyntaxKind4["MissingDeclaration"] = 288] = "MissingDeclaration";
+ SyntaxKind4[SyntaxKind4["ExternalModuleReference"] = 289] = "ExternalModuleReference";
+ SyntaxKind4[SyntaxKind4["JsxElement"] = 290] = "JsxElement";
+ SyntaxKind4[SyntaxKind4["JsxSelfClosingElement"] = 291] = "JsxSelfClosingElement";
+ SyntaxKind4[SyntaxKind4["JsxOpeningElement"] = 292] = "JsxOpeningElement";
+ SyntaxKind4[SyntaxKind4["JsxClosingElement"] = 293] = "JsxClosingElement";
+ SyntaxKind4[SyntaxKind4["JsxFragment"] = 294] = "JsxFragment";
+ SyntaxKind4[SyntaxKind4["JsxOpeningFragment"] = 295] = "JsxOpeningFragment";
+ SyntaxKind4[SyntaxKind4["JsxClosingFragment"] = 296] = "JsxClosingFragment";
+ SyntaxKind4[SyntaxKind4["JsxAttribute"] = 297] = "JsxAttribute";
+ SyntaxKind4[SyntaxKind4["JsxAttributes"] = 298] = "JsxAttributes";
+ SyntaxKind4[SyntaxKind4["JsxSpreadAttribute"] = 299] = "JsxSpreadAttribute";
+ SyntaxKind4[SyntaxKind4["JsxExpression"] = 300] = "JsxExpression";
+ SyntaxKind4[SyntaxKind4["CaseClause"] = 301] = "CaseClause";
+ SyntaxKind4[SyntaxKind4["DefaultClause"] = 302] = "DefaultClause";
+ SyntaxKind4[SyntaxKind4["HeritageClause"] = 303] = "HeritageClause";
+ SyntaxKind4[SyntaxKind4["CatchClause"] = 304] = "CatchClause";
+ SyntaxKind4[SyntaxKind4["AssertClause"] = 305] = "AssertClause";
+ SyntaxKind4[SyntaxKind4["AssertEntry"] = 306] = "AssertEntry";
+ SyntaxKind4[SyntaxKind4["ImportTypeAssertionContainer"] = 307] = "ImportTypeAssertionContainer";
+ SyntaxKind4[SyntaxKind4["PropertyAssignment"] = 308] = "PropertyAssignment";
+ SyntaxKind4[SyntaxKind4["ShorthandPropertyAssignment"] = 309] = "ShorthandPropertyAssignment";
+ SyntaxKind4[SyntaxKind4["SpreadAssignment"] = 310] = "SpreadAssignment";
+ SyntaxKind4[SyntaxKind4["EnumMember"] = 311] = "EnumMember";
+ SyntaxKind4[SyntaxKind4["UnparsedPrologue"] = 312] = "UnparsedPrologue";
+ SyntaxKind4[SyntaxKind4["UnparsedPrepend"] = 313] = "UnparsedPrepend";
+ SyntaxKind4[SyntaxKind4["UnparsedText"] = 314] = "UnparsedText";
+ SyntaxKind4[SyntaxKind4["UnparsedInternalText"] = 315] = "UnparsedInternalText";
+ SyntaxKind4[SyntaxKind4["UnparsedSyntheticReference"] = 316] = "UnparsedSyntheticReference";
+ SyntaxKind4[SyntaxKind4["SourceFile"] = 317] = "SourceFile";
+ SyntaxKind4[SyntaxKind4["Bundle"] = 318] = "Bundle";
+ SyntaxKind4[SyntaxKind4["UnparsedSource"] = 319] = "UnparsedSource";
+ SyntaxKind4[SyntaxKind4["InputFiles"] = 320] = "InputFiles";
+ SyntaxKind4[SyntaxKind4["JSDocTypeExpression"] = 321] = "JSDocTypeExpression";
+ SyntaxKind4[SyntaxKind4["JSDocNameReference"] = 322] = "JSDocNameReference";
+ SyntaxKind4[SyntaxKind4["JSDocMemberName"] = 323] = "JSDocMemberName";
+ SyntaxKind4[SyntaxKind4["JSDocAllType"] = 324] = "JSDocAllType";
+ SyntaxKind4[SyntaxKind4["JSDocUnknownType"] = 325] = "JSDocUnknownType";
+ SyntaxKind4[SyntaxKind4["JSDocNullableType"] = 326] = "JSDocNullableType";
+ SyntaxKind4[SyntaxKind4["JSDocNonNullableType"] = 327] = "JSDocNonNullableType";
+ SyntaxKind4[SyntaxKind4["JSDocOptionalType"] = 328] = "JSDocOptionalType";
+ SyntaxKind4[SyntaxKind4["JSDocFunctionType"] = 329] = "JSDocFunctionType";
+ SyntaxKind4[SyntaxKind4["JSDocVariadicType"] = 330] = "JSDocVariadicType";
+ SyntaxKind4[SyntaxKind4["JSDocNamepathType"] = 331] = "JSDocNamepathType";
+ SyntaxKind4[SyntaxKind4["JSDoc"] = 332] = "JSDoc";
+ SyntaxKind4[SyntaxKind4["JSDocComment"] = 332 /* JSDoc */] = "JSDocComment";
+ SyntaxKind4[SyntaxKind4["JSDocText"] = 333] = "JSDocText";
+ SyntaxKind4[SyntaxKind4["JSDocTypeLiteral"] = 334] = "JSDocTypeLiteral";
+ SyntaxKind4[SyntaxKind4["JSDocSignature"] = 335] = "JSDocSignature";
+ SyntaxKind4[SyntaxKind4["JSDocLink"] = 336] = "JSDocLink";
+ SyntaxKind4[SyntaxKind4["JSDocLinkCode"] = 337] = "JSDocLinkCode";
+ SyntaxKind4[SyntaxKind4["JSDocLinkPlain"] = 338] = "JSDocLinkPlain";
+ SyntaxKind4[SyntaxKind4["JSDocTag"] = 339] = "JSDocTag";
+ SyntaxKind4[SyntaxKind4["JSDocAugmentsTag"] = 340] = "JSDocAugmentsTag";
+ SyntaxKind4[SyntaxKind4["JSDocImplementsTag"] = 341] = "JSDocImplementsTag";
+ SyntaxKind4[SyntaxKind4["JSDocAuthorTag"] = 342] = "JSDocAuthorTag";
+ SyntaxKind4[SyntaxKind4["JSDocDeprecatedTag"] = 343] = "JSDocDeprecatedTag";
+ SyntaxKind4[SyntaxKind4["JSDocClassTag"] = 344] = "JSDocClassTag";
+ SyntaxKind4[SyntaxKind4["JSDocPublicTag"] = 345] = "JSDocPublicTag";
+ SyntaxKind4[SyntaxKind4["JSDocPrivateTag"] = 346] = "JSDocPrivateTag";
+ SyntaxKind4[SyntaxKind4["JSDocProtectedTag"] = 347] = "JSDocProtectedTag";
+ SyntaxKind4[SyntaxKind4["JSDocReadonlyTag"] = 348] = "JSDocReadonlyTag";
+ SyntaxKind4[SyntaxKind4["JSDocOverrideTag"] = 349] = "JSDocOverrideTag";
+ SyntaxKind4[SyntaxKind4["JSDocCallbackTag"] = 350] = "JSDocCallbackTag";
+ SyntaxKind4[SyntaxKind4["JSDocEnumTag"] = 351] = "JSDocEnumTag";
+ SyntaxKind4[SyntaxKind4["JSDocParameterTag"] = 352] = "JSDocParameterTag";
+ SyntaxKind4[SyntaxKind4["JSDocReturnTag"] = 353] = "JSDocReturnTag";
+ SyntaxKind4[SyntaxKind4["JSDocThisTag"] = 354] = "JSDocThisTag";
+ SyntaxKind4[SyntaxKind4["JSDocTypeTag"] = 355] = "JSDocTypeTag";
+ SyntaxKind4[SyntaxKind4["JSDocTemplateTag"] = 356] = "JSDocTemplateTag";
+ SyntaxKind4[SyntaxKind4["JSDocTypedefTag"] = 357] = "JSDocTypedefTag";
+ SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 358] = "JSDocSeeTag";
+ SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 359] = "JSDocPropertyTag";
+ SyntaxKind4[SyntaxKind4["SyntaxList"] = 360] = "SyntaxList";
+ SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 361] = "NotEmittedStatement";
+ SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 362] = "PartiallyEmittedExpression";
+ SyntaxKind4[SyntaxKind4["CommaListExpression"] = 363] = "CommaListExpression";
+ SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 364] = "MergeDeclarationMarker";
+ SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 365] = "EndOfDeclarationMarker";
+ SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 366] = "SyntheticReferenceExpression";
+ SyntaxKind4[SyntaxKind4["Count"] = 367] = "Count";
SyntaxKind4[SyntaxKind4["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
SyntaxKind4[SyntaxKind4["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -4080,15 +4083,15 @@ var SyntaxKind2 = /* @__PURE__ */ ((SyntaxKind4) => {
SyntaxKind4[SyntaxKind4["FirstReservedWord"] = 81 /* BreakKeyword */] = "FirstReservedWord";
SyntaxKind4[SyntaxKind4["LastReservedWord"] = 117 /* WithKeyword */] = "LastReservedWord";
SyntaxKind4[SyntaxKind4["FirstKeyword"] = 81 /* BreakKeyword */] = "FirstKeyword";
- SyntaxKind4[SyntaxKind4["LastKeyword"] = 164 /* OfKeyword */] = "LastKeyword";
+ SyntaxKind4[SyntaxKind4["LastKeyword"] = 165 /* OfKeyword */] = "LastKeyword";
SyntaxKind4[SyntaxKind4["FirstFutureReservedWord"] = 118 /* ImplementsKeyword */] = "FirstFutureReservedWord";
SyntaxKind4[SyntaxKind4["LastFutureReservedWord"] = 126 /* YieldKeyword */] = "LastFutureReservedWord";
- SyntaxKind4[SyntaxKind4["FirstTypeNode"] = 182 /* TypePredicate */] = "FirstTypeNode";
- SyntaxKind4[SyntaxKind4["LastTypeNode"] = 205 /* ImportType */] = "LastTypeNode";
+ SyntaxKind4[SyntaxKind4["FirstTypeNode"] = 184 /* TypePredicate */] = "FirstTypeNode";
+ SyntaxKind4[SyntaxKind4["LastTypeNode"] = 207 /* ImportType */] = "LastTypeNode";
SyntaxKind4[SyntaxKind4["FirstPunctuation"] = 18 /* OpenBraceToken */] = "FirstPunctuation";
SyntaxKind4[SyntaxKind4["LastPunctuation"] = 78 /* CaretEqualsToken */] = "LastPunctuation";
SyntaxKind4[SyntaxKind4["FirstToken"] = 0 /* Unknown */] = "FirstToken";
- SyntaxKind4[SyntaxKind4["LastToken"] = 164 /* LastKeyword */] = "LastToken";
+ SyntaxKind4[SyntaxKind4["LastToken"] = 165 /* LastKeyword */] = "LastToken";
SyntaxKind4[SyntaxKind4["FirstTriviaToken"] = 2 /* SingleLineCommentTrivia */] = "FirstTriviaToken";
SyntaxKind4[SyntaxKind4["LastTriviaToken"] = 7 /* ConflictMarkerTrivia */] = "LastTriviaToken";
SyntaxKind4[SyntaxKind4["FirstLiteralToken"] = 8 /* NumericLiteral */] = "FirstLiteralToken";
@@ -4097,15 +4100,15 @@ var SyntaxKind2 = /* @__PURE__ */ ((SyntaxKind4) => {
SyntaxKind4[SyntaxKind4["LastTemplateToken"] = 17 /* TemplateTail */] = "LastTemplateToken";
SyntaxKind4[SyntaxKind4["FirstBinaryOperator"] = 29 /* LessThanToken */] = "FirstBinaryOperator";
SyntaxKind4[SyntaxKind4["LastBinaryOperator"] = 78 /* CaretEqualsToken */] = "LastBinaryOperator";
- SyntaxKind4[SyntaxKind4["FirstStatement"] = 244 /* VariableStatement */] = "FirstStatement";
- SyntaxKind4[SyntaxKind4["LastStatement"] = 260 /* DebuggerStatement */] = "LastStatement";
- SyntaxKind4[SyntaxKind4["FirstNode"] = 165 /* QualifiedName */] = "FirstNode";
- SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 318 /* JSDocTypeExpression */] = "FirstJSDocNode";
- SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 356 /* JSDocPropertyTag */] = "LastJSDocNode";
- SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 336 /* JSDocTag */] = "FirstJSDocTagNode";
- SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 356 /* JSDocPropertyTag */] = "LastJSDocTagNode";
+ SyntaxKind4[SyntaxKind4["FirstStatement"] = 246 /* VariableStatement */] = "FirstStatement";
+ SyntaxKind4[SyntaxKind4["LastStatement"] = 262 /* DebuggerStatement */] = "LastStatement";
+ SyntaxKind4[SyntaxKind4["FirstNode"] = 166 /* QualifiedName */] = "FirstNode";
+ SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 321 /* JSDocTypeExpression */] = "FirstJSDocNode";
+ SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 359 /* JSDocPropertyTag */] = "LastJSDocNode";
+ SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 339 /* JSDocTag */] = "FirstJSDocTagNode";
+ SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 359 /* JSDocPropertyTag */] = "LastJSDocTagNode";
SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 127 /* AbstractKeyword */] = "FirstContextualKeyword";
- SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 164 /* OfKeyword */] = "LastContextualKeyword";
+ SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword";
return SyntaxKind4;
})(SyntaxKind2 || {});
var NodeFlags2 = /* @__PURE__ */ ((NodeFlags3) => {
@@ -9122,6 +9125,7 @@ var textToKeywordObj = {
protected: 123 /* ProtectedKeyword */,
public: 124 /* PublicKeyword */,
override: 163 /* OverrideKeyword */,
+ overload: 164 /* OverloadKeyword */,
out: 146 /* OutKeyword */,
readonly: 147 /* ReadonlyKeyword */,
require: 148 /* RequireKeyword */,
@@ -9152,7 +9156,7 @@ var textToKeywordObj = {
yield: 126 /* YieldKeyword */,
async: 133 /* AsyncKeyword */,
await: 134 /* AwaitKeyword */,
- of: 164 /* OfKeyword */
+ of: 165 /* OfKeyword */
};
var textToKeyword = new Map2(getEntries(textToKeywordObj));
var textToToken = new Map2(getEntries({
@@ -11227,16 +11231,16 @@ function collapseTextChangeRangesAcrossMultipleVersions(changes) {
return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
}
function getTypeParameterOwner(d) {
- if (d && d.kind === 167 /* TypeParameter */) {
+ if (d && d.kind === 168 /* TypeParameter */) {
for (let current = d; current; current = current.parent) {
- if (isFunctionLike(current) || isClassLike(current) || current.kind === 267 /* InterfaceDeclaration */) {
+ if (isFunctionLike(current) || isClassLike(current) || current.kind === 270 /* InterfaceDeclaration */) {
return current;
}
}
}
}
function isParameterPropertyDeclaration(node, parent) {
- return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent.kind === 176 /* Constructor */;
+ return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent.kind === 178 /* Constructor */;
}
function isEmptyBindingPattern(node) {
if (isBindingPattern(node)) {
@@ -11262,14 +11266,14 @@ function getCombinedFlags(node, getFlags) {
node = walkUpBindingElementsAndPatterns(node);
}
let flags = getFlags(node);
- if (node.kind === 261 /* VariableDeclaration */) {
+ if (node.kind === 263 /* VariableDeclaration */) {
node = node.parent;
}
- if (node && node.kind === 262 /* VariableDeclarationList */) {
+ if (node && node.kind === 264 /* VariableDeclarationList */) {
flags |= getFlags(node);
node = node.parent;
}
- if (node && node.kind === 244 /* VariableStatement */) {
+ if (node && node.kind === 246 /* VariableStatement */) {
flags |= getFlags(node);
}
return flags;
@@ -11390,30 +11394,30 @@ function nameForNamelessJSDocTypedef(declaration) {
return getDeclarationIdentifier(hostNode);
}
switch (hostNode.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (hostNode.declarationList && hostNode.declarationList.declarations[0]) {
return getDeclarationIdentifier(hostNode.declarationList.declarations[0]);
}
break;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
let expr = hostNode.expression;
- if (expr.kind === 227 /* BinaryExpression */ && expr.operatorToken.kind === 63 /* EqualsToken */) {
+ if (expr.kind === 229 /* BinaryExpression */ && expr.operatorToken.kind === 63 /* EqualsToken */) {
expr = expr.left;
}
switch (expr.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return expr.name;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const arg = expr.argumentExpression;
if (isIdentifier(arg)) {
return arg;
}
}
break;
- case 217 /* ParenthesizedExpression */: {
+ case 219 /* ParenthesizedExpression */: {
return getDeclarationIdentifier(hostNode.expression);
}
- case 257 /* LabeledStatement */: {
+ case 259 /* LabeledStatement */: {
if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) {
return getDeclarationIdentifier(hostNode.statement);
}
@@ -11444,16 +11448,16 @@ function getNonAssignedNameOfDeclaration(declaration) {
switch (declaration.kind) {
case 79 /* Identifier */:
return declaration;
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */: {
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */: {
const { name } = declaration;
- if (name.kind === 165 /* QualifiedName */) {
+ if (name.kind === 166 /* QualifiedName */) {
return name.right;
}
break;
}
- case 213 /* CallExpression */:
- case 227 /* BinaryExpression */: {
+ case 215 /* CallExpression */:
+ case 229 /* BinaryExpression */: {
const expr2 = declaration;
switch (getAssignmentDeclarationKind(expr2)) {
case 1 /* ExportsProperty */:
@@ -11469,15 +11473,15 @@ function getNonAssignedNameOfDeclaration(declaration) {
return void 0;
}
}
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return getNameOfJSDocTypedef(declaration);
- case 348 /* JSDocEnumTag */:
+ case 351 /* JSDocEnumTag */:
return nameForNamelessJSDocTypedef(declaration);
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
const { expression } = declaration;
return isIdentifier(expression) ? expression : void 0;
}
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = declaration;
if (isBindableStaticElementAccessExpression(expr)) {
return expr.argumentExpression;
@@ -11691,10 +11695,10 @@ function getAllJSDocTagsOfKind(node, kind) {
return getJSDocTags(node).filter((doc) => doc.kind === kind);
}
function getTextOfJSDocComment(comment) {
- return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 330 /* JSDocText */ ? c.text : formatJSDocLink(c)).join("");
+ return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 333 /* JSDocText */ ? c.text : formatJSDocLink(c)).join("");
}
function formatJSDocLink(link) {
- const kind = link.kind === 333 /* JSDocLink */ ? "link" : link.kind === 334 /* JSDocLinkCode */ ? "linkcode" : "linkplain";
+ const kind = link.kind === 336 /* JSDocLink */ ? "link" : link.kind === 337 /* JSDocLinkCode */ ? "linkcode" : "linkplain";
const name = link.name ? entityNameToString(link.name) : "";
const space = link.name && link.text.startsWith("://") ? "" : " ";
return `{@${kind} ${name}${space}${link.text}}`;
@@ -11704,7 +11708,7 @@ function getEffectiveTypeParameterDeclarations(node) {
return emptyArray;
}
if (isJSDocTypeAlias(node)) {
- Debug.assert(node.parent.kind === 329 /* JSDoc */);
+ Debug.assert(node.parent.kind === 332 /* JSDoc */);
return flatMap(node.parent.tags, (tag) => isJSDocTemplateTag(tag) ? tag.typeParameters : void 0);
}
if (node.typeParameters) {
@@ -11732,7 +11736,7 @@ function isMemberName(node) {
return node.kind === 79 /* Identifier */ || node.kind === 80 /* PrivateIdentifier */;
}
function isGetOrSetAccessorDeclaration(node) {
- return node.kind === 178 /* SetAccessor */ || node.kind === 177 /* GetAccessor */;
+ return node.kind === 180 /* SetAccessor */ || node.kind === 179 /* GetAccessor */;
}
function isPropertyAccessChain(node) {
return isPropertyAccessExpression(node) && !!(node.flags & 32 /* OptionalChain */);
@@ -11745,7 +11749,7 @@ function isCallChain(node) {
}
function isOptionalChain(node) {
const kind = node.kind;
- return !!(node.flags & 32 /* OptionalChain */) && (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */ || kind === 213 /* CallExpression */ || kind === 236 /* NonNullExpression */);
+ return !!(node.flags & 32 /* OptionalChain */) && (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */ || kind === 215 /* CallExpression */ || kind === 238 /* NonNullExpression */);
}
function isOptionalChainRoot(node) {
return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken;
@@ -11757,7 +11761,7 @@ function isOutermostOptionalChain(node) {
return !isOptionalChain(node.parent) || isOptionalChainRoot(node.parent) || node !== node.parent.expression;
}
function isNullishCoalesce(node) {
- return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
+ return node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
}
function isConstTypeReference(node) {
return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "const" && !node.typeArguments;
@@ -11769,34 +11773,34 @@ function isNonNullChain(node) {
return isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */);
}
function isBreakOrContinueStatement(node) {
- return node.kind === 253 /* BreakStatement */ || node.kind === 252 /* ContinueStatement */;
+ return node.kind === 255 /* BreakStatement */ || node.kind === 254 /* ContinueStatement */;
}
function isNamedExportBindings(node) {
- return node.kind === 283 /* NamespaceExport */ || node.kind === 282 /* NamedExports */;
+ return node.kind === 286 /* NamespaceExport */ || node.kind === 285 /* NamedExports */;
}
function isUnparsedTextLike(node) {
switch (node.kind) {
- case 311 /* UnparsedText */:
- case 312 /* UnparsedInternalText */:
+ case 314 /* UnparsedText */:
+ case 315 /* UnparsedInternalText */:
return true;
default:
return false;
}
}
function isUnparsedNode(node) {
- return isUnparsedTextLike(node) || node.kind === 309 /* UnparsedPrologue */ || node.kind === 313 /* UnparsedSyntheticReference */;
+ return isUnparsedTextLike(node) || node.kind === 312 /* UnparsedPrologue */ || node.kind === 316 /* UnparsedSyntheticReference */;
}
function isJSDocPropertyLikeTag(node) {
- return node.kind === 356 /* JSDocPropertyTag */ || node.kind === 349 /* JSDocParameterTag */;
+ return node.kind === 359 /* JSDocPropertyTag */ || node.kind === 352 /* JSDocParameterTag */;
}
function isNode(node) {
return isNodeKind(node.kind);
}
function isNodeKind(kind) {
- return kind >= 165 /* FirstNode */;
+ return kind >= 166 /* FirstNode */;
}
function isTokenKind(kind) {
- return kind >= 0 /* FirstToken */ && kind <= 164 /* LastToken */;
+ return kind >= 0 /* FirstToken */ && kind <= 165 /* LastToken */;
}
function isToken(n) {
return isTokenKind(n.kind);
@@ -11812,11 +11816,11 @@ function isLiteralExpression(node) {
}
function isLiteralExpressionOfObject(node) {
switch (node.kind) {
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
case 13 /* RegularExpressionLiteral */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
return true;
}
return false;
@@ -11836,13 +11840,13 @@ function isImportOrExportSpecifier(node) {
}
function isTypeOnlyImportOrExportDeclaration(node) {
switch (node.kind) {
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return node.isTypeOnly || node.parent.parent.isTypeOnly;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return node.parent.isTypeOnly;
- case 276 /* ImportClause */:
- case 274 /* ImportEqualsDeclaration */:
+ case 279 /* ImportClause */:
+ case 277 /* ImportEqualsDeclaration */:
return node.isTypeOnly;
default:
return false;
@@ -11898,15 +11902,15 @@ function isModifier(node) {
}
function isEntityName(node) {
const kind = node.kind;
- return kind === 165 /* QualifiedName */ || kind === 79 /* Identifier */;
+ return kind === 166 /* QualifiedName */ || kind === 79 /* Identifier */;
}
function isPropertyName(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 80 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ || kind === 166 /* ComputedPropertyName */;
+ return kind === 79 /* Identifier */ || kind === 80 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ || kind === 167 /* ComputedPropertyName */;
}
function isBindingName(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 206 /* ObjectBindingPattern */ || kind === 207 /* ArrayBindingPattern */;
+ return kind === 79 /* Identifier */ || kind === 208 /* ObjectBindingPattern */ || kind === 209 /* ArrayBindingPattern */;
}
function isFunctionLike(node) {
return !!node && isFunctionLikeKind(node.kind);
@@ -11922,13 +11926,13 @@ function isBooleanLiteral(node) {
}
function isFunctionLikeDeclarationKind(kind) {
switch (kind) {
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
default:
return false;
@@ -11936,14 +11940,14 @@ function isFunctionLikeDeclarationKind(kind) {
}
function isFunctionLikeKind(kind) {
switch (kind) {
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 184 /* FunctionType */:
- case 326 /* JSDocFunctionType */:
- case 185 /* ConstructorType */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 186 /* FunctionType */:
+ case 329 /* JSDocFunctionType */:
+ case 187 /* ConstructorType */:
return true;
default:
return isFunctionLikeDeclarationKind(kind);
@@ -11954,29 +11958,33 @@ function isFunctionOrModuleBlock(node) {
}
function isAnnotationElement(node) {
const kind = node.kind;
- return kind === 172 /* AnnotationPropertyDeclaration */;
+ return kind === 173 /* AnnotationPropertyDeclaration */;
+}
+function isOverloadElement(node) {
+ const kind = node.kind;
+ return kind === 174 /* OverloadPropertyDeclaration */;
}
function isClassElement(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 171 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 241 /* SemicolonClassElement */;
+ return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */;
}
function isClassLike(node) {
- return node && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || node.kind === 265 /* StructDeclaration */);
+ return node && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 267 /* StructDeclaration */);
}
function isStruct(node) {
- return node && node.kind === 265 /* StructDeclaration */;
+ return node && node.kind === 267 /* StructDeclaration */;
}
function isAccessor(node) {
- return node && (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */);
+ return node && (node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */);
}
function isAutoAccessorPropertyDeclaration(node) {
return isPropertyDeclaration(node) && hasAccessorModifier(node);
}
function isMethodOrAccessor(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -11984,10 +11992,10 @@ function isMethodOrAccessor(node) {
}
function isNamedClassElement(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
return true;
default:
return false;
@@ -11998,22 +12006,22 @@ function isModifierLike(node) {
}
function isTypeElement(node) {
const kind = node.kind;
- return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 170 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function isClassOrTypeElement(node) {
return isTypeElement(node) || isClassElement(node);
}
function isObjectLiteralElementLike(node) {
const kind = node.kind;
- return kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 307 /* SpreadAssignment */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 310 /* SpreadAssignment */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function isTypeNode(node) {
return isTypeNodeKind(node.kind);
}
function isFunctionOrConstructorTypeNode(node) {
switch (node.kind) {
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return true;
}
return false;
@@ -12021,23 +12029,23 @@ function isFunctionOrConstructorTypeNode(node) {
function isBindingPattern(node) {
if (node) {
const kind = node.kind;
- return kind === 207 /* ArrayBindingPattern */ || kind === 206 /* ObjectBindingPattern */;
+ return kind === 209 /* ArrayBindingPattern */ || kind === 208 /* ObjectBindingPattern */;
}
return false;
}
function isAssignmentPattern(node) {
const kind = node.kind;
- return kind === 209 /* ArrayLiteralExpression */ || kind === 210 /* ObjectLiteralExpression */;
+ return kind === 211 /* ArrayLiteralExpression */ || kind === 212 /* ObjectLiteralExpression */;
}
function isArrayBindingElement(node) {
const kind = node.kind;
- return kind === 208 /* BindingElement */ || kind === 233 /* OmittedExpression */;
+ return kind === 210 /* BindingElement */ || kind === 235 /* OmittedExpression */;
}
function isDeclarationBindingElement(bindingElement) {
switch (bindingElement.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
return true;
}
return false;
@@ -12047,78 +12055,78 @@ function isBindingOrAssignmentPattern(node) {
}
function isObjectBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 206 /* ObjectBindingPattern */:
- case 210 /* ObjectLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 212 /* ObjectLiteralExpression */:
return true;
}
return false;
}
function isObjectBindingOrAssignmentElement(node) {
switch (node.kind) {
- case 208 /* BindingElement */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 210 /* BindingElement */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return true;
}
return false;
}
function isArrayBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return true;
}
return false;
}
function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
const kind = node.kind;
- return kind === 211 /* PropertyAccessExpression */ || kind === 165 /* QualifiedName */ || kind === 205 /* ImportType */;
+ return kind === 213 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */ || kind === 207 /* ImportType */;
}
function isPropertyAccessOrQualifiedName(node) {
const kind = node.kind;
- return kind === 211 /* PropertyAccessExpression */ || kind === 165 /* QualifiedName */;
+ return kind === 213 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
}
function isCallLikeExpression(node) {
switch (node.kind) {
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 215 /* TaggedTemplateExpression */:
- case 169 /* Decorator */:
- case 220 /* EtsComponentExpression */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 170 /* Decorator */:
+ case 222 /* EtsComponentExpression */:
return true;
default:
return false;
}
}
function isCallOrNewExpression(node) {
- return node.kind === 213 /* CallExpression */ || node.kind === 214 /* NewExpression */;
+ return node.kind === 215 /* CallExpression */ || node.kind === 216 /* NewExpression */;
}
function isTemplateLiteral(node) {
const kind = node.kind;
- return kind === 229 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */;
+ return kind === 231 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */;
}
function isLeftHandSideExpression(node) {
return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind);
}
function isLeftHandSideExpressionKind(kind) {
switch (kind) {
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
- case 214 /* NewExpression */:
- case 213 /* CallExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
- case 215 /* TaggedTemplateExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 217 /* ParenthesizedExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 220 /* EtsComponentExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 216 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
+ case 217 /* TaggedTemplateExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 222 /* EtsComponentExpression */:
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
case 13 /* RegularExpressionLiteral */:
@@ -12126,15 +12134,15 @@ function isLeftHandSideExpressionKind(kind) {
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
case 96 /* FalseKeyword */:
case 105 /* NullKeyword */:
case 109 /* ThisKeyword */:
case 111 /* TrueKeyword */:
case 107 /* SuperKeyword */:
- case 236 /* NonNullExpression */:
- case 234 /* ExpressionWithTypeArguments */:
- case 237 /* MetaProperty */:
+ case 238 /* NonNullExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 239 /* MetaProperty */:
case 101 /* ImportKeyword */:
return true;
default:
@@ -12146,13 +12154,13 @@ function isUnaryExpression(node) {
}
function isUnaryExpressionKind(kind) {
switch (kind) {
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
- case 221 /* DeleteExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 224 /* AwaitExpression */:
- case 216 /* TypeAssertionExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 223 /* DeleteExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 226 /* AwaitExpression */:
+ case 218 /* TypeAssertionExpression */:
return true;
default:
return isLeftHandSideExpressionKind(kind);
@@ -12160,9 +12168,9 @@ function isUnaryExpressionKind(kind) {
}
function isUnaryExpressionWithWrite(expr) {
switch (expr.kind) {
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return true;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */;
default:
return false;
@@ -12173,16 +12181,16 @@ function isExpression(node) {
}
function isExpressionKind(kind) {
switch (kind) {
- case 228 /* ConditionalExpression */:
- case 230 /* YieldExpression */:
- case 219 /* ArrowFunction */:
- case 227 /* BinaryExpression */:
- case 231 /* SpreadElement */:
- case 235 /* AsExpression */:
- case 233 /* OmittedExpression */:
- case 360 /* CommaListExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 239 /* SatisfiesExpression */:
+ case 230 /* ConditionalExpression */:
+ case 232 /* YieldExpression */:
+ case 221 /* ArrowFunction */:
+ case 229 /* BinaryExpression */:
+ case 233 /* SpreadElement */:
+ case 237 /* AsExpression */:
+ case 235 /* OmittedExpression */:
+ case 363 /* CommaListExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 241 /* SatisfiesExpression */:
return true;
default:
return isUnaryExpressionKind(kind);
@@ -12190,20 +12198,20 @@ function isExpressionKind(kind) {
}
function isAssertionExpression(node) {
const kind = node.kind;
- return kind === 216 /* TypeAssertionExpression */ || kind === 235 /* AsExpression */;
+ return kind === 218 /* TypeAssertionExpression */ || kind === 237 /* AsExpression */;
}
function isNotEmittedOrPartiallyEmittedNode(node) {
return isNotEmittedStatement(node) || isPartiallyEmittedExpression(node);
}
function isIterationStatement(node, lookInLabeledStatements) {
switch (node.kind) {
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return true;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
}
return false;
@@ -12262,7 +12270,7 @@ function allImportsAreAnnotations(imports, resolver) {
});
}
function isForInOrOfStatement(node) {
- return node.kind === 250 /* ForInStatement */ || node.kind === 251 /* ForOfStatement */;
+ return node.kind === 252 /* ForInStatement */ || node.kind === 253 /* ForOfStatement */;
}
function isConciseBody(node) {
return isBlock(node) || isExpression(node);
@@ -12275,35 +12283,35 @@ function isForInitializer(node) {
}
function isModuleBody(node) {
const kind = node.kind;
- return kind === 271 /* ModuleBlock */ || kind === 270 /* ModuleDeclaration */ || kind === 79 /* Identifier */;
+ return kind === 274 /* ModuleBlock */ || kind === 273 /* ModuleDeclaration */ || kind === 79 /* Identifier */;
}
function isNamespaceBody(node) {
const kind = node.kind;
- return kind === 271 /* ModuleBlock */ || kind === 270 /* ModuleDeclaration */;
+ return kind === 274 /* ModuleBlock */ || kind === 273 /* ModuleDeclaration */;
}
function isJSDocNamespaceBody(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 270 /* ModuleDeclaration */;
+ return kind === 79 /* Identifier */ || kind === 273 /* ModuleDeclaration */;
}
function isNamedImportBindings(node) {
const kind = node.kind;
- return kind === 278 /* NamedImports */ || kind === 277 /* NamespaceImport */;
+ return kind === 281 /* NamedImports */ || kind === 280 /* NamespaceImport */;
}
function isModuleOrEnumDeclaration(node) {
- return node.kind === 270 /* ModuleDeclaration */ || node.kind === 269 /* EnumDeclaration */;
+ return node.kind === 273 /* ModuleDeclaration */ || node.kind === 272 /* EnumDeclaration */;
}
function isDeclarationKind(kind) {
- return kind === 219 /* ArrowFunction */ || kind === 208 /* BindingElement */ || kind === 264 /* ClassDeclaration */ || kind === 232 /* ClassExpression */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 176 /* Constructor */ || kind === 269 /* EnumDeclaration */ || kind === 308 /* EnumMember */ || kind === 284 /* ExportSpecifier */ || kind === 263 /* FunctionDeclaration */ || kind === 218 /* FunctionExpression */ || kind === 177 /* GetAccessor */ || kind === 276 /* ImportClause */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 279 /* ImportSpecifier */ || kind === 267 /* InterfaceDeclaration */ || kind === 294 /* JsxAttribute */ || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 270 /* ModuleDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 277 /* NamespaceImport */ || kind === 283 /* NamespaceExport */ || kind === 168 /* Parameter */ || kind === 305 /* PropertyAssignment */ || kind === 171 /* PropertyDeclaration */ || kind === 172 /* AnnotationPropertyDeclaration */ || kind === 170 /* PropertySignature */ || kind === 178 /* SetAccessor */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 268 /* TypeAliasDeclaration */ || kind === 167 /* TypeParameter */ || kind === 261 /* VariableDeclaration */ || kind === 354 /* JSDocTypedefTag */ || kind === 347 /* JSDocCallbackTag */ || kind === 356 /* JSDocPropertyTag */;
+ return kind === 221 /* ArrowFunction */ || kind === 210 /* BindingElement */ || kind === 266 /* ClassDeclaration */ || kind === 234 /* ClassExpression */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 174 /* OverloadPropertyDeclaration */ || kind === 178 /* Constructor */ || kind === 272 /* EnumDeclaration */ || kind === 311 /* EnumMember */ || kind === 287 /* ExportSpecifier */ || kind === 265 /* FunctionDeclaration */ || kind === 220 /* FunctionExpression */ || kind === 179 /* GetAccessor */ || kind === 279 /* ImportClause */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 282 /* ImportSpecifier */ || kind === 270 /* InterfaceDeclaration */ || kind === 297 /* JsxAttribute */ || kind === 176 /* MethodDeclaration */ || kind === 175 /* MethodSignature */ || kind === 273 /* ModuleDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 280 /* NamespaceImport */ || kind === 286 /* NamespaceExport */ || kind === 169 /* Parameter */ || kind === 308 /* PropertyAssignment */ || kind === 172 /* PropertyDeclaration */ || kind === 173 /* AnnotationPropertyDeclaration */ || kind === 171 /* PropertySignature */ || kind === 180 /* SetAccessor */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 271 /* TypeAliasDeclaration */ || kind === 168 /* TypeParameter */ || kind === 263 /* VariableDeclaration */ || kind === 357 /* JSDocTypedefTag */ || kind === 350 /* JSDocCallbackTag */ || kind === 359 /* JSDocPropertyTag */;
}
function isDeclarationStatementKind(kind) {
- return kind === 263 /* FunctionDeclaration */ || kind === 285 /* MissingDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 280 /* ExportAssignment */ || kind === 273 /* NamespaceExportDeclaration */;
+ return kind === 265 /* FunctionDeclaration */ || kind === 288 /* MissingDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 269 /* OverloadDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 276 /* NamespaceExportDeclaration */;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 253 /* BreakStatement */ || kind === 252 /* ContinueStatement */ || kind === 260 /* DebuggerStatement */ || kind === 247 /* DoStatement */ || kind === 245 /* ExpressionStatement */ || kind === 243 /* EmptyStatement */ || kind === 250 /* ForInStatement */ || kind === 251 /* ForOfStatement */ || kind === 249 /* ForStatement */ || kind === 246 /* IfStatement */ || kind === 257 /* LabeledStatement */ || kind === 254 /* ReturnStatement */ || kind === 256 /* SwitchStatement */ || kind === 258 /* ThrowStatement */ || kind === 259 /* TryStatement */ || kind === 244 /* VariableStatement */ || kind === 248 /* WhileStatement */ || kind === 255 /* WithStatement */ || kind === 358 /* NotEmittedStatement */ || kind === 362 /* EndOfDeclarationMarker */ || kind === 361 /* MergeDeclarationMarker */;
+ return kind === 255 /* BreakStatement */ || kind === 254 /* ContinueStatement */ || kind === 262 /* DebuggerStatement */ || kind === 249 /* DoStatement */ || kind === 247 /* ExpressionStatement */ || kind === 245 /* EmptyStatement */ || kind === 252 /* ForInStatement */ || kind === 253 /* ForOfStatement */ || kind === 251 /* ForStatement */ || kind === 248 /* IfStatement */ || kind === 259 /* LabeledStatement */ || kind === 256 /* ReturnStatement */ || kind === 258 /* SwitchStatement */ || kind === 260 /* ThrowStatement */ || kind === 261 /* TryStatement */ || kind === 246 /* VariableStatement */ || kind === 250 /* WhileStatement */ || kind === 257 /* WithStatement */ || kind === 361 /* NotEmittedStatement */ || kind === 365 /* EndOfDeclarationMarker */ || kind === 364 /* MergeDeclarationMarker */;
}
function isDeclaration(node) {
- if (node.kind === 167 /* TypeParameter */) {
- return node.parent && node.parent.kind !== 353 /* JSDocTemplateTag */ || isInJSFile(node);
+ if (node.kind === 168 /* TypeParameter */) {
+ return node.parent && node.parent.kind !== 356 /* JSDocTemplateTag */ || isInJSFile(node);
}
return isDeclarationKind(node.kind);
}
@@ -12318,10 +12326,10 @@ function isStatement(node) {
return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || isBlockStatement(node);
}
function isBlockStatement(node) {
- if (node.kind !== 242 /* Block */)
+ if (node.kind !== 244 /* Block */)
return false;
if (node.parent !== void 0) {
- if (node.parent.kind === 259 /* TryStatement */ || node.parent.kind === 301 /* CatchClause */) {
+ if (node.parent.kind === 261 /* TryStatement */ || node.parent.kind === 304 /* CatchClause */) {
return false;
}
}
@@ -12329,50 +12337,50 @@ function isBlockStatement(node) {
}
function isStatementOrBlock(node) {
const kind = node.kind;
- return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 242 /* Block */;
+ return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 244 /* Block */;
}
function isModuleReference(node) {
const kind = node.kind;
- return kind === 286 /* ExternalModuleReference */ || kind === 165 /* QualifiedName */ || kind === 79 /* Identifier */;
+ return kind === 289 /* ExternalModuleReference */ || kind === 166 /* QualifiedName */ || kind === 79 /* Identifier */;
}
function isJsxTagNameExpression(node) {
const kind = node.kind;
- return kind === 109 /* ThisKeyword */ || kind === 79 /* Identifier */ || kind === 211 /* PropertyAccessExpression */;
+ return kind === 109 /* ThisKeyword */ || kind === 79 /* Identifier */ || kind === 213 /* PropertyAccessExpression */;
}
function isJsxChild(node) {
const kind = node.kind;
- return kind === 287 /* JsxElement */ || kind === 297 /* JsxExpression */ || kind === 288 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ || kind === 291 /* JsxFragment */;
+ return kind === 290 /* JsxElement */ || kind === 300 /* JsxExpression */ || kind === 291 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ || kind === 294 /* JsxFragment */;
}
function isJsxAttributeLike(node) {
const kind = node.kind;
- return kind === 294 /* JsxAttribute */ || kind === 296 /* JsxSpreadAttribute */;
+ return kind === 297 /* JsxAttribute */ || kind === 299 /* JsxSpreadAttribute */;
}
function isStringLiteralOrJsxExpression(node) {
const kind = node.kind;
- return kind === 10 /* StringLiteral */ || kind === 297 /* JsxExpression */;
+ return kind === 10 /* StringLiteral */ || kind === 300 /* JsxExpression */;
}
function isJsxOpeningLikeElement(node) {
const kind = node.kind;
- return kind === 289 /* JsxOpeningElement */ || kind === 288 /* JsxSelfClosingElement */;
+ return kind === 292 /* JsxOpeningElement */ || kind === 291 /* JsxSelfClosingElement */;
}
function isCaseOrDefaultClause(node) {
const kind = node.kind;
- return kind === 298 /* CaseClause */ || kind === 299 /* DefaultClause */;
+ return kind === 301 /* CaseClause */ || kind === 302 /* DefaultClause */;
}
function isJSDocNode(node) {
- return node.kind >= 318 /* FirstJSDocNode */ && node.kind <= 356 /* LastJSDocNode */;
+ return node.kind >= 321 /* FirstJSDocNode */ && node.kind <= 359 /* LastJSDocNode */;
}
function isJSDocCommentContainingNode(node) {
- return node.kind === 329 /* JSDoc */ || node.kind === 328 /* JSDocNamepathType */ || node.kind === 330 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node);
+ return node.kind === 332 /* JSDoc */ || node.kind === 331 /* JSDocNamepathType */ || node.kind === 333 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node);
}
function isJSDocTag(node) {
- return node.kind >= 336 /* FirstJSDocTagNode */ && node.kind <= 356 /* LastJSDocTagNode */;
+ return node.kind >= 339 /* FirstJSDocTagNode */ && node.kind <= 359 /* LastJSDocTagNode */;
}
function isSetAccessor(node) {
- return node.kind === 178 /* SetAccessor */;
+ return node.kind === 180 /* SetAccessor */;
}
function isGetAccessor(node) {
- return node.kind === 177 /* GetAccessor */;
+ return node.kind === 179 /* GetAccessor */;
}
function hasJSDocNodes(node) {
const { jsDoc } = node;
@@ -12386,23 +12394,23 @@ function hasInitializer(node) {
}
function hasOnlyExpressionInitializer(node) {
switch (node.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 305 /* PropertyAssignment */:
- case 308 /* EnumMember */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 308 /* PropertyAssignment */:
+ case 311 /* EnumMember */:
return true;
default:
return false;
}
}
function isObjectLiteralElement(node) {
- return node.kind === 294 /* JsxAttribute */ || node.kind === 296 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);
+ return node.kind === 297 /* JsxAttribute */ || node.kind === 299 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);
}
function isTypeReferenceType(node) {
- return node.kind === 183 /* TypeReference */ || node.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.kind === 185 /* TypeReference */ || node.kind === 236 /* ExpressionWithTypeArguments */;
}
var MAX_SMI_X86 = 1073741823;
function guessIndentation(lines) {
@@ -12430,7 +12438,7 @@ function isStringLiteralLike(node) {
return node.kind === 10 /* StringLiteral */ || node.kind === 14 /* NoSubstitutionTemplateLiteral */;
}
function isJSDocLinkLike(node) {
- return node.kind === 333 /* JSDocLink */ || node.kind === 334 /* JSDocLinkCode */ || node.kind === 335 /* JSDocLinkPlain */;
+ return node.kind === 336 /* JSDocLink */ || node.kind === 337 /* JSDocLinkCode */ || node.kind === 338 /* JSDocLinkPlain */;
}
function hasRestParameter(s) {
const last2 = lastOrUndefined(s.parameters);
@@ -12438,7 +12446,7 @@ function hasRestParameter(s) {
}
function isRestParameter(node) {
const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
- return node.dotDotDotToken !== void 0 || !!type && type.kind === 327 /* JSDocVariadicType */;
+ return node.dotDotDotToken !== void 0 || !!type && type.kind === 330 /* JSDocVariadicType */;
}
var _MemoryUtils = class {
static tryGC() {
@@ -12662,7 +12670,7 @@ function aggregateChildData(node) {
}
}
function getSourceFileOfNode(node) {
- while (node && node.kind !== 314 /* SourceFile */) {
+ while (node && node.kind !== 317 /* SourceFile */) {
node = node.parent;
}
return node;
@@ -12675,11 +12683,11 @@ function isPlainJsFile(file, checkJs) {
}
function isStatementWithLocals(node) {
switch (node.kind) {
- case 242 /* Block */:
- case 272 /* CaseBlock */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 244 /* Block */:
+ case 275 /* CaseBlock */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
return true;
}
return false;
@@ -12836,7 +12844,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
if (includeJsDoc && hasJSDocNodes(node)) {
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
}
- if (node.kind === 357 /* SyntaxList */ && node._children.length > 0) {
+ if (node.kind === 360 /* SyntaxList */ && node._children.length > 0) {
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
}
return node.virtual ? node.pos : skipTrivia(
@@ -13039,7 +13047,7 @@ function isBlockOrCatchScoped(declaration) {
}
function isCatchClauseVariableDeclarationOrBindingElement(declaration) {
const node = getRootDeclaration(declaration);
- return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 301 /* CatchClause */;
+ return node.kind === 263 /* VariableDeclaration */ && node.parent.kind === 304 /* CatchClause */;
}
function isAmbientModule(node) {
return isModuleDeclaration(node) && (node.name.kind === 10 /* StringLiteral */ || isGlobalScopeAugmentation(node));
@@ -13057,10 +13065,10 @@ function isShorthandAmbientModuleSymbol(moduleSymbol) {
return isShorthandAmbientModule(moduleSymbol.valueDeclaration);
}
function isShorthandAmbientModule(node) {
- return !!node && node.kind === 270 /* ModuleDeclaration */ && !node.body;
+ return !!node && node.kind === 273 /* ModuleDeclaration */ && !node.body;
}
function isBlockScopedContainerTopLevel(node) {
- return node.kind === 314 /* SourceFile */ || node.kind === 270 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node);
+ return node.kind === 317 /* SourceFile */ || node.kind === 273 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node);
}
function isGlobalScopeAugmentation(module2) {
return !!(module2.flags & 1024 /* GlobalAugmentation */);
@@ -13070,9 +13078,9 @@ function isExternalModuleAugmentation(node) {
}
function isModuleAugmentationExternal(node) {
switch (node.parent.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return isExternalModule(node.parent);
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return isAmbientModule(node.parent.parent) && isSourceFile(node.parent.parent.parent) && !isExternalModule(node.parent.parent.parent);
}
return false;
@@ -13120,34 +13128,34 @@ function isAmbientPropertyDeclaration(node) {
}
function isBlockScope(node, parentNode) {
switch (node.kind) {
- case 314 /* SourceFile */:
- case 272 /* CaseBlock */:
- case 301 /* CatchClause */:
- case 270 /* ModuleDeclaration */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 317 /* SourceFile */:
+ case 275 /* CaseBlock */:
+ case 304 /* CatchClause */:
+ case 273 /* ModuleDeclaration */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return true;
- case 242 /* Block */:
+ case 244 /* Block */:
return !isFunctionLikeOrClassStaticBlockDeclaration(parentNode);
}
return false;
}
function isDeclarationWithTypeParameters(node) {
switch (node.kind) {
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
- case 332 /* JSDocSignature */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 335 /* JSDocSignature */:
return true;
default:
assertType(node);
@@ -13156,26 +13164,26 @@ function isDeclarationWithTypeParameters(node) {
}
function isDeclarationWithTypeParameterChildren(node) {
switch (node.kind) {
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 326 /* JSDocFunctionType */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 353 /* JSDocTemplateTag */:
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 329 /* JSDocFunctionType */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 356 /* JSDocTemplateTag */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
default:
assertType(node);
@@ -13184,8 +13192,8 @@ function isDeclarationWithTypeParameterChildren(node) {
}
function isAnyImportSyntax(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return true;
default:
return false;
@@ -13196,17 +13204,18 @@ function isAnyImportOrBareOrAccessedRequire(node) {
}
function isLateVisibilityPaintedStatement(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 244 /* VariableStatement */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 246 /* VariableStatement */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
return true;
default:
return false;
@@ -13239,7 +13248,7 @@ function getNameFromIndexInfo(info) {
return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : void 0;
}
function isComputedNonLiteralName(name) {
- return name.kind === 166 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
+ return name.kind === 167 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
}
function tryGetTextOfPropertyName(name) {
switch (name.kind) {
@@ -13250,7 +13259,7 @@ function tryGetTextOfPropertyName(name) {
case 8 /* NumericLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return escapeLeadingUnderscores(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
if (isStringOrNumericLiteralLike(name.expression))
return escapeLeadingUnderscores(name.expression.text);
return void 0;
@@ -13268,15 +13277,15 @@ function entityNameToString(name) {
case 80 /* PrivateIdentifier */:
case 79 /* Identifier */:
return getFullWidth(name) === 0 ? idText(name) : getTextOfNode(name);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return entityNameToString(name.left) + "." + entityNameToString(name.right);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isIdentifier(name.name) || isPrivateIdentifier(name.name)) {
return entityNameToString(name.expression) + "." + entityNameToString(name.name);
} else {
return Debug.assertNever(name.name);
}
- case 320 /* JSDocMemberName */:
+ case 323 /* JSDocMemberName */:
return entityNameToString(name.left) + entityNameToString(name.right);
default:
return Debug.assertNever(name);
@@ -13356,7 +13365,7 @@ function getSpanOfTokenAtPosition(sourceFile, pos) {
}
function getErrorSpanForArrowFunction(sourceFile, node) {
const pos = skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 242 /* Block */) {
+ if (node.body && node.body.kind === 244 /* Block */) {
const { line: startLine } = getLineAndCharacterOfPosition(sourceFile, node.body.pos);
const { line: endLine } = getLineAndCharacterOfPosition(sourceFile, node.body.end);
if (startLine < endLine) {
@@ -13368,37 +13377,37 @@ function getErrorSpanForArrowFunction(sourceFile, node) {
function getErrorSpanForNode(sourceFile, node) {
let errorNode = node;
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
const pos2 = skipTrivia(sourceFile.text, 0, false);
if (pos2 === sourceFile.text.length) {
return createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos2);
- case 261 /* VariableDeclaration */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 268 /* TypeAliasDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 277 /* NamespaceImport */:
+ case 263 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 271 /* TypeAliasDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 280 /* NamespaceImport */:
errorNode = node.name;
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return getErrorSpanForArrowFunction(sourceFile, node);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
const start = skipTrivia(sourceFile.text, node.pos);
const end = node.statements.length > 0 ? node.statements[0].pos : node.end;
return createTextSpanFromBounds(start, end);
@@ -13440,10 +13449,10 @@ function isLet(node) {
return !!(getCombinedNodeFlags(node) & 1 /* Let */);
}
function isSuperCall(n) {
- return n.kind === 213 /* CallExpression */ && n.expression.kind === 107 /* SuperKeyword */;
+ return n.kind === 215 /* CallExpression */ && n.expression.kind === 107 /* SuperKeyword */;
}
function isImportCall(n) {
- return n.kind === 213 /* CallExpression */ && n.expression.kind === 101 /* ImportKeyword */;
+ return n.kind === 215 /* CallExpression */ && n.expression.kind === 101 /* ImportKeyword */;
}
function isImportMeta(n) {
return isMetaProperty(n) && n.keywordToken === 101 /* ImportKeyword */ && n.name.escapedText === "meta";
@@ -13452,7 +13461,7 @@ function isLiteralImportTypeNode(n) {
return isImportTypeNode(n) && isLiteralTypeNode(n.argument) && isStringLiteral(n.argument.literal);
}
function isPrologueDirective(node) {
- return node.kind === 245 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */;
+ return node.kind === 247 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */;
}
function isCustomPrologue(node) {
return !!(getEmitFlags(node) & 1048576 /* CustomPrologue */);
@@ -13467,7 +13476,7 @@ function isHoistedVariableStatement(node) {
return isCustomPrologue(node) && isVariableStatement(node) && every(node.declarationList.declarations, isHoistedVariable);
}
function getJSDocCommentRanges(node, text) {
- const commentRanges = node.kind === 168 /* Parameter */ || node.kind === 167 /* TypeParameter */ || node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */ || node.kind === 217 /* ParenthesizedExpression */ || node.kind === 261 /* VariableDeclaration */ || node.kind === 284 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos);
+ const commentRanges = node.kind === 169 /* Parameter */ || node.kind === 168 /* TypeParameter */ || node.kind === 220 /* FunctionExpression */ || node.kind === 221 /* ArrowFunction */ || node.kind === 219 /* ParenthesizedExpression */ || node.kind === 263 /* VariableDeclaration */ || node.kind === 287 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos);
return filter(commentRanges, (comment) => text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */);
}
var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/;
@@ -13475,7 +13484,7 @@ var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/;
var defaultLibReferenceRegEx = /^(\/\/\/\s*/;
function isPartOfTypeNode(node) {
- if (182 /* FirstTypeNode */ <= node.kind && node.kind <= 205 /* LastTypeNode */) {
+ if (184 /* FirstTypeNode */ <= node.kind && node.kind <= 207 /* LastTypeNode */) {
return true;
}
switch (node.kind) {
@@ -13491,65 +13500,65 @@ function isPartOfTypeNode(node) {
case 145 /* NeverKeyword */:
return true;
case 115 /* VoidKeyword */:
- return node.parent.kind !== 223 /* VoidExpression */;
- case 234 /* ExpressionWithTypeArguments */:
+ return node.parent.kind !== 225 /* VoidExpression */;
+ case 236 /* ExpressionWithTypeArguments */:
return isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node);
- case 167 /* TypeParameter */:
- return node.parent.kind === 200 /* MappedType */ || node.parent.kind === 195 /* InferType */;
+ case 168 /* TypeParameter */:
+ return node.parent.kind === 202 /* MappedType */ || node.parent.kind === 197 /* InferType */;
case 79 /* Identifier */:
- if (node.parent.kind === 165 /* QualifiedName */ && node.parent.right === node) {
+ if (node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node) {
node = node.parent;
- } else if (node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node) {
+ } else if (node.parent.kind === 213 /* PropertyAccessExpression */ && node.parent.name === node) {
node = node.parent;
}
Debug.assert(
- node.kind === 79 /* Identifier */ || node.kind === 165 /* QualifiedName */ || node.kind === 211 /* PropertyAccessExpression */,
+ node.kind === 79 /* Identifier */ || node.kind === 166 /* QualifiedName */ || node.kind === 213 /* PropertyAccessExpression */,
"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."
);
- case 165 /* QualifiedName */:
- case 211 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
case 109 /* ThisKeyword */: {
const { parent } = node;
- if (parent.kind === 186 /* TypeQuery */) {
+ if (parent.kind === 188 /* TypeQuery */) {
return false;
}
- if (parent.kind === 205 /* ImportType */) {
+ if (parent.kind === 207 /* ImportType */) {
return !parent.isTypeOf;
}
- if (182 /* FirstTypeNode */ <= parent.kind && parent.kind <= 205 /* LastTypeNode */) {
+ if (184 /* FirstTypeNode */ <= parent.kind && parent.kind <= 207 /* LastTypeNode */) {
return true;
}
switch (parent.kind) {
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return isHeritageClause(parent.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return node === parent.constraint;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return node === parent.constraint;
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 168 /* Parameter */:
- case 261 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 169 /* Parameter */:
+ case 263 /* VariableDeclaration */:
return node === parent.type;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return node === parent.type;
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return node === parent.type;
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return node === parent.type;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
return contains(parent.typeArguments, node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return false;
}
}
@@ -13569,23 +13578,23 @@ function forEachReturnStatement(body, visitor) {
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitor(node);
- case 272 /* CaseBlock */:
- case 242 /* Block */:
- case 246 /* IfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 255 /* WithStatement */:
- case 256 /* SwitchStatement */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 257 /* LabeledStatement */:
- case 259 /* TryStatement */:
- case 301 /* CatchClause */:
+ case 275 /* CaseBlock */:
+ case 244 /* Block */:
+ case 248 /* IfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 257 /* WithStatement */:
+ case 258 /* SwitchStatement */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 259 /* LabeledStatement */:
+ case 261 /* TryStatement */:
+ case 304 /* CatchClause */:
return forEachChild(node, traverse);
}
}
@@ -13594,21 +13603,21 @@ function forEachYieldExpression(body, visitor) {
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
visitor(node);
const operand = node.expression;
if (operand) {
traverse(operand);
}
return;
- case 269 /* EnumDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return;
default:
if (isFunctionLike(node)) {
- if (node.name && node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name && node.name.kind === 167 /* ComputedPropertyName */) {
traverse(node.name.expression);
return;
}
@@ -13619,9 +13628,9 @@ function forEachYieldExpression(body, visitor) {
}
}
function getRestParameterElementType(node) {
- if (node && node.kind === 188 /* ArrayType */) {
+ if (node && node.kind === 190 /* ArrayType */) {
return node.elementType;
- } else if (node && node.kind === 183 /* TypeReference */) {
+ } else if (node && node.kind === 185 /* TypeReference */) {
return singleOrUndefined(node.typeArguments);
} else {
return void 0;
@@ -13629,27 +13638,27 @@ function getRestParameterElementType(node) {
}
function getMembersOfDeclaration(node) {
switch (node.kind) {
- case 267 /* InterfaceDeclaration */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 187 /* TypeLiteral */:
+ case 270 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 189 /* TypeLiteral */:
return node.members;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return node.properties;
}
}
function isVariableLike(node) {
if (node) {
switch (node.kind) {
- case 208 /* BindingElement */:
- case 308 /* EnumMember */:
- case 168 /* Parameter */:
- case 305 /* PropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 306 /* ShorthandPropertyAssignment */:
- case 261 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 311 /* EnumMember */:
+ case 169 /* Parameter */:
+ case 308 /* PropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 263 /* VariableDeclaration */:
return true;
}
}
@@ -13659,7 +13668,7 @@ function isVariableLikeOrAccessor(node) {
return isVariableLike(node) || isAccessor(node);
}
function isVariableDeclarationInVariableStatement(node) {
- return node.parent.kind === 262 /* VariableDeclarationList */ && node.parent.parent.kind === 244 /* VariableStatement */;
+ return node.parent.kind === 264 /* VariableDeclarationList */ && node.parent.parent.kind === 246 /* VariableStatement */;
}
function isCommonJsExportedExpression(node) {
if (!isInJSFile(node))
@@ -13676,13 +13685,13 @@ function isValidESSymbolDeclaration(node) {
}
function introducesArgumentsExoticObject(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return true;
}
return false;
@@ -13692,20 +13701,20 @@ function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) {
if (beforeUnwrapLabelCallback) {
beforeUnwrapLabelCallback(node);
}
- if (node.statement.kind !== 257 /* LabeledStatement */) {
+ if (node.statement.kind !== 259 /* LabeledStatement */) {
return node.statement;
}
node = node.statement;
}
}
function isFunctionBlock(node) {
- return node && node.kind === 242 /* Block */ && isFunctionLike(node.parent);
+ return node && node.kind === 244 /* Block */ && isFunctionLike(node.parent);
}
function isObjectLiteralMethod(node) {
- return node && node.kind === 174 /* MethodDeclaration */ && node.parent.kind === 210 /* ObjectLiteralExpression */;
+ return node && node.kind === 176 /* MethodDeclaration */ && node.parent.kind === 212 /* ObjectLiteralExpression */;
}
function isObjectLiteralOrClassExpressionMethodOrAccessor(node) {
- return (node.kind === 174 /* MethodDeclaration */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */) && (node.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.kind === 232 /* ClassExpression */);
+ return (node.kind === 176 /* MethodDeclaration */ || node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */) && (node.parent.kind === 212 /* ObjectLiteralExpression */ || node.parent.kind === 234 /* ClassExpression */);
}
function isIdentifierTypePredicate(predicate) {
return predicate && predicate.kind === 1 /* Identifier */;
@@ -13715,7 +13724,7 @@ function isThisTypePredicate(predicate) {
}
function getPropertyAssignment(objectLiteral, key, key2) {
return objectLiteral.properties.filter((property) => {
- if (property.kind === 305 /* PropertyAssignment */) {
+ if (property.kind === 308 /* PropertyAssignment */) {
const propName = tryGetTextOfPropertyName(property.name);
return key === propName || !!key2 && key2 === propName;
}
@@ -13765,63 +13774,63 @@ function getContainingStruct(node) {
return findAncestor(node.parent, isStruct);
}
function getThisContainer(node, includeArrowFunctions) {
- Debug.assert(node.kind !== 314 /* SourceFile */);
+ Debug.assert(node.kind !== 317 /* SourceFile */);
while (true) {
node = node.parent;
if (!node) {
return Debug.fail();
}
switch (node.kind) {
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
if (isClassLike(node.parent.parent)) {
return node;
}
node = node.parent;
break;
- case 169 /* Decorator */:
- if (node.parent.kind === 168 /* Parameter */ && isClassElement(node.parent.parent)) {
+ case 170 /* Decorator */:
+ if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) {
node = node.parent.parent;
} else if (isClassElement(node.parent)) {
node = node.parent;
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (!includeArrowFunctions) {
continue;
}
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 270 /* ModuleDeclaration */:
- case 175 /* ClassStaticBlockDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 269 /* EnumDeclaration */:
- case 314 /* SourceFile */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 273 /* ModuleDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 272 /* EnumDeclaration */:
+ case 317 /* SourceFile */:
return node;
}
}
}
function isThisContainerOrFunctionBlock(node) {
switch (node.kind) {
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 171 /* PropertyDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 172 /* PropertyDeclaration */:
return true;
- case 242 /* Block */:
+ case 244 /* Block */:
switch (node.parent.kind) {
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -13841,9 +13850,9 @@ function getNewTargetContainer(node) {
const container = getThisContainer(node, false);
if (container) {
switch (container.kind) {
- case 176 /* Constructor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return container;
}
}
@@ -13856,26 +13865,26 @@ function getSuperContainer(node, stopOnFunctions) {
return node;
}
switch (node.kind) {
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
node = node.parent;
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
if (!stopOnFunctions) {
continue;
}
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
return node;
- case 169 /* Decorator */:
- if (node.parent.kind === 168 /* Parameter */ && isClassElement(node.parent.parent)) {
+ case 170 /* Decorator */:
+ if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) {
node = node.parent.parent;
} else if (isClassElement(node.parent)) {
node = node.parent;
@@ -13885,14 +13894,14 @@ function getSuperContainer(node, stopOnFunctions) {
}
}
function getImmediatelyInvokedFunctionExpression(func) {
- if (func.kind === 218 /* FunctionExpression */ || func.kind === 219 /* ArrowFunction */) {
+ if (func.kind === 220 /* FunctionExpression */ || func.kind === 221 /* ArrowFunction */) {
let prev = func;
let parent = func.parent;
- while (parent.kind === 217 /* ParenthesizedExpression */) {
+ while (parent.kind === 219 /* ParenthesizedExpression */) {
prev = parent;
parent = parent.parent;
}
- if (parent.kind === 213 /* CallExpression */ && parent.expression === prev) {
+ if (parent.kind === 215 /* CallExpression */ && parent.expression === prev) {
return parent;
}
}
@@ -13902,11 +13911,11 @@ function isSuperOrSuperProperty(node) {
}
function isSuperProperty(node) {
const kind = node.kind;
- return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 107 /* SuperKeyword */;
+ return (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */) && node.expression.kind === 107 /* SuperKeyword */;
}
function isThisProperty(node) {
const kind = node.kind;
- return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 109 /* ThisKeyword */;
+ return (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */) && node.expression.kind === 109 /* ThisKeyword */;
}
function isThisInitializedDeclaration(node) {
var _a2;
@@ -13917,22 +13926,22 @@ function isThisInitializedObjectBindingExpression(node) {
}
function getEntityNameFromTypeNode(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return node.typeName;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return isEntityNameExpression(node.expression) ? node.expression : void 0;
case 79 /* Identifier */:
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return node;
}
return void 0;
}
function getInvokedExpression(node) {
switch (node.kind) {
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return node.tag;
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return node.tagName;
default:
return node.expression;
@@ -13943,20 +13952,20 @@ function nodeCanBeDecorated(node, parent, grandparent, compilerOptions) {
return false;
}
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
return true;
- case 171 /* PropertyDeclaration */:
- return parent.kind === 264 /* ClassDeclaration */ || parent.kind === 265 /* StructDeclaration */;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- return node.body !== void 0 && (parent.kind === 264 /* ClassDeclaration */ || parent.kind === 265 /* StructDeclaration */);
- case 168 /* Parameter */:
- return parent.body !== void 0 && (parent.kind === 176 /* Constructor */ || parent.kind === 174 /* MethodDeclaration */ || parent.kind === 178 /* SetAccessor */) && (grandparent.kind === 264 /* ClassDeclaration */ || grandparent.kind === 265 /* StructDeclaration */);
- case 263 /* FunctionDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ return parent.kind === 266 /* ClassDeclaration */ || parent.kind === 267 /* StructDeclaration */;
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ return node.body !== void 0 && (parent.kind === 266 /* ClassDeclaration */ || parent.kind === 267 /* StructDeclaration */);
+ case 169 /* Parameter */:
+ return parent.body !== void 0 && (parent.kind === 178 /* Constructor */ || parent.kind === 176 /* MethodDeclaration */ || parent.kind === 180 /* SetAccessor */) && (grandparent.kind === 266 /* ClassDeclaration */ || grandparent.kind === 267 /* StructDeclaration */);
+ case 265 /* FunctionDeclaration */:
return isArkTsDecorator(node, compilerOptions) || isSendableFunctionOrType(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return isSendableFunctionOrType(node);
}
return false;
@@ -13969,13 +13978,13 @@ function nodeOrChildIsDecorated(node, parent, grandparent) {
}
function childIsDecorated(node, parent) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return some(node.members, (m) => nodeOrChildIsDecorated(m, node, parent));
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return some(node.members, (m) => nodeOrChildIsDecorated(m, node, parent));
- case 174 /* MethodDeclaration */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
return some(node.parameters, (p) => nodeIsDecorated(p, node, parent));
default:
return false;
@@ -13989,7 +13998,7 @@ function classOrConstructorParameterIsDecorated(node) {
}
function isJSXTagName(node) {
const { parent } = node;
- if (parent.kind === 289 /* JsxOpeningElement */ || parent.kind === 288 /* JsxSelfClosingElement */ || parent.kind === 290 /* JsxClosingElement */) {
+ if (parent.kind === 292 /* JsxOpeningElement */ || parent.kind === 291 /* JsxSelfClosingElement */ || parent.kind === 293 /* JsxClosingElement */) {
return parent.tagName === node;
}
return false;
@@ -14001,55 +14010,55 @@ function isExpressionNode(node) {
case 111 /* TrueKeyword */:
case 96 /* FalseKeyword */:
case 13 /* RegularExpressionLiteral */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 211 /* PropertyAccessExpression */:
- case 220 /* EtsComponentExpression */:
- case 212 /* ElementAccessExpression */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 215 /* TaggedTemplateExpression */:
- case 235 /* AsExpression */:
- case 216 /* TypeAssertionExpression */:
- case 239 /* SatisfiesExpression */:
- case 236 /* NonNullExpression */:
- case 217 /* ParenthesizedExpression */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
- case 219 /* ArrowFunction */:
- case 223 /* VoidExpression */:
- case 221 /* DeleteExpression */:
- case 222 /* TypeOfExpression */:
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
- case 227 /* BinaryExpression */:
- case 228 /* ConditionalExpression */:
- case 231 /* SpreadElement */:
- case 229 /* TemplateExpression */:
- case 233 /* OmittedExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
- case 230 /* YieldExpression */:
- case 224 /* AwaitExpression */:
- case 237 /* MetaProperty */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 222 /* EtsComponentExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 237 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 241 /* SatisfiesExpression */:
+ case 238 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 225 /* VoidExpression */:
+ case 223 /* DeleteExpression */:
+ case 224 /* TypeOfExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 229 /* BinaryExpression */:
+ case 230 /* ConditionalExpression */:
+ case 233 /* SpreadElement */:
+ case 231 /* TemplateExpression */:
+ case 235 /* OmittedExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
+ case 232 /* YieldExpression */:
+ case 226 /* AwaitExpression */:
+ case 239 /* MetaProperty */:
return true;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return !isHeritageClause(node.parent);
- case 165 /* QualifiedName */:
- while (node.parent.kind === 165 /* QualifiedName */) {
+ case 166 /* QualifiedName */:
+ while (node.parent.kind === 166 /* QualifiedName */) {
node = node.parent;
}
- return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
- case 320 /* JSDocMemberName */:
+ return node.parent.kind === 188 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
+ case 323 /* JSDocMemberName */:
while (isJSDocMemberName(node.parent)) {
node = node.parent;
}
- return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
+ return node.parent.kind === 188 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
case 80 /* PrivateIdentifier */:
return isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 102 /* InKeyword */;
case 79 /* Identifier */:
- if (node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) {
+ if (node.parent.kind === 188 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) {
return true;
}
case 8 /* NumericLiteral */:
@@ -14065,64 +14074,64 @@ function isExpressionNode(node) {
function isInExpressionContext(node) {
const { parent } = node;
switch (parent.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 308 /* EnumMember */:
- case 305 /* PropertyAssignment */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 311 /* EnumMember */:
+ case 308 /* PropertyAssignment */:
+ case 210 /* BindingElement */:
return parent.initializer === node;
- case 245 /* ExpressionStatement */:
- case 246 /* IfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 254 /* ReturnStatement */:
- case 255 /* WithStatement */:
- case 256 /* SwitchStatement */:
- case 298 /* CaseClause */:
- case 258 /* ThrowStatement */:
+ case 247 /* ExpressionStatement */:
+ case 248 /* IfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 256 /* ReturnStatement */:
+ case 257 /* WithStatement */:
+ case 258 /* SwitchStatement */:
+ case 301 /* CaseClause */:
+ case 260 /* ThrowStatement */:
return parent.expression === node;
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
const forStatement = parent;
- return forStatement.initializer === node && forStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ return forStatement.initializer === node && forStatement.initializer.kind !== 264 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
const forInStatement = parent;
- return forInStatement.initializer === node && forInStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forInStatement.expression === node;
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ return forInStatement.initializer === node && forInStatement.initializer.kind !== 264 /* VariableDeclarationList */ || forInStatement.expression === node;
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return node === parent.expression;
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return node === parent.expression;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return node === parent.expression;
- case 169 /* Decorator */:
- case 297 /* JsxExpression */:
- case 296 /* JsxSpreadAttribute */:
- case 307 /* SpreadAssignment */:
+ case 170 /* Decorator */:
+ case 300 /* JsxExpression */:
+ case 299 /* JsxSpreadAttribute */:
+ case 310 /* SpreadAssignment */:
return true;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return parent.expression === node && !isPartOfTypeNode(parent);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return parent.objectAssignmentInitializer === node;
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return node === parent.expression;
default:
return isExpressionNode(parent);
}
}
function isPartOfTypeQuery(node) {
- while (node.kind === 165 /* QualifiedName */ || node.kind === 79 /* Identifier */) {
+ while (node.kind === 166 /* QualifiedName */ || node.kind === 79 /* Identifier */) {
node = node.parent;
}
- return node.kind === 186 /* TypeQuery */;
+ return node.kind === 188 /* TypeQuery */;
}
function isNamespaceReexportDeclaration(node) {
return isNamespaceExport(node) && !!node.parent.moduleSpecifier;
}
function isExternalModuleImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 286 /* ExternalModuleReference */;
+ return node.kind === 277 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 289 /* ExternalModuleReference */;
}
function getExternalModuleImportEqualsDeclarationExpression(node) {
Debug.assert(isExternalModuleImportEqualsDeclaration(node));
@@ -14132,7 +14141,7 @@ function getExternalModuleRequireArgument(node) {
return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
}
function isInternalModuleImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 286 /* ExternalModuleReference */;
+ return node.kind === 277 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 289 /* ExternalModuleReference */;
}
function isSourceFileJS(file) {
return isInJSFile(file);
@@ -14191,7 +14200,7 @@ function isInStruct(node) {
return !!container && isStruct(container);
}
function isRequireCall(callExpression, requireStringLiteralLikeArgument) {
- if (callExpression.kind !== 213 /* CallExpression */) {
+ if (callExpression.kind !== 215 /* CallExpression */) {
return false;
}
const { expression, arguments: args } = callExpression;
@@ -14253,9 +14262,9 @@ function getAssignedExpandoInitializer(node) {
function getExpandoInitializer(initializer, isPrototypeAssignment) {
if (isCallExpression(initializer)) {
const e = skipParentheses(initializer.expression);
- return e.kind === 218 /* FunctionExpression */ || e.kind === 219 /* ArrowFunction */ ? initializer : void 0;
+ return e.kind === 220 /* FunctionExpression */ || e.kind === 221 /* ArrowFunction */ ? initializer : void 0;
}
- if (initializer.kind === 218 /* FunctionExpression */ || initializer.kind === 232 /* ClassExpression */ || initializer.kind === 219 /* ArrowFunction */) {
+ if (initializer.kind === 220 /* FunctionExpression */ || initializer.kind === 234 /* ClassExpression */ || initializer.kind === 221 /* ArrowFunction */) {
return initializer;
}
if (isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) {
@@ -14417,7 +14426,7 @@ function isPrototypePropertyAssignment(node) {
return isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 3 /* PrototypeProperty */;
}
function isSpecialPropertyDeclaration(expr) {
- return isInJSFile(expr) && expr.parent && expr.parent.kind === 245 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent);
+ return isInJSFile(expr) && expr.parent && expr.parent.kind === 247 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent);
}
function setValueDeclaration(symbol, node) {
const { valueDeclaration } = symbol;
@@ -14430,16 +14439,16 @@ function isFunctionSymbol(symbol) {
return false;
}
const decl = symbol.valueDeclaration;
- return decl.kind === 263 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer);
+ return decl.kind === 265 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer);
}
function tryGetModuleSpecifierFromDeclaration(node) {
var _a2, _b;
switch (node.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return (_a2 = findAncestor(node.initializer, (node2) => isRequireCall(node2, true))) == null ? void 0 : _a2.arguments[0];
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return tryCast(node.moduleSpecifier, isStringLiteralLike);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
default:
Debug.assertNever(node);
@@ -14450,14 +14459,14 @@ function importFromModuleSpecifier(node) {
}
function tryGetImportFromModuleSpecifier(node) {
switch (node.parent.kind) {
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
return node.parent;
- case 286 /* ExternalModuleReference */:
+ case 289 /* ExternalModuleReference */:
return node.parent.parent;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return isImportCall(node.parent) || isRequireCall(node.parent, false) ? node.parent : void 0;
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
Debug.assert(isStringLiteral(node));
return tryCast(node.parent.parent, isImportTypeNode);
default:
@@ -14466,16 +14475,16 @@ function tryGetImportFromModuleSpecifier(node) {
}
function getExternalModuleName(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
return node.moduleSpecifier;
- case 274 /* ImportEqualsDeclaration */:
- return node.moduleReference.kind === 286 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
- case 205 /* ImportType */:
+ case 277 /* ImportEqualsDeclaration */:
+ return node.moduleReference.kind === 289 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
+ case 207 /* ImportType */:
return isLiteralImportTypeNode(node) ? node.argument.literal : void 0;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return node.arguments[0];
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return node.name.kind === 10 /* StringLiteral */ ? node.name : void 0;
default:
return Debug.assertNever(node);
@@ -14483,18 +14492,18 @@ function getExternalModuleName(node) {
}
function getNamespaceDeclarationNode(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return node.importClause && tryCast(node.importClause.namedBindings, isNamespaceImport);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return node;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return node.exportClause && tryCast(node.exportClause, isNamespaceExport);
default:
return Debug.assertNever(node);
}
}
function isDefaultImport(node) {
- return node.kind === 275 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
+ return node.kind === 278 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
}
function forEachImportClauseDeclaration(node, action) {
if (node.name) {
@@ -14511,13 +14520,13 @@ function forEachImportClauseDeclaration(node, action) {
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
- case 168 /* Parameter */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 306 /* ShorthandPropertyAssignment */:
- case 305 /* PropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 169 /* Parameter */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return node.questionToken !== void 0;
}
}
@@ -14529,7 +14538,7 @@ function isJSDocConstructSignature(node) {
return !!name && name.escapedText === "new";
}
function isJSDocTypeAlias(node) {
- return node.kind === 354 /* JSDocTypedefTag */ || node.kind === 347 /* JSDocCallbackTag */ || node.kind === 348 /* JSDocEnumTag */;
+ return node.kind === 357 /* JSDocTypedefTag */ || node.kind === 350 /* JSDocCallbackTag */ || node.kind === 351 /* JSDocEnumTag */;
}
function isTypeAlias(node) {
return isJSDocTypeAlias(node) || isTypeAliasDeclaration(node);
@@ -14542,14 +14551,14 @@ function getSourceOfDefaultedAssignment(node) {
}
function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
const v = getSingleVariableOfVariableStatement(node);
return v && v.initializer;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return node.initializer;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return node.initializer;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return node.initializer;
}
}
@@ -14557,7 +14566,7 @@ function getSingleVariableOfVariableStatement(node) {
return isVariableStatement(node) ? firstOrUndefined(node.declarationList.declarations) : void 0;
}
function getNestedModuleDeclaration(node) {
- return isModuleDeclaration(node) && node.body && node.body.kind === 270 /* ModuleDeclaration */ ? node.body : void 0;
+ return isModuleDeclaration(node) && node.body && node.body.kind === 273 /* ModuleDeclaration */ ? node.body : void 0;
}
function getJSDocCommentsAndTags(hostNode, noCache) {
let result;
@@ -14569,11 +14578,11 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
if (hasJSDocNodes(node)) {
result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
}
- if (node.kind === 168 /* Parameter */) {
+ if (node.kind === 169 /* Parameter */) {
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
break;
}
- if (node.kind === 167 /* TypeParameter */) {
+ if (node.kind === 168 /* TypeParameter */) {
result = addRange(result, (noCache ? getJSDocTypeParameterTagsNoCache : getJSDocTypeParameterTags)(node));
break;
}
@@ -14593,7 +14602,7 @@ function ownsJSDocTag(hostNode, tag) {
}
function getNextJSDocCommentLocation(node) {
const parent = node.parent;
- if (parent.kind === 305 /* PropertyAssignment */ || parent.kind === 280 /* ExportAssignment */ || parent.kind === 171 /* PropertyDeclaration */ || parent.kind === 245 /* ExpressionStatement */ && node.kind === 211 /* PropertyAccessExpression */ || parent.kind === 254 /* ReturnStatement */ || getNestedModuleDeclaration(parent) || isBinaryExpression(node) && node.operatorToken.kind === 63 /* EqualsToken */) {
+ if (parent.kind === 308 /* PropertyAssignment */ || parent.kind === 283 /* ExportAssignment */ || parent.kind === 172 /* PropertyDeclaration */ || parent.kind === 247 /* ExpressionStatement */ && node.kind === 213 /* PropertyAccessExpression */ || parent.kind === 256 /* ReturnStatement */ || getNestedModuleDeclaration(parent) || isBinaryExpression(node) && node.operatorToken.kind === 63 /* EqualsToken */) {
return parent;
} else if (parent.parent && (getSingleVariableOfVariableStatement(parent.parent) === node || isBinaryExpression(parent) && parent.operatorToken.kind === 63 /* EqualsToken */)) {
return parent.parent;
@@ -14669,32 +14678,32 @@ function getAssignmentTargetKind(node) {
let parent = node.parent;
while (true) {
switch (parent.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const binaryOperator = parent.operatorToken.kind;
return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 63 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
const unaryOperator = parent.operator;
return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
return parent.initializer === node ? 1 /* Definite */ : 0 /* None */;
- case 217 /* ParenthesizedExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 231 /* SpreadElement */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 233 /* SpreadElement */:
+ case 238 /* NonNullExpression */:
node = parent;
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
node = parent.parent;
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
if (parent.name !== node) {
return 0 /* None */;
}
node = parent.parent;
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (parent.name === node) {
return 0 /* None */;
}
@@ -14711,22 +14720,22 @@ function isAssignmentTarget(node) {
}
function isNodeWithPossibleHoistedDeclaration(node) {
switch (node.kind) {
- case 242 /* Block */:
- case 244 /* VariableStatement */:
- case 255 /* WithStatement */:
- case 246 /* IfStatement */:
- case 256 /* SwitchStatement */:
- case 272 /* CaseBlock */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 257 /* LabeledStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 259 /* TryStatement */:
- case 301 /* CatchClause */:
+ case 244 /* Block */:
+ case 246 /* VariableStatement */:
+ case 257 /* WithStatement */:
+ case 248 /* IfStatement */:
+ case 258 /* SwitchStatement */:
+ case 275 /* CaseBlock */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 259 /* LabeledStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 261 /* TryStatement */:
+ case 304 /* CatchClause */:
return true;
}
return false;
@@ -14741,14 +14750,14 @@ function walkUp(node, kind) {
return node;
}
function walkUpParenthesizedTypes(node) {
- return walkUp(node, 196 /* ParenthesizedType */);
+ return walkUp(node, 198 /* ParenthesizedType */);
}
function walkUpParenthesizedExpressions(node) {
- return walkUp(node, 217 /* ParenthesizedExpression */);
+ return walkUp(node, 219 /* ParenthesizedExpression */);
}
function walkUpParenthesizedTypesAndGetParentAndChild(node) {
let child;
- while (node && node.kind === 196 /* ParenthesizedType */) {
+ while (node && node.kind === 198 /* ParenthesizedType */) {
child = node;
node = node.parent;
}
@@ -14764,11 +14773,11 @@ function skipParentheses(node, excludeJSDocTypeAssertions) {
return skipOuterExpressions(node, flags);
}
function isDeleteTarget(node) {
- if (node.kind !== 211 /* PropertyAccessExpression */ && node.kind !== 212 /* ElementAccessExpression */) {
+ if (node.kind !== 213 /* PropertyAccessExpression */ && node.kind !== 214 /* ElementAccessExpression */) {
return false;
}
node = walkUpParenthesizedExpressions(node.parent);
- return node && node.kind === 221 /* DeleteExpression */;
+ return node && node.kind === 223 /* DeleteExpression */;
}
function isNodeDescendantOf(node, ancestor) {
while (node) {
@@ -14806,56 +14815,56 @@ function getDeclarationFromName(name) {
}
}
function isLiteralComputedPropertyDeclarationName(node) {
- return isStringOrNumericLiteralLike(node) && node.parent.kind === 166 /* ComputedPropertyName */ && isDeclaration(node.parent.parent);
+ return isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ && isDeclaration(node.parent.parent);
}
function isIdentifierName(node) {
const parent = node.parent;
switch (parent.kind) {
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 308 /* EnumMember */:
- case 305 /* PropertyAssignment */:
- case 211 /* PropertyAccessExpression */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 311 /* EnumMember */:
+ case 308 /* PropertyAssignment */:
+ case 213 /* PropertyAccessExpression */:
return parent.name === node;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return parent.right === node;
- case 208 /* BindingElement */:
- case 279 /* ImportSpecifier */:
+ case 210 /* BindingElement */:
+ case 282 /* ImportSpecifier */:
return parent.propertyName === node;
- case 284 /* ExportSpecifier */:
- case 294 /* JsxAttribute */:
- case 288 /* JsxSelfClosingElement */:
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
+ case 287 /* ExportSpecifier */:
+ case 297 /* JsxAttribute */:
+ case 291 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
return true;
}
return false;
}
function isAliasSymbolDeclaration(node) {
- if (node.kind === 274 /* ImportEqualsDeclaration */ || node.kind === 273 /* NamespaceExportDeclaration */ || node.kind === 276 /* ImportClause */ && !!node.name || node.kind === 277 /* NamespaceImport */ || node.kind === 283 /* NamespaceExport */ || node.kind === 279 /* ImportSpecifier */ || node.kind === 284 /* ExportSpecifier */ || node.kind === 280 /* ExportAssignment */ && exportAssignmentIsAlias(node)) {
+ if (node.kind === 277 /* ImportEqualsDeclaration */ || node.kind === 276 /* NamespaceExportDeclaration */ || node.kind === 279 /* ImportClause */ && !!node.name || node.kind === 280 /* NamespaceImport */ || node.kind === 286 /* NamespaceExport */ || node.kind === 282 /* ImportSpecifier */ || node.kind === 287 /* ExportSpecifier */ || node.kind === 283 /* ExportAssignment */ && exportAssignmentIsAlias(node)) {
return true;
}
return isInJSFile(node) && (isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isPropertyAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableExpression(node.parent.right));
}
function getAliasDeclarationFromName(node) {
switch (node.parent.kind) {
- case 276 /* ImportClause */:
- case 279 /* ImportSpecifier */:
- case 277 /* NamespaceImport */:
- case 284 /* ExportSpecifier */:
- case 280 /* ExportAssignment */:
- case 274 /* ImportEqualsDeclaration */:
- case 283 /* NamespaceExport */:
+ case 279 /* ImportClause */:
+ case 282 /* ImportSpecifier */:
+ case 280 /* NamespaceImport */:
+ case 287 /* ExportSpecifier */:
+ case 283 /* ExportAssignment */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 286 /* NamespaceExport */:
return node.parent;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
do {
node = node.parent;
- } while (node.parent.kind === 165 /* QualifiedName */);
+ } while (node.parent.kind === 166 /* QualifiedName */);
return getAliasDeclarationFromName(node);
}
}
@@ -14870,7 +14879,7 @@ function getExportAssignmentExpression(node) {
return isExportAssignment(node) ? node.expression : node.right;
}
function getPropertyAssignmentAliasLikeExpression(node) {
- return node.kind === 306 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 305 /* PropertyAssignment */ ? node.initializer : node.parent.right;
+ return node.kind === 309 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 308 /* PropertyAssignment */ ? node.initializer : node.parent.right;
}
function getEffectiveBaseTypeNode(node) {
const baseType = getClassExtendsHeritageElement(node);
@@ -14955,10 +14964,10 @@ function getVirtualEtsComponent(node) {
return void 0;
}
function isKeyword(token) {
- return 81 /* FirstKeyword */ <= token && token <= 164 /* LastKeyword */;
+ return 81 /* FirstKeyword */ <= token && token <= 165 /* LastKeyword */;
}
function isContextualKeyword(token) {
- return 127 /* FirstContextualKeyword */ <= token && token <= 164 /* LastContextualKeyword */;
+ return 127 /* FirstContextualKeyword */ <= token && token <= 165 /* LastContextualKeyword */;
}
function isNonContextualKeyword(token) {
return isKeyword(token) && !isContextualKeyword(token);
@@ -14994,13 +15003,13 @@ function getFunctionFlags(node) {
}
let flags = 0 /* Normal */;
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
if (node.asteriskToken) {
flags |= 1 /* Generator */;
}
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (hasSyntacticModifier(node, 512 /* Async */)) {
flags |= 2 /* Async */;
}
@@ -15013,10 +15022,10 @@ function getFunctionFlags(node) {
}
function isAsyncFunction(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 512 /* Async */);
}
return false;
@@ -15032,7 +15041,7 @@ function hasDynamicName(declaration) {
return !!name && isDynamicName(name);
}
function isDynamicName(name) {
- if (!(name.kind === 166 /* ComputedPropertyName */ || name.kind === 212 /* ElementAccessExpression */)) {
+ if (!(name.kind === 167 /* ComputedPropertyName */ || name.kind === 214 /* ElementAccessExpression */)) {
return false;
}
const expr = isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression;
@@ -15046,7 +15055,7 @@ function getPropertyNameForPropertyNameNode(name) {
case 10 /* StringLiteral */:
case 8 /* NumericLiteral */:
return escapeLeadingUnderscores(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
const nameExpression = name.expression;
if (isStringOrNumericLiteralLike(nameExpression)) {
return escapeLeadingUnderscores(nameExpression.text);
@@ -15098,17 +15107,17 @@ function isPushOrUnshiftIdentifier(node) {
}
function isParameterDeclaration(node) {
const root = getRootDeclaration(node);
- return root.kind === 168 /* Parameter */;
+ return root.kind === 169 /* Parameter */;
}
function getRootDeclaration(node) {
- while (node.kind === 208 /* BindingElement */) {
+ while (node.kind === 210 /* BindingElement */) {
node = node.parent.parent;
}
return node;
}
function nodeStartsNewLexicalEnvironment(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 218 /* FunctionExpression */ || kind === 263 /* FunctionDeclaration */ || kind === 219 /* ArrowFunction */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 270 /* ModuleDeclaration */ || kind === 314 /* SourceFile */;
+ return kind === 178 /* Constructor */ || kind === 220 /* FunctionExpression */ || kind === 265 /* FunctionDeclaration */ || kind === 221 /* ArrowFunction */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 273 /* ModuleDeclaration */ || kind === 317 /* SourceFile */;
}
function nodeIsSynthesized(range) {
return positionIsSynthesized(range.pos) || positionIsSynthesized(range.end);
@@ -15123,22 +15132,22 @@ var Associativity = /* @__PURE__ */ ((Associativity2) => {
})(Associativity || {});
function getExpressionAssociativity(expression) {
const operator = getOperator(expression);
- const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0;
+ const hasArguments = expression.kind === 216 /* NewExpression */ && expression.arguments !== void 0;
return getOperatorAssociativity(expression.kind, operator, hasArguments);
}
function getOperatorAssociativity(kind, operator, hasArguments) {
switch (kind) {
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return hasArguments ? 0 /* Left */ : 1 /* Right */;
- case 225 /* PrefixUnaryExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 221 /* DeleteExpression */:
- case 224 /* AwaitExpression */:
- case 228 /* ConditionalExpression */:
- case 230 /* YieldExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 223 /* DeleteExpression */:
+ case 226 /* AwaitExpression */:
+ case 230 /* ConditionalExpression */:
+ case 232 /* YieldExpression */:
return 1 /* Right */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (operator) {
case 42 /* AsteriskAsteriskToken */:
case 63 /* EqualsToken */:
@@ -15164,13 +15173,13 @@ function getOperatorAssociativity(kind, operator, hasArguments) {
}
function getExpressionPrecedence(expression) {
const operator = getOperator(expression);
- const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0;
+ const hasArguments = expression.kind === 216 /* NewExpression */ && expression.arguments !== void 0;
return getOperatorPrecedence(expression.kind, operator, hasArguments);
}
function getOperator(expression) {
- if (expression.kind === 227 /* BinaryExpression */) {
+ if (expression.kind === 229 /* BinaryExpression */) {
return expression.operatorToken.kind;
- } else if (expression.kind === 225 /* PrefixUnaryExpression */ || expression.kind === 226 /* PostfixUnaryExpression */) {
+ } else if (expression.kind === 227 /* PrefixUnaryExpression */ || expression.kind === 228 /* PostfixUnaryExpression */) {
return expression.operator;
} else {
return expression.kind;
@@ -15206,15 +15215,15 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => {
})(OperatorPrecedence || {});
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return 0 /* Comma */;
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return 1 /* Spread */;
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return 2 /* Yield */;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return 4 /* Conditional */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (operatorKind) {
case 27 /* CommaToken */:
return 0 /* Comma */;
@@ -15238,27 +15247,27 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
default:
return getBinaryOperatorPrecedence(operatorKind);
}
- case 216 /* TypeAssertionExpression */:
- case 236 /* NonNullExpression */:
- case 225 /* PrefixUnaryExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 221 /* DeleteExpression */:
- case 224 /* AwaitExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 238 /* NonNullExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 223 /* DeleteExpression */:
+ case 226 /* AwaitExpression */:
return 16 /* Unary */;
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return 17 /* Update */;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return 18 /* LeftHandSide */;
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */;
- case 215 /* TaggedTemplateExpression */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
- case 237 /* MetaProperty */:
+ case 217 /* TaggedTemplateExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 239 /* MetaProperty */:
return 19 /* Member */;
- case 235 /* AsExpression */:
- case 239 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 241 /* SatisfiesExpression */:
return 11 /* Relational */;
case 109 /* ThisKeyword */:
case 107 /* SuperKeyword */:
@@ -15270,19 +15279,19 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
case 8 /* NumericLiteral */:
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 232 /* ClassExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
case 13 /* RegularExpressionLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
- case 217 /* ParenthesizedExpression */:
- case 233 /* OmittedExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
+ case 231 /* TemplateExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 235 /* OmittedExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
return 20 /* Primary */;
default:
return -1 /* Invalid */;
@@ -15335,7 +15344,7 @@ function getBinaryOperatorPrecedence(kind) {
function getSemanticJsxChildren(children) {
return filter(children, (i) => {
switch (i.kind) {
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return !!i.expression;
case 11 /* JsxText */:
return !i.containsOnlyTriviaWhiteSpaces;
@@ -15726,7 +15735,7 @@ function isThisInTypeQuery(node) {
while (isQualifiedName(node.parent) && node.parent.left === node) {
node = node.parent;
}
- return node.parent.kind === 186 /* TypeQuery */;
+ return node.parent.kind === 188 /* TypeQuery */;
}
function identifierIsThisKeyword(id) {
return id.originalKeywordKind === 109 /* ThisKeyword */;
@@ -15738,9 +15747,9 @@ function getAllAccessorDeclarations(declarations, accessor) {
let setAccessor;
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
- if (accessor.kind === 177 /* GetAccessor */) {
+ if (accessor.kind === 179 /* GetAccessor */) {
getAccessor = accessor;
- } else if (accessor.kind === 178 /* SetAccessor */) {
+ } else if (accessor.kind === 180 /* SetAccessor */) {
setAccessor = accessor;
} else {
Debug.fail("Accessor has wrong kind");
@@ -15756,10 +15765,10 @@ function getAllAccessorDeclarations(declarations, accessor) {
} else if (!secondAccessor) {
secondAccessor = member;
}
- if (member.kind === 177 /* GetAccessor */ && !getAccessor) {
+ if (member.kind === 179 /* GetAccessor */ && !getAccessor) {
getAccessor = member;
}
- if (member.kind === 178 /* SetAccessor */ && !setAccessor) {
+ if (member.kind === 180 /* SetAccessor */ && !setAccessor) {
setAccessor = member;
}
}
@@ -15791,7 +15800,7 @@ function getJSDocTypeParameterDeclarations(node) {
return flatMap(getJSDocTags(node), (tag) => isNonTypeAliasTemplate(tag) ? tag.typeParameters : void 0);
}
function isNonTypeAliasTemplate(tag) {
- return isJSDocTemplateTag(tag) && !(tag.parent.kind === 329 /* JSDoc */ && tag.parent.tags.some(isJSDocTypeAlias));
+ return isJSDocTemplateTag(tag) && !(tag.parent.kind === 332 /* JSDoc */ && tag.parent.tags.some(isJSDocTypeAlias));
}
function getEffectiveSetAccessorTypeAnnotationNode(node) {
const parameter = getSetAccessorValueParameter(node);
@@ -15976,7 +15985,7 @@ function getSelectedSyntacticModifierFlags(node, flags) {
return getSyntacticModifierFlags(node) & flags;
}
function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) {
- if (node.kind >= 0 /* FirstToken */ && node.kind <= 164 /* LastToken */) {
+ if (node.kind >= 0 /* FirstToken */ && node.kind <= 165 /* LastToken */) {
return 0 /* None */;
}
if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) {
@@ -16067,7 +16076,7 @@ function modifierToFlag(token) {
return 32768 /* In */;
case 146 /* OutKeyword */:
return 65536 /* Out */;
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return 131072 /* Decorator */;
}
return 0 /* None */;
@@ -16100,7 +16109,7 @@ function isLeftHandSideOfAssignment(node) {
function isDestructuringAssignment(node) {
if (isAssignmentExpression(node, true)) {
const kind = node.left.kind;
- return kind === 210 /* ObjectLiteralExpression */ || kind === 209 /* ArrayLiteralExpression */;
+ return kind === 212 /* ObjectLiteralExpression */ || kind === 211 /* ArrayLiteralExpression */;
}
return false;
}
@@ -16114,12 +16123,12 @@ function getFirstIdentifier(node) {
switch (node.kind) {
case 79 /* Identifier */:
return node;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
do {
node = node.left;
} while (node.kind !== 79 /* Identifier */);
return node;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
do {
node = node.expression;
} while (node.kind !== 79 /* Identifier */);
@@ -16127,7 +16136,7 @@ function getFirstIdentifier(node) {
}
}
function isDottedName(node) {
- return node.kind === 79 /* Identifier */ || node.kind === 109 /* ThisKeyword */ || node.kind === 107 /* SuperKeyword */ || node.kind === 237 /* MetaProperty */ || node.kind === 211 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 217 /* ParenthesizedExpression */ && isDottedName(node.expression);
+ return node.kind === 79 /* Identifier */ || node.kind === 109 /* ThisKeyword */ || node.kind === 107 /* SuperKeyword */ || node.kind === 239 /* MetaProperty */ || node.kind === 213 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 219 /* ParenthesizedExpression */ && isDottedName(node.expression);
}
function isPropertyAccessEntityNameExpression(node) {
return isPropertyAccessExpression(node) && isIdentifier(node.name) && isEntityNameExpression(node.expression);
@@ -16152,7 +16161,7 @@ function isPrototypeAccess(node) {
return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype";
}
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
- return node.parent.kind === 165 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node;
+ return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 213 /* PropertyAccessExpression */ && node.parent.name === node;
}
function isRightSideOfAccessExpression(node) {
return isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node;
@@ -16161,10 +16170,10 @@ function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) {
return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node || isJSDocMemberName(node.parent) && node.parent.right === node;
}
function isEmptyObjectLiteral(expression) {
- return expression.kind === 210 /* ObjectLiteralExpression */ && expression.properties.length === 0;
+ return expression.kind === 212 /* ObjectLiteralExpression */ && expression.properties.length === 0;
}
function isEmptyArrayLiteral(expression) {
- return expression.kind === 209 /* ArrayLiteralExpression */ && expression.elements.length === 0;
+ return expression.kind === 211 /* ArrayLiteralExpression */ && expression.elements.length === 0;
}
function getLocalSymbolForExportDefault(symbol) {
if (!isExportDefaultSymbol(symbol) || !symbol.declarations)
@@ -16392,8 +16401,8 @@ function isDeclarationNameOfEnumOrNamespace(node) {
const parseNode = getParseTreeNode(node);
if (parseNode) {
switch (parseNode.parent.kind) {
- case 269 /* EnumDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
return parseNode === parseNode.parent.name;
}
}
@@ -16454,30 +16463,30 @@ function accessKind(node) {
if (!parent)
return 0 /* Read */;
switch (parent.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return accessKind(parent);
- case 226 /* PostfixUnaryExpression */:
- case 225 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const { operator } = parent;
return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const { left, operatorToken } = parent;
return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 63 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return parent.name !== node ? 0 /* Read */ : accessKind(parent);
- case 305 /* PropertyAssignment */: {
+ case 308 /* PropertyAssignment */: {
const parentAccess = accessKind(parent.parent);
return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess;
}
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return accessKind(parent);
default:
return 0 /* Read */;
}
function writeOrReadWrite() {
- return parent.parent && walkUpParenthesizedExpressions(parent.parent).kind === 245 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
+ return parent.parent && walkUpParenthesizedExpressions(parent.parent).kind === 247 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
}
}
function reverseAccessKind(a) {
@@ -16590,16 +16599,16 @@ function isObjectTypeDeclaration(node) {
return isClassLike(node) || isInterfaceDeclaration(node) || isTypeLiteralNode(node);
}
function isTypeNodeKind(kind) {
- return kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */ || kind === 132 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 149 /* NumberKeyword */ || kind === 162 /* BigIntKeyword */ || kind === 150 /* ObjectKeyword */ || kind === 135 /* BooleanKeyword */ || kind === 153 /* StringKeyword */ || kind === 154 /* SymbolKeyword */ || kind === 115 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 145 /* NeverKeyword */ || kind === 234 /* ExpressionWithTypeArguments */ || kind === 321 /* JSDocAllType */ || kind === 322 /* JSDocUnknownType */ || kind === 323 /* JSDocNullableType */ || kind === 324 /* JSDocNonNullableType */ || kind === 325 /* JSDocOptionalType */ || kind === 326 /* JSDocFunctionType */ || kind === 327 /* JSDocVariadicType */;
+ return kind >= 184 /* FirstTypeNode */ && kind <= 207 /* LastTypeNode */ || kind === 132 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 149 /* NumberKeyword */ || kind === 162 /* BigIntKeyword */ || kind === 150 /* ObjectKeyword */ || kind === 135 /* BooleanKeyword */ || kind === 153 /* StringKeyword */ || kind === 154 /* SymbolKeyword */ || kind === 115 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 145 /* NeverKeyword */ || kind === 236 /* ExpressionWithTypeArguments */ || kind === 324 /* JSDocAllType */ || kind === 325 /* JSDocUnknownType */ || kind === 326 /* JSDocNullableType */ || kind === 327 /* JSDocNonNullableType */ || kind === 328 /* JSDocOptionalType */ || kind === 329 /* JSDocFunctionType */ || kind === 330 /* JSDocVariadicType */;
}
function isAccessExpression(node) {
- return node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */;
+ return node.kind === 213 /* PropertyAccessExpression */ || node.kind === 214 /* ElementAccessExpression */;
}
function getNameOfAccessExpression(node) {
- if (node.kind === 211 /* PropertyAccessExpression */) {
+ if (node.kind === 213 /* PropertyAccessExpression */) {
return node.name;
}
- Debug.assert(node.kind === 212 /* ElementAccessExpression */);
+ Debug.assert(node.kind === 214 /* ElementAccessExpression */);
return node.argumentExpression;
}
function isBundleFileTextLike(section) {
@@ -16612,7 +16621,7 @@ function isBundleFileTextLike(section) {
}
}
function isNamedImportsOrExports(node) {
- return node.kind === 278 /* NamedImports */ || node.kind === 282 /* NamedExports */;
+ return node.kind === 281 /* NamedImports */ || node.kind === 285 /* NamedExports */;
}
function getLeftmostAccessExpression(expr) {
while (isAccessExpression(expr)) {
@@ -16625,12 +16634,12 @@ function forEachNameInAccessChainWalkingLeft(name, action) {
return walkAccessExpression(name.parent);
}
function walkAccessExpression(access) {
- if (access.kind === 211 /* PropertyAccessExpression */) {
+ if (access.kind === 213 /* PropertyAccessExpression */) {
const res = action(access.name);
if (res !== void 0) {
return res;
}
- } else if (access.kind === 212 /* ElementAccessExpression */) {
+ } else if (access.kind === 214 /* ElementAccessExpression */) {
if (isIdentifier(access.argumentExpression) || isStringLiteralLike(access.argumentExpression)) {
const res = action(access.argumentExpression);
if (res !== void 0) {
@@ -16652,28 +16661,28 @@ function forEachNameInAccessChainWalkingLeft(name, action) {
function getLeftmostExpression(node, stopAtCallExpressions) {
while (true) {
switch (node.kind) {
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
node = node.operand;
continue;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
node = node.left;
continue;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
node = node.condition;
continue;
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
node = node.tag;
continue;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (stopAtCallExpressions) {
return node;
}
- case 235 /* AsExpression */:
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
- case 236 /* NonNullExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 239 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 238 /* NonNullExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 241 /* SatisfiesExpression */:
node = node.expression;
continue;
}
@@ -17637,33 +17646,33 @@ function isShorthandPropertyNameUseSite(useSite) {
return isIdentifier(useSite) && isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite;
}
function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) {
- while (node.kind === 79 /* Identifier */ || node.kind === 211 /* PropertyAccessExpression */) {
+ while (node.kind === 79 /* Identifier */ || node.kind === 213 /* PropertyAccessExpression */) {
node = node.parent;
}
- if (node.kind !== 166 /* ComputedPropertyName */) {
+ if (node.kind !== 167 /* ComputedPropertyName */) {
return false;
}
if (hasSyntacticModifier(node.parent, 256 /* Abstract */)) {
return true;
}
const containerKind = node.parent.parent.kind;
- return containerKind === 267 /* InterfaceDeclaration */ || containerKind === 187 /* TypeLiteral */;
+ return containerKind === 270 /* InterfaceDeclaration */ || containerKind === 189 /* TypeLiteral */;
}
function isIdentifierInNonEmittingHeritageClause(node) {
if (node.kind !== 79 /* Identifier */)
return false;
const heritageClause = findAncestor(node.parent, (parent) => {
switch (parent.kind) {
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return true;
- case 211 /* PropertyAccessExpression */:
- case 234 /* ExpressionWithTypeArguments */:
+ case 213 /* PropertyAccessExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
return false;
default:
return "quit";
}
});
- return (heritageClause == null ? void 0 : heritageClause.token) === 118 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 267 /* InterfaceDeclaration */;
+ return (heritageClause == null ? void 0 : heritageClause.token) === 118 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 270 /* InterfaceDeclaration */;
}
function isIdentifierTypeReference(node) {
return isTypeReferenceNode(node) && isIdentifier(node.typeName);
@@ -17752,20 +17761,20 @@ function getContainingNodeArray(node) {
if (!node.parent)
return void 0;
switch (node.kind) {
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
const { parent: parent2 } = node;
- return parent2.kind === 195 /* InferType */ ? void 0 : parent2.typeParameters;
- case 168 /* Parameter */:
+ return parent2.kind === 197 /* InferType */ ? void 0 : parent2.typeParameters;
+ case 169 /* Parameter */:
return node.parent.parameters;
- case 204 /* TemplateLiteralTypeSpan */:
+ case 206 /* TemplateLiteralTypeSpan */:
return node.parent.templateSpans;
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return node.parent.templateSpans;
- case 169 /* Decorator */: {
+ case 170 /* Decorator */: {
const { parent: parent3 } = node;
return canHaveDecorators(parent3) ? parent3.modifiers : canHaveIllegalDecorators(parent3) ? parent3.illegalDecorators : void 0;
}
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return node.parent.heritageClauses;
}
const { parent } = node;
@@ -17773,43 +17782,43 @@ function getContainingNodeArray(node) {
return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags;
}
switch (parent.kind) {
- case 187 /* TypeLiteral */:
- case 267 /* InterfaceDeclaration */:
+ case 189 /* TypeLiteral */:
+ case 270 /* InterfaceDeclaration */:
return isTypeElement(node) ? parent.members : void 0;
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return parent.types;
- case 189 /* TupleType */:
- case 209 /* ArrayLiteralExpression */:
- case 360 /* CommaListExpression */:
- case 278 /* NamedImports */:
- case 282 /* NamedExports */:
+ case 191 /* TupleType */:
+ case 211 /* ArrayLiteralExpression */:
+ case 363 /* CommaListExpression */:
+ case 281 /* NamedImports */:
+ case 285 /* NamedExports */:
return parent.elements;
- case 210 /* ObjectLiteralExpression */:
- case 295 /* JsxAttributes */:
+ case 212 /* ObjectLiteralExpression */:
+ case 298 /* JsxAttributes */:
return parent.properties;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
return isTypeNode(node) ? parent.typeArguments : parent.expression === node ? void 0 : parent.arguments;
- case 287 /* JsxElement */:
- case 291 /* JsxFragment */:
+ case 290 /* JsxElement */:
+ case 294 /* JsxFragment */:
return isJsxChild(node) ? parent.children : void 0;
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return isTypeNode(node) ? parent.typeArguments : void 0;
- case 242 /* Block */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 274 /* ModuleBlock */:
return parent.statements;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return parent.clauses;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return isClassElement(node) ? parent.members : void 0;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return isEnumMember(node) ? parent.members : void 0;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return parent.statements;
}
}
@@ -17818,7 +17827,7 @@ function hasContextSensitiveParameters(node) {
if (some(node.parameters, (p) => !getEffectiveTypeAnnotationNode(p))) {
return true;
}
- if (node.kind !== 219 /* ArrowFunction */) {
+ if (node.kind !== 221 /* ArrowFunction */) {
const parameter = firstOrUndefined(node.parameters);
if (!(parameter && parameterIsThisKeyword(parameter))) {
return true;
@@ -17831,14 +17840,14 @@ function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "-Infinity" || name === "NaN";
}
function isCatchClauseVariableDeclaration(node) {
- return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 301 /* CatchClause */;
+ return node.kind === 263 /* VariableDeclaration */ && node.parent.kind === 304 /* CatchClause */;
}
function isParameterOrCatchClauseVariable(symbol) {
const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
return !!declaration && (isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
}
function isFunctionExpressionOrArrowFunction(node) {
- return node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */;
+ return node.kind === 220 /* FunctionExpression */ || node.kind === 221 /* ArrowFunction */;
}
function escapeSnippetText(text) {
return text.replace(/\$/gm, () => "\\$");
@@ -17901,23 +17910,23 @@ function getNodeModulePathParts(fullPath, modulePathPart) {
}
function getParameterTypeNode(parameter) {
var _a2;
- return parameter.kind === 349 /* JSDocParameterTag */ ? (_a2 = parameter.typeExpression) == null ? void 0 : _a2.type : parameter.type;
+ return parameter.kind === 352 /* JSDocParameterTag */ ? (_a2 = parameter.typeExpression) == null ? void 0 : _a2.type : parameter.type;
}
function isTypeDeclaration(node) {
switch (node.kind) {
- case 167 /* TypeParameter */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 168 /* TypeParameter */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return true;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return node.isTypeOnly;
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return node.parent.parent.isTypeOnly;
default:
return false;
@@ -17930,7 +17939,7 @@ function isCalledStructDeclaration(declarations) {
if (!declarations) {
return false;
}
- return declarations.some((declaration) => declaration.kind === 265 /* StructDeclaration */);
+ return declarations.some((declaration) => declaration.kind === 267 /* StructDeclaration */);
}
function getNameOfDecorator(node) {
const expression = node.expression;
@@ -18162,16 +18171,16 @@ function createParenthesizerRules(factory2) {
return parenthesizerRule;
}
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
- const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator);
- const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator);
+ const binaryOperatorPrecedence = getOperatorPrecedence(229 /* BinaryExpression */, binaryOperator);
+ const binaryOperatorAssociativity = getOperatorAssociativity(229 /* BinaryExpression */, binaryOperator);
const emittedOperand = skipPartiallyEmittedExpressions(operand);
- if (!isLeftSideOfBinary && operand.kind === 219 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
+ if (!isLeftSideOfBinary && operand.kind === 221 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
return true;
}
const operandPrecedence = getExpressionPrecedence(emittedOperand);
switch (compareValues(operandPrecedence, binaryOperatorPrecedence)) {
case -1 /* LessThan */:
- if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 230 /* YieldExpression */) {
+ if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 232 /* YieldExpression */) {
return false;
}
return true;
@@ -18205,7 +18214,7 @@ function createParenthesizerRules(factory2) {
if (isLiteralKind(node.kind)) {
return node.kind;
}
- if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {
+ if (node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {
if (node.cachedLiteralKind !== void 0) {
return node.cachedLiteralKind;
}
@@ -18218,7 +18227,7 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
const skipped = skipPartiallyEmittedExpressions(operand);
- if (skipped.kind === 217 /* ParenthesizedExpression */) {
+ if (skipped.kind === 219 /* ParenthesizedExpression */) {
return operand;
}
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory2.createParenthesizedExpression(operand) : operand;
@@ -18233,7 +18242,7 @@ function createParenthesizerRules(factory2) {
return isCommaSequence(expression) ? factory2.createParenthesizedExpression(expression) : expression;
}
function parenthesizeConditionOfConditionalExpression(condition) {
- const conditionalPrecedence = getOperatorPrecedence(228 /* ConditionalExpression */, 57 /* QuestionToken */);
+ const conditionalPrecedence = getOperatorPrecedence(230 /* ConditionalExpression */, 57 /* QuestionToken */);
const emittedCondition = skipPartiallyEmittedExpressions(condition);
const conditionPrecedence = getExpressionPrecedence(emittedCondition);
if (compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) {
@@ -18250,8 +18259,8 @@ function createParenthesizerRules(factory2) {
let needsParens = isCommaSequence(check);
if (!needsParens) {
switch (getLeftmostExpression(check, false).kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
needsParens = true;
}
}
@@ -18260,16 +18269,16 @@ function createParenthesizerRules(factory2) {
function parenthesizeExpressionOfNew(expression) {
const leftmostExpr = getLeftmostExpression(expression, true);
switch (leftmostExpr.kind) {
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return factory2.createParenthesizedExpression(expression);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return !leftmostExpr.arguments ? factory2.createParenthesizedExpression(expression) : expression;
}
return parenthesizeLeftSideOfAccess(expression);
}
function parenthesizeLeftSideOfAccess(expression, optionalChain) {
const emittedExpression = skipPartiallyEmittedExpressions(expression);
- if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 214 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) {
+ if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 216 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) {
return expression;
}
return setTextRange(factory2.createParenthesizedExpression(expression), expression);
@@ -18287,7 +18296,7 @@ function createParenthesizerRules(factory2) {
function parenthesizeExpressionForDisallowedComma(expression) {
const emittedExpression = skipPartiallyEmittedExpressions(expression);
const expressionPrecedence = getExpressionPrecedence(emittedExpression);
- const commaPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, 27 /* CommaToken */);
+ const commaPrecedence = getOperatorPrecedence(229 /* BinaryExpression */, 27 /* CommaToken */);
return expressionPrecedence > commaPrecedence ? expression : setTextRange(factory2.createParenthesizedExpression(expression), expression);
}
function parenthesizeExpressionOfExpressionStatement(expression) {
@@ -18295,7 +18304,7 @@ function createParenthesizerRules(factory2) {
if (isCallExpression(emittedExpression)) {
const callee = emittedExpression.expression;
const kind = skipPartiallyEmittedExpressions(callee).kind;
- if (kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */) {
+ if (kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */) {
const updated = factory2.updateCallExpression(
emittedExpression,
setTextRange(factory2.createParenthesizedExpression(callee), callee),
@@ -18306,37 +18315,37 @@ function createParenthesizerRules(factory2) {
}
}
const leftmostExpressionKind = getLeftmostExpression(emittedExpression, false).kind;
- if (leftmostExpressionKind === 210 /* ObjectLiteralExpression */ || leftmostExpressionKind === 218 /* FunctionExpression */) {
+ if (leftmostExpressionKind === 212 /* ObjectLiteralExpression */ || leftmostExpressionKind === 220 /* FunctionExpression */) {
return setTextRange(factory2.createParenthesizedExpression(expression), expression);
}
return expression;
}
function parenthesizeConciseBodyOfArrowFunction(body) {
- if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 210 /* ObjectLiteralExpression */)) {
+ if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 212 /* ObjectLiteralExpression */)) {
return setTextRange(factory2.createParenthesizedExpression(body), body);
}
return body;
}
function parenthesizeCheckTypeOfConditionalType(checkType) {
switch (checkType.kind) {
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 194 /* ConditionalType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 196 /* ConditionalType */:
return factory2.createParenthesizedType(checkType);
}
return checkType;
}
function parenthesizeExtendsTypeOfConditionalType(extendsType) {
switch (extendsType.kind) {
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return factory2.createParenthesizedType(extendsType);
}
return extendsType;
}
function parenthesizeConstituentTypeOfUnionType(type) {
switch (type.kind) {
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeCheckTypeOfConditionalType(type);
@@ -18346,8 +18355,8 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeConstituentTypeOfIntersectionType(type) {
switch (type.kind) {
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeConstituentTypeOfUnionType(type);
@@ -18357,23 +18366,23 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeOperandOfTypeOperator(type) {
switch (type.kind) {
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeConstituentTypeOfIntersectionType(type);
}
function parenthesizeOperandOfReadonlyTypeOperator(type) {
switch (type.kind) {
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return factory2.createParenthesizedType(type);
}
return parenthesizeOperandOfTypeOperator(type);
}
function parenthesizeNonArrayTypeOfPostfixType(type) {
switch (type.kind) {
- case 195 /* InferType */:
- case 198 /* TypeOperator */:
- case 186 /* TypeQuery */:
+ case 197 /* InferType */:
+ case 200 /* TypeOperator */:
+ case 188 /* TypeQuery */:
return factory2.createParenthesizedType(type);
}
return parenthesizeOperandOfTypeOperator(type);
@@ -18527,11 +18536,11 @@ function createNodeConverters(factory2) {
}
function convertToAssignmentPattern(node) {
switch (node.kind) {
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return convertToArrayAssignmentPattern(node);
- case 206 /* ObjectBindingPattern */:
- case 210 /* ObjectLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 212 /* ObjectLiteralExpression */:
return convertToObjectAssignmentPattern(node);
}
}
@@ -18656,6 +18665,8 @@ function createNodeFactory(flags, baseFactory2) {
updatePropertyDeclaration,
createAnnotationPropertyDeclaration,
updateAnnotationPropertyDeclaration,
+ createOverloadPropertyDeclaration,
+ updateOverloadPropertyDeclaration,
createMethodSignature,
updateMethodSignature,
createMethodDeclaration,
@@ -18851,6 +18862,8 @@ function createNodeFactory(flags, baseFactory2) {
updateStructDeclaration,
createAnnotationDeclaration,
updateAnnotationDeclaration,
+ createOverloadDeclaration,
+ updateOverloadDeclaration,
createInterfaceDeclaration,
updateInterfaceDeclaration,
createTypeAliasDeclaration,
@@ -18897,40 +18910,40 @@ function createNodeFactory(flags, baseFactory2) {
createExternalModuleReference,
updateExternalModuleReference,
get createJSDocAllType() {
- return getJSDocPrimaryTypeCreateFunction(321 /* JSDocAllType */);
+ return getJSDocPrimaryTypeCreateFunction(324 /* JSDocAllType */);
},
get createJSDocUnknownType() {
- return getJSDocPrimaryTypeCreateFunction(322 /* JSDocUnknownType */);
+ return getJSDocPrimaryTypeCreateFunction(325 /* JSDocUnknownType */);
},
get createJSDocNonNullableType() {
- return getJSDocPrePostfixUnaryTypeCreateFunction(324 /* JSDocNonNullableType */);
+ return getJSDocPrePostfixUnaryTypeCreateFunction(327 /* JSDocNonNullableType */);
},
get updateJSDocNonNullableType() {
- return getJSDocPrePostfixUnaryTypeUpdateFunction(324 /* JSDocNonNullableType */);
+ return getJSDocPrePostfixUnaryTypeUpdateFunction(327 /* JSDocNonNullableType */);
},
get createJSDocNullableType() {
- return getJSDocPrePostfixUnaryTypeCreateFunction(323 /* JSDocNullableType */);
+ return getJSDocPrePostfixUnaryTypeCreateFunction(326 /* JSDocNullableType */);
},
get updateJSDocNullableType() {
- return getJSDocPrePostfixUnaryTypeUpdateFunction(323 /* JSDocNullableType */);
+ return getJSDocPrePostfixUnaryTypeUpdateFunction(326 /* JSDocNullableType */);
},
get createJSDocOptionalType() {
- return getJSDocUnaryTypeCreateFunction(325 /* JSDocOptionalType */);
+ return getJSDocUnaryTypeCreateFunction(328 /* JSDocOptionalType */);
},
get updateJSDocOptionalType() {
- return getJSDocUnaryTypeUpdateFunction(325 /* JSDocOptionalType */);
+ return getJSDocUnaryTypeUpdateFunction(328 /* JSDocOptionalType */);
},
get createJSDocVariadicType() {
- return getJSDocUnaryTypeCreateFunction(327 /* JSDocVariadicType */);
+ return getJSDocUnaryTypeCreateFunction(330 /* JSDocVariadicType */);
},
get updateJSDocVariadicType() {
- return getJSDocUnaryTypeUpdateFunction(327 /* JSDocVariadicType */);
+ return getJSDocUnaryTypeUpdateFunction(330 /* JSDocVariadicType */);
},
get createJSDocNamepathType() {
- return getJSDocUnaryTypeCreateFunction(328 /* JSDocNamepathType */);
+ return getJSDocUnaryTypeCreateFunction(331 /* JSDocNamepathType */);
},
get updateJSDocNamepathType() {
- return getJSDocUnaryTypeUpdateFunction(328 /* JSDocNamepathType */);
+ return getJSDocUnaryTypeUpdateFunction(331 /* JSDocNamepathType */);
},
createJSDocFunctionType,
updateJSDocFunctionType,
@@ -18967,76 +18980,76 @@ function createNodeFactory(flags, baseFactory2) {
createJSDocLinkPlain,
updateJSDocLinkPlain,
get createJSDocTypeTag() {
- return getJSDocTypeLikeTagCreateFunction(352 /* JSDocTypeTag */);
+ return getJSDocTypeLikeTagCreateFunction(355 /* JSDocTypeTag */);
},
get updateJSDocTypeTag() {
- return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocTypeTag */);
+ return getJSDocTypeLikeTagUpdateFunction(355 /* JSDocTypeTag */);
},
get createJSDocReturnTag() {
- return getJSDocTypeLikeTagCreateFunction(350 /* JSDocReturnTag */);
+ return getJSDocTypeLikeTagCreateFunction(353 /* JSDocReturnTag */);
},
get updateJSDocReturnTag() {
- return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocReturnTag */);
+ return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocReturnTag */);
},
get createJSDocThisTag() {
- return getJSDocTypeLikeTagCreateFunction(351 /* JSDocThisTag */);
+ return getJSDocTypeLikeTagCreateFunction(354 /* JSDocThisTag */);
},
get updateJSDocThisTag() {
- return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocThisTag */);
+ return getJSDocTypeLikeTagUpdateFunction(354 /* JSDocThisTag */);
},
get createJSDocEnumTag() {
- return getJSDocTypeLikeTagCreateFunction(348 /* JSDocEnumTag */);
+ return getJSDocTypeLikeTagCreateFunction(351 /* JSDocEnumTag */);
},
get updateJSDocEnumTag() {
- return getJSDocTypeLikeTagUpdateFunction(348 /* JSDocEnumTag */);
+ return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocEnumTag */);
},
get createJSDocAuthorTag() {
- return getJSDocSimpleTagCreateFunction(339 /* JSDocAuthorTag */);
+ return getJSDocSimpleTagCreateFunction(342 /* JSDocAuthorTag */);
},
get updateJSDocAuthorTag() {
- return getJSDocSimpleTagUpdateFunction(339 /* JSDocAuthorTag */);
+ return getJSDocSimpleTagUpdateFunction(342 /* JSDocAuthorTag */);
},
get createJSDocClassTag() {
- return getJSDocSimpleTagCreateFunction(341 /* JSDocClassTag */);
+ return getJSDocSimpleTagCreateFunction(344 /* JSDocClassTag */);
},
get updateJSDocClassTag() {
- return getJSDocSimpleTagUpdateFunction(341 /* JSDocClassTag */);
+ return getJSDocSimpleTagUpdateFunction(344 /* JSDocClassTag */);
},
get createJSDocPublicTag() {
- return getJSDocSimpleTagCreateFunction(342 /* JSDocPublicTag */);
+ return getJSDocSimpleTagCreateFunction(345 /* JSDocPublicTag */);
},
get updateJSDocPublicTag() {
- return getJSDocSimpleTagUpdateFunction(342 /* JSDocPublicTag */);
+ return getJSDocSimpleTagUpdateFunction(345 /* JSDocPublicTag */);
},
get createJSDocPrivateTag() {
- return getJSDocSimpleTagCreateFunction(343 /* JSDocPrivateTag */);
+ return getJSDocSimpleTagCreateFunction(346 /* JSDocPrivateTag */);
},
get updateJSDocPrivateTag() {
- return getJSDocSimpleTagUpdateFunction(343 /* JSDocPrivateTag */);
+ return getJSDocSimpleTagUpdateFunction(346 /* JSDocPrivateTag */);
},
get createJSDocProtectedTag() {
- return getJSDocSimpleTagCreateFunction(344 /* JSDocProtectedTag */);
+ return getJSDocSimpleTagCreateFunction(347 /* JSDocProtectedTag */);
},
get updateJSDocProtectedTag() {
- return getJSDocSimpleTagUpdateFunction(344 /* JSDocProtectedTag */);
+ return getJSDocSimpleTagUpdateFunction(347 /* JSDocProtectedTag */);
},
get createJSDocReadonlyTag() {
- return getJSDocSimpleTagCreateFunction(345 /* JSDocReadonlyTag */);
+ return getJSDocSimpleTagCreateFunction(348 /* JSDocReadonlyTag */);
},
get updateJSDocReadonlyTag() {
- return getJSDocSimpleTagUpdateFunction(345 /* JSDocReadonlyTag */);
+ return getJSDocSimpleTagUpdateFunction(348 /* JSDocReadonlyTag */);
},
get createJSDocOverrideTag() {
- return getJSDocSimpleTagCreateFunction(346 /* JSDocOverrideTag */);
+ return getJSDocSimpleTagCreateFunction(349 /* JSDocOverrideTag */);
},
get updateJSDocOverrideTag() {
- return getJSDocSimpleTagUpdateFunction(346 /* JSDocOverrideTag */);
+ return getJSDocSimpleTagUpdateFunction(349 /* JSDocOverrideTag */);
},
get createJSDocDeprecatedTag() {
- return getJSDocSimpleTagCreateFunction(340 /* JSDocDeprecatedTag */);
+ return getJSDocSimpleTagCreateFunction(343 /* JSDocDeprecatedTag */);
},
get updateJSDocDeprecatedTag() {
- return getJSDocSimpleTagUpdateFunction(340 /* JSDocDeprecatedTag */);
+ return getJSDocSimpleTagUpdateFunction(343 /* JSDocDeprecatedTag */);
},
createJSDocUnknownTag,
updateJSDocUnknownTag,
@@ -19287,12 +19300,13 @@ function createNodeFactory(flags, baseFactory2) {
}
if (name) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 305 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 308 /* PropertyAssignment */:
if (isIdentifier(name)) {
node.transformFlags |= propagateIdentifierNameFlags(name);
break;
@@ -19559,7 +19573,7 @@ function createNodeFactory(flags, baseFactory2) {
return baseFactory2.createBaseTokenNode(kind);
}
function createToken(token) {
- Debug.assert(token >= 0 /* FirstToken */ && token <= 164 /* LastToken */, "Invalid token");
+ Debug.assert(token >= 0 /* FirstToken */ && token <= 165 /* LastToken */, "Invalid token");
Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals.");
Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals.");
Debug.assert(token !== 79 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers");
@@ -19663,7 +19677,7 @@ function createNodeFactory(flags, baseFactory2) {
return result.length ? result : void 0;
}
function createQualifiedName(left, right) {
- const node = createBaseNode(165 /* QualifiedName */);
+ const node = createBaseNode(166 /* QualifiedName */);
node.left = left;
node.right = asName(right);
node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right);
@@ -19673,7 +19687,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.right !== right ? update(createQualifiedName(left, right), node) : node;
}
function createComputedPropertyName(expression) {
- const node = createBaseNode(166 /* ComputedPropertyName */);
+ const node = createBaseNode(167 /* ComputedPropertyName */);
node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */;
return node;
@@ -19683,7 +19697,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) {
const node = createBaseNamedDeclaration(
- 167 /* TypeParameter */,
+ 168 /* TypeParameter */,
modifiers,
name
);
@@ -19697,7 +19711,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 168 /* Parameter */,
+ 169 /* Parameter */,
modifiers,
name,
type,
@@ -19722,7 +19736,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? update(createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer), node) : node;
}
function createDecorator(expression, annotationDeclaration) {
- const node = createBaseNode(169 /* Decorator */);
+ const node = createBaseNode(170 /* Decorator */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.annotationDeclaration = annotationDeclaration;
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */ | 8192 /* ContainsTypeScriptClassSyntax */ | 33554432 /* ContainsDecorators */;
@@ -19733,7 +19747,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertySignature(modifiers, name, questionToken, type) {
const node = createBaseNamedDeclaration(
- 170 /* PropertySignature */,
+ 171 /* PropertySignature */,
modifiers,
name
);
@@ -19746,6 +19760,21 @@ function createNodeFactory(flags, baseFactory2) {
function updatePropertySignature(node, modifiers, name, questionToken, type) {
return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature(modifiers, name, questionToken, type), node) : node;
}
+ function createOverloadPropertyDeclaration(modifiers, name, questionToken, type) {
+ const node = createBaseNamedDeclaration(
+ 174 /* OverloadPropertyDeclaration */,
+ modifiers,
+ name
+ );
+ node.type = type;
+ node.questionToken = questionToken;
+ node.transformFlags = 1 /* ContainsTypeScript */;
+ node.initializer = void 0;
+ return node;
+ }
+ function updateOverloadPropertyDeclaration(node, modifiers, name, questionToken, type) {
+ return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createOverloadPropertyDeclaration(modifiers, name, questionToken, type), node) : node;
+ }
function finishUpdatePropertySignature(updated, original) {
if (updated !== original) {
updated.initializer = original.initializer;
@@ -19754,7 +19783,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 171 /* PropertyDeclaration */,
+ 172 /* PropertyDeclaration */,
modifiers,
name,
type,
@@ -19776,7 +19805,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createAnnotationPropertyDeclaration(name, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
void 0,
name,
type,
@@ -19790,7 +19819,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 173 /* MethodSignature */,
+ 175 /* MethodSignature */,
modifiers,
name,
typeParameters,
@@ -19806,7 +19835,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 174 /* MethodDeclaration */,
+ 176 /* MethodDeclaration */,
modifiers,
name,
typeParameters,
@@ -19843,7 +19872,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassStaticBlockDeclaration(body) {
const node = createBaseGenericNamedDeclaration(
- 175 /* ClassStaticBlockDeclaration */,
+ 177 /* ClassStaticBlockDeclaration */,
void 0,
void 0,
void 0
@@ -19866,7 +19895,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructorDeclaration(modifiers, parameters, body) {
const node = createBaseFunctionLikeDeclaration(
- 176 /* Constructor */,
+ 178 /* Constructor */,
modifiers,
void 0,
void 0,
@@ -19893,7 +19922,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createGetAccessorDeclaration(modifiers, name, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 177 /* GetAccessor */,
+ 179 /* GetAccessor */,
modifiers,
name,
void 0,
@@ -19915,7 +19944,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createSetAccessorDeclaration(modifiers, name, parameters, body) {
const node = createBaseFunctionLikeDeclaration(
- 178 /* SetAccessor */,
+ 180 /* SetAccessor */,
modifiers,
name,
void 0,
@@ -19939,7 +19968,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createCallSignature(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 179 /* CallSignature */,
+ 181 /* CallSignature */,
void 0,
void 0,
typeParameters,
@@ -19954,7 +19983,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructSignature(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 180 /* ConstructSignature */,
+ 182 /* ConstructSignature */,
void 0,
void 0,
typeParameters,
@@ -19969,7 +19998,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createIndexSignature(modifiers, parameters, type) {
const node = createBaseSignatureDeclaration(
- 181 /* IndexSignature */,
+ 183 /* IndexSignature */,
modifiers,
void 0,
void 0,
@@ -19983,7 +20012,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature(modifiers, parameters, type), node) : node;
}
function createTemplateLiteralTypeSpan(type, literal) {
- const node = createBaseNode(204 /* TemplateLiteralTypeSpan */);
+ const node = createBaseNode(206 /* TemplateLiteralTypeSpan */);
node.type = type;
node.literal = literal;
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -19996,7 +20025,7 @@ function createNodeFactory(flags, baseFactory2) {
return createToken(kind);
}
function createTypePredicateNode(assertsModifier, parameterName, type) {
- const node = createBaseNode(182 /* TypePredicate */);
+ const node = createBaseNode(184 /* TypePredicate */);
node.assertsModifier = assertsModifier;
node.parameterName = asName(parameterName);
node.type = type;
@@ -20007,7 +20036,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode(assertsModifier, parameterName, type), node) : node;
}
function createTypeReferenceNode(typeName, typeArguments) {
- const node = createBaseNode(183 /* TypeReference */);
+ const node = createBaseNode(185 /* TypeReference */);
node.typeName = asName(typeName);
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments));
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -20018,7 +20047,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionTypeNode(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 184 /* FunctionType */,
+ 186 /* FunctionType */,
void 0,
void 0,
typeParameters,
@@ -20043,7 +20072,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 185 /* ConstructorType */,
+ 187 /* ConstructorType */,
modifiers,
void 0,
typeParameters,
@@ -20066,7 +20095,7 @@ function createNodeFactory(flags, baseFactory2) {
return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);
}
function createTypeQueryNode(exprName, typeArguments) {
- const node = createBaseNode(186 /* TypeQuery */);
+ const node = createBaseNode(188 /* TypeQuery */);
node.exprName = exprName;
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -20076,7 +20105,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node;
}
function createTypeLiteralNode(members) {
- const node = createBaseNode(187 /* TypeLiteral */);
+ const node = createBaseNode(189 /* TypeLiteral */);
node.members = createNodeArray(members);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -20085,7 +20114,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.members !== members ? update(createTypeLiteralNode(members), node) : node;
}
function createArrayTypeNode(elementType) {
- const node = createBaseNode(188 /* ArrayType */);
+ const node = createBaseNode(190 /* ArrayType */);
node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -20094,7 +20123,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elementType !== elementType ? update(createArrayTypeNode(elementType), node) : node;
}
function createTupleTypeNode(elements) {
- const node = createBaseNode(189 /* TupleType */);
+ const node = createBaseNode(191 /* TupleType */);
node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements));
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -20103,7 +20132,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node;
}
function createNamedTupleMember(dotDotDotToken, name, questionToken, type) {
- const node = createBaseNode(202 /* NamedTupleMember */);
+ const node = createBaseNode(204 /* NamedTupleMember */);
node.dotDotDotToken = dotDotDotToken;
node.name = name;
node.questionToken = questionToken;
@@ -20115,7 +20144,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node) : node;
}
function createOptionalTypeNode(type) {
- const node = createBaseNode(190 /* OptionalType */);
+ const node = createBaseNode(192 /* OptionalType */);
node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -20124,7 +20153,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createOptionalTypeNode(type), node) : node;
}
function createRestTypeNode(type) {
- const node = createBaseNode(191 /* RestType */);
+ const node = createBaseNode(193 /* RestType */);
node.type = type;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -20142,19 +20171,19 @@ function createNodeFactory(flags, baseFactory2) {
return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node;
}
function createUnionTypeNode(types) {
- return createUnionOrIntersectionTypeNode(192 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
+ return createUnionOrIntersectionTypeNode(194 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
}
function updateUnionTypeNode(node, types) {
return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
}
function createIntersectionTypeNode(types) {
- return createUnionOrIntersectionTypeNode(193 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
+ return createUnionOrIntersectionTypeNode(195 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
}
function updateIntersectionTypeNode(node, types) {
return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
}
function createConditionalTypeNode(checkType, extendsType, trueType, falseType) {
- const node = createBaseNode(194 /* ConditionalType */);
+ const node = createBaseNode(196 /* ConditionalType */);
node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType);
node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType);
node.trueType = trueType;
@@ -20166,7 +20195,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) : node;
}
function createInferTypeNode(typeParameter) {
- const node = createBaseNode(195 /* InferType */);
+ const node = createBaseNode(197 /* InferType */);
node.typeParameter = typeParameter;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -20175,7 +20204,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.typeParameter !== typeParameter ? update(createInferTypeNode(typeParameter), node) : node;
}
function createTemplateLiteralType(head, templateSpans) {
- const node = createBaseNode(203 /* TemplateLiteralType */);
+ const node = createBaseNode(205 /* TemplateLiteralType */);
node.head = head;
node.templateSpans = createNodeArray(templateSpans);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -20185,7 +20214,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
}
function createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf = false) {
- const node = createBaseNode(205 /* ImportType */);
+ const node = createBaseNode(207 /* ImportType */);
node.argument = argument;
node.assertions = assertions;
node.qualifier = qualifier;
@@ -20198,7 +20227,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node;
}
function createParenthesizedType(type) {
- const node = createBaseNode(196 /* ParenthesizedType */);
+ const node = createBaseNode(198 /* ParenthesizedType */);
node.type = type;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -20207,12 +20236,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createParenthesizedType(type), node) : node;
}
function createThisTypeNode() {
- const node = createBaseNode(197 /* ThisType */);
+ const node = createBaseNode(199 /* ThisType */);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
}
function createTypeOperatorNode(operator, type) {
- const node = createBaseNode(198 /* TypeOperator */);
+ const node = createBaseNode(200 /* TypeOperator */);
node.operator = operator;
node.type = operator === 147 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -20222,7 +20251,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createTypeOperatorNode(node.operator, type), node) : node;
}
function createIndexedAccessTypeNode(objectType, indexType) {
- const node = createBaseNode(199 /* IndexedAccessType */);
+ const node = createBaseNode(201 /* IndexedAccessType */);
node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType);
node.indexType = indexType;
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -20232,7 +20261,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node;
}
function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) {
- const node = createBaseNode(200 /* MappedType */);
+ const node = createBaseNode(202 /* MappedType */);
node.readonlyToken = readonlyToken;
node.typeParameter = typeParameter;
node.nameType = nameType;
@@ -20246,7 +20275,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node;
}
function createLiteralTypeNode(literal) {
- const node = createBaseNode(201 /* LiteralType */);
+ const node = createBaseNode(203 /* LiteralType */);
node.literal = literal;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -20255,7 +20284,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.literal !== literal ? update(createLiteralTypeNode(literal), node) : node;
}
function createObjectBindingPattern(elements) {
- const node = createBaseNode(206 /* ObjectBindingPattern */);
+ const node = createBaseNode(208 /* ObjectBindingPattern */);
node.elements = createNodeArray(elements);
node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */;
if (node.transformFlags & 32768 /* ContainsRestOrSpread */) {
@@ -20267,7 +20296,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createObjectBindingPattern(elements), node) : node;
}
function createArrayBindingPattern(elements) {
- const node = createBaseNode(207 /* ArrayBindingPattern */);
+ const node = createBaseNode(209 /* ArrayBindingPattern */);
node.elements = createNodeArray(elements);
node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */;
return node;
@@ -20277,7 +20306,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createBindingElement(dotDotDotToken, propertyName, name, initializer) {
const node = createBaseBindingLikeDeclaration(
- 208 /* BindingElement */,
+ 210 /* BindingElement */,
void 0,
name,
initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
@@ -20300,7 +20329,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createArrayLiteralExpression(elements, multiLine) {
- const node = createBaseExpression(209 /* ArrayLiteralExpression */);
+ const node = createBaseExpression(211 /* ArrayLiteralExpression */);
const lastElement = elements && lastOrUndefined(elements);
const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0);
node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray);
@@ -20312,7 +20341,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node;
}
function createObjectLiteralExpression(properties, multiLine) {
- const node = createBaseExpression(210 /* ObjectLiteralExpression */);
+ const node = createBaseExpression(212 /* ObjectLiteralExpression */);
node.properties = createNodeArray(properties);
node.multiLine = multiLine;
node.transformFlags |= propagateChildrenFlags(node.properties);
@@ -20322,7 +20351,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node;
}
function createPropertyAccessExpression(expression, name) {
- const node = createBaseExpression(211 /* PropertyAccessExpression */);
+ const node = createBaseExpression(213 /* PropertyAccessExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.name = asName(name);
node.transformFlags = propagateChildFlags(node.expression) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
@@ -20338,7 +20367,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node;
}
function createPropertyAccessChain(expression, questionDotToken, name) {
- const node = createBaseExpression(211 /* PropertyAccessExpression */);
+ const node = createBaseExpression(213 /* PropertyAccessExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -20351,7 +20380,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain(expression, questionDotToken, name), node) : node;
}
function createElementAccessExpression(expression, index) {
- const node = createBaseExpression(212 /* ElementAccessExpression */);
+ const node = createBaseExpression(214 /* ElementAccessExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.argumentExpression = asExpression(index);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.argumentExpression);
@@ -20367,7 +20396,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node;
}
function createElementAccessChain(expression, questionDotToken, index) {
- const node = createBaseExpression(212 /* ElementAccessExpression */);
+ const node = createBaseExpression(214 /* ElementAccessExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -20380,7 +20409,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node;
}
function createCallExpression(expression, typeArguments, argumentsArray) {
- const node = createBaseExpression(213 /* CallExpression */);
+ const node = createBaseExpression(215 /* CallExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
@@ -20402,7 +20431,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node;
}
function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) {
- const node = createBaseExpression(213 /* CallExpression */);
+ const node = createBaseExpression(215 /* CallExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -20422,7 +20451,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node;
}
function createNewExpression(expression, typeArguments, argumentsArray) {
- const node = createBaseExpression(214 /* NewExpression */);
+ const node = createBaseExpression(216 /* NewExpression */);
node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0;
@@ -20436,7 +20465,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createNewExpression(expression, typeArguments, argumentsArray), node) : node;
}
function createTaggedTemplateExpression(tag, typeArguments, template) {
- const node = createBaseExpression(215 /* TaggedTemplateExpression */);
+ const node = createBaseExpression(217 /* TaggedTemplateExpression */);
node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag, false);
node.typeArguments = asNodeArray(typeArguments);
node.template = template;
@@ -20453,7 +20482,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node;
}
function createTypeAssertion(type, expression) {
- const node = createBaseExpression(216 /* TypeAssertionExpression */);
+ const node = createBaseExpression(218 /* TypeAssertionExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -20463,7 +20492,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node;
}
function createParenthesizedExpression(expression) {
- const node = createBaseExpression(217 /* ParenthesizedExpression */);
+ const node = createBaseExpression(219 /* ParenthesizedExpression */);
node.expression = expression;
node.transformFlags = propagateChildFlags(node.expression);
return node;
@@ -20473,7 +20502,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 218 /* FunctionExpression */,
+ 220 /* FunctionExpression */,
modifiers,
name,
typeParameters,
@@ -20501,7 +20530,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node;
}
function createEtsComponentExpression(name, argumentsArray, body) {
- const node = createBaseExpression(220 /* EtsComponentExpression */);
+ const node = createBaseExpression(222 /* EtsComponentExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(name);
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
node.body = body;
@@ -20512,7 +20541,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
const node = createBaseFunctionLikeDeclaration(
- 219 /* ArrowFunction */,
+ 221 /* ArrowFunction */,
modifiers,
void 0,
typeParameters,
@@ -20531,7 +20560,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node;
}
function createDeleteExpression(expression) {
- const node = createBaseExpression(221 /* DeleteExpression */);
+ const node = createBaseExpression(223 /* DeleteExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -20540,7 +20569,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createDeleteExpression(expression), node) : node;
}
function createTypeOfExpression(expression) {
- const node = createBaseExpression(222 /* TypeOfExpression */);
+ const node = createBaseExpression(224 /* TypeOfExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -20549,7 +20578,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node;
}
function createVoidExpression(expression) {
- const node = createBaseExpression(223 /* VoidExpression */);
+ const node = createBaseExpression(225 /* VoidExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -20558,7 +20587,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createVoidExpression(expression), node) : node;
}
function createAwaitExpression(expression) {
- const node = createBaseExpression(224 /* AwaitExpression */);
+ const node = createBaseExpression(226 /* AwaitExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */;
return node;
@@ -20567,7 +20596,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createAwaitExpression(expression), node) : node;
}
function createPrefixUnaryExpression(operator, operand) {
- const node = createBaseExpression(225 /* PrefixUnaryExpression */);
+ const node = createBaseExpression(227 /* PrefixUnaryExpression */);
node.operator = operator;
node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand);
node.transformFlags |= propagateChildFlags(node.operand);
@@ -20580,7 +20609,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node;
}
function createPostfixUnaryExpression(operand, operator) {
- const node = createBaseExpression(226 /* PostfixUnaryExpression */);
+ const node = createBaseExpression(228 /* PostfixUnaryExpression */);
node.operator = operator;
node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand);
node.transformFlags |= propagateChildFlags(node.operand);
@@ -20593,7 +20622,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node;
}
function createBinaryExpression(left, operator, right) {
- const node = createBaseExpression(227 /* BinaryExpression */);
+ const node = createBaseExpression(229 /* BinaryExpression */);
const operatorToken = asToken(operator);
const operatorKind = operatorToken.kind;
node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left);
@@ -20642,7 +20671,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node;
}
function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) {
- const node = createBaseExpression(228 /* ConditionalExpression */);
+ const node = createBaseExpression(230 /* ConditionalExpression */);
node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition);
node.questionToken = questionToken != null ? questionToken : createToken(57 /* QuestionToken */);
node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue);
@@ -20655,7 +20684,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node;
}
function createTemplateExpression(head, templateSpans) {
- const node = createBaseExpression(229 /* TemplateExpression */);
+ const node = createBaseExpression(231 /* TemplateExpression */);
node.head = head;
node.templateSpans = createNodeArray(templateSpans);
node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */;
@@ -20708,7 +20737,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createYieldExpression(asteriskToken, expression) {
Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression.");
- const node = createBaseExpression(230 /* YieldExpression */);
+ const node = createBaseExpression(232 /* YieldExpression */);
node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.asteriskToken = asteriskToken;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */;
@@ -20718,7 +20747,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node;
}
function createSpreadElement(expression) {
- const node = createBaseExpression(231 /* SpreadElement */);
+ const node = createBaseExpression(233 /* SpreadElement */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */;
return node;
@@ -20728,7 +20757,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 232 /* ClassExpression */,
+ 234 /* ClassExpression */,
modifiers,
name,
typeParameters,
@@ -20742,10 +20771,10 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) : node;
}
function createOmittedExpression() {
- return createBaseExpression(233 /* OmittedExpression */);
+ return createBaseExpression(235 /* OmittedExpression */);
}
function createExpressionWithTypeArguments(expression, typeArguments) {
- const node = createBaseNode(234 /* ExpressionWithTypeArguments */);
+ const node = createBaseNode(236 /* ExpressionWithTypeArguments */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | 1024 /* ContainsES2015 */;
@@ -20755,7 +20784,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node;
}
function createAsExpression(expression, type) {
- const node = createBaseExpression(235 /* AsExpression */);
+ const node = createBaseExpression(237 /* AsExpression */);
node.expression = expression;
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -20765,7 +20794,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node;
}
function createNonNullExpression(expression) {
- const node = createBaseExpression(236 /* NonNullExpression */);
+ const node = createBaseExpression(238 /* NonNullExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
return node;
@@ -20777,7 +20806,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createNonNullExpression(expression), node) : node;
}
function createSatisfiesExpression(expression, type) {
- const node = createBaseExpression(239 /* SatisfiesExpression */);
+ const node = createBaseExpression(241 /* SatisfiesExpression */);
node.expression = expression;
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -20787,7 +20816,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node;
}
function createNonNullChain(expression) {
- const node = createBaseExpression(236 /* NonNullExpression */);
+ const node = createBaseExpression(238 /* NonNullExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -20798,7 +20827,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createNonNullChain(expression), node) : node;
}
function createMetaProperty(keywordToken, name) {
- const node = createBaseExpression(237 /* MetaProperty */);
+ const node = createBaseExpression(239 /* MetaProperty */);
node.keywordToken = keywordToken;
node.name = name;
node.transformFlags |= propagateChildFlags(node.name);
@@ -20818,7 +20847,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createMetaProperty(node.keywordToken, name), node) : node;
}
function createTemplateSpan(expression, literal) {
- const node = createBaseNode(240 /* TemplateSpan */);
+ const node = createBaseNode(242 /* TemplateSpan */);
node.expression = expression;
node.literal = literal;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */;
@@ -20828,12 +20857,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan(expression, literal), node) : node;
}
function createSemicolonClassElement() {
- const node = createBaseNode(241 /* SemicolonClassElement */);
+ const node = createBaseNode(243 /* SemicolonClassElement */);
node.transformFlags |= 1024 /* ContainsES2015 */;
return node;
}
function createBlock(statements, multiLine) {
- const node = createBaseNode(242 /* Block */);
+ const node = createBaseNode(244 /* Block */);
node.statements = createNodeArray(statements);
node.multiLine = multiLine;
node.transformFlags |= propagateChildrenFlags(node.statements);
@@ -20843,7 +20872,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node;
}
function createVariableStatement(modifiers, declarationList) {
- const node = createBaseDeclaration(244 /* VariableStatement */);
+ const node = createBaseDeclaration(246 /* VariableStatement */);
node.modifiers = asNodeArray(modifiers);
node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList);
@@ -20856,10 +20885,10 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node;
}
function createEmptyStatement() {
- return createBaseNode(243 /* EmptyStatement */);
+ return createBaseNode(245 /* EmptyStatement */);
}
function createExpressionStatement(expression) {
- const node = createBaseNode(245 /* ExpressionStatement */);
+ const node = createBaseNode(247 /* ExpressionStatement */);
node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -20868,7 +20897,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createExpressionStatement(expression), node) : node;
}
function createIfStatement(expression, thenStatement, elseStatement) {
- const node = createBaseNode(246 /* IfStatement */);
+ const node = createBaseNode(248 /* IfStatement */);
node.expression = expression;
node.thenStatement = asEmbeddedStatement(thenStatement);
node.elseStatement = asEmbeddedStatement(elseStatement);
@@ -20879,7 +20908,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? update(createIfStatement(expression, thenStatement, elseStatement), node) : node;
}
function createDoStatement(statement, expression) {
- const node = createBaseNode(247 /* DoStatement */);
+ const node = createBaseNode(249 /* DoStatement */);
node.statement = asEmbeddedStatement(statement);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression);
@@ -20889,7 +20918,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statement !== statement || node.expression !== expression ? update(createDoStatement(statement, expression), node) : node;
}
function createWhileStatement(expression, statement) {
- const node = createBaseNode(248 /* WhileStatement */);
+ const node = createBaseNode(250 /* WhileStatement */);
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
@@ -20899,7 +20928,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statement !== statement ? update(createWhileStatement(expression, statement), node) : node;
}
function createForStatement(initializer, condition, incrementor, statement) {
- const node = createBaseNode(249 /* ForStatement */);
+ const node = createBaseNode(251 /* ForStatement */);
node.initializer = initializer;
node.condition = condition;
node.incrementor = incrementor;
@@ -20911,7 +20940,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement ? update(createForStatement(initializer, condition, incrementor, statement), node) : node;
}
function createForInStatement(initializer, expression, statement) {
- const node = createBaseNode(250 /* ForInStatement */);
+ const node = createBaseNode(252 /* ForInStatement */);
node.initializer = initializer;
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
@@ -20922,7 +20951,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForInStatement(initializer, expression, statement), node) : node;
}
function createForOfStatement(awaitModifier, initializer, expression, statement) {
- const node = createBaseNode(251 /* ForOfStatement */);
+ const node = createBaseNode(253 /* ForOfStatement */);
node.awaitModifier = awaitModifier;
node.initializer = initializer;
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
@@ -20936,7 +20965,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForOfStatement(awaitModifier, initializer, expression, statement), node) : node;
}
function createContinueStatement(label) {
- const node = createBaseNode(252 /* ContinueStatement */);
+ const node = createBaseNode(254 /* ContinueStatement */);
node.label = asName(label);
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -20945,7 +20974,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label ? update(createContinueStatement(label), node) : node;
}
function createBreakStatement(label) {
- const node = createBaseNode(253 /* BreakStatement */);
+ const node = createBaseNode(255 /* BreakStatement */);
node.label = asName(label);
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -20954,7 +20983,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label ? update(createBreakStatement(label), node) : node;
}
function createReturnStatement(expression) {
- const node = createBaseNode(254 /* ReturnStatement */);
+ const node = createBaseNode(256 /* ReturnStatement */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -20963,7 +20992,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createReturnStatement(expression), node) : node;
}
function createWithStatement(expression, statement) {
- const node = createBaseNode(255 /* WithStatement */);
+ const node = createBaseNode(257 /* WithStatement */);
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
@@ -20973,7 +21002,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statement !== statement ? update(createWithStatement(expression, statement), node) : node;
}
function createSwitchStatement(expression, caseBlock) {
- const node = createBaseNode(256 /* SwitchStatement */);
+ const node = createBaseNode(258 /* SwitchStatement */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.caseBlock = caseBlock;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock);
@@ -20983,7 +21012,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.caseBlock !== caseBlock ? update(createSwitchStatement(expression, caseBlock), node) : node;
}
function createLabeledStatement(label, statement) {
- const node = createBaseNode(257 /* LabeledStatement */);
+ const node = createBaseNode(259 /* LabeledStatement */);
node.label = asName(label);
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement);
@@ -20993,7 +21022,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label || node.statement !== statement ? update(createLabeledStatement(label, statement), node) : node;
}
function createThrowStatement(expression) {
- const node = createBaseNode(258 /* ThrowStatement */);
+ const node = createBaseNode(260 /* ThrowStatement */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -21002,7 +21031,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createThrowStatement(expression), node) : node;
}
function createTryStatement(tryBlock, catchClause, finallyBlock) {
- const node = createBaseNode(259 /* TryStatement */);
+ const node = createBaseNode(261 /* TryStatement */);
node.tryBlock = tryBlock;
node.catchClause = catchClause;
node.finallyBlock = finallyBlock;
@@ -21013,11 +21042,11 @@ function createNodeFactory(flags, baseFactory2) {
return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node;
}
function createDebuggerStatement() {
- return createBaseNode(260 /* DebuggerStatement */);
+ return createBaseNode(262 /* DebuggerStatement */);
}
function createVariableDeclaration(name, exclamationToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 261 /* VariableDeclaration */,
+ 263 /* VariableDeclaration */,
void 0,
name,
type,
@@ -21034,7 +21063,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration(name, exclamationToken, type, initializer), node) : node;
}
function createVariableDeclarationList(declarations, flags2 = 0 /* None */) {
- const node = createBaseNode(262 /* VariableDeclarationList */);
+ const node = createBaseNode(264 /* VariableDeclarationList */);
node.flags |= flags2 & 3 /* BlockScoped */;
node.declarations = createNodeArray(declarations);
node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
@@ -21048,7 +21077,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 263 /* FunctionDeclaration */,
+ 265 /* FunctionDeclaration */,
modifiers,
name,
typeParameters,
@@ -21085,7 +21114,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 264 /* ClassDeclaration */,
+ 266 /* ClassDeclaration */,
modifiers,
name,
typeParameters,
@@ -21107,7 +21136,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createStructDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 265 /* StructDeclaration */,
+ 267 /* StructDeclaration */,
modifiers,
name,
typeParameters,
@@ -21129,7 +21158,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createAnnotationDeclaration(modifiers, name, members) {
const node = createBaseNamedDeclaration(
- 266 /* AnnotationDeclaration */,
+ 268 /* AnnotationDeclaration */,
modifiers,
name
);
@@ -21146,9 +21175,28 @@ function createNodeFactory(flags, baseFactory2) {
function updateAnnotationDeclaration(node, modifiers, name, members) {
return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createAnnotationDeclaration(modifiers, name, members), node) : node;
}
+ function createOverloadDeclaration(modifiers, name, members) {
+ const node = createBaseNamedDeclaration(
+ 269 /* OverloadDeclaration */,
+ modifiers,
+ name
+ );
+ node.members = createNodeArray(members);
+ node.transformFlags |= propagateChildrenFlags(node.members);
+ if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
+ node.transformFlags = 1 /* ContainsTypeScript */;
+ } else {
+ node.transformFlags |= 1024 /* ContainsES2015 */;
+ node.transformFlags |= 1 /* ContainsTypeScript */;
+ }
+ return node;
+ }
+ function updateOverloadDeclaration(node, modifiers, name, members) {
+ return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createOverloadDeclaration(modifiers, name, members), node) : node;
+ }
function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseInterfaceOrClassLikeDeclaration(
- 267 /* InterfaceDeclaration */,
+ 270 /* InterfaceDeclaration */,
modifiers,
name,
typeParameters,
@@ -21170,7 +21218,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createTypeAliasDeclaration(modifiers, name, typeParameters, type) {
const node = createBaseGenericNamedDeclaration(
- 268 /* TypeAliasDeclaration */,
+ 271 /* TypeAliasDeclaration */,
modifiers,
name,
typeParameters
@@ -21191,7 +21239,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createEnumDeclaration(modifiers, name, members) {
const node = createBaseNamedDeclaration(
- 269 /* EnumDeclaration */,
+ 272 /* EnumDeclaration */,
modifiers,
name
);
@@ -21211,7 +21259,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createModuleDeclaration(modifiers, name, body, flags2 = 0 /* None */) {
- const node = createBaseDeclaration(270 /* ModuleDeclaration */);
+ const node = createBaseDeclaration(273 /* ModuleDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.flags |= flags2 & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */);
node.name = name;
@@ -21235,7 +21283,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createModuleBlock(statements) {
- const node = createBaseNode(271 /* ModuleBlock */);
+ const node = createBaseNode(274 /* ModuleBlock */);
node.statements = createNodeArray(statements);
node.transformFlags |= propagateChildrenFlags(node.statements);
return node;
@@ -21244,7 +21292,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createModuleBlock(statements), node) : node;
}
function createCaseBlock(clauses) {
- const node = createBaseNode(272 /* CaseBlock */);
+ const node = createBaseNode(275 /* CaseBlock */);
node.clauses = createNodeArray(clauses);
node.transformFlags |= propagateChildrenFlags(node.clauses);
return node;
@@ -21254,7 +21302,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createNamespaceExportDeclaration(name) {
const node = createBaseNamedDeclaration(
- 273 /* NamespaceExportDeclaration */,
+ 276 /* NamespaceExportDeclaration */,
void 0,
name
);
@@ -21275,7 +21323,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) {
const node = createBaseNamedDeclaration(
- 274 /* ImportEqualsDeclaration */,
+ 277 /* ImportEqualsDeclaration */,
modifiers,
name
);
@@ -21298,7 +21346,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) {
- const node = createBaseDeclaration(275 /* ImportDeclaration */);
+ const node = createBaseDeclaration(278 /* ImportDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.importClause = importClause;
node.moduleSpecifier = moduleSpecifier;
@@ -21318,7 +21366,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createImportClause(isTypeOnly, name, namedBindings) {
- const node = createBaseNode(276 /* ImportClause */);
+ const node = createBaseNode(279 /* ImportClause */);
node.isTypeOnly = isTypeOnly;
node.name = name;
node.namedBindings = namedBindings;
@@ -21340,7 +21388,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createAssertClause(elements, multiLine) {
- const node = createBaseNode(302 /* AssertClause */);
+ const node = createBaseNode(305 /* AssertClause */);
node.elements = createNodeArray(elements);
node.multiLine = multiLine;
node.transformFlags |= 4 /* ContainsESNext */;
@@ -21350,7 +21398,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements || node.multiLine !== multiLine ? update(createAssertClause(elements, multiLine), node) : node;
}
function createAssertEntry(name, value) {
- const node = createBaseNode(303 /* AssertEntry */);
+ const node = createBaseNode(306 /* AssertEntry */);
node.name = name;
node.value = value;
node.transformFlags |= 4 /* ContainsESNext */;
@@ -21360,7 +21408,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.value !== value ? update(createAssertEntry(name, value), node) : node;
}
function createImportTypeAssertionContainer(clause, multiLine) {
- const node = createBaseNode(304 /* ImportTypeAssertionContainer */);
+ const node = createBaseNode(307 /* ImportTypeAssertionContainer */);
node.assertClause = clause;
node.multiLine = multiLine;
return node;
@@ -21369,7 +21417,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
}
function createNamespaceImport(name) {
- const node = createBaseNode(277 /* NamespaceImport */);
+ const node = createBaseNode(280 /* NamespaceImport */);
node.name = name;
node.transformFlags |= propagateChildFlags(node.name);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -21379,7 +21427,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createNamespaceImport(name), node) : node;
}
function createNamespaceExport(name) {
- const node = createBaseNode(283 /* NamespaceExport */);
+ const node = createBaseNode(286 /* NamespaceExport */);
node.name = name;
node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */;
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -21389,7 +21437,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createNamespaceExport(name), node) : node;
}
function createNamedImports(elements) {
- const node = createBaseNode(278 /* NamedImports */);
+ const node = createBaseNode(281 /* NamedImports */);
node.elements = createNodeArray(elements);
node.transformFlags |= propagateChildrenFlags(node.elements);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -21399,7 +21447,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createNamedImports(elements), node) : node;
}
function createImportSpecifier(isTypeOnly, propertyName, name) {
- const node = createBaseNode(279 /* ImportSpecifier */);
+ const node = createBaseNode(282 /* ImportSpecifier */);
node.isTypeOnly = isTypeOnly;
node.propertyName = propertyName;
node.name = name;
@@ -21411,7 +21459,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier(isTypeOnly, propertyName, name), node) : node;
}
function createExportAssignment(modifiers, isExportEquals, expression) {
- const node = createBaseDeclaration(280 /* ExportAssignment */);
+ const node = createBaseDeclaration(283 /* ExportAssignment */);
node.modifiers = asNodeArray(modifiers);
node.isExportEquals = isExportEquals;
node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary(63 /* EqualsToken */, void 0, expression) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression);
@@ -21430,7 +21478,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
- const node = createBaseDeclaration(281 /* ExportDeclaration */);
+ const node = createBaseDeclaration(284 /* ExportDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.isTypeOnly = isTypeOnly;
node.exportClause = exportClause;
@@ -21451,7 +21499,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createNamedExports(elements) {
- const node = createBaseNode(282 /* NamedExports */);
+ const node = createBaseNode(285 /* NamedExports */);
node.elements = createNodeArray(elements);
node.transformFlags |= propagateChildrenFlags(node.elements);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -21461,7 +21509,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createNamedExports(elements), node) : node;
}
function createExportSpecifier(isTypeOnly, propertyName, name) {
- const node = createBaseNode(284 /* ExportSpecifier */);
+ const node = createBaseNode(287 /* ExportSpecifier */);
node.isTypeOnly = isTypeOnly;
node.propertyName = asName(propertyName);
node.name = asName(name);
@@ -21473,11 +21521,11 @@ function createNodeFactory(flags, baseFactory2) {
return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier(isTypeOnly, propertyName, name), node) : node;
}
function createMissingDeclaration() {
- const node = createBaseDeclaration(285 /* MissingDeclaration */);
+ const node = createBaseDeclaration(288 /* MissingDeclaration */);
return node;
}
function createExternalModuleReference(expression) {
- const node = createBaseNode(286 /* ExternalModuleReference */);
+ const node = createBaseNode(289 /* ExternalModuleReference */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -21510,7 +21558,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createJSDocFunctionType(parameters, type) {
const node = createBaseSignatureDeclaration(
- 326 /* JSDocFunctionType */,
+ 329 /* JSDocFunctionType */,
void 0,
void 0,
void 0,
@@ -21523,7 +21571,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node;
}
function createJSDocTypeLiteral(propertyTags, isArrayType = false) {
- const node = createBaseNode(331 /* JSDocTypeLiteral */);
+ const node = createBaseNode(334 /* JSDocTypeLiteral */);
node.jsDocPropertyTags = asNodeArray(propertyTags);
node.isArrayType = isArrayType;
return node;
@@ -21532,7 +21580,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral(propertyTags, isArrayType), node) : node;
}
function createJSDocTypeExpression(type) {
- const node = createBaseNode(318 /* JSDocTypeExpression */);
+ const node = createBaseNode(321 /* JSDocTypeExpression */);
node.type = type;
return node;
}
@@ -21540,7 +21588,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createJSDocTypeExpression(type), node) : node;
}
function createJSDocSignature(typeParameters, parameters, type) {
- const node = createBaseNode(332 /* JSDocSignature */);
+ const node = createBaseNode(335 /* JSDocSignature */);
node.typeParameters = asNodeArray(typeParameters);
node.parameters = createNodeArray(parameters);
node.type = type;
@@ -21560,7 +21608,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) {
- const node = createBaseJSDocTag(353 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier("template"), comment);
+ const node = createBaseJSDocTag(356 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier("template"), comment);
node.constraint = constraint;
node.typeParameters = createNodeArray(typeParameters);
return node;
@@ -21569,7 +21617,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node;
}
function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) {
- const node = createBaseJSDocTag(354 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment);
+ const node = createBaseJSDocTag(357 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment);
node.typeExpression = typeExpression;
node.fullName = fullName;
node.name = getJSDocTypeAliasName(fullName);
@@ -21579,7 +21627,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node;
}
function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
- const node = createBaseJSDocTag(349 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment);
+ const node = createBaseJSDocTag(352 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment);
node.typeExpression = typeExpression;
node.name = name;
node.isNameFirst = !!isNameFirst;
@@ -21590,7 +21638,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node;
}
function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
- const node = createBaseJSDocTag(356 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment);
+ const node = createBaseJSDocTag(359 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment);
node.typeExpression = typeExpression;
node.name = name;
node.isNameFirst = !!isNameFirst;
@@ -21601,7 +21649,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node;
}
function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) {
- const node = createBaseJSDocTag(347 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment);
+ const node = createBaseJSDocTag(350 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment);
node.typeExpression = typeExpression;
node.fullName = fullName;
node.name = getJSDocTypeAliasName(fullName);
@@ -21611,7 +21659,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node;
}
function createJSDocAugmentsTag(tagName, className, comment) {
- const node = createBaseJSDocTag(337 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier("augments"), comment);
+ const node = createBaseJSDocTag(340 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier("augments"), comment);
node.class = className;
return node;
}
@@ -21619,12 +21667,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag(tagName, className, comment), node) : node;
}
function createJSDocImplementsTag(tagName, className, comment) {
- const node = createBaseJSDocTag(338 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier("implements"), comment);
+ const node = createBaseJSDocTag(341 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier("implements"), comment);
node.class = className;
return node;
}
function createJSDocSeeTag(tagName, name, comment) {
- const node = createBaseJSDocTag(355 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier("see"), comment);
+ const node = createBaseJSDocTag(358 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier("see"), comment);
node.name = name;
return node;
}
@@ -21632,7 +21680,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.comment !== comment ? update(createJSDocSeeTag(tagName, name, comment), node) : node;
}
function createJSDocNameReference(name) {
- const node = createBaseNode(319 /* JSDocNameReference */);
+ const node = createBaseNode(322 /* JSDocNameReference */);
node.name = name;
return node;
}
@@ -21640,7 +21688,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocNameReference(name), node) : node;
}
function createJSDocMemberName(left, right) {
- const node = createBaseNode(320 /* JSDocMemberName */);
+ const node = createBaseNode(323 /* JSDocMemberName */);
node.left = left;
node.right = right;
node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.right);
@@ -21650,7 +21698,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.right !== right ? update(createJSDocMemberName(left, right), node) : node;
}
function createJSDocLink(name, text) {
- const node = createBaseNode(333 /* JSDocLink */);
+ const node = createBaseNode(336 /* JSDocLink */);
node.name = name;
node.text = text;
return node;
@@ -21659,7 +21707,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocLink(name, text), node) : node;
}
function createJSDocLinkCode(name, text) {
- const node = createBaseNode(334 /* JSDocLinkCode */);
+ const node = createBaseNode(337 /* JSDocLinkCode */);
node.name = name;
node.text = text;
return node;
@@ -21668,7 +21716,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocLinkCode(name, text), node) : node;
}
function createJSDocLinkPlain(name, text) {
- const node = createBaseNode(335 /* JSDocLinkPlain */);
+ const node = createBaseNode(338 /* JSDocLinkPlain */);
node.name = name;
node.text = text;
return node;
@@ -21695,14 +21743,14 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment), node) : node;
}
function createJSDocUnknownTag(tagName, comment) {
- const node = createBaseJSDocTag(336 /* JSDocTag */, tagName, comment);
+ const node = createBaseJSDocTag(339 /* JSDocTag */, tagName, comment);
return node;
}
function updateJSDocUnknownTag(node, tagName, comment) {
return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node;
}
function createJSDocText(text) {
- const node = createBaseNode(330 /* JSDocText */);
+ const node = createBaseNode(333 /* JSDocText */);
node.text = text;
return node;
}
@@ -21710,7 +21758,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.text !== text ? update(createJSDocText(text), node) : node;
}
function createJSDocComment(comment, tags) {
- const node = createBaseNode(329 /* JSDoc */);
+ const node = createBaseNode(332 /* JSDoc */);
node.comment = comment;
node.tags = asNodeArray(tags);
return node;
@@ -21719,7 +21767,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.comment !== comment || node.tags !== tags ? update(createJSDocComment(comment, tags), node) : node;
}
function createJsxElement(openingElement, children, closingElement) {
- const node = createBaseNode(287 /* JsxElement */);
+ const node = createBaseNode(290 /* JsxElement */);
node.openingElement = openingElement;
node.children = createNodeArray(children);
node.closingElement = closingElement;
@@ -21730,7 +21778,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement(openingElement, children, closingElement), node) : node;
}
function createJsxSelfClosingElement(tagName, typeArguments, attributes) {
- const node = createBaseNode(288 /* JsxSelfClosingElement */);
+ const node = createBaseNode(291 /* JsxSelfClosingElement */);
node.tagName = tagName;
node.typeArguments = asNodeArray(typeArguments);
node.attributes = attributes;
@@ -21744,7 +21792,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement(tagName, typeArguments, attributes), node) : node;
}
function createJsxOpeningElement(tagName, typeArguments, attributes) {
- const node = createBaseNode(289 /* JsxOpeningElement */);
+ const node = createBaseNode(292 /* JsxOpeningElement */);
node.tagName = tagName;
node.typeArguments = asNodeArray(typeArguments);
node.attributes = attributes;
@@ -21758,7 +21806,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement(tagName, typeArguments, attributes), node) : node;
}
function createJsxClosingElement(tagName) {
- const node = createBaseNode(290 /* JsxClosingElement */);
+ const node = createBaseNode(293 /* JsxClosingElement */);
node.tagName = tagName;
node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */;
return node;
@@ -21767,7 +21815,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName ? update(createJsxClosingElement(tagName), node) : node;
}
function createJsxFragment(openingFragment, children, closingFragment) {
- const node = createBaseNode(291 /* JsxFragment */);
+ const node = createBaseNode(294 /* JsxFragment */);
node.openingFragment = openingFragment;
node.children = createNodeArray(children);
node.closingFragment = closingFragment;
@@ -21788,17 +21836,17 @@ function createNodeFactory(flags, baseFactory2) {
return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText(text, containsOnlyTriviaWhiteSpaces), node) : node;
}
function createJsxOpeningFragment() {
- const node = createBaseNode(292 /* JsxOpeningFragment */);
+ const node = createBaseNode(295 /* JsxOpeningFragment */);
node.transformFlags |= 2 /* ContainsJsx */;
return node;
}
function createJsxJsxClosingFragment() {
- const node = createBaseNode(293 /* JsxClosingFragment */);
+ const node = createBaseNode(296 /* JsxClosingFragment */);
node.transformFlags |= 2 /* ContainsJsx */;
return node;
}
function createJsxAttribute(name, initializer) {
- const node = createBaseNode(294 /* JsxAttribute */);
+ const node = createBaseNode(297 /* JsxAttribute */);
node.name = name;
node.initializer = initializer;
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */;
@@ -21808,7 +21856,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node;
}
function createJsxAttributes(properties) {
- const node = createBaseNode(295 /* JsxAttributes */);
+ const node = createBaseNode(298 /* JsxAttributes */);
node.properties = createNodeArray(properties);
node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */;
return node;
@@ -21817,7 +21865,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.properties !== properties ? update(createJsxAttributes(properties), node) : node;
}
function createJsxSpreadAttribute(expression) {
- const node = createBaseNode(296 /* JsxSpreadAttribute */);
+ const node = createBaseNode(299 /* JsxSpreadAttribute */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */;
return node;
@@ -21826,7 +21874,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createJsxSpreadAttribute(expression), node) : node;
}
function createJsxExpression(dotDotDotToken, expression) {
- const node = createBaseNode(297 /* JsxExpression */);
+ const node = createBaseNode(300 /* JsxExpression */);
node.dotDotDotToken = dotDotDotToken;
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */;
@@ -21836,7 +21884,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createJsxExpression(node.dotDotDotToken, expression), node) : node;
}
function createCaseClause(expression, statements) {
- const node = createBaseNode(298 /* CaseClause */);
+ const node = createBaseNode(301 /* CaseClause */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.statements = createNodeArray(statements);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements);
@@ -21846,7 +21894,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statements !== statements ? update(createCaseClause(expression, statements), node) : node;
}
function createDefaultClause(statements) {
- const node = createBaseNode(299 /* DefaultClause */);
+ const node = createBaseNode(302 /* DefaultClause */);
node.statements = createNodeArray(statements);
node.transformFlags = propagateChildrenFlags(node.statements);
return node;
@@ -21855,7 +21903,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createDefaultClause(statements), node) : node;
}
function createHeritageClause(token, types) {
- const node = createBaseNode(300 /* HeritageClause */);
+ const node = createBaseNode(303 /* HeritageClause */);
node.token = token;
node.types = createNodeArray(types);
node.transformFlags |= propagateChildrenFlags(node.types);
@@ -21875,7 +21923,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.types !== types ? update(createHeritageClause(node.token, types), node) : node;
}
function createCatchClause(variableDeclaration, block) {
- const node = createBaseNode(301 /* CatchClause */);
+ const node = createBaseNode(304 /* CatchClause */);
if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
variableDeclaration = createVariableDeclaration(
variableDeclaration,
@@ -21896,7 +21944,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertyAssignment(name, initializer) {
const node = createBaseNamedDeclaration(
- 305 /* PropertyAssignment */,
+ 308 /* PropertyAssignment */,
void 0,
name
);
@@ -21922,7 +21970,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createShorthandPropertyAssignment(name, objectAssignmentInitializer) {
const node = createBaseNamedDeclaration(
- 306 /* ShorthandPropertyAssignment */,
+ 309 /* ShorthandPropertyAssignment */,
void 0,
name
);
@@ -21949,7 +21997,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createSpreadAssignment(expression) {
- const node = createBaseNode(307 /* SpreadAssignment */);
+ const node = createBaseNode(310 /* SpreadAssignment */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */;
return node;
@@ -21958,7 +22006,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node;
}
function createEnumMember(name, initializer) {
- const node = createBaseNode(308 /* EnumMember */);
+ const node = createBaseNode(311 /* EnumMember */);
node.name = asName(name);
node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */;
@@ -21968,7 +22016,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.initializer !== initializer ? update(createEnumMember(name, initializer), node) : node;
}
function createSourceFile2(statements, endOfFileToken, flags2) {
- const node = baseFactory2.createBaseSourceFileNode(314 /* SourceFile */);
+ const node = baseFactory2.createBaseSourceFileNode(317 /* SourceFile */);
node.statements = createNodeArray(statements);
node.endOfFileToken = endOfFileToken;
node.flags |= flags2;
@@ -21983,7 +22031,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
- const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(314 /* SourceFile */);
+ const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(317 /* SourceFile */);
for (const p in source) {
if (p === "emitNode" || hasProperty(node, p) || !hasProperty(source, p))
continue;
@@ -22005,7 +22053,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node;
}
function createBundle(sourceFiles, prepends = emptyArray) {
- const node = createBaseNode(315 /* Bundle */);
+ const node = createBaseNode(318 /* Bundle */);
node.prepends = prepends;
node.sourceFiles = sourceFiles;
return node;
@@ -22014,7 +22062,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle(sourceFiles, prepends), node) : node;
}
function createUnparsedSource(prologues, syntheticReferences, texts) {
- const node = createBaseNode(316 /* UnparsedSource */);
+ const node = createBaseNode(319 /* UnparsedSource */);
node.prologues = prologues;
node.syntheticReferences = syntheticReferences;
node.texts = texts;
@@ -22031,48 +22079,48 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createUnparsedPrologue(data) {
- return createBaseUnparsedNode(309 /* UnparsedPrologue */, data);
+ return createBaseUnparsedNode(312 /* UnparsedPrologue */, data);
}
function createUnparsedPrepend(data, texts) {
- const node = createBaseUnparsedNode(310 /* UnparsedPrepend */, data);
+ const node = createBaseUnparsedNode(313 /* UnparsedPrepend */, data);
node.texts = texts;
return node;
}
function createUnparsedTextLike(data, internal) {
- return createBaseUnparsedNode(internal ? 312 /* UnparsedInternalText */ : 311 /* UnparsedText */, data);
+ return createBaseUnparsedNode(internal ? 315 /* UnparsedInternalText */ : 314 /* UnparsedText */, data);
}
function createUnparsedSyntheticReference(section) {
- const node = createBaseNode(313 /* UnparsedSyntheticReference */);
+ const node = createBaseNode(316 /* UnparsedSyntheticReference */);
node.data = section.data;
node.section = section;
return node;
}
function createInputFiles2() {
- const node = createBaseNode(317 /* InputFiles */);
+ const node = createBaseNode(320 /* InputFiles */);
node.javascriptText = "";
node.declarationText = "";
return node;
}
function createSyntheticExpression(type, isSpread = false, tupleNameSource) {
- const node = createBaseNode(238 /* SyntheticExpression */);
+ const node = createBaseNode(240 /* SyntheticExpression */);
node.type = type;
node.isSpread = isSpread;
node.tupleNameSource = tupleNameSource;
return node;
}
function createSyntaxList(children) {
- const node = createBaseNode(357 /* SyntaxList */);
+ const node = createBaseNode(360 /* SyntaxList */);
node._children = children;
return node;
}
function createNotEmittedStatement(original) {
- const node = createBaseNode(358 /* NotEmittedStatement */);
+ const node = createBaseNode(361 /* NotEmittedStatement */);
node.original = original;
setTextRange(node, original);
return node;
}
function createPartiallyEmittedExpression(expression, original) {
- const node = createBaseNode(359 /* PartiallyEmittedExpression */);
+ const node = createBaseNode(362 /* PartiallyEmittedExpression */);
node.expression = expression;
node.original = original;
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -22094,7 +22142,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createCommaListExpression(elements) {
- const node = createBaseNode(360 /* CommaListExpression */);
+ const node = createBaseNode(363 /* CommaListExpression */);
node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
node.transformFlags |= propagateChildrenFlags(node.elements);
return node;
@@ -22103,19 +22151,19 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
}
function createEndOfDeclarationMarker(original) {
- const node = createBaseNode(362 /* EndOfDeclarationMarker */);
+ const node = createBaseNode(365 /* EndOfDeclarationMarker */);
node.emitNode = {};
node.original = original;
return node;
}
function createMergeDeclarationMarker(original) {
- const node = createBaseNode(361 /* MergeDeclarationMarker */);
+ const node = createBaseNode(364 /* MergeDeclarationMarker */);
node.emitNode = {};
node.original = original;
return node;
}
function createSyntheticReferenceExpression(expression, thisArg) {
- const node = createBaseNode(363 /* SyntheticReferenceExpression */);
+ const node = createBaseNode(366 /* SyntheticReferenceExpression */);
node.expression = expression;
node.thisArg = thisArg;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -22128,7 +22176,7 @@ function createNodeFactory(flags, baseFactory2) {
if (node === void 0) {
return node;
}
- const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(314 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
+ const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(317 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
clone2.flags |= node.flags & ~8 /* Synthesized */;
clone2.transformFlags = node.transformFlags;
setOriginalNode(clone2, node);
@@ -22253,17 +22301,17 @@ function createNodeFactory(flags, baseFactory2) {
}
function updateOuterExpression(outerExpression, expression) {
switch (outerExpression.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return updateParenthesizedExpression(outerExpression, expression);
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return updateTypeAssertion(outerExpression, outerExpression.type, expression);
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return updateAsExpression(outerExpression, expression, outerExpression.type);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return updateNonNullExpression(outerExpression, expression);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return updatePartiallyEmittedExpression(outerExpression, expression);
}
}
@@ -22303,13 +22351,13 @@ function createNodeFactory(flags, baseFactory2) {
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
return false;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
const elements = target.elements;
if (elements.length === 0) {
return false;
}
return true;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return target.properties.length > 0;
default:
return true;
@@ -22556,7 +22604,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray(array) : void 0;
@@ -22589,41 +22637,41 @@ function updateWithOriginal(updated, original) {
}
function getDefaultTagNameForKind(kind) {
switch (kind) {
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return "type";
- case 350 /* JSDocReturnTag */:
+ case 353 /* JSDocReturnTag */:
return "returns";
- case 351 /* JSDocThisTag */:
+ case 354 /* JSDocThisTag */:
return "this";
- case 348 /* JSDocEnumTag */:
+ case 351 /* JSDocEnumTag */:
return "enum";
- case 339 /* JSDocAuthorTag */:
+ case 342 /* JSDocAuthorTag */:
return "author";
- case 341 /* JSDocClassTag */:
+ case 344 /* JSDocClassTag */:
return "class";
- case 342 /* JSDocPublicTag */:
+ case 345 /* JSDocPublicTag */:
return "public";
- case 343 /* JSDocPrivateTag */:
+ case 346 /* JSDocPrivateTag */:
return "private";
- case 344 /* JSDocProtectedTag */:
+ case 347 /* JSDocProtectedTag */:
return "protected";
- case 345 /* JSDocReadonlyTag */:
+ case 348 /* JSDocReadonlyTag */:
return "readonly";
- case 346 /* JSDocOverrideTag */:
+ case 349 /* JSDocOverrideTag */:
return "override";
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return "template";
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return "typedef";
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
return "param";
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
return "prop";
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
return "callback";
- case 337 /* JSDocAugmentsTag */:
+ case 340 /* JSDocAugmentsTag */:
return "augments";
- case 338 /* JSDocImplementsTag */:
+ case 341 /* JSDocImplementsTag */:
return "implements";
default:
return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`);
@@ -22696,35 +22744,35 @@ function aggregateChildrenFlags(children) {
children.transformFlags = subtreeFlags;
}
function getTransformFlagsSubtreeExclusions(kind) {
- if (kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */) {
+ if (kind >= 184 /* FirstTypeNode */ && kind <= 207 /* LastTypeNode */) {
return -2 /* TypeExcludes */;
}
switch (kind) {
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 211 /* ArrayLiteralExpression */:
return -2147450880 /* ArrayLiteralOrCallOrNewExcludes */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return -1941676032 /* ModuleExcludes */;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return -2147483648 /* ParameterExcludes */;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return -2072174592 /* ArrowFunctionExcludes */;
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
return -1937940480 /* FunctionExcludes */;
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return -2146893824 /* VariableDeclarationListExcludes */;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return -2147344384 /* ClassExcludes */;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return -1937948672 /* ConstructorExcludes */;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return -2013249536 /* PropertyExcludes */;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return -2005057536 /* MethodOrAccessorExcludes */;
case 132 /* AnyKeyword */:
case 149 /* NumberKeyword */:
@@ -22735,31 +22783,31 @@ function getTransformFlagsSubtreeExclusions(kind) {
case 135 /* BooleanKeyword */:
case 154 /* SymbolKeyword */:
case 115 /* VoidKeyword */:
- case 167 /* TypeParameter */:
- case 170 /* PropertySignature */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 168 /* TypeParameter */:
+ case 171 /* PropertySignature */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return -2 /* TypeExcludes */;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return -2147278848 /* ObjectLiteralExcludes */;
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return -2147418112 /* CatchClauseExcludes */;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return -2147450880 /* BindingPatternExcludes */;
- case 216 /* TypeAssertionExpression */:
- case 239 /* SatisfiesExpression */:
- case 235 /* AsExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 241 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 219 /* ParenthesizedExpression */:
case 107 /* SuperKeyword */:
return -2147483648 /* OuterExpressionExcludes */;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return -2147483648 /* PropertyAccessExcludes */;
default:
return -2147483648 /* NodeExcludes */;
@@ -23060,7 +23108,7 @@ function getOrCreateEmitNode(node) {
var _a2;
if (!node.emitNode) {
if (isParseTreeNode(node)) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return node.emitNode = { annotatedNodes: [node] };
}
const sourceFile = (_a2 = getSourceFileOfNode(getParseTreeNode(getSourceFileOfNode(node)))) != null ? _a2 : Debug.fail("Could not determine parsed source file.");
@@ -24059,589 +24107,595 @@ function isImportKeyword(node) {
return node.kind === 101 /* ImportKeyword */;
}
function isQualifiedName(node) {
- return node.kind === 165 /* QualifiedName */;
+ return node.kind === 166 /* QualifiedName */;
}
function isComputedPropertyName(node) {
- return node.kind === 166 /* ComputedPropertyName */;
+ return node.kind === 167 /* ComputedPropertyName */;
}
function isTypeParameterDeclaration(node) {
- return node.kind === 167 /* TypeParameter */;
+ return node.kind === 168 /* TypeParameter */;
}
function isParameter(node) {
- return node.kind === 168 /* Parameter */;
+ return node.kind === 169 /* Parameter */;
}
function isDecoratorOrAnnotation(node) {
- return node.kind === 169 /* Decorator */;
+ return node.kind === 170 /* Decorator */;
}
function isDecorator(node) {
- return node.kind === 169 /* Decorator */ && node.annotationDeclaration === void 0;
+ return node.kind === 170 /* Decorator */ && node.annotationDeclaration === void 0;
}
function isAnnotation(node) {
- return node.kind === 169 /* Decorator */ && node.annotationDeclaration !== void 0;
+ return node.kind === 170 /* Decorator */ && node.annotationDeclaration !== void 0;
}
function isPropertySignature(node) {
- return node.kind === 170 /* PropertySignature */;
+ return node.kind === 171 /* PropertySignature */;
+}
+function isOverloadPropertyDeclaration(node) {
+ return node.kind === 174 /* OverloadPropertyDeclaration */;
}
function isPropertyDeclaration(node) {
- return node.kind === 171 /* PropertyDeclaration */;
+ return node.kind === 172 /* PropertyDeclaration */;
}
function isAnnotationPropertyDeclaration(node) {
- return node.kind === 172 /* AnnotationPropertyDeclaration */;
+ return node.kind === 173 /* AnnotationPropertyDeclaration */;
}
function isMethodSignature(node) {
- return node.kind === 173 /* MethodSignature */;
+ return node.kind === 175 /* MethodSignature */;
}
function isMethodDeclaration(node) {
- return node.kind === 174 /* MethodDeclaration */;
+ return node.kind === 176 /* MethodDeclaration */;
}
function isClassStaticBlockDeclaration(node) {
- return node.kind === 175 /* ClassStaticBlockDeclaration */;
+ return node.kind === 177 /* ClassStaticBlockDeclaration */;
}
function isConstructorDeclaration(node) {
- return node.kind === 176 /* Constructor */;
+ return node.kind === 178 /* Constructor */;
}
function isGetAccessorDeclaration(node) {
- return node.kind === 177 /* GetAccessor */;
+ return node.kind === 179 /* GetAccessor */;
}
function isSetAccessorDeclaration(node) {
- return node.kind === 178 /* SetAccessor */;
+ return node.kind === 180 /* SetAccessor */;
}
function isCallSignatureDeclaration(node) {
- return node.kind === 179 /* CallSignature */;
+ return node.kind === 181 /* CallSignature */;
}
function isConstructSignatureDeclaration(node) {
- return node.kind === 180 /* ConstructSignature */;
+ return node.kind === 182 /* ConstructSignature */;
}
function isIndexSignatureDeclaration(node) {
- return node.kind === 181 /* IndexSignature */;
+ return node.kind === 183 /* IndexSignature */;
}
function isTypePredicateNode(node) {
- return node.kind === 182 /* TypePredicate */;
+ return node.kind === 184 /* TypePredicate */;
}
function isTypeReferenceNode(node) {
- return node.kind === 183 /* TypeReference */;
+ return node.kind === 185 /* TypeReference */;
}
function isFunctionTypeNode(node) {
- return node.kind === 184 /* FunctionType */;
+ return node.kind === 186 /* FunctionType */;
}
function isConstructorTypeNode(node) {
- return node.kind === 185 /* ConstructorType */;
+ return node.kind === 187 /* ConstructorType */;
}
function isTypeQueryNode(node) {
- return node.kind === 186 /* TypeQuery */;
+ return node.kind === 188 /* TypeQuery */;
}
function isTypeLiteralNode(node) {
- return node.kind === 187 /* TypeLiteral */;
+ return node.kind === 189 /* TypeLiteral */;
}
function isArrayTypeNode(node) {
- return node.kind === 188 /* ArrayType */;
+ return node.kind === 190 /* ArrayType */;
}
function isTupleTypeNode(node) {
- return node.kind === 189 /* TupleType */;
+ return node.kind === 191 /* TupleType */;
}
function isNamedTupleMember(node) {
- return node.kind === 202 /* NamedTupleMember */;
+ return node.kind === 204 /* NamedTupleMember */;
}
function isOptionalTypeNode(node) {
- return node.kind === 190 /* OptionalType */;
+ return node.kind === 192 /* OptionalType */;
}
function isRestTypeNode(node) {
- return node.kind === 191 /* RestType */;
+ return node.kind === 193 /* RestType */;
}
function isUnionTypeNode(node) {
- return node.kind === 192 /* UnionType */;
+ return node.kind === 194 /* UnionType */;
}
function isIntersectionTypeNode(node) {
- return node.kind === 193 /* IntersectionType */;
+ return node.kind === 195 /* IntersectionType */;
}
function isConditionalTypeNode(node) {
- return node.kind === 194 /* ConditionalType */;
+ return node.kind === 196 /* ConditionalType */;
}
function isInferTypeNode(node) {
- return node.kind === 195 /* InferType */;
+ return node.kind === 197 /* InferType */;
}
function isParenthesizedTypeNode(node) {
- return node.kind === 196 /* ParenthesizedType */;
+ return node.kind === 198 /* ParenthesizedType */;
}
function isThisTypeNode(node) {
- return node.kind === 197 /* ThisType */;
+ return node.kind === 199 /* ThisType */;
}
function isTypeOperatorNode(node) {
- return node.kind === 198 /* TypeOperator */;
+ return node.kind === 200 /* TypeOperator */;
}
function isIndexedAccessTypeNode(node) {
- return node.kind === 199 /* IndexedAccessType */;
+ return node.kind === 201 /* IndexedAccessType */;
}
function isMappedTypeNode(node) {
- return node.kind === 200 /* MappedType */;
+ return node.kind === 202 /* MappedType */;
}
function isLiteralTypeNode(node) {
- return node.kind === 201 /* LiteralType */;
+ return node.kind === 203 /* LiteralType */;
}
function isImportTypeNode(node) {
- return node.kind === 205 /* ImportType */;
+ return node.kind === 207 /* ImportType */;
}
function isTemplateLiteralTypeSpan(node) {
- return node.kind === 204 /* TemplateLiteralTypeSpan */;
+ return node.kind === 206 /* TemplateLiteralTypeSpan */;
}
function isTemplateLiteralTypeNode(node) {
- return node.kind === 203 /* TemplateLiteralType */;
+ return node.kind === 205 /* TemplateLiteralType */;
}
function isObjectBindingPattern(node) {
- return node.kind === 206 /* ObjectBindingPattern */;
+ return node.kind === 208 /* ObjectBindingPattern */;
}
function isArrayBindingPattern(node) {
- return node.kind === 207 /* ArrayBindingPattern */;
+ return node.kind === 209 /* ArrayBindingPattern */;
}
function isBindingElement(node) {
- return node.kind === 208 /* BindingElement */;
+ return node.kind === 210 /* BindingElement */;
}
function isArrayLiteralExpression(node) {
- return node.kind === 209 /* ArrayLiteralExpression */;
+ return node.kind === 211 /* ArrayLiteralExpression */;
}
function isObjectLiteralExpression(node) {
- return node.kind === 210 /* ObjectLiteralExpression */;
+ return node.kind === 212 /* ObjectLiteralExpression */;
}
function isPropertyAccessExpression(node) {
- return node.kind === 211 /* PropertyAccessExpression */;
+ return node.kind === 213 /* PropertyAccessExpression */;
}
function isElementAccessExpression(node) {
- return node.kind === 212 /* ElementAccessExpression */;
+ return node.kind === 214 /* ElementAccessExpression */;
}
function isCallExpression(node) {
- return node.kind === 213 /* CallExpression */;
+ return node.kind === 215 /* CallExpression */;
}
function isNewExpression(node) {
- return node.kind === 214 /* NewExpression */;
+ return node.kind === 216 /* NewExpression */;
}
function isTaggedTemplateExpression(node) {
- return node.kind === 215 /* TaggedTemplateExpression */;
+ return node.kind === 217 /* TaggedTemplateExpression */;
}
function isTypeAssertionExpression(node) {
- return node.kind === 216 /* TypeAssertionExpression */;
+ return node.kind === 218 /* TypeAssertionExpression */;
}
function isParenthesizedExpression(node) {
- return node.kind === 217 /* ParenthesizedExpression */;
+ return node.kind === 219 /* ParenthesizedExpression */;
}
function isFunctionExpression(node) {
- return node.kind === 218 /* FunctionExpression */;
+ return node.kind === 220 /* FunctionExpression */;
}
function isEtsComponentExpression(node) {
- return node.kind === 220 /* EtsComponentExpression */;
+ return node.kind === 222 /* EtsComponentExpression */;
}
function isArrowFunction(node) {
- return node.kind === 219 /* ArrowFunction */;
+ return node.kind === 221 /* ArrowFunction */;
}
function isDeleteExpression(node) {
- return node.kind === 221 /* DeleteExpression */;
+ return node.kind === 223 /* DeleteExpression */;
}
function isTypeOfExpression(node) {
- return node.kind === 222 /* TypeOfExpression */;
+ return node.kind === 224 /* TypeOfExpression */;
}
function isVoidExpression(node) {
- return node.kind === 223 /* VoidExpression */;
+ return node.kind === 225 /* VoidExpression */;
}
function isAwaitExpression(node) {
- return node.kind === 224 /* AwaitExpression */;
+ return node.kind === 226 /* AwaitExpression */;
}
function isPrefixUnaryExpression(node) {
- return node.kind === 225 /* PrefixUnaryExpression */;
+ return node.kind === 227 /* PrefixUnaryExpression */;
}
function isPostfixUnaryExpression(node) {
- return node.kind === 226 /* PostfixUnaryExpression */;
+ return node.kind === 228 /* PostfixUnaryExpression */;
}
function isBinaryExpression(node) {
- return node.kind === 227 /* BinaryExpression */;
+ return node.kind === 229 /* BinaryExpression */;
}
function isConditionalExpression(node) {
- return node.kind === 228 /* ConditionalExpression */;
+ return node.kind === 230 /* ConditionalExpression */;
}
function isTemplateExpression(node) {
- return node.kind === 229 /* TemplateExpression */;
+ return node.kind === 231 /* TemplateExpression */;
}
function isYieldExpression(node) {
- return node.kind === 230 /* YieldExpression */;
+ return node.kind === 232 /* YieldExpression */;
}
function isSpreadElement(node) {
- return node.kind === 231 /* SpreadElement */;
+ return node.kind === 233 /* SpreadElement */;
}
function isClassExpression(node) {
- return node.kind === 232 /* ClassExpression */;
+ return node.kind === 234 /* ClassExpression */;
}
function isOmittedExpression(node) {
- return node.kind === 233 /* OmittedExpression */;
+ return node.kind === 235 /* OmittedExpression */;
}
function isExpressionWithTypeArguments(node) {
- return node.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.kind === 236 /* ExpressionWithTypeArguments */;
}
function isAsExpression(node) {
- return node.kind === 235 /* AsExpression */;
+ return node.kind === 237 /* AsExpression */;
}
function isSatisfiesExpression(node) {
- return node.kind === 239 /* SatisfiesExpression */;
+ return node.kind === 241 /* SatisfiesExpression */;
}
function isNonNullExpression(node) {
- return node.kind === 236 /* NonNullExpression */;
+ return node.kind === 238 /* NonNullExpression */;
}
function isMetaProperty(node) {
- return node.kind === 237 /* MetaProperty */;
+ return node.kind === 239 /* MetaProperty */;
}
function isSyntheticExpression(node) {
- return node.kind === 238 /* SyntheticExpression */;
+ return node.kind === 240 /* SyntheticExpression */;
}
function isPartiallyEmittedExpression(node) {
- return node.kind === 359 /* PartiallyEmittedExpression */;
+ return node.kind === 362 /* PartiallyEmittedExpression */;
}
function isCommaListExpression(node) {
- return node.kind === 360 /* CommaListExpression */;
+ return node.kind === 363 /* CommaListExpression */;
}
function isTemplateSpan(node) {
- return node.kind === 240 /* TemplateSpan */;
+ return node.kind === 242 /* TemplateSpan */;
}
function isSemicolonClassElement(node) {
- return node.kind === 241 /* SemicolonClassElement */;
+ return node.kind === 243 /* SemicolonClassElement */;
}
function isBlock(node) {
- return node.kind === 242 /* Block */;
+ return node.kind === 244 /* Block */;
}
function isVariableStatement(node) {
- return node.kind === 244 /* VariableStatement */;
+ return node.kind === 246 /* VariableStatement */;
}
function isEmptyStatement(node) {
- return node.kind === 243 /* EmptyStatement */;
+ return node.kind === 245 /* EmptyStatement */;
}
function isExpressionStatement(node) {
- return node.kind === 245 /* ExpressionStatement */;
+ return node.kind === 247 /* ExpressionStatement */;
}
function isIfStatement(node) {
- return node.kind === 246 /* IfStatement */;
+ return node.kind === 248 /* IfStatement */;
}
function isDoStatement(node) {
- return node.kind === 247 /* DoStatement */;
+ return node.kind === 249 /* DoStatement */;
}
function isWhileStatement(node) {
- return node.kind === 248 /* WhileStatement */;
+ return node.kind === 250 /* WhileStatement */;
}
function isForStatement(node) {
- return node.kind === 249 /* ForStatement */;
+ return node.kind === 251 /* ForStatement */;
}
function isForInStatement(node) {
- return node.kind === 250 /* ForInStatement */;
+ return node.kind === 252 /* ForInStatement */;
}
function isForOfStatement(node) {
- return node.kind === 251 /* ForOfStatement */;
+ return node.kind === 253 /* ForOfStatement */;
}
function isContinueStatement(node) {
- return node.kind === 252 /* ContinueStatement */;
+ return node.kind === 254 /* ContinueStatement */;
}
function isBreakStatement(node) {
- return node.kind === 253 /* BreakStatement */;
+ return node.kind === 255 /* BreakStatement */;
}
function isReturnStatement(node) {
- return node.kind === 254 /* ReturnStatement */;
+ return node.kind === 256 /* ReturnStatement */;
}
function isWithStatement(node) {
- return node.kind === 255 /* WithStatement */;
+ return node.kind === 257 /* WithStatement */;
}
function isSwitchStatement(node) {
- return node.kind === 256 /* SwitchStatement */;
+ return node.kind === 258 /* SwitchStatement */;
}
function isLabeledStatement(node) {
- return node.kind === 257 /* LabeledStatement */;
+ return node.kind === 259 /* LabeledStatement */;
}
function isThrowStatement(node) {
- return node.kind === 258 /* ThrowStatement */;
+ return node.kind === 260 /* ThrowStatement */;
}
function isTryStatement(node) {
- return node.kind === 259 /* TryStatement */;
+ return node.kind === 261 /* TryStatement */;
}
function isDebuggerStatement(node) {
- return node.kind === 260 /* DebuggerStatement */;
+ return node.kind === 262 /* DebuggerStatement */;
}
function isVariableDeclaration(node) {
- return node.kind === 261 /* VariableDeclaration */;
+ return node.kind === 263 /* VariableDeclaration */;
}
function isVariableDeclarationList(node) {
- return node.kind === 262 /* VariableDeclarationList */;
+ return node.kind === 264 /* VariableDeclarationList */;
}
function isFunctionDeclaration(node) {
- return node.kind === 263 /* FunctionDeclaration */;
+ return node.kind === 265 /* FunctionDeclaration */;
}
function isClassDeclaration(node) {
- return node.kind === 264 /* ClassDeclaration */;
+ return node.kind === 266 /* ClassDeclaration */;
}
function isStructDeclaration(node) {
- return node.kind === 265 /* StructDeclaration */;
+ return node.kind === 267 /* StructDeclaration */;
}
function isAnnotationDeclaration(node) {
- return node.kind === 266 /* AnnotationDeclaration */;
+ return node.kind === 268 /* AnnotationDeclaration */;
+}
+function isOverloadDeclaration(node) {
+ return node.kind === 269 /* OverloadDeclaration */;
}
function isInterfaceDeclaration(node) {
- return node.kind === 267 /* InterfaceDeclaration */;
+ return node.kind === 270 /* InterfaceDeclaration */;
}
function isTypeAliasDeclaration(node) {
- return node.kind === 268 /* TypeAliasDeclaration */;
+ return node.kind === 271 /* TypeAliasDeclaration */;
}
function isEnumDeclaration(node) {
- return node.kind === 269 /* EnumDeclaration */;
+ return node.kind === 272 /* EnumDeclaration */;
}
function isModuleDeclaration(node) {
- return node.kind === 270 /* ModuleDeclaration */;
+ return node.kind === 273 /* ModuleDeclaration */;
}
function isModuleBlock(node) {
- return node.kind === 271 /* ModuleBlock */;
+ return node.kind === 274 /* ModuleBlock */;
}
function isCaseBlock(node) {
- return node.kind === 272 /* CaseBlock */;
+ return node.kind === 275 /* CaseBlock */;
}
function isNamespaceExportDeclaration(node) {
- return node.kind === 273 /* NamespaceExportDeclaration */;
+ return node.kind === 276 /* NamespaceExportDeclaration */;
}
function isImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */;
+ return node.kind === 277 /* ImportEqualsDeclaration */;
}
function isImportDeclaration(node) {
- return node.kind === 275 /* ImportDeclaration */;
+ return node.kind === 278 /* ImportDeclaration */;
}
function isImportClause(node) {
- return node.kind === 276 /* ImportClause */;
+ return node.kind === 279 /* ImportClause */;
}
function isImportTypeAssertionContainer(node) {
- return node.kind === 304 /* ImportTypeAssertionContainer */;
+ return node.kind === 307 /* ImportTypeAssertionContainer */;
}
function isAssertClause(node) {
- return node.kind === 302 /* AssertClause */;
+ return node.kind === 305 /* AssertClause */;
}
function isAssertEntry(node) {
- return node.kind === 303 /* AssertEntry */;
+ return node.kind === 306 /* AssertEntry */;
}
function isNamespaceImport(node) {
- return node.kind === 277 /* NamespaceImport */;
+ return node.kind === 280 /* NamespaceImport */;
}
function isNamespaceExport(node) {
- return node.kind === 283 /* NamespaceExport */;
+ return node.kind === 286 /* NamespaceExport */;
}
function isNamedImports(node) {
- return node.kind === 278 /* NamedImports */;
+ return node.kind === 281 /* NamedImports */;
}
function isImportSpecifier(node) {
- return node.kind === 279 /* ImportSpecifier */;
+ return node.kind === 282 /* ImportSpecifier */;
}
function isExportAssignment(node) {
- return node.kind === 280 /* ExportAssignment */;
+ return node.kind === 283 /* ExportAssignment */;
}
function isExportDeclaration(node) {
- return node.kind === 281 /* ExportDeclaration */;
+ return node.kind === 284 /* ExportDeclaration */;
}
function isNamedExports(node) {
- return node.kind === 282 /* NamedExports */;
+ return node.kind === 285 /* NamedExports */;
}
function isExportSpecifier(node) {
- return node.kind === 284 /* ExportSpecifier */;
+ return node.kind === 287 /* ExportSpecifier */;
}
function isMissingDeclaration(node) {
- return node.kind === 285 /* MissingDeclaration */;
+ return node.kind === 288 /* MissingDeclaration */;
}
function isNotEmittedStatement(node) {
- return node.kind === 358 /* NotEmittedStatement */;
+ return node.kind === 361 /* NotEmittedStatement */;
}
function isSyntheticReference(node) {
- return node.kind === 363 /* SyntheticReferenceExpression */;
+ return node.kind === 366 /* SyntheticReferenceExpression */;
}
function isMergeDeclarationMarker(node) {
- return node.kind === 361 /* MergeDeclarationMarker */;
+ return node.kind === 364 /* MergeDeclarationMarker */;
}
function isEndOfDeclarationMarker(node) {
- return node.kind === 362 /* EndOfDeclarationMarker */;
+ return node.kind === 365 /* EndOfDeclarationMarker */;
}
function isExternalModuleReference(node) {
- return node.kind === 286 /* ExternalModuleReference */;
+ return node.kind === 289 /* ExternalModuleReference */;
}
function isJsxElement(node) {
- return node.kind === 287 /* JsxElement */;
+ return node.kind === 290 /* JsxElement */;
}
function isJsxSelfClosingElement(node) {
- return node.kind === 288 /* JsxSelfClosingElement */;
+ return node.kind === 291 /* JsxSelfClosingElement */;
}
function isJsxOpeningElement(node) {
- return node.kind === 289 /* JsxOpeningElement */;
+ return node.kind === 292 /* JsxOpeningElement */;
}
function isJsxClosingElement(node) {
- return node.kind === 290 /* JsxClosingElement */;
+ return node.kind === 293 /* JsxClosingElement */;
}
function isJsxFragment(node) {
- return node.kind === 291 /* JsxFragment */;
+ return node.kind === 294 /* JsxFragment */;
}
function isJsxOpeningFragment(node) {
- return node.kind === 292 /* JsxOpeningFragment */;
+ return node.kind === 295 /* JsxOpeningFragment */;
}
function isJsxClosingFragment(node) {
- return node.kind === 293 /* JsxClosingFragment */;
+ return node.kind === 296 /* JsxClosingFragment */;
}
function isJsxAttribute(node) {
- return node.kind === 294 /* JsxAttribute */;
+ return node.kind === 297 /* JsxAttribute */;
}
function isJsxAttributes(node) {
- return node.kind === 295 /* JsxAttributes */;
+ return node.kind === 298 /* JsxAttributes */;
}
function isJsxSpreadAttribute(node) {
- return node.kind === 296 /* JsxSpreadAttribute */;
+ return node.kind === 299 /* JsxSpreadAttribute */;
}
function isJsxExpression(node) {
- return node.kind === 297 /* JsxExpression */;
+ return node.kind === 300 /* JsxExpression */;
}
function isCaseClause(node) {
- return node.kind === 298 /* CaseClause */;
+ return node.kind === 301 /* CaseClause */;
}
function isDefaultClause(node) {
- return node.kind === 299 /* DefaultClause */;
+ return node.kind === 302 /* DefaultClause */;
}
function isHeritageClause(node) {
- return node.kind === 300 /* HeritageClause */;
+ return node.kind === 303 /* HeritageClause */;
}
function isCatchClause(node) {
- return node.kind === 301 /* CatchClause */;
+ return node.kind === 304 /* CatchClause */;
}
function isPropertyAssignment(node) {
- return node.kind === 305 /* PropertyAssignment */;
+ return node.kind === 308 /* PropertyAssignment */;
}
function isShorthandPropertyAssignment(node) {
- return node.kind === 306 /* ShorthandPropertyAssignment */;
+ return node.kind === 309 /* ShorthandPropertyAssignment */;
}
function isSpreadAssignment(node) {
- return node.kind === 307 /* SpreadAssignment */;
+ return node.kind === 310 /* SpreadAssignment */;
}
function isEnumMember(node) {
- return node.kind === 308 /* EnumMember */;
+ return node.kind === 311 /* EnumMember */;
}
function isUnparsedPrepend(node) {
- return node.kind === 310 /* UnparsedPrepend */;
+ return node.kind === 313 /* UnparsedPrepend */;
}
function isSourceFile(node) {
- return node.kind === 314 /* SourceFile */;
+ return node.kind === 317 /* SourceFile */;
}
function isBundle(node) {
- return node.kind === 315 /* Bundle */;
+ return node.kind === 318 /* Bundle */;
}
function isUnparsedSource(node) {
- return node.kind === 316 /* UnparsedSource */;
+ return node.kind === 319 /* UnparsedSource */;
}
function isJSDocTypeExpression(node) {
- return node.kind === 318 /* JSDocTypeExpression */;
+ return node.kind === 321 /* JSDocTypeExpression */;
}
function isJSDocNameReference(node) {
- return node.kind === 319 /* JSDocNameReference */;
+ return node.kind === 322 /* JSDocNameReference */;
}
function isJSDocMemberName(node) {
- return node.kind === 320 /* JSDocMemberName */;
+ return node.kind === 323 /* JSDocMemberName */;
}
function isJSDocLink(node) {
- return node.kind === 333 /* JSDocLink */;
+ return node.kind === 336 /* JSDocLink */;
}
function isJSDocLinkCode(node) {
- return node.kind === 334 /* JSDocLinkCode */;
+ return node.kind === 337 /* JSDocLinkCode */;
}
function isJSDocLinkPlain(node) {
- return node.kind === 335 /* JSDocLinkPlain */;
+ return node.kind === 338 /* JSDocLinkPlain */;
}
function isJSDocAllType(node) {
- return node.kind === 321 /* JSDocAllType */;
+ return node.kind === 324 /* JSDocAllType */;
}
function isJSDocUnknownType(node) {
- return node.kind === 322 /* JSDocUnknownType */;
+ return node.kind === 325 /* JSDocUnknownType */;
}
function isJSDocNullableType(node) {
- return node.kind === 323 /* JSDocNullableType */;
+ return node.kind === 326 /* JSDocNullableType */;
}
function isJSDocNonNullableType(node) {
- return node.kind === 324 /* JSDocNonNullableType */;
+ return node.kind === 327 /* JSDocNonNullableType */;
}
function isJSDocOptionalType(node) {
- return node.kind === 325 /* JSDocOptionalType */;
+ return node.kind === 328 /* JSDocOptionalType */;
}
function isJSDocFunctionType(node) {
- return node.kind === 326 /* JSDocFunctionType */;
+ return node.kind === 329 /* JSDocFunctionType */;
}
function isJSDocVariadicType(node) {
- return node.kind === 327 /* JSDocVariadicType */;
+ return node.kind === 330 /* JSDocVariadicType */;
}
function isJSDocNamepathType(node) {
- return node.kind === 328 /* JSDocNamepathType */;
+ return node.kind === 331 /* JSDocNamepathType */;
}
function isJSDoc(node) {
- return node.kind === 329 /* JSDoc */;
+ return node.kind === 332 /* JSDoc */;
}
function isJSDocTypeLiteral(node) {
- return node.kind === 331 /* JSDocTypeLiteral */;
+ return node.kind === 334 /* JSDocTypeLiteral */;
}
function isJSDocSignature(node) {
- return node.kind === 332 /* JSDocSignature */;
+ return node.kind === 335 /* JSDocSignature */;
}
function isJSDocAugmentsTag(node) {
- return node.kind === 337 /* JSDocAugmentsTag */;
+ return node.kind === 340 /* JSDocAugmentsTag */;
}
function isJSDocAuthorTag(node) {
- return node.kind === 339 /* JSDocAuthorTag */;
+ return node.kind === 342 /* JSDocAuthorTag */;
}
function isJSDocClassTag(node) {
- return node.kind === 341 /* JSDocClassTag */;
+ return node.kind === 344 /* JSDocClassTag */;
}
function isJSDocCallbackTag(node) {
- return node.kind === 347 /* JSDocCallbackTag */;
+ return node.kind === 350 /* JSDocCallbackTag */;
}
function isJSDocPublicTag(node) {
- return node.kind === 342 /* JSDocPublicTag */;
+ return node.kind === 345 /* JSDocPublicTag */;
}
function isJSDocPrivateTag(node) {
- return node.kind === 343 /* JSDocPrivateTag */;
+ return node.kind === 346 /* JSDocPrivateTag */;
}
function isJSDocProtectedTag(node) {
- return node.kind === 344 /* JSDocProtectedTag */;
+ return node.kind === 347 /* JSDocProtectedTag */;
}
function isJSDocReadonlyTag(node) {
- return node.kind === 345 /* JSDocReadonlyTag */;
+ return node.kind === 348 /* JSDocReadonlyTag */;
}
function isJSDocOverrideTag(node) {
- return node.kind === 346 /* JSDocOverrideTag */;
+ return node.kind === 349 /* JSDocOverrideTag */;
}
function isJSDocDeprecatedTag(node) {
- return node.kind === 340 /* JSDocDeprecatedTag */;
+ return node.kind === 343 /* JSDocDeprecatedTag */;
}
function isJSDocSeeTag(node) {
- return node.kind === 355 /* JSDocSeeTag */;
+ return node.kind === 358 /* JSDocSeeTag */;
}
function isJSDocEnumTag(node) {
- return node.kind === 348 /* JSDocEnumTag */;
+ return node.kind === 351 /* JSDocEnumTag */;
}
function isJSDocParameterTag(node) {
- return node.kind === 349 /* JSDocParameterTag */;
+ return node.kind === 352 /* JSDocParameterTag */;
}
function isJSDocReturnTag(node) {
- return node.kind === 350 /* JSDocReturnTag */;
+ return node.kind === 353 /* JSDocReturnTag */;
}
function isJSDocThisTag(node) {
- return node.kind === 351 /* JSDocThisTag */;
+ return node.kind === 354 /* JSDocThisTag */;
}
function isJSDocTypeTag(node) {
- return node.kind === 352 /* JSDocTypeTag */;
+ return node.kind === 355 /* JSDocTypeTag */;
}
function isJSDocTemplateTag(node) {
- return node.kind === 353 /* JSDocTemplateTag */;
+ return node.kind === 356 /* JSDocTemplateTag */;
}
function isJSDocTypedefTag(node) {
- return node.kind === 354 /* JSDocTypedefTag */;
+ return node.kind === 357 /* JSDocTypedefTag */;
}
function isJSDocUnknownTag(node) {
- return node.kind === 336 /* JSDocTag */;
+ return node.kind === 339 /* JSDocTag */;
}
function isJSDocPropertyTag(node) {
- return node.kind === 356 /* JSDocPropertyTag */;
+ return node.kind === 359 /* JSDocPropertyTag */;
}
function isJSDocImplementsTag(node) {
- return node.kind === 338 /* JSDocImplementsTag */;
+ return node.kind === 341 /* JSDocImplementsTag */;
}
function isSyntaxList(n) {
- return n.kind === 357 /* SyntaxList */;
+ return n.kind === 360 /* SyntaxList */;
}
// src/compiler/factory/utilities.ts
@@ -24885,14 +24939,14 @@ function createExpressionForObjectLiteralElementLike(factory2, node, property, r
Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals.");
}
switch (property.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return createExpressionForAccessorDeclaration(factory2, node.properties, property, receiver, !!node.multiLine);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return createExpressionForPropertyAssignment(factory2, property, receiver);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return createExpressionForShorthandPropertyAssignment(factory2, property, receiver);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return createExpressionForMethodDeclaration(factory2, property, receiver);
}
}
@@ -24945,7 +24999,7 @@ function startsWithUseStrict(statements) {
return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement);
}
function isCommaSequence(node) {
- return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 360 /* CommaListExpression */;
+ return node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 363 /* CommaListExpression */;
}
function isJSDocTypeAssertion(node) {
return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
@@ -24957,18 +25011,18 @@ function getJSDocTypeAssertionType(node) {
}
function isOuterExpression(node, kinds = 15 /* All */) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
if (kinds & 16 /* ExcludeJSDocTypeAssertion */ && isJSDocTypeAssertion(node)) {
return false;
}
return (kinds & 1 /* Parentheses */) !== 0;
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
- case 239 /* SatisfiesExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
+ case 241 /* SatisfiesExpression */:
return (kinds & 2 /* TypeAssertions */) !== 0;
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return (kinds & 4 /* NonNullAssertions */) !== 0;
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
}
return false;
@@ -25074,10 +25128,10 @@ function getLocalNameForExternalImport(factory2, node, sourceFile) {
const name = namespaceDeclaration.name;
return isGeneratedIdentifier(name) ? name : factory2.createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name) || idText(name));
}
- if (node.kind === 275 /* ImportDeclaration */ && node.importClause) {
+ if (node.kind === 278 /* ImportDeclaration */ && node.importClause) {
return factory2.getGeneratedNameForNode(node);
}
- if (node.kind === 281 /* ExportDeclaration */ && node.moduleSpecifier) {
+ if (node.kind === 284 /* ExportDeclaration */ && node.moduleSpecifier) {
return factory2.getGeneratedNameForNode(node);
}
return void 0;
@@ -25132,11 +25186,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) {
}
if (isObjectLiteralElementLike(bindingElement)) {
switch (bindingElement.kind) {
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return bindingElement.name;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return getTargetOfBindingOrAssignmentElement(bindingElement.expression);
}
}
@@ -25150,11 +25204,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) {
}
function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
return bindingElement.dotDotDotToken;
- case 231 /* SpreadElement */:
- case 307 /* SpreadAssignment */:
+ case 233 /* SpreadElement */:
+ case 310 /* SpreadAssignment */:
return bindingElement;
}
return void 0;
@@ -25166,7 +25220,7 @@ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) {
}
function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
if (bindingElement.propertyName) {
const propertyName = bindingElement.propertyName;
if (isPrivateIdentifier(propertyName)) {
@@ -25175,7 +25229,7 @@ function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName;
}
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (bindingElement.name) {
const propertyName = bindingElement.name;
if (isPrivateIdentifier(propertyName)) {
@@ -25184,7 +25238,7 @@ function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName;
}
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
if (bindingElement.name && isPrivateIdentifier(bindingElement.name)) {
return Debug.failBadSyntaxKind(bindingElement.name);
}
@@ -25201,11 +25255,11 @@ function isStringOrNumericLiteral(node) {
}
function getElementsOfBindingOrAssignmentPattern(name) {
switch (name.kind) {
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return name.elements;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return name.properties;
}
}
@@ -25222,19 +25276,19 @@ function getJSDocTypeAliasName(fullName) {
}
function canHaveIllegalType(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 178 /* SetAccessor */;
+ return kind === 178 /* Constructor */ || kind === 180 /* SetAccessor */;
}
function canHaveIllegalTypeParameters(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function canHaveIllegalDecorators(node) {
const kind = node.kind;
- return kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 263 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 285 /* MissingDeclaration */ || kind === 244 /* VariableStatement */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 280 /* ExportAssignment */;
+ return kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 265 /* FunctionDeclaration */ || kind === 178 /* Constructor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 288 /* MissingDeclaration */ || kind === 246 /* VariableStatement */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 283 /* ExportAssignment */;
}
function canHaveIllegalModifiers(node) {
const kind = node.kind;
- return kind === 175 /* ClassStaticBlockDeclaration */ || kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 184 /* FunctionType */ || kind === 285 /* MissingDeclaration */ || kind === 273 /* NamespaceExportDeclaration */;
+ return kind === 177 /* ClassStaticBlockDeclaration */ || kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 186 /* FunctionType */ || kind === 288 /* MissingDeclaration */ || kind === 276 /* NamespaceExportDeclaration */;
}
var isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration);
var isQuestionOrExclamationToken = or(isQuestionToken, isExclamationToken);
@@ -25520,11 +25574,11 @@ function setTextRange(range, location) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 167 /* TypeParameter */ || kind === 168 /* Parameter */ || kind === 170 /* PropertySignature */ || kind === 171 /* PropertyDeclaration */ || kind === 173 /* MethodSignature */ || kind === 174 /* MethodDeclaration */ || kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 185 /* ConstructorType */ || kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || kind === 232 /* ClassExpression */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 244 /* VariableStatement */ || kind === 263 /* FunctionDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 280 /* ExportAssignment */ || kind === 281 /* ExportDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 168 /* Parameter */ || kind === 171 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 232 /* ClassExpression */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* StructDeclaration */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */;
}
// src/compiler/parser.ts
@@ -25594,430 +25648,434 @@ function isImportMeta2(node) {
return isMetaProperty(node) && node.keywordToken === 101 /* ImportKeyword */ && node.name.escapedText === "meta";
}
var forEachChildTable = {
- [165 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) {
+ [166 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right);
},
- [167 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) {
+ [168 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression);
},
- [306 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) {
+ [309 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer);
},
- [307 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) {
+ [310 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [168 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) {
+ [169 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [171 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) {
+ [172 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [172 /* AnnotationPropertyDeclaration */]: function forEachChildInAnnotationPropertyDeclaration(node, cbNode, _cbNodes) {
+ [173 /* AnnotationPropertyDeclaration */]: function forEachChildInAnnotationPropertyDeclaration(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [170 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) {
+ [171 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) {
+ return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
+ },
+ [174 /* OverloadPropertyDeclaration */]: function forEachChildInOverloadPropertyDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [305 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) {
+ [308 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer);
},
- [261 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) {
+ [263 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [208 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) {
+ [210 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [181 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) {
+ [183 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [185 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) {
+ [187 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [184 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) {
+ [186 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [179 /* CallSignature */]: forEachChildInCallOrConstructSignature,
- [180 /* ConstructSignature */]: forEachChildInCallOrConstructSignature,
- [220 /* EtsComponentExpression */]: function forEachChildInEtsComponentExpression(node, cbNode, cbNodes) {
+ [181 /* CallSignature */]: forEachChildInCallOrConstructSignature,
+ [182 /* ConstructSignature */]: forEachChildInCallOrConstructSignature,
+ [222 /* EtsComponentExpression */]: function forEachChildInEtsComponentExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.arguments) || visitNode2(cbNode, node.body);
},
- [174 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) {
+ [176 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [173 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) {
+ [175 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [176 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) {
+ [178 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [177 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) {
+ [179 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [178 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) {
+ [180 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [263 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) {
+ [265 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [218 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) {
+ [220 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [219 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) {
+ [221 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body);
},
- [175 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) {
+ [177 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body);
},
- [183 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) {
+ [185 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [182 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) {
+ [184 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.assertsModifier) || visitNode2(cbNode, node.parameterName) || visitNode2(cbNode, node.type);
},
- [186 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) {
+ [188 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.exprName) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [187 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) {
+ [189 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.members);
},
- [188 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) {
+ [190 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.elementType);
},
- [189 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) {
+ [191 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [192 /* UnionType */]: forEachChildInUnionOrIntersectionType,
- [193 /* IntersectionType */]: forEachChildInUnionOrIntersectionType,
- [194 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) {
+ [194 /* UnionType */]: forEachChildInUnionOrIntersectionType,
+ [195 /* IntersectionType */]: forEachChildInUnionOrIntersectionType,
+ [196 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.checkType) || visitNode2(cbNode, node.extendsType) || visitNode2(cbNode, node.trueType) || visitNode2(cbNode, node.falseType);
},
- [195 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) {
+ [197 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.typeParameter);
},
- [205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
+ [207 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.assertions) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [304 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
+ [307 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.assertClause);
},
- [196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
- [198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
- [199 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) {
+ [198 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
+ [200 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
+ [201 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.objectType) || visitNode2(cbNode, node.indexType);
},
- [200 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) {
+ [202 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.readonlyToken) || visitNode2(cbNode, node.typeParameter) || visitNode2(cbNode, node.nameType) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNodes(cbNode, cbNodes, node.members);
},
- [201 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) {
+ [203 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.literal);
},
- [202 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) {
+ [204 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type);
},
- [206 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
- [207 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
- [209 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) {
+ [208 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
+ [209 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
+ [211 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [210 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) {
+ [212 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.properties);
},
- [211 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) {
+ [213 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.name);
},
- [212 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) {
+ [214 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.argumentExpression);
},
- [213 /* CallExpression */]: forEachChildInCallOrNewExpression,
- [214 /* NewExpression */]: forEachChildInCallOrNewExpression,
- [215 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) {
+ [215 /* CallExpression */]: forEachChildInCallOrNewExpression,
+ [216 /* NewExpression */]: forEachChildInCallOrNewExpression,
+ [217 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tag) || visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.template);
},
- [216 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) {
+ [218 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.expression);
},
- [217 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) {
+ [219 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [221 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) {
+ [223 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [222 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) {
+ [224 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [223 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) {
+ [225 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [225 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) {
+ [227 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.operand);
},
- [230 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) {
+ [232 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.expression);
},
- [224 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) {
+ [226 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [226 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) {
+ [228 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.operand);
},
- [227 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) {
+ [229 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.operatorToken) || visitNode2(cbNode, node.right);
},
- [235 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) {
+ [237 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type);
},
- [236 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) {
+ [238 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [239 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) {
+ [241 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type);
},
- [237 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) {
+ [239 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [228 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) {
+ [230 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.whenTrue) || visitNode2(cbNode, node.colonToken) || visitNode2(cbNode, node.whenFalse);
},
- [231 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) {
+ [233 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [242 /* Block */]: forEachChildInBlock,
- [271 /* ModuleBlock */]: forEachChildInBlock,
- [314 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) {
+ [244 /* Block */]: forEachChildInBlock,
+ [274 /* ModuleBlock */]: forEachChildInBlock,
+ [317 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken);
},
- [244 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) {
+ [246 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList);
},
- [262 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) {
+ [264 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.declarations);
},
- [245 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) {
+ [247 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [246 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) {
+ [248 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.thenStatement) || visitNode2(cbNode, node.elseStatement);
},
- [247 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) {
+ [249 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.statement) || visitNode2(cbNode, node.expression);
},
- [248 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) {
+ [250 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [249 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) {
+ [251 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.incrementor) || visitNode2(cbNode, node.statement);
},
- [250 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) {
+ [252 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [251 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) {
+ [253 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.awaitModifier) || visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [252 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement,
- [253 /* BreakStatement */]: forEachChildInContinueOrBreakStatement,
- [254 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) {
+ [254 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement,
+ [255 /* BreakStatement */]: forEachChildInContinueOrBreakStatement,
+ [256 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [255 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) {
+ [257 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [256 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) {
+ [258 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.caseBlock);
},
- [272 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) {
+ [275 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.clauses);
},
- [298 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) {
+ [301 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements);
},
- [299 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) {
+ [302 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.statements);
},
- [257 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) {
+ [259 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.label) || visitNode2(cbNode, node.statement);
},
- [258 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) {
+ [260 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [259 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) {
+ [261 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.tryBlock) || visitNode2(cbNode, node.catchClause) || visitNode2(cbNode, node.finallyBlock);
},
- [301 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) {
+ [304 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.variableDeclaration) || visitNode2(cbNode, node.block);
},
- [169 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) {
+ [170 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [264 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression,
- [232 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression,
- [265 /* StructDeclaration */]: forEachChildInClassDeclarationOrExpression,
- [266 /* AnnotationDeclaration */]: forEachChildInAnnotationDeclaration,
- [267 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) {
+ [266 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression,
+ [234 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression,
+ [267 /* StructDeclaration */]: forEachChildInClassDeclarationOrExpression,
+ [268 /* AnnotationDeclaration */]: forEachChildInAnnotationDeclaration,
+ [269 /* OverloadDeclaration */]: forEachChildInOverloadDeclaration,
+ [270 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members);
},
- [268 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) {
+ [271 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type);
},
- [269 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) {
+ [272 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
},
- [308 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) {
+ [311 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [270 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) {
+ [273 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body);
},
- [274 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) {
+ [277 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
},
- [275 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
+ [278 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
},
- [276 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
+ [279 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
},
- [302 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) {
+ [305 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [303 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) {
+ [306 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
},
- [273 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
+ [276 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNode2(cbNode, node.name);
},
- [277 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) {
+ [280 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [283 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) {
+ [286 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [278 /* NamedImports */]: forEachChildInNamedImportsOrExports,
- [282 /* NamedExports */]: forEachChildInNamedImportsOrExports,
- [281 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
+ [281 /* NamedImports */]: forEachChildInNamedImportsOrExports,
+ [285 /* NamedExports */]: forEachChildInNamedImportsOrExports,
+ [284 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
},
- [279 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
- [284 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
- [280 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) {
+ [282 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
+ [287 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
+ [283 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression);
},
- [229 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) {
+ [231 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
},
- [240 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) {
+ [242 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.literal);
},
- [203 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) {
+ [205 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
},
- [204 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) {
+ [206 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.literal);
},
- [166 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) {
+ [167 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [300 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) {
+ [303 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.types);
},
- [234 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) {
+ [236 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [286 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) {
+ [289 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [285 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
+ [288 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
},
- [360 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
+ [363 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [287 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
+ [290 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingElement);
},
- [291 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) {
+ [294 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingFragment);
},
- [288 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
- [289 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
- [295 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) {
+ [291 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
+ [292 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
+ [298 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.properties);
},
- [294 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) {
+ [297 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [296 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) {
+ [299 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [297 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) {
+ [300 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.expression);
},
- [290 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) {
+ [293 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.tagName);
},
- [190 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [191 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [318 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [324 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [323 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [325 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [327 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [326 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) {
+ [192 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [193 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [321 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [327 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [326 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [328 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [330 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [329 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [329 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) {
+ [332 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) {
return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags);
},
- [355 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
+ [358 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [319 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) {
+ [322 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [320 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) {
+ [323 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right);
},
- [349 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
- [356 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
- [339 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) {
+ [352 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
+ [359 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
+ [342 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [338 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) {
+ [341 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [337 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) {
+ [340 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [353 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
+ [356 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [354 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
- return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 318 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)));
+ [357 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
+ return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 321 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)));
},
- [347 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
+ [350 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [350 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
- [352 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
- [351 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
- [348 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
- [332 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
+ [353 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
+ [355 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
+ [354 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
+ [351 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
+ [335 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type);
},
- [333 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain,
- [334 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain,
- [335 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain,
- [331 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) {
+ [336 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain,
+ [337 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain,
+ [338 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain,
+ [334 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) {
return forEach(node.jsDocPropertyTags, cbNode);
},
- [336 /* JSDocTag */]: forEachChildInJSDocTag,
- [341 /* JSDocClassTag */]: forEachChildInJSDocTag,
- [342 /* JSDocPublicTag */]: forEachChildInJSDocTag,
- [343 /* JSDocPrivateTag */]: forEachChildInJSDocTag,
- [344 /* JSDocProtectedTag */]: forEachChildInJSDocTag,
- [345 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
- [340 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
- [346 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
- [359 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
+ [339 /* JSDocTag */]: forEachChildInJSDocTag,
+ [344 /* JSDocClassTag */]: forEachChildInJSDocTag,
+ [345 /* JSDocPublicTag */]: forEachChildInJSDocTag,
+ [346 /* JSDocPrivateTag */]: forEachChildInJSDocTag,
+ [347 /* JSDocProtectedTag */]: forEachChildInJSDocTag,
+ [348 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
+ [343 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
+ [349 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
+ [362 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
};
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
@@ -26046,6 +26104,9 @@ function forEachChildInClassDeclarationOrExpression(node, cbNode, cbNodes) {
function forEachChildInAnnotationDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
}
+function forEachChildInOverloadDeclaration(node, cbNode, cbNodes) {
+ return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
+}
function forEachChildInNamedImportsOrExports(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
}
@@ -26074,7 +26135,7 @@ function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
}
function forEachChild(node, cbNode, cbNodes) {
- if (node === void 0 || node.kind <= 164 /* LastToken */) {
+ if (node === void 0 || node.kind <= 165 /* LastToken */) {
return;
}
const fn = forEachChildTable[node.kind];
@@ -26109,7 +26170,7 @@ function forEachChildRecursively(rootNode, cbNode, cbNodes) {
continue;
return res;
}
- if (current.kind >= 165 /* FirstNode */) {
+ if (current.kind >= 166 /* FirstNode */) {
for (const child of gatherPossibleChildren(current)) {
queue.push(child);
parents.push(current);
@@ -27085,7 +27146,7 @@ var Parser;
parseErrorAtCurrentToken(diagnosticMessage, arg0);
}
const pos = getNodePos();
- const result = kind === 79 /* Identifier */ ? factory2.createIdentifier("", void 0, void 0) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, "", "", void 0) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral("", void 0) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral("", void 0) : kind === 285 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind);
+ const result = kind === 79 /* Identifier */ ? factory2.createIdentifier("", void 0, void 0) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, "", "", void 0) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral("", void 0) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral("", void 0) : kind === 288 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind);
return finishNode(result, pos);
}
function internIdentifier(text) {
@@ -27210,6 +27271,9 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
+ if (token() === 164 /* OverloadKeyword */) {
+ return true;
+ }
return canFollowExportModifier();
case 89 /* DefaultKeyword */:
return nextTokenCanFollowDefaultKeyword();
@@ -27234,7 +27298,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -27509,15 +27573,15 @@ var Parser;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 181 /* IndexSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 241 /* SemicolonClassElement */:
+ case 178 /* Constructor */:
+ case 183 /* IndexSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 243 /* SemicolonClassElement */:
return true;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return !inStructContext();
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
const methodDeclaration = node;
const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 136 /* ConstructorKeyword */;
return !nameIsConstructor;
@@ -27528,8 +27592,8 @@ var Parser;
function isReusableSwitchClause(node) {
if (node) {
switch (node.kind) {
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return true;
}
}
@@ -27538,66 +27602,66 @@ var Parser;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 244 /* VariableStatement */:
- case 242 /* Block */:
- case 246 /* IfStatement */:
- case 245 /* ExpressionStatement */:
- case 258 /* ThrowStatement */:
- case 254 /* ReturnStatement */:
- case 256 /* SwitchStatement */:
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 249 /* ForStatement */:
- case 248 /* WhileStatement */:
- case 255 /* WithStatement */:
- case 243 /* EmptyStatement */:
- case 259 /* TryStatement */:
- case 257 /* LabeledStatement */:
- case 247 /* DoStatement */:
- case 260 /* DebuggerStatement */:
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 246 /* VariableStatement */:
+ case 244 /* Block */:
+ case 248 /* IfStatement */:
+ case 247 /* ExpressionStatement */:
+ case 260 /* ThrowStatement */:
+ case 256 /* ReturnStatement */:
+ case 258 /* SwitchStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 250 /* WhileStatement */:
+ case 257 /* WithStatement */:
+ case 245 /* EmptyStatement */:
+ case 261 /* TryStatement */:
+ case 259 /* LabeledStatement */:
+ case 249 /* DoStatement */:
+ case 262 /* DebuggerStatement */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
}
}
return false;
}
function isReusableEnumMember(node) {
- return node.kind === 308 /* EnumMember */;
+ return node.kind === 311 /* EnumMember */;
}
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 170 /* PropertySignature */:
- case 179 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 171 /* PropertySignature */:
+ case 181 /* CallSignature */:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 261 /* VariableDeclaration */) {
+ if (node.kind !== 263 /* VariableDeclaration */) {
return false;
}
const variableDeclarator = node;
return variableDeclarator.initializer === void 0;
}
function isReusableParameter(node) {
- if (node.kind !== 168 /* Parameter */) {
+ if (node.kind !== 169 /* Parameter */) {
return false;
}
const parameter = node;
@@ -27888,14 +27952,14 @@ var Parser;
}
function typeHasArrowFunctionBlockingParseError(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return nodeIsMissing(node.typeName);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */: {
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */: {
const { parameters, type } = node;
return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type);
}
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return typeHasArrowFunctionBlockingParseError(node.type);
default:
return false;
@@ -28136,14 +28200,14 @@ var Parser;
function parseSignatureMember(kind) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
- if (kind === 180 /* ConstructSignature */) {
+ if (kind === 182 /* ConstructSignature */) {
parseExpected(104 /* NewKeyword */);
}
const typeParameters = parseTypeParameters();
const parameters = parseParameters(4 /* Type */);
const type = parseReturnType(58 /* ColonToken */, true);
parseTypeMemberSemicolon();
- const node = kind === 179 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type);
+ const node = kind === 181 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function isIndexSignature() {
@@ -28181,6 +28245,17 @@ var Parser;
node.illegalDecorators = decorators;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+ function parseOverloadPropertyDeclaration(pos, hasJSDoc, modifiers) {
+ const name = parsePropertyName();
+ const questionToken = parseOptionalToken(57 /* QuestionToken */);
+ let node;
+ const type = parseTypeAnnotation();
+ node = factory2.createOverloadPropertyDeclaration(modifiers, name, questionToken, type);
+ if (token() === 63 /* EqualsToken */)
+ node.initializer = parseInitializer();
+ parseTypeMemberSemicolon();
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
+ }
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
@@ -28222,19 +28297,19 @@ var Parser;
}
function parseTypeMember() {
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) {
- return parseSignatureMember(179 /* CallSignature */);
+ return parseSignatureMember(181 /* CallSignature */);
}
if (token() === 104 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) {
- return parseSignatureMember(180 /* ConstructSignature */);
+ return parseSignatureMember(182 /* ConstructSignature */);
}
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 177 /* GetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 179 /* GetAccessor */, 4 /* Type */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 178 /* SetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 180 /* SetAccessor */, 4 /* Type */);
}
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
@@ -29110,7 +29185,7 @@ var Parser;
return void 0;
}
let unwrappedType = type;
- while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 196 /* ParenthesizedType */) {
+ while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 198 /* ParenthesizedType */) {
unwrappedType = unwrappedType.type;
}
const hasJSDocFunctionType = unwrappedType && isJSDocFunctionType(unwrappedType);
@@ -29173,7 +29248,7 @@ var Parser;
return parseBinaryExpressionRest(precedence, leftOperand, pos);
}
function isInOrOfKeyword(t) {
- return t === 102 /* InKeyword */ || t === 164 /* OfKeyword */;
+ return t === 102 /* InKeyword */ || t === 165 /* OfKeyword */;
}
function parseBinaryExpressionRest(precedence, leftOperand, pos) {
while (true) {
@@ -29255,7 +29330,7 @@ var Parser;
if (token() === 42 /* AsteriskAsteriskToken */) {
const pos = skipTrivia(sourceText, simpleUnaryExpression.pos);
const { end } = simpleUnaryExpression;
- if (simpleUnaryExpression.kind === 216 /* TypeAssertionExpression */) {
+ if (simpleUnaryExpression.kind === 218 /* TypeAssertionExpression */) {
parseErrorAt(pos, end, Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
} else {
parseErrorAt(pos, end, Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator));
@@ -29378,11 +29453,11 @@ var Parser;
const pos = getNodePos();
const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext);
let result;
- if (opening.kind === 289 /* JsxOpeningElement */) {
+ if (opening.kind === 292 /* JsxOpeningElement */) {
let children = parseJsxChildren(opening);
let closingElement;
const lastChild = children[children.length - 1];
- if ((lastChild == null ? void 0 : lastChild.kind) === 287 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) {
+ if ((lastChild == null ? void 0 : lastChild.kind) === 290 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) {
const end = lastChild.children.end;
const newLast = finishNode(
factory2.createJsxElement(
@@ -29406,10 +29481,10 @@ var Parser;
}
}
result = finishNode(factory2.createJsxElement(opening, children, closingElement), pos);
- } else if (opening.kind === 292 /* JsxOpeningFragment */) {
+ } else if (opening.kind === 295 /* JsxOpeningFragment */) {
result = finishNode(factory2.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos);
} else {
- Debug.assert(opening.kind === 288 /* JsxSelfClosingElement */);
+ Debug.assert(opening.kind === 291 /* JsxSelfClosingElement */);
result = opening;
}
if (inExpressionContext && token() === 29 /* LessThanToken */) {
@@ -29465,7 +29540,7 @@ var Parser;
if (!child)
break;
list.push(child);
- if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 287 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) {
+ if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 290 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) {
break;
}
}
@@ -29673,7 +29748,7 @@ var Parser;
continue;
}
if (isTemplateStartOfTaggedTemplate()) {
- expression = !questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest(pos, expression, questionDotToken, void 0);
+ expression = !questionDotToken && expression.kind === 236 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest(pos, expression, questionDotToken, void 0);
continue;
}
if (!questionDotToken) {
@@ -29721,7 +29796,7 @@ var Parser;
}
}
if (typeArguments || token() === 20 /* OpenParenToken */) {
- if (!questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (!questionDotToken && expression.kind === 236 /* ExpressionWithTypeArguments */) {
typeArguments = expression.typeArguments;
expression = expression.expression;
}
@@ -29948,10 +30023,10 @@ var Parser;
const decorators = parseDecorators();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 177 /* GetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 0 /* None */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 178 /* SetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 0 /* None */);
}
const asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
const tokenIsIdentifier = isIdentifier2();
@@ -30021,7 +30096,7 @@ var Parser;
const expressionPos = getNodePos();
let expression = parseMemberExpressionRest(expressionPos, parsePrimaryExpression(), false);
let typeArguments;
- if (expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (expression.kind === 236 /* ExpressionWithTypeArguments */) {
typeArguments = expression.typeArguments;
expression = expression.expression;
}
@@ -30129,7 +30204,7 @@ var Parser;
}
}
let node;
- if (awaitToken ? parseExpected(164 /* OfKeyword */) : parseOptional(164 /* OfKeyword */)) {
+ if (awaitToken ? parseExpected(165 /* OfKeyword */) : parseOptional(165 /* OfKeyword */)) {
const expression = allowInAnd(() => parseAssignmentExpressionOrHigher(true));
parseExpected(21 /* CloseParenToken */);
node = factory2.createForOfStatement(awaitToken, initializer, expression, parseStatement());
@@ -30150,10 +30225,10 @@ var Parser;
function parseBreakOrContinueStatement(kind) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
- parseExpected(kind === 253 /* BreakStatement */ ? 81 /* BreakKeyword */ : 87 /* ContinueKeyword */);
+ parseExpected(kind === 255 /* BreakStatement */ ? 81 /* BreakKeyword */ : 87 /* ContinueKeyword */);
const label = canParseSemicolon() ? void 0 : parseIdentifier();
parseSemicolon();
- const node = kind === 253 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label);
+ const node = kind === 255 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseReturnStatement() {
@@ -30307,6 +30382,8 @@ var Parser;
return inEtsContext();
case 59 /* AtToken */:
return inAllowAnnotationContext() && nextToken() === 119 /* InterfaceKeyword */;
+ case 164 /* OverloadKeyword */:
+ return nextTokenIsIdentifierOnSameLine();
case 119 /* InterfaceKeyword */:
case 155 /* TypeKeyword */:
return nextTokenIsIdentifierOnSameLine();
@@ -30441,9 +30518,9 @@ var Parser;
case 98 /* ForKeyword */:
return parseForOrForInOrForOfStatement();
case 87 /* ContinueKeyword */:
- return parseBreakOrContinueStatement(252 /* ContinueStatement */);
+ return parseBreakOrContinueStatement(254 /* ContinueStatement */);
case 81 /* BreakKeyword */:
- return parseBreakOrContinueStatement(253 /* BreakStatement */);
+ return parseBreakOrContinueStatement(255 /* BreakStatement */);
case 106 /* ReturnKeyword */:
return parseReturnStatement();
case 117 /* WithKeyword */:
@@ -30459,6 +30536,7 @@ var Parser;
case 88 /* DebuggerKeyword */:
return parseDebuggerStatement();
case 59 /* AtToken */:
+ case 164 /* OverloadKeyword */:
return parseDeclaration();
case 133 /* AsyncKeyword */:
case 119 /* InterfaceKeyword */:
@@ -30507,6 +30585,19 @@ var Parser;
const node = factory2.createAnnotationDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+ function parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers) {
+ parseExpected(164 /* OverloadKeyword */);
+ const name = createIdentifier(isBindingIdentifier());
+ let members;
+ if (parseExpected(18 /* OpenBraceToken */)) {
+ members = parseOverloadMembers();
+ parseExpected(19 /* CloseBraceToken */);
+ } else {
+ members = createMissingList();
+ }
+ const node = factory2.createOverloadDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
+ }
function parseDeclaration() {
var _a2, _b;
const pos = getNodePos();
@@ -30576,6 +30667,8 @@ var Parser;
return parseAnnotationDeclaration(pos, hasJSDoc, decorators, modifiers);
}
return parseDeclarationDefault(pos, decorators, modifiers);
+ case 164 /* OverloadKeyword */:
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
case 119 /* InterfaceKeyword */:
return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
case 155 /* TypeKeyword */:
@@ -30605,7 +30698,7 @@ var Parser;
}
function parseDeclarationDefault(pos, decorators, modifiers) {
if (decorators || modifiers) {
- const missing = createMissingNode(285 /* MissingDeclaration */, true, Diagnostics.Declaration_expected);
+ const missing = createMissingNode(288 /* MissingDeclaration */, true, Diagnostics.Declaration_expected);
setTextRangePos(missing, pos);
missing.illegalDecorators = decorators;
missing.modifiers = modifiers;
@@ -30715,7 +30808,7 @@ var Parser;
}
nextToken();
let declarations;
- if (token() === 164 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {
+ if (token() === 165 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {
declarations = createMissingList();
} else {
const savedDisallowIn = inDisallowInContext();
@@ -30745,7 +30838,7 @@ var Parser;
const asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
const name = modifierFlags & 1024 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier();
if (name && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
- fileStylesComponents.set(name.escapedText.toString(), 263 /* FunctionDeclaration */);
+ fileStylesComponents.set(name.escapedText.toString(), 265 /* FunctionDeclaration */);
}
const originalUICallbackContext = inUICallbackContext();
setEtsBuilderContext(hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions));
@@ -30849,7 +30942,7 @@ var Parser;
setUICallbackContext(inBuildContext() || inBuilderContext());
if (inStructContext() && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
if (methodName && currentStructName) {
- structStylesComponents.set(methodName, { structName: currentStructName, kind: 174 /* MethodDeclaration */ });
+ structStylesComponents.set(methodName, { structName: currentStructName, kind: 176 /* MethodDeclaration */ });
}
const stylesEtsComponentDecoratorNames = getEtsStylesDecoratorComponentNames(decorators, sourceFileCompilerOptions);
if (stylesEtsComponentDecoratorNames.length > 0) {
@@ -30938,7 +31031,7 @@ var Parser;
const parameters = parseParameters(0 /* None */);
const type = parseReturnType(58 /* ColonToken */, false);
const body = parseFunctionBlockOrSemicolon(flags);
- const node = kind === 177 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body);
+ const node = kind === 179 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body);
node.typeParameters = typeParameters;
if (isSetAccessorDeclaration(node))
node.type = type;
@@ -31150,10 +31243,10 @@ var Parser;
return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 177 /* GetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 0 /* None */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 178 /* SetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 0 /* None */);
}
if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers);
@@ -31189,35 +31282,35 @@ var Parser;
const hasJSDoc = hasPrecedingJSDocComment();
if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (parseContextualModifier(138 /* GetKeyword */)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (isIndexSignature()) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
@@ -31228,11 +31321,66 @@ var Parser;
}
return Debug.fail("Should not have attempted to parse annotation member declaration.");
}
+ function parseOverloadElement() {
+ const pos = getNodePos();
+ if (token() === 26 /* SemicolonToken */) {
+ parseErrorAt(pos, pos, Diagnostics.Unexpected_keyword_or_identifier);
+ }
+ const hasJSDoc = hasPrecedingJSDocComment();
+ if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (parseContextualModifier(138 /* GetKeyword */)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (parseContextualModifier(152 /* SetKeyword */)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (isIndexSignature()) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (tokenIsIdentifierOrKeyword(token())) {
+ const modifiers = parseModifiers();
+ let overloadPropertyDeclaration = parseOverloadPropertyDeclaration(pos, hasJSDoc, modifiers);
+ if (overloadPropertyDeclaration.kind === 174 /* OverloadPropertyDeclaration */) {
+ return overloadPropertyDeclaration;
+ }
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ return Debug.fail("Should not have attempted to parse annotation member declaration.");
+ }
function parseClassExpression() {
- return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0, 232 /* ClassExpression */);
+ return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0, 234 /* ClassExpression */);
}
function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) {
- return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 264 /* ClassDeclaration */);
+ return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 266 /* ClassDeclaration */);
}
function parseStructDeclaration(pos, hasJSDoc, decorators, modifiers) {
return parseStructDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers);
@@ -31253,7 +31401,7 @@ var Parser;
members = createMissingList();
}
setAwaitContext(savedAwaitContext);
- const node = kind === 264 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
+ const node = kind === 266 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseStructDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers) {
@@ -31317,7 +31465,7 @@ var Parser;
function parseExpressionWithTypeArguments() {
const pos = getNodePos();
const expression = parseLeftHandSideExpressionOrHigher();
- if (expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (expression.kind === 236 /* ExpressionWithTypeArguments */) {
return expression;
}
const typeArguments = tryParseTypeArguments();
@@ -31335,13 +31483,16 @@ var Parser;
function parseAnnotationMembers() {
return parseList(ParsingContext.AnnotationMembers, parseAnnotationElement);
}
+ function parseOverloadMembers() {
+ return parseList(ParsingContext.TypeMembers, parseOverloadElement);
+ }
function parseStructMembers(pos) {
const structMembers = parseList(ParsingContext.ClassMembers, parseClassElement);
const virtualStructMembers = [];
const virtualParameterProperties = [];
structMembers.forEach((member) => {
virtualStructMembers.push(member);
- if (member.kind === 171 /* PropertyDeclaration */) {
+ if (member.kind === 172 /* PropertyDeclaration */) {
const property = member;
virtualParameterProperties.push(
finishVirtualNode(
@@ -31588,7 +31739,7 @@ var Parser;
function parseImportClause(identifier, pos, isTypeOnly) {
let namedBindings;
if (!identifier || parseOptional(27 /* CommaToken */)) {
- namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(278 /* NamedImports */);
+ namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(281 /* NamedImports */);
}
return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos);
}
@@ -31621,15 +31772,15 @@ var Parser;
}
function parseNamedImportsOrExports(kind) {
const pos = getNodePos();
- const node = kind === 278 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */));
+ const node = kind === 281 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */));
return finishNode(node, pos);
}
function parseExportSpecifier() {
const hasJSDoc = hasPrecedingJSDocComment();
- return withJSDoc(parseImportOrExportSpecifier(284 /* ExportSpecifier */), hasJSDoc);
+ return withJSDoc(parseImportOrExportSpecifier(287 /* ExportSpecifier */), hasJSDoc);
}
function parseImportSpecifier() {
- return parseImportOrExportSpecifier(279 /* ImportSpecifier */);
+ return parseImportOrExportSpecifier(282 /* ImportSpecifier */);
}
function parseImportOrExportSpecifier(kind) {
const pos = getNodePos();
@@ -31673,10 +31824,10 @@ var Parser;
parseExpected(129 /* AsKeyword */);
name = parseNameWithKeywordCheck();
}
- if (kind === 279 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
+ if (kind === 282 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected);
}
- const node = kind === 279 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
+ const node = kind === 282 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
return finishNode(node, pos);
function parseNameWithKeywordCheck() {
checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2();
@@ -31703,7 +31854,7 @@ var Parser;
parseExpected(160 /* FromKeyword */);
moduleSpecifier = parseModuleSpecifier();
} else {
- exportClause = parseNamedImportsOrExports(282 /* NamedExports */);
+ exportClause = parseNamedImportsOrExports(285 /* NamedExports */);
if (token() === 160 /* FromKeyword */ || token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak()) {
parseExpected(160 /* FromKeyword */);
moduleSpecifier = parseModuleSpecifier();
@@ -32277,7 +32428,7 @@ var Parser;
switch (node.kind) {
case 150 /* ObjectKeyword */:
return true;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return isObjectOrObjectArrayTypeReference(node.elementType);
default:
return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments;
@@ -32307,12 +32458,12 @@ var Parser;
let child;
let children;
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) {
- if (child.kind === 349 /* JSDocParameterTag */ || child.kind === 356 /* JSDocPropertyTag */) {
+ if (child.kind === 352 /* JSDocParameterTag */ || child.kind === 359 /* JSDocPropertyTag */) {
children = append(children, child);
}
}
if (children) {
- const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 188 /* ArrayType */), pos);
+ const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 190 /* ArrayType */), pos);
return finishNode(factory2.createJSDocTypeExpression(literal), pos);
}
}
@@ -32425,7 +32576,7 @@ var Parser;
let hasChildren = false;
while (child = tryParse(() => parseChildPropertyTag(indent2))) {
hasChildren = true;
- if (child.kind === 352 /* JSDocTypeTag */) {
+ if (child.kind === 355 /* JSDocTypeTag */) {
if (childTypeTag) {
const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
if (lastError) {
@@ -32440,7 +32591,7 @@ var Parser;
}
}
if (hasChildren) {
- const isArrayType = typeExpression && typeExpression.type.kind === 188 /* ArrayType */;
+ const isArrayType = typeExpression && typeExpression.type.kind === 190 /* ArrayType */;
const jsdocTypeLiteral = factory2.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType);
typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral, start2);
end2 = typeExpression.end;
@@ -32491,7 +32642,7 @@ var Parser;
const returnTag = tryParse(() => {
if (parseOptionalJsdoc(59 /* AtToken */)) {
const tag = parseTag(indent2);
- if (tag && tag.kind === 350 /* JSDocReturnTag */) {
+ if (tag && tag.kind === 353 /* JSDocReturnTag */) {
return tag;
}
}
@@ -32525,7 +32676,7 @@ var Parser;
case 59 /* AtToken */:
if (canParseTag) {
const child = tryParseChildTag(target, indent2);
- if (child && (child.kind === 349 /* JSDocParameterTag */ || child.kind === 356 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
+ if (child && (child.kind === 352 /* JSDocParameterTag */ || child.kind === 359 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
return false;
}
return child;
@@ -35045,7 +35196,7 @@ function convertConfigFileToObject(sourceFile, errors, reportOptionsErrors, opti
var _a2;
const rootExpression = (_a2 = sourceFile.statements[0]) == null ? void 0 : _a2.expression;
const knownRootOptions = reportOptionsErrors ? getTsconfigRootOptionsMap() : void 0;
- if (rootExpression && rootExpression.kind !== 210 /* ObjectLiteralExpression */) {
+ if (rootExpression && rootExpression.kind !== 212 /* ObjectLiteralExpression */) {
errors.push(createDiagnosticForNodeInSourceFile(
sourceFile,
rootExpression,
@@ -35077,7 +35228,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) {
const result = returnValue ? {} : void 0;
for (const element of node.properties) {
- if (element.kind !== 305 /* PropertyAssignment */) {
+ if (element.kind !== 308 /* PropertyAssignment */) {
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element, Diagnostics.Property_assignment_expected));
continue;
}
@@ -35165,13 +35316,13 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
case 8 /* NumericLiteral */:
reportInvalidOptionValue(option && option.type !== "number");
return validateValue(Number(valueExpression.text));
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) {
break;
}
reportInvalidOptionValue(option && option.type !== "number");
return validateValue(-Number(valueExpression.operand.text));
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
reportInvalidOptionValue(option && option.type !== "object");
const objectLiteralExpression = valueExpression;
if (option) {
@@ -35190,7 +35341,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
void 0
));
}
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
reportInvalidOptionValue(option && option.type !== "list");
return validateValue(convertArrayLiteralExpressionToJson(
valueExpression.elements,
@@ -38235,7 +38386,7 @@ function getReservedDecoratorsOfEtsFile(node, host) {
}
function getReservedDecoratorsOfStructDeclaration(node, host) {
let reservedDecorators;
- if (node.parent.kind === 265 /* StructDeclaration */) {
+ if (node.parent.kind === 267 /* StructDeclaration */) {
reservedDecorators = ensureEtsDecorators(node, host);
}
return reservedDecorators;
@@ -38452,10 +38603,10 @@ function isTokenInsideBuilder(decorators, compilerOptions) {
return false;
}
function getEtsComponentExpressionInnerCallExpressionNode(node) {
- while (node && node.kind !== 220 /* EtsComponentExpression */) {
- if (node.kind === 213 /* CallExpression */) {
+ while (node && node.kind !== 222 /* EtsComponentExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
node = node.expression;
- } else if (node.kind === 211 /* PropertyAccessExpression */) {
+ } else if (node.kind === 213 /* PropertyAccessExpression */) {
node = node.expression;
} else {
node = void 0;
@@ -38468,7 +38619,7 @@ function getRootEtsComponentInnerCallExpressionNode(node) {
return node;
}
while (node) {
- const ancestor = getAncestor(isCallExpression(node) ? node.parent : node, 213 /* CallExpression */);
+ const ancestor = getAncestor(isCallExpression(node) ? node.parent : node, 215 /* CallExpression */);
const target = getRootEtsComponent(ancestor);
if (target && isInStateStylesObject(node)) {
return target;
@@ -38497,7 +38648,7 @@ function getEtsComponentExpressionInnerExpressionStatementNode(node) {
return void 0;
}
function isInStateStylesObject(node) {
- const ancestor = getAncestor(node, 210 /* ObjectLiteralExpression */);
+ const ancestor = getAncestor(node, 212 /* ObjectLiteralExpression */);
return ancestor !== void 0 && ancestor.parent !== void 0 && isPropertyAssignment(ancestor.parent);
}
function getEtsExtendDecoratorsComponentNames(decorators, compilerOptions) {
@@ -38505,7 +38656,7 @@ function getEtsExtendDecoratorsComponentNames(decorators, compilerOptions) {
const extendComponents = [];
const extendDecorator = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.extend) == null ? void 0 : _b.decorator) != null ? _c : "Extend";
decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (decorator.expression.kind === 213 /* CallExpression */) {
+ if (decorator.expression.kind === 215 /* CallExpression */) {
const identifier = decorator.expression.expression;
const args = decorator.expression.arguments;
if (identifier.kind === 79 /* Identifier */ && (extendDecorator == null ? void 0 : extendDecorator.includes(identifier.escapedText.toString())) && args.length) {
@@ -38522,7 +38673,7 @@ function getEtsStylesDecoratorComponentNames(decorators, compilerOptions) {
const stylesComponents = [];
const stylesDecorator = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.styles) == null ? void 0 : _b.decorator) != null ? _c : "Styles";
decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (decorator.kind === 169 /* Decorator */ && decorator.expression.kind === 79 /* Identifier */) {
+ if (decorator.kind === 170 /* Decorator */ && decorator.expression.kind === 79 /* Identifier */) {
const identifier = decorator.expression;
if (identifier.kind === 79 /* Identifier */ && identifier.escapedText === stylesDecorator) {
stylesComponents.push(identifier.escapedText);
@@ -38568,7 +38719,7 @@ function transformAnnotation(context) {
}
function visitAnnotationsDeclarations(node) {
switch (node.kind) {
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return visitAnnotationDeclaration(node);
default:
return visitEachChild(node, visitAnnotationsDeclarations, context);
@@ -38576,9 +38727,9 @@ function transformAnnotation(context) {
}
function visitAnnotations(node) {
switch (node.kind) {
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return visitImportSpecifier(node);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return visitAnnotation(node);
default:
return visitEachChild(node, visitAnnotations, context);
@@ -38618,14 +38769,14 @@ function transformAnnotation(context) {
return factory.createIdentifier(
annotationMagicNamePrefix + expr.escapedText
);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
const propAccessExpr = expr;
return factory.updatePropertyAccessExpression(
propAccessExpr,
propAccessExpr.expression,
addMagicPrefixToAnnotationNameIdentifier(propAccessExpr.name)
);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
const callExpr = expr;
return factory.updateCallExpression(
callExpr,
@@ -38706,16 +38857,16 @@ function transformTypeExportImportAndConstEnumInTypeScript(context) {
}
function visitImportExportAndConstEnumMember(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitConstEnum(node);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return visitEnumMember(node);
default:
return visitEachChild(node, visitImportExportAndConstEnumMember, context);
@@ -38761,7 +38912,7 @@ function transformTypeExportImportAndConstEnumInTypeScript(context) {
return name || namedBindings ? factory.updateImportClause(node, false, name, namedBindings) : void 0;
}
function visitNamedImportBindings(node) {
- if (node.kind === 277 /* NamespaceImport */) {
+ if (node.kind === 280 /* NamespaceImport */) {
if (resolver.isReferencedAliasDeclaration(node)) {
return node;
}
@@ -39361,23 +39512,23 @@ function getModuleInstanceStateCached(node, visited = new Map2()) {
}
function getModuleInstanceStateWorker(node, visited) {
switch (node.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return 0 /* NonInstantiated */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (isEnumConst(node)) {
return 2 /* ConstEnumOnly */;
}
break;
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
if (!hasSyntacticModifier(node, 1 /* Export */)) {
return 0 /* NonInstantiated */;
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportDeclaration = node;
- if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 282 /* NamedExports */) {
+ if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 285 /* NamedExports */) {
let state = 0 /* NonInstantiated */;
for (const specifier of exportDeclaration.exportClause.elements) {
const specifierState = getModuleInstanceStateForAliasTarget(specifier, visited);
@@ -39391,7 +39542,7 @@ function getModuleInstanceStateWorker(node, visited) {
return state;
}
break;
- case 271 /* ModuleBlock */: {
+ case 274 /* ModuleBlock */: {
let state = 0 /* NonInstantiated */;
forEachChild(node, (n) => {
const childState = getModuleInstanceStateCached(n, visited);
@@ -39410,7 +39561,7 @@ function getModuleInstanceStateWorker(node, visited) {
});
return state;
}
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return getModuleInstanceState(node, visited);
case 79 /* Identifier */:
if (node.isInJSDocNamespace) {
@@ -39582,7 +39733,7 @@ function createBinder() {
}
}
function getDeclarationName(node) {
- if (node.kind === 280 /* ExportAssignment */) {
+ if (node.kind === 283 /* ExportAssignment */) {
return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
}
const name = getNameOfDeclaration(node);
@@ -39591,7 +39742,7 @@ function createBinder() {
const moduleName = getTextOfIdentifierOrLiteral(name);
return isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName}"`;
}
- if (name.kind === 166 /* ComputedPropertyName */) {
+ if (name.kind === 167 /* ComputedPropertyName */) {
const nameExpression = name.expression;
if (isStringOrNumericLiteralLike(nameExpression)) {
return escapeLeadingUnderscores(nameExpression.text);
@@ -39613,30 +39764,30 @@ function createBinder() {
return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0;
}
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return "__constructor" /* Constructor */;
- case 184 /* FunctionType */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
+ case 186 /* FunctionType */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
return "__call" /* Call */;
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
return "__new" /* New */;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return "__index" /* Index */;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return "__export" /* ExportStar */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return "export=" /* ExportEquals */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) {
return "export=" /* ExportEquals */;
}
Debug.fail("Unknown binary declaration kind");
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */;
- case 168 /* Parameter */:
- Debug.assert(node.parent.kind === 326 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
+ case 169 /* Parameter */:
+ Debug.assert(node.parent.kind === 329 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
const functionType = node.parent;
const index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -39683,7 +39834,7 @@ function createBinder() {
messageNeedsName = false;
multipleDefaultExports = true;
} else {
- if (symbol.declarations && symbol.declarations.length && (node.kind === 280 /* ExportAssignment */ && !node.isExportEquals)) {
+ if (symbol.declarations && symbol.declarations.length && (node.kind === 283 /* ExportAssignment */ && !node.isExportEquals)) {
message = Diagnostics.A_module_cannot_have_multiple_default_exports;
messageNeedsName = false;
multipleDefaultExports = true;
@@ -39722,7 +39873,7 @@ function createBinder() {
function declareModuleMember(node, symbolFlags, symbolExcludes) {
const hasExportModifier = !!(getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node);
if (symbolFlags & 2097152 /* Alias */) {
- if (node.kind === 284 /* ExportSpecifier */ || node.kind === 274 /* ImportEqualsDeclaration */ && hasExportModifier) {
+ if (node.kind === 287 /* ExportSpecifier */ || node.kind === 277 /* ImportEqualsDeclaration */ && hasExportModifier) {
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
} else {
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
@@ -39766,7 +39917,7 @@ function createBinder() {
const saveThisParentContainer = thisParentContainer;
const savedBlockScopeContainer = blockScopeContainer;
if (containerFlags & 1 /* IsContainer */) {
- if (node.kind !== 219 /* ArrowFunction */) {
+ if (node.kind !== 221 /* ArrowFunction */) {
thisParentContainer = container;
}
container = blockScopeContainer = node;
@@ -39786,14 +39937,14 @@ function createBinder() {
const saveExceptionTarget = currentExceptionTarget;
const saveActiveLabelList = activeLabelList;
const saveHasExplicitReturn = hasExplicitReturn;
- const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 512 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */;
+ const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 512 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 177 /* ClassStaticBlockDeclaration */;
if (!isImmediatelyInvoked) {
currentFlow = initFlowNode({ flags: 2 /* Start */ });
if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) {
currentFlow.node = node;
}
}
- currentReturnTarget = isImmediatelyInvoked || node.kind === 176 /* Constructor */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */) ? createBranchLabel() : void 0;
+ currentReturnTarget = isImmediatelyInvoked || node.kind === 178 /* Constructor */ || isInJSFile(node) && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */) ? createBranchLabel() : void 0;
currentExceptionTarget = void 0;
currentBreakTarget = void 0;
currentContinueTarget = void 0;
@@ -39807,14 +39958,14 @@ function createBinder() {
node.flags |= 512 /* HasExplicitReturn */;
node.endFlowNode = currentFlow;
}
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
node.flags |= emitFlags;
node.endFlowNode = currentFlow;
}
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
currentFlow = finishFlowLabel(currentReturnTarget);
- if (node.kind === 176 /* Constructor */ || node.kind === 175 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) {
+ if (node.kind === 178 /* Constructor */ || node.kind === 177 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */)) {
node.returnFlowNode = currentFlow;
}
}
@@ -39839,8 +39990,8 @@ function createBinder() {
blockScopeContainer = savedBlockScopeContainer;
}
function bindEachFunctionsFirst(nodes) {
- bindEach(nodes, (n) => n.kind === 263 /* FunctionDeclaration */ ? bind(n) : void 0);
- bindEach(nodes, (n) => n.kind !== 263 /* FunctionDeclaration */ ? bind(n) : void 0);
+ bindEach(nodes, (n) => n.kind === 265 /* FunctionDeclaration */ ? bind(n) : void 0);
+ bindEach(nodes, (n) => n.kind !== 265 /* FunctionDeclaration */ ? bind(n) : void 0);
}
function bindEach(nodes, bindFunction = bind) {
if (nodes === void 0) {
@@ -39860,59 +40011,59 @@ function createBinder() {
inAssignmentPattern = saveInAssignmentPattern;
return;
}
- if (node.kind >= 244 /* FirstStatement */ && node.kind <= 260 /* LastStatement */ && !options.allowUnreachableCode) {
+ if (node.kind >= 246 /* FirstStatement */ && node.kind <= 262 /* LastStatement */ && !options.allowUnreachableCode) {
node.flowNode = currentFlow;
}
switch (node.kind) {
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
bindWhileStatement(node);
break;
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
bindDoStatement(node);
break;
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
bindForStatement(node);
break;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
bindForInOrForOfStatement(node);
break;
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
bindIfStatement(node);
break;
- case 254 /* ReturnStatement */:
- case 258 /* ThrowStatement */:
+ case 256 /* ReturnStatement */:
+ case 260 /* ThrowStatement */:
bindReturnOrThrow(node);
break;
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
bindBreakOrContinueStatement(node);
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
bindTryStatement(node);
break;
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
bindSwitchStatement(node);
break;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
bindCaseBlock(node);
break;
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
bindCaseClause(node);
break;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
bindExpressionStatement(node);
break;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
bindLabeledStatement(node);
break;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
bindPrefixUnaryExpressionFlow(node);
break;
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
bindPostfixUnaryExpressionFlow(node);
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
inAssignmentPattern = saveInAssignmentPattern;
bindDestructuringAssignmentFlow(node);
@@ -39920,49 +40071,49 @@ function createBinder() {
}
bindBinaryExpressionFlow(node);
break;
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
bindDeleteExpressionFlow(node);
break;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
bindConditionalExpressionFlow(node);
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
bindVariableDeclarationFlow(node);
break;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
bindAccessExpressionFlow(node);
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
bindCallExpressionFlow(node);
break;
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
bindNonNullExpressionFlow(node);
break;
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
bindJSDocTypeAlias(node);
break;
- case 314 /* SourceFile */: {
+ case 317 /* SourceFile */: {
bindEachFunctionsFirst(node.statements);
bind(node.endOfFileToken);
break;
}
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
bindEachFunctionsFirst(node.statements);
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
bindBindingElementFlow(node);
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
bindParameterFlow(node);
break;
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 305 /* PropertyAssignment */:
- case 231 /* SpreadElement */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 308 /* PropertyAssignment */:
+ case 233 /* SpreadElement */:
inAssignmentPattern = saveInAssignmentPattern;
default:
bindEachChild(node);
@@ -39976,19 +40127,19 @@ function createBinder() {
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
case 109 /* ThisKeyword */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return containsNarrowableReference(expr);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return hasNarrowableArgument(expr);
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return isNarrowingExpression(expr.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isNarrowingBinaryExpression(expr);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return isNarrowingExpression(expr.expression);
}
return false;
@@ -40007,7 +40158,7 @@ function createBinder() {
}
}
}
- if (expr.expression.kind === 211 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) {
+ if (expr.expression.kind === 213 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) {
return true;
}
return false;
@@ -40038,9 +40189,9 @@ function createBinder() {
}
function isNarrowableOperand(expr) {
switch (expr.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isNarrowableOperand(expr.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (expr.operatorToken.kind) {
case 63 /* EqualsToken */:
return isNarrowableOperand(expr.left);
@@ -40113,24 +40264,24 @@ function createBinder() {
function isStatementCondition(node) {
const parent2 = node.parent;
switch (parent2.kind) {
- case 246 /* IfStatement */:
- case 248 /* WhileStatement */:
- case 247 /* DoStatement */:
+ case 248 /* IfStatement */:
+ case 250 /* WhileStatement */:
+ case 249 /* DoStatement */:
return parent2.expression === node;
- case 249 /* ForStatement */:
- case 228 /* ConditionalExpression */:
+ case 251 /* ForStatement */:
+ case 230 /* ConditionalExpression */:
return parent2.condition === node;
}
return false;
}
function isLogicalExpression(node) {
while (true) {
- if (node.kind === 217 /* ParenthesizedExpression */) {
+ if (node.kind === 219 /* ParenthesizedExpression */) {
node = node.expression;
- } else if (node.kind === 225 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
+ } else if (node.kind === 227 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
node = node.operand;
} else {
- return node.kind === 227 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */);
+ return node.kind === 229 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */);
}
}
}
@@ -40171,7 +40322,7 @@ function createBinder() {
}
function setContinueTarget(node, target) {
let label = activeLabelList;
- while (label && node.parent.kind === 257 /* LabeledStatement */) {
+ while (label && node.parent.kind === 259 /* LabeledStatement */) {
label.continueTarget = target;
label = label.next;
node = node.parent;
@@ -40222,12 +40373,12 @@ function createBinder() {
bind(node.expression);
addAntecedent(preLoopLabel, currentFlow);
currentFlow = preLoopLabel;
- if (node.kind === 251 /* ForOfStatement */) {
+ if (node.kind === 253 /* ForOfStatement */) {
bind(node.awaitModifier);
}
addAntecedent(postLoopLabel, currentFlow);
bind(node.initializer);
- if (node.initializer.kind !== 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind !== 264 /* VariableDeclarationList */) {
bindAssignmentTargetFlow(node.initializer);
}
bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
@@ -40249,7 +40400,7 @@ function createBinder() {
}
function bindReturnOrThrow(node) {
bind(node.expression);
- if (node.kind === 254 /* ReturnStatement */) {
+ if (node.kind === 256 /* ReturnStatement */) {
hasExplicitReturn = true;
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
@@ -40266,7 +40417,7 @@ function createBinder() {
return void 0;
}
function bindBreakOrContinueFlow(node, breakTarget, continueTarget) {
- const flowLabel = node.kind === 253 /* BreakStatement */ ? breakTarget : continueTarget;
+ const flowLabel = node.kind === 255 /* BreakStatement */ ? breakTarget : continueTarget;
if (flowLabel) {
addAntecedent(flowLabel, currentFlow);
currentFlow = unreachableFlow;
@@ -40336,7 +40487,7 @@ function createBinder() {
preSwitchCaseFlow = currentFlow;
bind(node.caseBlock);
addAntecedent(postSwitchLabel, currentFlow);
- const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 299 /* DefaultClause */);
+ const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 302 /* DefaultClause */);
node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents;
if (!hasDefault) {
addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0));
@@ -40379,7 +40530,7 @@ function createBinder() {
maybeBindExpressionFlowIfCall(node.expression);
}
function maybeBindExpressionFlowIfCall(node) {
- if (node.kind === 213 /* CallExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
const call = node;
if (call.expression.kind !== 107 /* SuperKeyword */ && isDottedName(call.expression)) {
currentFlow = createFlowCall(currentFlow, call);
@@ -40405,7 +40556,7 @@ function createBinder() {
currentFlow = finishFlowLabel(postStatementLabel);
}
function bindDestructuringTargetFlow(node) {
- if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */) {
+ if (node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */) {
bindAssignmentTargetFlow(node.left);
} else {
bindAssignmentTargetFlow(node);
@@ -40414,21 +40565,21 @@ function createBinder() {
function bindAssignmentTargetFlow(node) {
if (isNarrowableReference(node)) {
currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node);
- } else if (node.kind === 209 /* ArrayLiteralExpression */) {
+ } else if (node.kind === 211 /* ArrayLiteralExpression */) {
for (const e of node.elements) {
- if (e.kind === 231 /* SpreadElement */) {
+ if (e.kind === 233 /* SpreadElement */) {
bindAssignmentTargetFlow(e.expression);
} else {
bindDestructuringTargetFlow(e);
}
}
- } else if (node.kind === 210 /* ObjectLiteralExpression */) {
+ } else if (node.kind === 212 /* ObjectLiteralExpression */) {
for (const p of node.properties) {
- if (p.kind === 305 /* PropertyAssignment */) {
+ if (p.kind === 308 /* PropertyAssignment */) {
bindDestructuringTargetFlow(p.initializer);
- } else if (p.kind === 306 /* ShorthandPropertyAssignment */) {
+ } else if (p.kind === 309 /* ShorthandPropertyAssignment */) {
bindAssignmentTargetFlow(p.name);
- } else if (p.kind === 307 /* SpreadAssignment */) {
+ } else if (p.kind === 310 /* SpreadAssignment */) {
bindAssignmentTargetFlow(p.expression);
}
}
@@ -40551,7 +40702,7 @@ function createBinder() {
const operator = node.operatorToken.kind;
if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
- if (operator === 63 /* EqualsToken */ && node.left.kind === 212 /* ElementAccessExpression */) {
+ if (operator === 63 /* EqualsToken */ && node.left.kind === 214 /* ElementAccessExpression */) {
const elementAccess = node.left;
if (isNarrowableOperand(elementAccess.expression)) {
currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
@@ -40579,7 +40730,7 @@ function createBinder() {
}
function bindDeleteExpressionFlow(node) {
bindEachChild(node);
- if (node.expression.kind === 211 /* PropertyAccessExpression */) {
+ if (node.expression.kind === 213 /* PropertyAccessExpression */) {
bindAssignmentTargetFlow(node.expression);
}
}
@@ -40644,7 +40795,7 @@ function createBinder() {
}
function bindJSDocTypeAlias(node) {
bind(node.tagName);
- if (node.kind !== 348 /* JSDocEnumTag */ && node.fullName) {
+ if (node.kind !== 351 /* JSDocEnumTag */ && node.fullName) {
setParent(node.fullName, node);
setParentRecursive(node.fullName, false);
}
@@ -40655,7 +40806,7 @@ function createBinder() {
function bindJSDocClassTag(node) {
bindEachChild(node);
const host = getHostSignatureFromJSDoc(node);
- if (host && host.kind !== 174 /* MethodDeclaration */) {
+ if (host && host.kind !== 176 /* MethodDeclaration */) {
addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
}
}
@@ -40668,15 +40819,15 @@ function createBinder() {
}
function bindOptionalChainRest(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
bind(node.questionDotToken);
bind(node.name);
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
bind(node.questionDotToken);
bind(node.argumentExpression);
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
bind(node.questionDotToken);
bindEach(node.typeArguments);
bindEach(node.arguments);
@@ -40723,7 +40874,7 @@ function createBinder() {
bindOptionalChainFlow(node);
} else {
const expr = skipParentheses(node.expression);
- if (expr.kind === 218 /* FunctionExpression */ || expr.kind === 219 /* ArrowFunction */) {
+ if (expr.kind === 220 /* FunctionExpression */ || expr.kind === 221 /* ArrowFunction */) {
bindEach(node.typeArguments);
bindEach(node.arguments);
bind(node.expression);
@@ -40734,7 +40885,7 @@ function createBinder() {
}
}
}
- if (node.expression.kind === 211 /* PropertyAccessExpression */) {
+ if (node.expression.kind === 213 /* PropertyAccessExpression */) {
const propertyAccess = node.expression;
if (isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && isPushOrUnshiftIdentifier(propertyAccess.name)) {
currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
@@ -40743,58 +40894,60 @@ function createBinder() {
}
function getContainerFlags(node) {
switch (node.kind) {
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 269 /* EnumDeclaration */:
- case 210 /* ObjectLiteralExpression */:
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 295 /* JsxAttributes */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 212 /* ObjectLiteralExpression */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 298 /* JsxAttributes */:
return 1 /* IsContainer */;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return 1 /* IsContainer */ | 64 /* IsInterface */;
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 200 /* MappedType */:
- case 181 /* IndexSignature */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 202 /* MappedType */:
+ case 183 /* IndexSignature */:
return 1 /* IsContainer */ | 32 /* HasLocals */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
}
- case 176 /* Constructor */:
- case 263 /* FunctionDeclaration */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
- case 326 /* JSDocFunctionType */:
- case 184 /* FunctionType */:
- case 180 /* ConstructSignature */:
- case 185 /* ConstructorType */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 265 /* FunctionDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
+ case 329 /* JSDocFunctionType */:
+ case 186 /* FunctionType */:
+ case 182 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 177 /* ClassStaticBlockDeclaration */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return 4 /* IsControlFlowContainer */;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
- case 301 /* CatchClause */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 272 /* CaseBlock */:
+ case 304 /* CatchClause */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 275 /* CaseBlock */:
return 2 /* IsBlockScopedContainer */;
- case 242 /* Block */:
+ case 244 /* Block */:
return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */;
}
return 0 /* None */;
@@ -40807,43 +40960,44 @@ function createBinder() {
}
function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) {
switch (container.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return declareModuleMember(node, symbolFlags, symbolExcludes);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
return declareClassMember(node, symbolFlags, symbolExcludes);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 210 /* ObjectLiteralExpression */:
- case 267 /* InterfaceDeclaration */:
- case 295 /* JsxAttributes */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 212 /* ObjectLiteralExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 298 /* JsxAttributes */:
return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 332 /* JSDocSignature */:
- case 181 /* IndexSignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 326 /* JSDocFunctionType */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 175 /* ClassStaticBlockDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 200 /* MappedType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 335 /* JSDocSignature */:
+ case 183 /* IndexSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 329 /* JSDocFunctionType */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 202 /* MappedType */:
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
}
}
@@ -40929,10 +41083,10 @@ function createBinder() {
}
function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {
switch (blockScopeContainer.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (isExternalOrCommonJsModule(container)) {
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
@@ -41122,7 +41276,7 @@ function createBinder() {
}
function checkStrictModeFunctionDeclaration(node) {
if (languageVersion < 2 /* ES2015 */) {
- if (blockScopeContainer.kind !== 314 /* SourceFile */ && blockScopeContainer.kind !== 270 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
+ if (blockScopeContainer.kind !== 317 /* SourceFile */ && blockScopeContainer.kind !== 273 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
const errorSpan = getErrorSpanForNode(file, node);
file.bindDiagnostics.push(createFileDiagnostic(
file,
@@ -41189,7 +41343,7 @@ function createBinder() {
node.tracingPath = file.path;
const saveInStrictMode = inStrictMode;
bindWorker(node);
- if (node.kind > 164 /* LastToken */) {
+ if (node.kind > 165 /* LastToken */) {
const saveParent = parent;
parent = node;
const containerFlags = getContainerFlags(node);
@@ -41251,23 +41405,23 @@ function createBinder() {
break;
}
case 109 /* ThisKeyword */:
- if (currentFlow && (isExpression(node) || parent.kind === 306 /* ShorthandPropertyAssignment */)) {
+ if (currentFlow && (isExpression(node) || parent.kind === 309 /* ShorthandPropertyAssignment */)) {
node.flowNode = currentFlow;
}
return checkContextualIdentifier(node);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
if (currentFlow && isPartOfTypeQuery(node)) {
node.flowNode = currentFlow;
}
break;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
case 107 /* SuperKeyword */:
node.flowNode = currentFlow;
break;
case 80 /* PrivateIdentifier */:
return checkPrivateIdentifier(node);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = node;
if (currentFlow && isNarrowableReference(expr)) {
expr.flowNode = currentFlow;
@@ -41285,7 +41439,7 @@ function createBinder() {
);
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const specialKind = getAssignmentDeclarationKind(node);
switch (specialKind) {
case 1 /* ExportsProperty */:
@@ -41320,79 +41474,80 @@ function createBinder() {
Debug.fail("Unknown binary expression special property assignment kind");
}
return checkStrictModeBinaryExpression(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return checkStrictModeCatchClause(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return checkStrictModeDeleteExpression(node);
case 8 /* NumericLiteral */:
return checkStrictModeNumericLiteral(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return checkStrictModePostfixUnaryExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return checkStrictModePrefixUnaryExpression(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return checkStrictModeWithStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return checkStrictModeLabeledStatement(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
seenThisKeyword = true;
return;
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
break;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return bindTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return bindParameter(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return bindVariableDeclarationOrBindingElement(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
node.flowNode = currentFlow;
return bindVariableDeclarationOrBindingElement(node);
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 174 /* OverloadPropertyDeclaration */:
return bindPropertyWorker(node);
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */);
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return bindPropertyOrMethodOrAccessor(
node,
8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */),
isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */
);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return bindFunctionDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, 0 /* None */);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */);
- case 184 /* FunctionType */:
- case 326 /* JSDocFunctionType */:
- case 332 /* JSDocSignature */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 329 /* JSDocFunctionType */:
+ case 335 /* JSDocSignature */:
+ case 187 /* ConstructorType */:
return bindFunctionOrConstructorType(node);
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 200 /* MappedType */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 202 /* MappedType */:
return bindAnonymousTypeWorker(node);
- case 341 /* JSDocClassTag */:
+ case 344 /* JSDocClassTag */:
return bindJSDocClassTag(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return bindObjectLiteralExpression(node);
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return bindFunctionExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
const assignmentKind = getAssignmentDeclarationKind(node);
switch (assignmentKind) {
case 7 /* ObjectDefinePropertyValue */:
@@ -41410,61 +41565,63 @@ function createBinder() {
bindCallExpression(node);
}
break;
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
inStrictMode = true;
return bindClassLikeDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return bindAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return bindOverloadDeclaration(node);
+ case 270 /* InterfaceDeclaration */:
return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return bindEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return bindModuleDeclaration(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return bindJsxAttributes(node);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */);
- case 274 /* ImportEqualsDeclaration */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return bindNamespaceExportDeclaration(node);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return bindImportClause(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return bindExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return bindExportAssignment(node);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
updateStrictModeStatementList(node.statements);
return bindSourceFileIfExternalModule();
- case 242 /* Block */:
+ case 244 /* Block */:
if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) {
return;
}
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return updateStrictModeStatementList(node.statements);
- case 349 /* JSDocParameterTag */:
- if (node.parent.kind === 332 /* JSDocSignature */) {
+ case 352 /* JSDocParameterTag */:
+ if (node.parent.kind === 335 /* JSDocSignature */) {
return bindParameter(node);
}
- if (node.parent.kind !== 331 /* JSDocTypeLiteral */) {
+ if (node.parent.kind !== 334 /* JSDocTypeLiteral */) {
break;
}
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
const propTag = node;
- const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 325 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
+ const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 328 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */);
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
}
}
@@ -41602,8 +41759,8 @@ function createBinder() {
}
const thisContainer = getThisContainer(node, false);
switch (thisContainer.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
let constructorSymbol = thisContainer.symbol;
if (isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 63 /* EqualsToken */) {
const l = thisContainer.parent.left;
@@ -41621,13 +41778,14 @@ function createBinder() {
addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */);
}
break;
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
const containingClass = thisContainer.parent;
const symbolTable = isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members;
if (hasDynamicName(node)) {
@@ -41636,7 +41794,7 @@ function createBinder() {
declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, true);
}
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (hasDynamicName(node)) {
break;
} else if (thisContainer.commonJsModuleIndicator) {
@@ -41661,7 +41819,7 @@ function createBinder() {
function bindSpecialPropertyDeclaration(node) {
if (node.expression.kind === 109 /* ThisKeyword */) {
bindThisPropertyAssignment(node);
- } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 314 /* SourceFile */) {
+ } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 317 /* SourceFile */) {
if (isPrototypeAccess(node.expression)) {
bindPrototypePropertyAssignment(node, node.parent);
} else {
@@ -41691,7 +41849,7 @@ function createBinder() {
}
function bindObjectDefinePropertyAssignment(node) {
let namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]);
- const isToplevel = node.parent.parent.kind === 314 /* SourceFile */;
+ const isToplevel = node.parent.parent.kind === 317 /* SourceFile */;
namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, false, false);
bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, false);
}
@@ -41777,7 +41935,7 @@ function createBinder() {
declareSymbol(symbolTable, namespaceSymbol, declaration, includes | 67108864 /* Assignment */, excludes & ~67108864 /* Assignment */);
}
function isTopLevelNamespaceAssignment(propertyAccess) {
- return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 314 /* SourceFile */ : propertyAccess.parent.parent.kind === 314 /* SourceFile */;
+ return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 317 /* SourceFile */ : propertyAccess.parent.parent.kind === 317 /* SourceFile */;
}
function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) {
let namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer);
@@ -41835,7 +41993,7 @@ function createBinder() {
}
}
function bindClassLikeDeclaration(node) {
- if (node.kind === 264 /* ClassDeclaration */ || node.kind === 265 /* StructDeclaration */) {
+ if (node.kind === 266 /* ClassDeclaration */ || node.kind === 267 /* StructDeclaration */) {
bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */);
} else {
const bindingName = node.name ? node.name.escapedText : "__class" /* Class */;
@@ -41857,7 +42015,7 @@ function createBinder() {
prototypeSymbol.parent = symbol;
}
function bindAnnotationDeclaration(node) {
- Debug.assert(node.kind === 266 /* AnnotationDeclaration */);
+ Debug.assert(node.kind === 268 /* AnnotationDeclaration */);
bindBlockScopedDeclaration(node, 32 /* Class */ | 268435456 /* Annotation */, 899503 /* ClassExcludes */);
const { symbol } = node;
const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype");
@@ -41871,6 +42029,21 @@ function createBinder() {
symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);
prototypeSymbol.parent = symbol;
}
+ function bindOverloadDeclaration(node) {
+ Debug.assert(node.kind === 269 /* OverloadDeclaration */);
+ bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */);
+ const { symbol } = node;
+ const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype");
+ const symbolExport = symbol.exports.get(prototypeSymbol.escapedName);
+ if (symbolExport) {
+ if (node.name) {
+ setParent(node.name, node);
+ }
+ file.bindDiagnostics.push(createDiagnosticForNode2(symbolExport.declarations[0], Diagnostics.Duplicate_identifier_0, symbolName(prototypeSymbol)));
+ }
+ symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);
+ prototypeSymbol.parent = symbol;
+ }
function bindEnumDeclaration(node) {
return isEnumConst(node) ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */);
}
@@ -41879,7 +42052,7 @@ function createBinder() {
checkStrictModeEvalOrArguments(node, node.name);
}
if (!isBindingPattern(node.name)) {
- const possibleVariableDecl = node.kind === 261 /* VariableDeclaration */ ? node : node.parent.parent;
+ const possibleVariableDecl = node.kind === 263 /* VariableDeclaration */ ? node : node.parent.parent;
if (isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) {
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
} else if (isBlockOrCatchScoped(node)) {
@@ -41892,7 +42065,7 @@ function createBinder() {
}
}
function bindParameter(node) {
- if (node.kind === 349 /* JSDocParameterTag */ && container.kind !== 332 /* JSDocSignature */) {
+ if (node.kind === 352 /* JSDocParameterTag */ && container.kind !== 335 /* JSDocSignature */) {
return;
}
if (inStrictMode && !(node.flags & 16777216 /* Ambient */)) {
@@ -41959,7 +42132,7 @@ function createBinder() {
} else {
declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
}
- } else if (node.parent.kind === 195 /* InferType */) {
+ } else if (node.parent.kind === 197 /* InferType */) {
const container2 = getInferTypeContainer(node.parent);
if (container2) {
if (!container2.locals) {
@@ -41982,7 +42155,7 @@ function createBinder() {
return false;
}
if (currentFlow === unreachableFlow) {
- const reportError = isStatementButNotDeclaration(node) && node.kind !== 243 /* EmptyStatement */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 270 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
+ const reportError = isStatementButNotDeclaration(node) && node.kind !== 245 /* EmptyStatement */ || node.kind === 266 /* ClassDeclaration */ || node.kind === 273 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
if (reportError) {
currentFlow = reportedUnreachableFlow;
if (!options.allowUnreachableCode) {
@@ -42008,12 +42181,12 @@ function isExecutableStatement(s) {
}
function isPurelyTypeDeclaration(s) {
switch (s.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return getModuleInstanceState(s) !== 1 /* Instantiated */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return hasSyntacticModifier(s, 2048 /* Const */);
default:
return false;
@@ -42195,7 +42368,7 @@ function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignatu
symbol.exports.forEach(visitSymbol);
}
forEach(symbol.declarations, (d) => {
- if (d.type && d.type.kind === 186 /* TypeQuery */) {
+ if (d.type && d.type.kind === 188 /* TypeQuery */) {
const query = d.type;
const entity = getResolvedSymbol(getFirstIdentifier2(query.exprName));
visitSymbol(entity);
@@ -44261,7 +44434,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks());
}
function isGlobalSourceFile(node) {
- return node.kind === 314 /* SourceFile */ && !isExternalOrCommonJsModule(node);
+ return node.kind === 317 /* SourceFile */ && !isExternalOrCommonJsModule(node);
}
function isValidFromLibs(symbol, node) {
var _a2;
@@ -44338,13 +44511,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile);
}
if (declaration.pos <= usage.pos && !(isPropertyDeclaration(declaration) && isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) {
- if (declaration.kind === 208 /* BindingElement */) {
- const errorBindingElement = getAncestor(usage, 208 /* BindingElement */);
+ if (declaration.kind === 210 /* BindingElement */) {
+ const errorBindingElement = getAncestor(usage, 210 /* BindingElement */);
if (errorBindingElement) {
return findAncestor(errorBindingElement, isBindingElement) !== findAncestor(declaration, isBindingElement) || declaration.pos < errorBindingElement.pos;
}
- return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 261 /* VariableDeclaration */), usage);
- } else if (declaration.kind === 261 /* VariableDeclaration */) {
+ return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 263 /* VariableDeclaration */), usage);
+ } else if (declaration.kind === 263 /* VariableDeclaration */) {
return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
} else if (isClassDeclaration(declaration)) {
return !findAncestor(usage, (n) => isComputedPropertyName(n) && n.parent.parent === declaration);
@@ -44355,10 +44528,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return true;
}
- if (usage.parent.kind === 284 /* ExportSpecifier */ || usage.parent.kind === 280 /* ExportAssignment */ && usage.parent.isExportEquals) {
+ if (usage.parent.kind === 287 /* ExportSpecifier */ || usage.parent.kind === 283 /* ExportAssignment */ && usage.parent.isExportEquals) {
return true;
}
- if (usage.kind === 280 /* ExportAssignment */ && usage.isExportEquals) {
+ if (usage.kind === 283 /* ExportAssignment */ && usage.isExportEquals) {
return true;
}
if (!!(usage.flags & 8388608 /* JSDoc */) || isInTypeQuery(usage) || usageInTypeDeclaration()) {
@@ -44377,9 +44550,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration2, usage2) {
switch (declaration2.parent.parent.kind) {
- case 244 /* VariableStatement */:
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
+ case 246 /* VariableStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
if (isSameScopeDescendentOf(usage2, declaration2, declContainer)) {
return true;
}
@@ -44404,7 +44577,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const initializerOfProperty = propertyDeclaration.initializer === current;
if (initializerOfProperty) {
if (isStatic(current.parent)) {
- if (declaration2.kind === 174 /* MethodDeclaration */) {
+ if (declaration2.kind === 176 /* MethodDeclaration */) {
return true;
}
if (isPropertyDeclaration(declaration2) && getContainingClass(usage2) === getContainingClass(declaration2)) {
@@ -44418,7 +44591,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
} else {
- const isDeclarationInstanceProperty = declaration2.kind === 171 /* PropertyDeclaration */ && !isStatic(declaration2);
+ const isDeclarationInstanceProperty = declaration2.kind === 172 /* PropertyDeclaration */ && !isStatic(declaration2);
if (!isDeclarationInstanceProperty || getContainingClass(usage2) !== getContainingClass(declaration2)) {
return true;
}
@@ -44437,15 +44610,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return "quit";
}
switch (node.kind) {
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return true;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return stopAtAnyPropertyDeclaration && (isPropertyDeclaration(declaration2) && node.parent === declaration2.parent || isParameterPropertyDeclaration(declaration2, declaration2.parent) && node.parent === declaration2.parent.parent) ? "quit" : true;
- case 242 /* Block */:
+ case 244 /* Block */:
switch (node.parent.kind) {
- case 177 /* GetAccessor */:
- case 174 /* MethodDeclaration */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -44475,22 +44648,22 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function requiresScopeChangeWorker(node) {
switch (node.kind) {
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 176 /* Constructor */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 178 /* Constructor */:
return false;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 305 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 308 /* PropertyAssignment */:
return requiresScopeChangeWorker(node.name);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (hasStaticModifier(node)) {
return target < 99 /* ESNext */ || !useDefineForClassFields;
}
return requiresScopeChangeWorker(node.name);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return requiresScopeChangeWorker(node.name);
default:
if (isNullishCoalesce(node) || isOptionalChain(node)) {
@@ -44532,17 +44705,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (result = lookup(location.locals, name, meaning)) {
let useResult = true;
if (isFunctionLike(location) && lastLocation && lastLocation !== location.body) {
- if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 329 /* JSDoc */) {
- useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || lastLocation.kind === 168 /* Parameter */ || lastLocation.kind === 349 /* JSDocParameterTag */ || lastLocation.kind === 350 /* JSDocReturnTag */ || lastLocation.kind === 167 /* TypeParameter */ : false;
+ if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 332 /* JSDoc */) {
+ useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || lastLocation.kind === 169 /* Parameter */ || lastLocation.kind === 352 /* JSDocParameterTag */ || lastLocation.kind === 353 /* JSDocReturnTag */ || lastLocation.kind === 168 /* TypeParameter */ : false;
}
if (meaning & result.flags & 3 /* Variable */) {
if (useOuterVariableScopeInParameter(result, location, lastLocation)) {
useResult = false;
} else if (result.flags & 1 /* FunctionScopedVariable */) {
- useResult = lastLocation.kind === 168 /* Parameter */ || lastLocation === location.type && !!findAncestor(result.valueDeclaration, isParameter);
+ useResult = lastLocation.kind === 169 /* Parameter */ || lastLocation === location.type && !!findAncestor(result.valueDeclaration, isParameter);
}
}
- } else if (location.kind === 194 /* ConditionalType */) {
+ } else if (location.kind === 196 /* ConditionalType */) {
useResult = lastLocation === location.trueType;
}
if (useResult) {
@@ -44554,13 +44727,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation);
switch (location.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (!isExternalOrCommonJsModule(location))
break;
isInExternalModule = true;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const moduleExports = getSymbolOfNode(location) ? ((_a2 = getSymbolOfNode(location)) == null ? void 0 : _a2.exports) || emptySymbols : emptySymbols;
- if (location.kind === 314 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 16777216 /* Ambient */ && !isGlobalScopeAugmentation(location)) {
+ if (location.kind === 317 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 16777216 /* Ambient */ && !isGlobalScopeAugmentation(location)) {
if (result = moduleExports.get("default" /* Default */)) {
const localSymbol = getLocalSymbolForExportDefault(result);
if (localSymbol && result.flags & meaning && localSymbol.escapedName === name) {
@@ -44569,7 +44742,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
result = void 0;
}
const moduleExport = moduleExports.get(name);
- if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 284 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 283 /* NamespaceExport */))) {
+ if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 287 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 286 /* NamespaceExport */))) {
break;
}
}
@@ -44581,12 +44754,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (result = lookup(((_c = getSymbolOfNode(location)) == null ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) {
break loop;
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (!isStatic(location)) {
const ctor = findConstructorDeclaration(location.parent);
if (ctor && ctor.locals) {
@@ -44597,9 +44770,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
if (result = lookup(getSymbolOfNode(location).members || emptySymbols, name, meaning & 788968 /* Type */)) {
if (!isTypeParameterSymbolDeclaredInContainer(result, location)) {
result = void 0;
@@ -44613,7 +44786,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
break loop;
}
- if (location.kind === 232 /* ClassExpression */ && meaning & 32 /* Class */) {
+ if (location.kind === 234 /* ClassExpression */ && meaning & 32 /* Class */) {
const className = location.name;
if (className && name === className.escapedText) {
result = location.symbol;
@@ -44621,7 +44794,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
if (lastLocation === location.expression && location.parent.token === 95 /* ExtendsKeyword */) {
const container = location.parent.parent;
if (isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 788968 /* Type */))) {
@@ -44632,9 +44805,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
grandparent = location.parent.parent;
- if (isClassLike(grandparent) || grandparent.kind === 267 /* InterfaceDeclaration */) {
+ if (isClassLike(grandparent) || grandparent.kind === 270 /* InterfaceDeclaration */) {
if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) {
if (nameNotFoundMessage) {
error(errorLocation, Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
@@ -44643,21 +44816,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */) {
break;
}
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
if (meaning & 3 /* Variable */ && name === "arguments") {
result = argumentsSymbol;
break loop;
}
break;
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
if (meaning & 3 /* Variable */ && name === "arguments") {
result = argumentsSymbol;
break loop;
@@ -44670,37 +44843,37 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 169 /* Decorator */:
- if (location.parent && location.parent.kind === 168 /* Parameter */) {
+ case 170 /* Decorator */:
+ if (location.parent && location.parent.kind === 169 /* Parameter */) {
location = location.parent;
}
- if (location.parent && (isClassElement(location.parent) || location.parent.kind === 264 /* ClassDeclaration */)) {
+ if (location.parent && (isClassElement(location.parent) || location.parent.kind === 266 /* ClassDeclaration */)) {
location = location.parent;
}
break;
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
const root = getJSDocRoot(location);
if (root) {
location = root.parent;
}
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) {
if (!associatedDeclarationForContainingInitializerOrBindingName) {
associatedDeclarationForContainingInitializerOrBindingName = location;
}
}
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) {
if (isParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) {
associatedDeclarationForContainingInitializerOrBindingName = location;
}
}
break;
- case 195 /* InferType */:
+ case 197 /* InferType */:
if (meaning & 262144 /* TypeParameter */) {
const parameterName = location.typeParameter.name;
if (parameterName && name === parameterName.escapedText) {
@@ -44721,7 +44894,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (!result) {
if (lastLocation) {
- Debug.assert(lastLocation.kind === 314 /* SourceFile */);
+ Debug.assert(lastLocation.kind === 317 /* SourceFile */);
if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) {
return lastLocation.symbol;
}
@@ -44818,7 +44991,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) {
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */);
if (typeOnlyDeclaration) {
- const message = typeOnlyDeclaration.kind === 284 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
+ const message = typeOnlyDeclaration.kind === 287 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
const unescapedName = unescapeLeadingUnderscores(name);
addTypeOnlyDeclarationRelatedInfo(
error(errorLocation, message, unescapedName),
@@ -44838,14 +45011,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
diagnostic,
createDiagnosticForNode(
typeOnlyDeclaration,
- typeOnlyDeclaration.kind === 284 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
+ typeOnlyDeclaration.kind === 287 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
unescapedName
)
);
}
function getIsDeferredContext(location, lastLocation) {
- if (location.kind !== 219 /* ArrowFunction */ && location.kind !== 218 /* FunctionExpression */) {
- return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 171 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name);
+ if (location.kind !== 221 /* ArrowFunction */ && location.kind !== 220 /* FunctionExpression */) {
+ return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 172 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name);
}
if (lastLocation && lastLocation === location.name) {
return false;
@@ -44857,12 +45030,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isSelfReferenceLocation(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 273 /* ModuleDeclaration */:
return true;
default:
return false;
@@ -44874,7 +45047,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isTypeParameterSymbolDeclaredInContainer(symbol, container) {
if (symbol.declarations) {
for (const decl of symbol.declarations) {
- if (decl.kind === 167 /* TypeParameter */) {
+ if (decl.kind === 168 /* TypeParameter */) {
const parent = isJSDocTemplateTag(decl.parent) ? getJSDocHost(decl.parent) : decl.parent;
if (parent === container) {
return !(isJSDocTemplateTag(decl.parent) && find(decl.parent.parent.tags, isJSDocTypeAlias));
@@ -44924,9 +45097,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getEntityNameForExtendingInterface(node) {
switch (node.kind) {
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return node.parent ? getEntityNameForExtendingInterface(node.parent) : void 0;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
if (isEntityNameExpression(node.expression)) {
return node.expression;
}
@@ -44974,7 +45147,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown";
}
function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) {
- if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 284 /* ExportSpecifier */) {
+ if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 287 /* ExportSpecifier */) {
error(errorLocation, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name);
return true;
}
@@ -45063,7 +45236,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const declaration = (_a2 = result.declarations) == null ? void 0 : _a2.find(
- (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || d.kind === 269 /* EnumDeclaration */
+ (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || d.kind === 272 /* EnumDeclaration */
);
if (declaration === void 0)
return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");
@@ -45097,13 +45270,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getAnyImportSyntax(node) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return node;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return node.parent;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return node.parent.parent;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return node.parent.parent.parent;
default:
return void 0;
@@ -45113,7 +45286,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return symbol.declarations && findLast(symbol.declarations, isAliasSymbolDeclaration2);
}
function isAliasSymbolDeclaration2(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */ || node.kind === 273 /* NamespaceExportDeclaration */ || node.kind === 276 /* ImportClause */ && !!node.name || node.kind === 277 /* NamespaceImport */ || node.kind === 283 /* NamespaceExport */ || node.kind === 279 /* ImportSpecifier */ || node.kind === 284 /* ExportSpecifier */ || node.kind === 280 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 306 /* ShorthandPropertyAssignment */ || node.kind === 305 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 261 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 208 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
+ return node.kind === 277 /* ImportEqualsDeclaration */ || node.kind === 276 /* NamespaceExportDeclaration */ || node.kind === 279 /* ImportClause */ && !!node.name || node.kind === 280 /* NamespaceImport */ || node.kind === 286 /* NamespaceExport */ || node.kind === 282 /* ImportSpecifier */ || node.kind === 287 /* ExportSpecifier */ || node.kind === 283 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 309 /* ShorthandPropertyAssignment */ || node.kind === 308 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 263 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 210 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
}
function isAliasableOrJsExpression(e) {
return isAliasableExpression(e) || isFunctionExpression(e) && isJSConstructor(e);
@@ -45124,7 +45297,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const name = getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0];
return isIdentifier(commonJSPropertyAccess.name) ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) : void 0;
}
- if (isVariableDeclaration(node) || node.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ if (isVariableDeclaration(node) || node.moduleReference.kind === 289 /* ExternalModuleReference */) {
const immediate = resolveExternalModuleName(
node,
getExternalModuleRequireArgument(node) || getExternalModuleImportEqualsDeclarationExpression(node)
@@ -45140,7 +45313,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) {
if (markSymbolOfAliasDeclarationIfTypeOnly(node, void 0, resolved, false) && !node.isTypeOnly) {
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfNode(node));
- const isExport = typeOnlyDeclaration.kind === 284 /* ExportSpecifier */;
+ const isExport = typeOnlyDeclaration.kind === 287 /* ExportSpecifier */;
const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here;
const name = unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
@@ -45242,15 +45415,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getModuleSpecifierForImportOrExport(node) {
switch (node.kind) {
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return node.parent.moduleSpecifier;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : void 0;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return node.parent.parent.moduleSpecifier;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return node.parent.parent.parent.moduleSpecifier;
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return node.parent.parent.moduleSpecifier;
default:
return Debug.assertNever(node);
@@ -45495,31 +45668,31 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTargetOfAliasDeclaration(node, dontRecursivelyResolve = false) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
- case 261 /* VariableDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 263 /* VariableDeclaration */:
return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return getTargetOfImportClause(node, dontRecursivelyResolve);
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return getTargetOfNamespaceImport(node, dontRecursivelyResolve);
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
return getTargetOfNamespaceExport(node, dontRecursivelyResolve);
- case 279 /* ImportSpecifier */:
- case 208 /* BindingElement */:
+ case 282 /* ImportSpecifier */:
+ case 210 /* BindingElement */:
return getTargetOfImportSpecifier(node, dontRecursivelyResolve);
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve);
- case 280 /* ExportAssignment */:
- case 227 /* BinaryExpression */:
+ case 283 /* ExportAssignment */:
+ case 229 /* BinaryExpression */:
return getTargetOfExportAssignment(node, dontRecursivelyResolve);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, true, dontRecursivelyResolve);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getTargetOfAliasLikeExpression(node.initializer, dontRecursivelyResolve);
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return getTargetOfAccessExpression(node, dontRecursivelyResolve);
default:
return Debug.fail();
@@ -45650,10 +45823,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (entityName.kind === 79 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
- if (entityName.kind === 79 /* Identifier */ || entityName.parent.kind === 165 /* QualifiedName */) {
+ if (entityName.kind === 79 /* Identifier */ || entityName.parent.kind === 166 /* QualifiedName */) {
return resolveEntityName(entityName, 1920 /* Namespace */, false, dontResolveAlias);
} else {
- Debug.assert(entityName.parent.kind === 274 /* ImportEqualsDeclaration */);
+ Debug.assert(entityName.parent.kind === 277 /* ImportEqualsDeclaration */);
return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, false, dontResolveAlias);
}
}
@@ -45713,9 +45886,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!symbol) {
return getMergedSymbol(symbolFromJSPrototype);
}
- } else if (name.kind === 165 /* QualifiedName */ || name.kind === 211 /* PropertyAccessExpression */) {
- const left = name.kind === 165 /* QualifiedName */ ? name.left : name.expression;
- const right = name.kind === 165 /* QualifiedName */ ? name.right : name.name;
+ } else if (name.kind === 166 /* QualifiedName */ || name.kind === 213 /* PropertyAccessExpression */) {
+ const left = name.kind === 166 /* QualifiedName */ ? name.left : name.expression;
+ const right = name.kind === 166 /* QualifiedName */ ? name.right : name.name;
let namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, false, location);
if (!namespace || nodeIsMissing(right)) {
return void 0;
@@ -45772,7 +45945,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
throw Debug.assertNever(name, "Unknown entity name kind.");
}
Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here.");
- if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 280 /* ExportAssignment */)) {
+ if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 283 /* ExportAssignment */)) {
markSymbolOfAliasDeclarationIfTypeOnly(getAliasDeclarationFromName(name), symbol, void 0, true);
}
return symbol.flags & meaning || dontResolveAlias ? symbol : resolveAlias(symbol);
@@ -46075,7 +46248,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
var _a2;
const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
if (!dontResolveAlias && symbol) {
- if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 314 /* SourceFile */)) {
+ if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 317 /* SourceFile */)) {
const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop";
error(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName);
return symbol;
@@ -46393,7 +46566,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function findConstructorDeclaration(node) {
const members = node.members;
for (const member of members) {
- if (member.kind === 176 /* Constructor */ && nodeIsPresent(member.body)) {
+ if (member.kind === 178 /* Constructor */ && nodeIsPresent(member.body)) {
return member;
}
}
@@ -46503,19 +46676,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
switch (location.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (!isExternalOrCommonJsModule(location)) {
break;
}
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const sym = getSymbolOfNode(location);
if (result = callback((sym == null ? void 0 : sym.exports) || emptySymbols, void 0, true, location)) {
return result;
}
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
let table;
(getSymbolOfNode(location).members || emptySymbols).forEach((memberSymbol, key) => {
if (memberSymbol.flags & (788968 /* Type */ & ~67108864 /* Assignment */)) {
@@ -46571,7 +46744,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return [symbol];
}
const result2 = forEachEntry(symbols, (symbolFromSymbolTable) => {
- if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 284 /* ExportSpecifier */))) {
+ if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 287 /* ExportSpecifier */))) {
const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
const candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification);
if (candidate) {
@@ -46607,7 +46780,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (symbolFromSymbolTable === symbol) {
return true;
}
- const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 284 /* ExportSpecifier */);
+ const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 287 /* ExportSpecifier */);
symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
const flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
if (flags & meaning) {
@@ -46622,10 +46795,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (symbol.declarations && symbol.declarations.length) {
for (const declaration of symbol.declarations) {
switch (declaration.kind) {
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
continue;
default:
return false;
@@ -46724,10 +46897,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return node && getSymbolOfNode(node);
}
function hasExternalModuleSymbol(declaration) {
- return isAmbientModule(declaration) || declaration.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
+ return isAmbientModule(declaration) || declaration.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
}
function hasNonGlobalAugmentationExternalModuleSymbol(declaration) {
- return isModuleWithStringLiteralName(declaration) || declaration.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
+ return isModuleWithStringLiteralName(declaration) || declaration.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
}
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
let aliasesToMakeVisible;
@@ -46773,9 +46946,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
let meaning;
- if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 234 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 166 /* ComputedPropertyName */) {
+ if (entityName.parent.kind === 188 /* TypeQuery */ || entityName.parent.kind === 236 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
- } else if (entityName.kind === 165 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 274 /* ImportEqualsDeclaration */) {
+ } else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 213 /* PropertyAccessExpression */ || entityName.parent.kind === 277 /* ImportEqualsDeclaration */) {
meaning = 1920 /* Namespace */;
} else {
meaning = 788968 /* Type */;
@@ -46815,7 +46988,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
function symbolToStringWorker(writer2) {
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
- const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 314 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
+ const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 317 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
printer.writeNode(4 /* Unspecified */, entity, sourceFile, writer2);
return writer2;
@@ -46826,9 +46999,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function signatureToStringWorker(writer2) {
let sigOutput;
if (flags & 262144 /* WriteArrowStyleSignature */) {
- sigOutput = kind === 1 /* Construct */ ? 185 /* ConstructorType */ : 184 /* FunctionType */;
+ sigOutput = kind === 1 /* Construct */ ? 187 /* ConstructorType */ : 186 /* FunctionType */;
} else {
- sigOutput = kind === 1 /* Construct */ ? 180 /* ConstructSignature */ : 179 /* CallSignature */;
+ sigOutput = kind === 1 /* Construct */ ? 182 /* ConstructSignature */ : 181 /* CallSignature */;
}
const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
@@ -47322,7 +47495,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function shouldWriteTypeOfFunctionSymbol() {
var _a3;
const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && some(symbol.declarations, (declaration) => isStatic(declaration));
- const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || forEach(symbol.declarations, (declaration) => declaration.parent.kind === 314 /* SourceFile */ || declaration.parent.kind === 271 /* ModuleBlock */));
+ const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || forEach(symbol.declarations, (declaration) => declaration.parent.kind === 317 /* SourceFile */ || declaration.parent.kind === 274 /* ModuleBlock */));
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a3 = context.visitedTypes) == null ? void 0 : _a3.has(typeId))) && (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
}
@@ -47401,12 +47574,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
const signature = resolved.callSignatures[0];
- const signatureNode = signatureToSignatureDeclarationHelper(signature, 184 /* FunctionType */, context);
+ const signatureNode = signatureToSignatureDeclarationHelper(signature, 186 /* FunctionType */, context);
return signatureNode;
}
if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {
const signature = resolved.constructSignatures[0];
- const signatureNode = signatureToSignatureDeclarationHelper(signature, 185 /* ConstructorType */, context);
+ const signatureNode = signatureToSignatureDeclarationHelper(signature, 187 /* ConstructorType */, context);
return signatureNode;
}
}
@@ -47574,12 +47747,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const typeElements = [];
for (const signature of resolvedType.callSignatures) {
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 179 /* CallSignature */, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 181 /* CallSignature */, context));
}
for (const signature of resolvedType.constructSignatures) {
if (signature.flags & 4 /* Abstract */)
continue;
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 182 /* ConstructSignature */, context));
}
for (const info of resolvedType.indexInfos) {
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
@@ -47651,7 +47824,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {
const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */);
for (const signature of signatures) {
- const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 173 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
+ const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 175 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
typeElements.push(preserveCommentsOn(methodDeclaration));
}
} else {
@@ -47682,8 +47855,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function preserveCommentsOn(node) {
var _a3;
- if (some(propertySymbol.declarations, (d) => d.kind === 356 /* JSDocPropertyTag */)) {
- const d = (_a3 = propertySymbol.declarations) == null ? void 0 : _a3.find((d2) => d2.kind === 356 /* JSDocPropertyTag */);
+ if (some(propertySymbol.declarations, (d) => d.kind === 359 /* JSDocPropertyTag */)) {
+ const d = (_a3 = propertySymbol.declarations) == null ? void 0 : _a3.find((d2) => d2.kind === 359 /* JSDocPropertyTag */);
const commentText = getTextOfJSDocComment(d.comment);
if (commentText) {
setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
@@ -47786,7 +47959,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
typeParameters = signature.typeParameters && signature.typeParameters.map((parameter) => typeParameterToDeclaration(parameter, context));
}
const expandedParams = getExpandedParameters(signature, true)[0];
- const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
+ const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 178 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
if (thisParameter) {
parameters.unshift(thisParameter);
@@ -47807,11 +47980,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
let modifiers = options == null ? void 0 : options.modifiers;
- if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
+ if (kind === 187 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
const flags = modifiersToFlags(modifiers);
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
}
- const node = kind === 179 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 180 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 173 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 176 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0) : kind === 177 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 178 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 181 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 326 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 184 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 185 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 263 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 218 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 219 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
+ const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
if (typeArguments) {
node.typeArguments = factory.createNodeArray(typeArguments);
}
@@ -47849,9 +48022,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return typeParameterToDeclarationWithConstraint(type, context, constraintNode);
}
function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) {
- let parameterDeclaration = getDeclarationOfKind(parameterSymbol, 168 /* Parameter */);
+ let parameterDeclaration = getDeclarationOfKind(parameterSymbol, 169 /* Parameter */);
if (!parameterDeclaration && !isTransientSymbol(parameterSymbol)) {
- parameterDeclaration = getDeclarationOfKind(parameterSymbol, 349 /* JSDocParameterTag */);
+ parameterDeclaration = getDeclarationOfKind(parameterSymbol, 352 /* JSDocParameterTag */);
}
let parameterType = getTypeOfSymbol(parameterSymbol);
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
@@ -47861,7 +48034,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && preserveModifierFlags && parameterDeclaration && canHaveModifiers(parameterDeclaration) ? map(getModifiers(parameterDeclaration), factory.cloneNode) : void 0;
const isRest = parameterDeclaration && isRestParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 32768 /* RestParameter */;
const dotDotDotToken = isRest ? factory.createToken(25 /* DotDotDotToken */) : void 0;
- const name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 79 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 165 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol);
+ const name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 79 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 166 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol);
const isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 16384 /* OptionalParameter */;
const questionToken = isOptional ? factory.createToken(57 /* QuestionToken */) : void 0;
const parameterNode = factory.createParameterDeclaration(
@@ -48009,11 +48182,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getSpecifierForModuleSymbol(symbol, context, overrideImportMode) {
var _a2;
- let file = getDeclarationOfKind(symbol, 314 /* SourceFile */);
+ let file = getDeclarationOfKind(symbol, 317 /* SourceFile */);
if (!file) {
const equivalentFileSymbol = firstDefined(symbol.declarations, (d) => getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol));
if (equivalentFileSymbol) {
- file = getDeclarationOfKind(equivalentFileSymbol, 314 /* SourceFile */);
+ file = getDeclarationOfKind(equivalentFileSymbol, 317 /* SourceFile */);
}
}
if (file && file.moduleName !== void 0) {
@@ -48453,7 +48626,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return transformed === existing ? setTextRange(factory.cloneNode(existing), existing) : transformed;
function visitExistingNodeTreeSymbols(node) {
- if (isJSDocAllType(node) || node.kind === 328 /* JSDocNamepathType */) {
+ if (isJSDocAllType(node) || node.kind === 331 /* JSDocNamepathType */) {
return factory.createKeywordTypeNode(132 /* AnyKeyword */);
}
if (isJSDocUnknownType(node)) {
@@ -48593,8 +48766,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function symbolTableToDeclarationStatements(symbolTable, context, bundled) {
- const serializePropertySymbolForClass = makeSerializePropertySymbol(factory.createPropertyDeclaration, 174 /* MethodDeclaration */, true);
- const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol((mods, name, question, type) => factory.createPropertySignature(mods, name, question, type), 173 /* MethodSignature */, false);
+ const serializePropertySymbolForClass = makeSerializePropertySymbol(factory.createPropertyDeclaration, 176 /* MethodDeclaration */, true);
+ const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol((mods, name, question, type) => factory.createPropertySignature(mods, name, question, type), 175 /* MethodSignature */, false);
const enclosingDeclaration = context.enclosingDeclaration;
let results = [];
const visitedSymbols = new Set2();
@@ -48968,8 +49141,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const baseTypes = getBaseTypes(interfaceType);
const baseType = length(baseTypes) ? getIntersectionType(baseTypes) : void 0;
const members = flatMap(getPropertiesOfType(interfaceType), (p) => serializePropertySymbolForInterface(p, baseType));
- const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 179 /* CallSignature */);
- const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 180 /* ConstructSignature */);
+ const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 181 /* CallSignature */);
+ const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 182 /* ConstructSignature */);
const indexSignatures = serializeIndexSignatures(interfaceType, baseType);
const heritageClauses = !length(baseTypes) ? void 0 : [factory.createHeritageClause(95 /* ExtendsKeyword */, mapDefined(baseTypes, (b) => trySerializeAsTypeReference(b, 111551 /* Value */)))];
addResult(factory.createInterfaceDeclaration(
@@ -49037,7 +49210,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags) {
const signatures = getSignaturesOfType(type, 0 /* Call */);
for (const sig of signatures) {
- const decl = signatureToSignatureDeclarationHelper(sig, 263 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled });
+ const decl = signatureToSignatureDeclarationHelper(sig, 265 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled });
addResult(setTextRange(decl, getSignatureTextRangeLocation(sig)), modifierFlags);
}
if (!(symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && !!symbol.exports && !!symbol.exports.size)) {
@@ -49172,7 +49345,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
(p) => serializePropertySymbolForClass(p, true, staticBaseType)
);
const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */));
- const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 176 /* Constructor */);
+ const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 178 /* Constructor */);
const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]);
context.enclosingDeclaration = oldEnclosing;
addResult(setTextRange(factory.createClassDeclaration(
@@ -49219,8 +49392,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const targetName = getInternalSymbolName(target, verbatimTargetName);
includePrivateSymbol(target);
switch (node.kind) {
- case 208 /* BindingElement */:
- if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 261 /* VariableDeclaration */) {
+ case 210 /* BindingElement */:
+ if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 263 /* VariableDeclaration */) {
const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context);
const { propertyName } = node;
addResult(factory.createImportDeclaration(
@@ -49236,15 +49409,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
Debug.failBadSyntaxKind(((_c = node.parent) == null ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization");
- case 306 /* ShorthandPropertyAssignment */:
- if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 227 /* BinaryExpression */) {
+ case 309 /* ShorthandPropertyAssignment */:
+ if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 229 /* BinaryExpression */) {
serializeExportSpecifier(
unescapeLeadingUnderscores(symbol.escapedName),
targetName
);
}
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
if (isPropertyAccessExpression(node.initializer)) {
const initializer = node.initializer;
const uniqueName = factory.createUniqueName(localName);
@@ -49263,7 +49436,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
), modifierFlags);
break;
}
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, isJsonSourceFile)) {
serializeMaybeAliasAssignment(symbol);
break;
@@ -49276,10 +49449,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
isLocalImport ? symbolToName(target, context, 67108863 /* All */, false) : factory.createExternalModuleReference(factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))
), isLocalImport ? modifierFlags : 0 /* None */);
break;
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
addResult(factory.createNamespaceExportDeclaration(idText(node.name)), 0 /* None */);
break;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
addResult(factory.createImportDeclaration(
void 0,
factory.createImportClause(false, factory.createIdentifier(localName), void 0),
@@ -49287,7 +49460,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void 0
), 0 /* None */);
break;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
addResult(factory.createImportDeclaration(
void 0,
factory.createImportClause(false, void 0, factory.createNamespaceImport(factory.createIdentifier(localName))),
@@ -49295,7 +49468,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void 0
), 0 /* None */);
break;
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
addResult(factory.createExportDeclaration(
void 0,
false,
@@ -49303,7 +49476,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))
), 0 /* None */);
break;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
addResult(factory.createImportDeclaration(
void 0,
factory.createImportClause(
@@ -49321,7 +49494,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void 0
), 0 /* None */);
break;
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
const specifier = node.parent.parent.moduleSpecifier;
serializeExportSpecifier(
unescapeLeadingUnderscores(symbol.escapedName),
@@ -49329,12 +49502,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
specifier && isStringLiteralLike(specifier) ? factory.createStringLiteral(specifier.text) : void 0
);
break;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
serializeMaybeAliasAssignment(symbol);
break;
- case 227 /* BinaryExpression */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 229 /* BinaryExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (symbol.escapedName === "default" /* Default */ || symbol.escapedName === "export=" /* ExportEquals */) {
serializeMaybeAliasAssignment(symbol);
} else {
@@ -49710,17 +49883,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeAliasForTypeLiteral(type) {
if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */ && type.symbol.declarations) {
const node = walkUpParenthesizedTypes(type.symbol.declarations[0].parent);
- if (node.kind === 268 /* TypeAliasDeclaration */) {
+ if (node.kind === 271 /* TypeAliasDeclaration */) {
return getSymbolOfNode(node);
}
}
return void 0;
}
function isTopLevelInExternalModuleAugmentation(node) {
- return node && node.parent && node.parent.kind === 271 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent);
+ return node && node.parent && node.parent.kind === 274 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent);
}
function isDefaultBindingContext(location) {
- return location.kind === 314 /* SourceFile */ || isAmbientModule(location);
+ return location.kind === 317 /* SourceFile */ || isAmbientModule(location);
}
function getNameOfSymbolFromNameType(symbol, context) {
const nameType = getSymbolLinks(symbol).nameType;
@@ -49765,17 +49938,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!declaration) {
declaration = symbol.declarations[0];
}
- if (declaration.parent && declaration.parent.kind === 261 /* VariableDeclaration */) {
+ if (declaration.parent && declaration.parent.kind === 263 /* VariableDeclaration */) {
return declarationNameToString(declaration.parent.name);
}
switch (declaration.kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) {
context.encounteredError = true;
}
- return declaration.kind === 232 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)";
+ return declaration.kind === 234 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)";
}
}
const name = getNameOfSymbolFromNameType(symbol, context);
@@ -49792,68 +49965,68 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
function determineIfDeclarationIsVisible() {
switch (node.kind) {
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
- case 348 /* JSDocEnumTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 351 /* JSDocEnumTag */:
return !!(node.parent && node.parent.parent && node.parent.parent.parent && isSourceFile(node.parent.parent.parent));
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return isDeclarationVisible(node.parent.parent);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
if (isBindingPattern(node.name) && !node.name.elements.length) {
return false;
}
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 269 /* EnumDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 268 /* AnnotationDeclaration */:
if (isExternalModuleAugmentation(node)) {
return true;
}
const parent = getDeclarationContainer(node);
- if (!(getCombinedModifierFlags(node) & 1 /* Export */) && !(node.kind !== 274 /* ImportEqualsDeclaration */ && parent.kind !== 314 /* SourceFile */ && parent.flags & 16777216 /* Ambient */)) {
+ if (!(getCombinedModifierFlags(node) & 1 /* Export */) && !(node.kind !== 277 /* ImportEqualsDeclaration */ && parent.kind !== 317 /* SourceFile */ && parent.flags & 16777216 /* Ambient */)) {
return isGlobalSourceFile(parent);
}
return isDeclarationVisible(parent);
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (hasEffectiveModifier(node, 8 /* Private */ | 16 /* Protected */)) {
return false;
}
- case 176 /* Constructor */:
- case 180 /* ConstructSignature */:
- case 179 /* CallSignature */:
- case 181 /* IndexSignature */:
- case 168 /* Parameter */:
- case 271 /* ModuleBlock */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 187 /* TypeLiteral */:
- case 183 /* TypeReference */:
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 196 /* ParenthesizedType */:
- case 202 /* NamedTupleMember */:
+ case 178 /* Constructor */:
+ case 182 /* ConstructSignature */:
+ case 181 /* CallSignature */:
+ case 183 /* IndexSignature */:
+ case 169 /* Parameter */:
+ case 274 /* ModuleBlock */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 189 /* TypeLiteral */:
+ case 185 /* TypeReference */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 198 /* ParenthesizedType */:
+ case 204 /* NamedTupleMember */:
return isDeclarationVisible(node.parent);
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
return false;
- case 167 /* TypeParameter */:
- case 314 /* SourceFile */:
- case 273 /* NamespaceExportDeclaration */:
+ case 168 /* TypeParameter */:
+ case 317 /* SourceFile */:
+ case 276 /* NamespaceExportDeclaration */:
return true;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return false;
default:
return false;
@@ -49862,9 +50035,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function collectLinkedAliases(node, setVisibility) {
let exportSymbol;
- if (node.parent && node.parent.kind === 280 /* ExportAssignment */) {
+ if (node.parent && node.parent.kind === 283 /* ExportAssignment */) {
exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, void 0, node, false);
- } else if (node.parent.kind === 284 /* ExportSpecifier */) {
+ } else if (node.parent.kind === 287 /* ExportSpecifier */) {
exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */);
}
let result;
@@ -49959,12 +50132,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getDeclarationContainer(node) {
return findAncestor(getRootDeclaration(node), (node2) => {
switch (node2.kind) {
- case 261 /* VariableDeclaration */:
- case 262 /* VariableDeclarationList */:
- case 279 /* ImportSpecifier */:
- case 278 /* NamedImports */:
- case 277 /* NamespaceImport */:
- case 276 /* ImportClause */:
+ case 263 /* VariableDeclaration */:
+ case 264 /* VariableDeclarationList */:
+ case 282 /* ImportSpecifier */:
+ case 281 /* NamedImports */:
+ case 280 /* NamespaceImport */:
+ case 279 /* ImportClause */:
return false;
default:
return true;
@@ -50068,23 +50241,23 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getParentElementAccess(node) {
const ancestor = node.parent.parent;
switch (ancestor.kind) {
- case 208 /* BindingElement */:
- case 305 /* PropertyAssignment */:
+ case 210 /* BindingElement */:
+ case 308 /* PropertyAssignment */:
return getSyntheticElementAccess(ancestor);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return getSyntheticElementAccess(node.parent);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return ancestor.initializer;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return ancestor.right;
}
}
function getDestructuringPropertyName(node) {
const parent = node.parent;
- if (node.kind === 208 /* BindingElement */ && parent.kind === 206 /* ObjectBindingPattern */) {
+ if (node.kind === 210 /* BindingElement */ && parent.kind === 208 /* ObjectBindingPattern */) {
return getLiteralPropertyNameText(node.propertyName || node.name);
}
- if (node.kind === 305 /* PropertyAssignment */ || node.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.kind === 308 /* PropertyAssignment */ || node.kind === 309 /* ShorthandPropertyAssignment */) {
return getLiteralPropertyNameText(node.name);
}
return "" + parent.elements.indexOf(node);
@@ -50109,7 +50282,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */);
}
let type;
- if (pattern.kind === 206 /* ObjectBindingPattern */) {
+ if (pattern.kind === 208 /* ObjectBindingPattern */) {
if (declaration.dotDotDotToken) {
parentType = getReducedType(parentType);
if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) {
@@ -50164,17 +50337,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isEmptyArrayLiteral2(node) {
const expr = skipParentheses(node, true);
- return expr.kind === 209 /* ArrayLiteralExpression */ && expr.elements.length === 0;
+ return expr.kind === 211 /* ArrayLiteralExpression */ && expr.elements.length === 0;
}
function addOptionality(type, isProperty = false, isOptional = true) {
return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type;
}
function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) {
- if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250 /* ForInStatement */) {
+ if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 252 /* ForInStatement */) {
const indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression, checkMode)));
return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType;
}
- if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) {
+ if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 253 /* ForOfStatement */) {
const forOfStatement = declaration.parent.parent;
return checkRightHandSideOfForOf(forOfStatement) || anyType;
}
@@ -50197,8 +50370,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (isParameter(declaration)) {
const func = declaration.parent;
- if (func.kind === 178 /* SetAccessor */ && hasBindableName(func)) {
- const getter = getDeclarationOfKind(getSymbolOfNode(declaration.parent), 177 /* GetAccessor */);
+ if (func.kind === 180 /* SetAccessor */ && hasBindableName(func)) {
+ const getter = getDeclarationOfKind(getSymbolOfNode(declaration.parent), 179 /* GetAccessor */);
if (getter) {
const getterSignature = getSignatureFromDeclaration(getter);
const thisParameter = getAccessorThisParameter(func);
@@ -50251,7 +50424,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const links = getSymbolLinks(symbol);
if (links.isConstructorDeclaredProperty === void 0) {
links.isConstructorDeclaredProperty = false;
- links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 212 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(void 0, declaration, symbol, declaration));
+ links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 214 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(void 0, declaration, symbol, declaration));
}
return links.isConstructorDeclaredProperty;
}
@@ -50267,7 +50440,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
for (const declaration of symbol.declarations) {
const container = getThisContainer(declaration, false);
- if (container && (container.kind === 176 /* Constructor */ || isJSConstructor(container))) {
+ if (container && (container.kind === 178 /* Constructor */ || isJSConstructor(container))) {
return container;
}
}
@@ -50529,7 +50702,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isDeclarationInConstructor(expression) {
const thisContainer = getThisContainer(expression, false);
- return thisContainer.kind === 176 /* Constructor */ || thisContainer.kind === 263 /* FunctionDeclaration */ || thisContainer.kind === 218 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent);
+ return thisContainer.kind === 178 /* Constructor */ || thisContainer.kind === 265 /* FunctionDeclaration */ || thisContainer.kind === 220 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent);
}
function getConstructorDefinedThisAssignmentTypes(types, declarations) {
Debug.assert(types.length === declarations.length);
@@ -50585,7 +50758,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2) {
const elements = pattern.elements;
const lastElement = lastOrUndefined(elements);
- const restElement = lastElement && lastElement.kind === 208 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0;
+ const restElement = lastElement && lastElement.kind === 210 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0;
if (elements.length === 0 || elements.length === 1 && restElement) {
return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType;
}
@@ -50601,7 +50774,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
}
function getTypeFromBindingPattern(pattern, includePatternInType = false, reportErrors2 = false) {
- return pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2);
+ return pattern.kind === 208 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2);
}
function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors2) {
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, true, 0 /* Normal */), declaration, reportErrors2);
@@ -50634,7 +50807,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function declarationBelongsToPrivateAmbientMember(declaration) {
const root = getRootDeclaration(declaration);
- const memberDeclaration = root.kind === 168 /* Parameter */ ? root.parent : root;
+ const memberDeclaration = root.kind === 169 /* Parameter */ ? root.parent : root;
return isPrivateWithinAmbient(memberDeclaration);
}
function tryGetTypeFromEffectiveTypeNode(node) {
@@ -50702,7 +50875,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return reportCircularityError(symbol);
}
let type;
- if (declaration.kind === 280 /* ExportAssignment */) {
+ if (declaration.kind === 283 /* ExportAssignment */) {
type = widenTypeForVariableLikeDeclaration(tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionCached(declaration.expression), declaration);
} else if (isBinaryExpression(declaration) || isInJSFile(declaration) && (isCallExpression(declaration) || (isPropertyAccessExpression(declaration) || isBindableStaticElementAccessExpression(declaration)) && isBinaryExpression(declaration.parent))) {
type = getWidenedTypeForAssignmentDeclaration(symbol);
@@ -50719,7 +50892,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, 0 /* Normal */);
} else if (isObjectLiteralMethod(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, 0 /* Normal */);
- } else if (isParameter(declaration) || isPropertyDeclaration(declaration) || isPropertySignature(declaration) || isAnnotationPropertyDeclaration(declaration) || isVariableDeclaration(declaration) || isBindingElement(declaration) || isJSDocPropertyLikeTag(declaration)) {
+ } else if (isParameter(declaration) || isPropertyDeclaration(declaration) || isPropertySignature(declaration) || isAnnotationPropertyDeclaration(declaration) || isVariableDeclaration(declaration) || isBindingElement(declaration) || isOverloadPropertyDeclaration(declaration) || isJSDocPropertyLikeTag(declaration)) {
type = getWidenedTypeForVariableLikeDeclaration(declaration, true);
} else if (isEnumDeclaration(declaration)) {
type = getTypeOfFuncClassEnumModule(symbol);
@@ -50739,13 +50912,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getAnnotatedAccessorTypeNode(accessor) {
if (accessor) {
switch (accessor.kind) {
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
const getterTypeAnnotation = getEffectiveReturnTypeNode(accessor);
return getterTypeAnnotation;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
const setterTypeAnnotation = getEffectiveSetAccessorTypeAnnotationNode(accessor);
return setterTypeAnnotation;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
Debug.assert(hasAccessorModifier(accessor));
const accessorTypeAnnotation = getEffectiveTypeAnnotationNode(accessor);
return accessorTypeAnnotation;
@@ -50770,9 +50943,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!pushTypeResolution(symbol, 0 /* Type */)) {
return errorType;
}
- const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */);
- const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */);
- const accessor = tryCast(getDeclarationOfKind(symbol, 171 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
+ const getter = getDeclarationOfKind(symbol, 179 /* GetAccessor */);
+ const setter = getDeclarationOfKind(symbol, 180 /* SetAccessor */);
+ const accessor = tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && accessor.initializer && getWidenedTypeForVariableLikeDeclaration(accessor, true);
if (!type) {
if (setter && !isPrivateWithinAmbient(setter)) {
@@ -50807,7 +50980,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!pushTypeResolution(symbol, 8 /* WriteType */)) {
return errorType;
}
- const setter = (_a2 = getDeclarationOfKind(symbol, 178 /* SetAccessor */)) != null ? _a2 : tryCast(getDeclarationOfKind(symbol, 171 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
+ const setter = (_a2 = getDeclarationOfKind(symbol, 180 /* SetAccessor */)) != null ? _a2 : tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
let writeType = getAnnotatedAccessorType(setter);
if (!popTypeResolution()) {
if (getAnnotatedAccessorTypeNode(setter)) {
@@ -50842,7 +51015,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const declaration = symbol.valueDeclaration;
if (symbol.flags & 1536 /* Module */ && isShorthandAmbientModuleSymbol(symbol)) {
return anyType;
- } else if (declaration && (declaration.kind === 227 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 227 /* BinaryExpression */)) {
+ } else if (declaration && (declaration.kind === 229 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 229 /* BinaryExpression */)) {
return getWidenedTypeForAssignmentDeclaration(symbol);
} else if (symbol.flags & 512 /* ValueModule */ && declaration && isSourceFile(declaration) && declaration.commonJsModuleIndicator) {
const resolvedModule = resolveExternalModuleSymbol(symbol);
@@ -50898,7 +51071,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
);
return errorType;
}
- if (noImplicitAny && (declaration.kind !== 168 /* Parameter */ || declaration.initializer)) {
+ if (noImplicitAny && (declaration.kind !== 169 /* Parameter */ || declaration.initializer)) {
error(
symbol.valueDeclaration,
Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,
@@ -51009,43 +51182,43 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 326 /* JSDocFunctionType */:
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 268 /* TypeAliasDeclaration */:
- case 353 /* JSDocTemplateTag */:
- case 354 /* JSDocTypedefTag */:
- case 348 /* JSDocEnumTag */:
- case 347 /* JSDocCallbackTag */:
- case 200 /* MappedType */:
- case 194 /* ConditionalType */: {
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 329 /* JSDocFunctionType */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 271 /* TypeAliasDeclaration */:
+ case 356 /* JSDocTemplateTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 351 /* JSDocEnumTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 202 /* MappedType */:
+ case 196 /* ConditionalType */: {
const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
- if (node.kind === 200 /* MappedType */) {
+ if (node.kind === 202 /* MappedType */) {
return append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)));
- } else if (node.kind === 194 /* ConditionalType */) {
+ } else if (node.kind === 196 /* ConditionalType */) {
return concatenate(outerTypeParameters, getInferTypeParameters(node));
}
const outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, getEffectiveTypeParameterDeclarations(node));
- const thisType = includeThisTypes && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || node.kind === 267 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
+ const thisType = includeThisTypes && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 270 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
return thisType ? append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters;
}
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
const paramSymbol = getParameterSymbolFromJSDoc(node);
if (paramSymbol) {
node = paramSymbol.valueDeclaration;
}
break;
- case 329 /* JSDoc */: {
+ case 332 /* JSDoc */: {
const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
return node.tags ? appendTypeParameters(outerTypeParameters, flatMap(node.tags, (t) => isJSDocTemplateTag(t) ? t.typeParameters : void 0)) : outerTypeParameters;
}
@@ -51053,7 +51226,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getOuterTypeParametersOfClassOrInterface(symbol) {
- const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 267 /* InterfaceDeclaration */);
+ const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 270 /* InterfaceDeclaration */);
Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
return getOuterTypeParameters(declaration);
}
@@ -51063,7 +51236,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let result;
for (const node of symbol.declarations) {
- if (node.kind === 267 /* InterfaceDeclaration */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) {
+ if (node.kind === 270 /* InterfaceDeclaration */ || node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) {
const declaration = node;
result = appendTypeParameters(result, getEffectiveTypeParameterDeclarations(declaration));
}
@@ -51196,7 +51369,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (!popTypeResolution() && type.symbol.declarations) {
for (const declaration of type.symbol.declarations) {
- if (declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 267 /* InterfaceDeclaration */) {
+ if (declaration.kind === 266 /* ClassDeclaration */ || declaration.kind === 270 /* InterfaceDeclaration */) {
reportCircularBaseType(declaration, type);
}
}
@@ -51279,7 +51452,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray;
if (type.symbol.declarations) {
for (const declaration of type.symbol.declarations) {
- if (declaration.kind === 267 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) {
+ if (declaration.kind === 270 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) {
for (const node of getInterfaceBaseTypeNodes(declaration)) {
const baseType = getReducedType(getTypeFromTypeNode(node));
if (!isErrorType(baseType)) {
@@ -51307,7 +51480,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
for (const declaration of symbol.declarations) {
- if (declaration.kind === 267 /* InterfaceDeclaration */) {
+ if (declaration.kind === 270 /* InterfaceDeclaration */) {
if (declaration.flags & 128 /* ContainsThis */) {
return false;
}
@@ -51373,7 +51546,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
} else {
type = errorType;
- if (declaration.kind === 348 /* JSDocEnumTag */) {
+ if (declaration.kind === 351 /* JSDocEnumTag */) {
error(declaration.typeExpression.type, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
} else {
error(isNamedDeclaration(declaration) ? declaration.name || declaration : declaration, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
@@ -51386,7 +51559,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isStringConcatExpression(expr) {
if (isStringLiteralLike(expr)) {
return true;
- } else if (expr.kind === 227 /* BinaryExpression */) {
+ } else if (expr.kind === 229 /* BinaryExpression */) {
return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right);
}
return false;
@@ -51401,11 +51574,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return true;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */;
case 79 /* Identifier */:
return nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isStringConcatExpression(expr);
default:
return false;
@@ -51419,7 +51592,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let hasNonLiteralMember = false;
if (symbol.declarations) {
for (const declaration of symbol.declarations) {
- if (declaration.kind === 269 /* EnumDeclaration */) {
+ if (declaration.kind === 272 /* EnumDeclaration */) {
for (const member of declaration.members) {
if (member.initializer && isStringLiteralLike(member.initializer)) {
return links.enumKind = 1 /* Literal */;
@@ -51446,7 +51619,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const memberTypeList = [];
if (symbol.declarations) {
for (const declaration of symbol.declarations) {
- if (declaration.kind === 269 /* EnumDeclaration */) {
+ if (declaration.kind === 272 /* EnumDeclaration */) {
for (const member of declaration.members) {
const value = getEnumMemberValue(member);
const memberType = getFreshTypeOfLiteralType(getEnumLiteralType(value !== void 0 ? value : 0, enumCount, getSymbolOfNode(member)));
@@ -51524,11 +51697,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 115 /* VoidKeyword */:
case 157 /* UndefinedKeyword */:
case 145 /* NeverKeyword */:
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return true;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return isThislessType(node.elementType);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return !node.typeArguments || node.typeArguments.every(isThislessType);
}
return false;
@@ -51544,21 +51717,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isThislessFunctionLikeDeclaration(node) {
const returnType = getEffectiveReturnTypeNode(node);
const typeParameters = getEffectiveTypeParameterDeclarations(node);
- return (node.kind === 176 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter);
+ return (node.kind === 178 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter);
}
function isThisless(symbol) {
if (symbol.declarations && symbol.declarations.length === 1) {
const declaration = symbol.declarations[0];
if (declaration) {
switch (declaration.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return isThislessVariableLikeDeclaration(declaration);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return isThislessFunctionLikeDeclaration(declaration);
}
}
@@ -52423,7 +52596,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isMappedTypeWithKeyofConstraintDeclaration(type) {
const constraintDeclaration = getConstraintDeclarationForMappedType(type);
- return constraintDeclaration.kind === 198 /* TypeOperator */ && constraintDeclaration.operator === 142 /* KeyOfKeyword */;
+ return constraintDeclaration.kind === 200 /* TypeOperator */ && constraintDeclaration.operator === 142 /* KeyOfKeyword */;
}
function getModifiersTypeFromMappedType(type) {
if (!type.modifiersType) {
@@ -53150,7 +53323,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
}
function isJSDocOptionalParameter(node) {
- return isInJSFile(node) && (node.type && node.type.kind === 325 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 325 /* JSDocOptionalType */));
+ return isInJSFile(node) && (node.type && node.type.kind === 328 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 328 /* JSDocOptionalType */));
}
function tryFindAmbientModule(moduleName, withAugmentations) {
if (isExternalModuleNameRelative(moduleName)) {
@@ -53183,7 +53356,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
const { isBracketed, typeExpression } = node;
- return isBracketed || !!typeExpression && typeExpression.type.kind === 325 /* JSDocOptionalType */;
+ return isBracketed || !!typeExpression && typeExpression.type.kind === 328 /* JSDocOptionalType */;
}
function createTypePredicate(kind, parameterName, parameterIndex, type) {
return { kind, parameterName, parameterIndex, type };
@@ -53251,7 +53424,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
parameters.push(paramSymbol);
}
- if (type && type.kind === 201 /* LiteralType */) {
+ if (type && type.kind === 203 /* LiteralType */) {
flags |= 2 /* HasLiteralTypes */;
}
const isOptionalParameter2 = isOptionalJSDocPropertyLikeTag(param) || param.initializer || param.questionToken || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type || isJSDocOptionalParameter(param);
@@ -53259,14 +53432,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
minArgumentCount = parameters.length;
}
}
- if ((declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter || !thisParameter)) {
- const otherKind = declaration.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */;
+ if ((declaration.kind === 179 /* GetAccessor */ || declaration.kind === 180 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter || !thisParameter)) {
+ const otherKind = declaration.kind === 179 /* GetAccessor */ ? 180 /* SetAccessor */ : 179 /* GetAccessor */;
const other = getDeclarationOfKind(getSymbolOfNode(declaration), otherKind);
if (other) {
thisParameter = getAnnotatedAccessorThisParameter(other);
}
}
- const classType = declaration.kind === 176 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
+ const classType = declaration.kind === 178 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
flags |= 1 /* HasRestParameter */;
@@ -53342,15 +53515,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
return node.escapedText === argumentsSymbol.escapedName && getReferencedValueSymbol(node) === argumentsSymbol;
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- return node.name.kind === 166 /* ComputedPropertyName */ && traverse(node.name);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ return node.name.kind === 167 /* ComputedPropertyName */ && traverse(node.name);
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return traverse(node.expression);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return traverse(node.initializer);
default:
return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && !!forEachChild(node, traverse);
@@ -53417,7 +53590,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function createTypePredicateFromTypePredicateNode(node, signature) {
const parameterName = node.parameterName;
const type = node.type && getTypeFromTypeNode(node.type);
- return parameterName.kind === 197 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, void 0, void 0, type) : createTypePredicate(
+ return parameterName.kind === 199 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, void 0, void 0, type) : createTypePredicate(
node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */,
parameterName.escapedText,
findIndex(signature.parameters, (p) => p.escapedName === parameterName.escapedText),
@@ -53460,7 +53633,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return signature.resolvedReturnType;
}
function getReturnTypeFromAnnotation(declaration) {
- if (declaration.kind === 176 /* Constructor */) {
+ if (declaration.kind === 178 /* Constructor */) {
return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol));
}
if (isJSDocConstructSignature(declaration)) {
@@ -53470,12 +53643,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (typeNode) {
return getTypeFromTypeNode(typeNode);
}
- if (declaration.kind === 177 /* GetAccessor */ && hasBindableName(declaration)) {
+ if (declaration.kind === 179 /* GetAccessor */ && hasBindableName(declaration)) {
const jsDocType = isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration);
if (jsDocType) {
return jsDocType;
}
- const setter = getDeclarationOfKind(getSymbolOfNode(declaration), 178 /* SetAccessor */);
+ const setter = getDeclarationOfKind(getSymbolOfNode(declaration), 180 /* SetAccessor */);
const setterType = getAnnotatedAccessorType(setter);
if (setterType) {
return setterType;
@@ -53563,7 +53736,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
var _a2;
if (!signature.isolatedSignatureType) {
const kind = (_a2 = signature.declaration) == null ? void 0 : _a2.kind;
- const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
+ const isConstructor = kind === void 0 || kind === 178 /* Constructor */ || kind === 182 /* ConstructSignature */ || kind === 187 /* ConstructorType */;
const type = createObjectType(16 /* Anonymous */);
type.members = emptySymbols;
type.properties = emptyArray;
@@ -53622,9 +53795,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let inferences;
if ((_a2 = typeParameter.symbol) == null ? void 0 : _a2.declarations) {
for (const declaration of typeParameter.symbol.declarations) {
- if (declaration.parent.kind === 195 /* InferType */) {
+ if (declaration.parent.kind === 197 /* InferType */) {
const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent);
- if (grandParent.kind === 183 /* TypeReference */ && !omitTypeReferences) {
+ if (grandParent.kind === 185 /* TypeReference */ && !omitTypeReferences) {
const typeReference = grandParent;
const typeParameters = getTypeParametersForTypeReference(typeReference);
if (typeParameters) {
@@ -53642,13 +53815,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- } else if (grandParent.kind === 168 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 191 /* RestType */ || grandParent.kind === 202 /* NamedTupleMember */ && grandParent.dotDotDotToken) {
+ } else if (grandParent.kind === 169 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 193 /* RestType */ || grandParent.kind === 204 /* NamedTupleMember */ && grandParent.dotDotDotToken) {
inferences = append(inferences, createArrayType(unknownType));
- } else if (grandParent.kind === 204 /* TemplateLiteralTypeSpan */) {
+ } else if (grandParent.kind === 206 /* TemplateLiteralTypeSpan */) {
inferences = append(inferences, stringType);
- } else if (grandParent.kind === 167 /* TypeParameter */ && grandParent.parent.kind === 200 /* MappedType */) {
+ } else if (grandParent.kind === 168 /* TypeParameter */ && grandParent.parent.kind === 202 /* MappedType */) {
inferences = append(inferences, keyofConstraintType);
- } else if (grandParent.kind === 200 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 194 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 200 /* MappedType */ && grandParent.parent.checkType.type) {
+ } else if (grandParent.kind === 202 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 196 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 202 /* MappedType */ && grandParent.parent.checkType.type) {
const checkMappedType2 = grandParent.parent.checkType;
const nodeType = getTypeFromTypeNode(checkMappedType2.type);
inferences = append(inferences, instantiateType(
@@ -53673,7 +53846,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
let type = getTypeFromTypeNode(constraintDeclaration);
if (type.flags & 1 /* Any */ && !isErrorType(type)) {
- type = constraintDeclaration.parent.parent.kind === 200 /* MappedType */ ? keyofConstraintType : unknownType;
+ type = constraintDeclaration.parent.parent.kind === 202 /* MappedType */ ? keyofConstraintType : unknownType;
}
typeParameter.constraint = type;
}
@@ -53682,7 +53855,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return typeParameter.constraint === noConstraintType ? void 0 : typeParameter.constraint;
}
function getParentSymbolOfTypeParameter(typeParameter) {
- const tp = getDeclarationOfKind(typeParameter.symbol, 167 /* TypeParameter */);
+ const tp = getDeclarationOfKind(typeParameter.symbol, 168 /* TypeParameter */);
const host2 = isJSDocTemplateTag(tp.parent) ? getEffectiveContainerForJSDocTemplateTag(tp.parent) : tp.parent;
return host2 && getSymbolOfNode(host2);
}
@@ -53762,7 +53935,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return ((_a2 = type.target.localTypeParameters) == null ? void 0 : _a2.map(() => errorType)) || emptyArray;
}
const node = type.node;
- const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
+ const typeArguments = !node ? emptyArray : node.kind === 185 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : node.kind === 190 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
if (popTypeResolution()) {
type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
} else {
@@ -53796,7 +53969,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return errorType;
}
}
- if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
+ if (node.kind === 185 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
return createDeferredTypeReference(type, node, void 0);
}
const typeArguments = concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgumentsFromTypeReferenceNode(node), typeParameters, minTypeArgumentCount, isJs));
@@ -53864,9 +54037,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTypeReferenceName(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return node.typeName;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
const expr = node.expression;
if (isEntityNameExpression(expr)) {
return expr;
@@ -53878,10 +54051,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return symbol.parent ? `${getSymbolPath(symbol.parent)}.${symbol.escapedName}` : symbol.escapedName;
}
function getUnresolvedSymbolForEntityName(name) {
- const identifier = name.kind === 165 /* QualifiedName */ ? name.right : name.kind === 211 /* PropertyAccessExpression */ ? name.name : name;
+ const identifier = name.kind === 166 /* QualifiedName */ ? name.right : name.kind === 213 /* PropertyAccessExpression */ ? name.name : name;
const text = identifier.escapedText;
if (text) {
- const parentSymbol = name.kind === 165 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 211 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0;
+ const parentSymbol = name.kind === 166 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 213 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0;
const path2 = parentSymbol ? `${getSymbolPath(parentSymbol)}.${text}` : text;
let result = unresolvedSymbols.get(path2);
if (!result) {
@@ -53957,7 +54130,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const valueType = getTypeOfSymbol(symbol);
let typeType = valueType;
if (symbol.valueDeclaration) {
- const isImportTypeWithQualifier = node.kind === 205 /* ImportType */ && node.qualifier;
+ const isImportTypeWithQualifier = node.kind === 207 /* ImportType */ && node.qualifier;
if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) {
typeType = getTypeReferenceType(node, valueType.symbol);
}
@@ -53985,7 +54158,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
}
function isUnaryTupleTypeNode(node) {
- return node.kind === 189 /* TupleType */ && node.elements.length === 1;
+ return node.kind === 191 /* TupleType */ && node.elements.length === 1;
}
function getImpliedConstraint(type, checkNode, extendsNode) {
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) : void 0;
@@ -53993,17 +54166,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getConditionalFlowTypeOfType(type, node) {
let constraints;
let covariant = true;
- while (node && !isStatement(node) && node.kind !== 329 /* JSDoc */) {
+ while (node && !isStatement(node) && node.kind !== 332 /* JSDoc */) {
const parent = node.parent;
- if (parent.kind === 168 /* Parameter */) {
+ if (parent.kind === 169 /* Parameter */) {
covariant = !covariant;
}
- if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent.kind === 194 /* ConditionalType */ && node === parent.trueType) {
+ if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent.kind === 196 /* ConditionalType */ && node === parent.trueType) {
const constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType);
if (constraint) {
constraints = append(constraints, constraint);
}
- } else if (type.flags & 262144 /* TypeParameter */ && parent.kind === 200 /* MappedType */ && node === parent.type) {
+ } else if (type.flags & 262144 /* TypeParameter */ && parent.kind === 202 /* MappedType */ && node === parent.type) {
const mappedType = getTypeFromTypeNode(parent);
if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
const typeParameter = getHomomorphicTypeVariable(mappedType);
@@ -54020,7 +54193,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return constraints ? getSubstitutionType(type, getIntersectionType(constraints)) : type;
}
function isJSDocTypeReference(node) {
- return !!(node.flags & 8388608 /* JSDoc */) && (node.kind === 183 /* TypeReference */ || node.kind === 205 /* ImportType */);
+ return !!(node.flags & 8388608 /* JSDoc */) && (node.kind === 185 /* TypeReference */ || node.kind === 207 /* ImportType */);
}
function checkNoTypeArguments(node, symbol) {
if (node.typeArguments) {
@@ -54126,9 +54299,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (declarations) {
for (const declaration of declarations) {
switch (declaration.kind) {
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
return declaration;
}
}
@@ -54289,11 +54462,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTupleElementFlags(node) {
switch (node.kind) {
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return 2 /* Optional */;
- case 191 /* RestType */:
+ case 193 /* RestType */:
return getRestTypeElementFlags(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */;
default:
return 1 /* Required */;
@@ -54309,55 +54482,55 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return readonly ? globalReadonlyArrayType : globalArrayType;
}
const elementFlags = map(node.elements, getTupleElementFlags);
- const missingName = some(node.elements, (e) => e.kind !== 202 /* NamedTupleMember */);
+ const missingName = some(node.elements, (e) => e.kind !== 204 /* NamedTupleMember */);
return getTupleTargetType(elementFlags, readonly, missingName ? void 0 : node.elements);
}
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
- return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
+ return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 190 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 191 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
}
function isResolvedByTypeAlias(node) {
const parent = node.parent;
switch (parent.kind) {
- case 196 /* ParenthesizedType */:
- case 202 /* NamedTupleMember */:
- case 183 /* TypeReference */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 199 /* IndexedAccessType */:
- case 194 /* ConditionalType */:
- case 198 /* TypeOperator */:
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
+ case 198 /* ParenthesizedType */:
+ case 204 /* NamedTupleMember */:
+ case 185 /* TypeReference */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 201 /* IndexedAccessType */:
+ case 196 /* ConditionalType */:
+ case 200 /* TypeOperator */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
return isResolvedByTypeAlias(parent);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
}
return false;
}
function mayResolveTypeAlias(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node, 788968 /* Type */).flags & 524288 /* TypeAlias */);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return true;
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return node.operator !== 158 /* UniqueKeyword */ && mayResolveTypeAlias(node.type);
- case 196 /* ParenthesizedType */:
- case 190 /* OptionalType */:
- case 202 /* NamedTupleMember */:
- case 325 /* JSDocOptionalType */:
- case 323 /* JSDocNullableType */:
- case 324 /* JSDocNonNullableType */:
- case 318 /* JSDocTypeExpression */:
+ case 198 /* ParenthesizedType */:
+ case 192 /* OptionalType */:
+ case 204 /* NamedTupleMember */:
+ case 328 /* JSDocOptionalType */:
+ case 326 /* JSDocNullableType */:
+ case 327 /* JSDocNonNullableType */:
+ case 321 /* JSDocTypeExpression */:
return mayResolveTypeAlias(node.type);
- case 191 /* RestType */:
- return node.type.kind !== 188 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 193 /* RestType */:
+ return node.type.kind !== 190 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return some(node.types, mayResolveTypeAlias);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType);
}
return false;
@@ -54368,10 +54541,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const target = getArrayOrTupleTargetType(node);
if (target === emptyGenericType) {
links.resolvedType = emptyObjectType;
- } else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
- links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, void 0);
+ } else if (!(node.kind === 191 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
+ links.resolvedType = node.kind === 191 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, void 0);
} else {
- const elementTypes = node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
+ const elementTypes = node.kind === 190 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
links.resolvedType = createNormalizedTypeReference(target, elementTypes);
}
}
@@ -55352,7 +55525,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, accessNode, accessFlags) {
var _a2;
- const accessExpression = accessNode && accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode : void 0;
+ const accessExpression = accessNode && accessNode.kind === 214 /* ElementAccessExpression */ ? accessNode : void 0;
const propName = accessNode && isPrivateIdentifier(accessNode) ? void 0 : getPropertyNameFromIndex(indexType, accessNode);
if (propName !== void 0) {
if (accessFlags & 256 /* Contextual */) {
@@ -55520,7 +55693,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getIndexNodeForAccessExpression(accessNode) {
- return accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 199 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 166 /* ComputedPropertyName */ ? accessNode.expression : accessNode;
+ return accessNode.kind === 214 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 201 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 167 /* ComputedPropertyName */ ? accessNode.expression : accessNode;
}
function isPatternLiteralPlaceholderType(type) {
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
@@ -55651,7 +55824,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
accessFlags |= 1 /* IncludeUndefined */;
- if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
+ if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 201 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
if (objectType.flags & 3 /* AnyOrUnknown */) {
return objectType;
}
@@ -56191,7 +56364,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getThisType(node) {
const container = getThisContainer(node, false);
const parent = container && container.parent;
- if (parent && (isClassLike(parent) || parent.kind === 267 /* InterfaceDeclaration */)) {
+ if (parent && (isClassLike(parent) || parent.kind === 270 /* InterfaceDeclaration */)) {
if (!isStatic(container) && (!isConstructorDeclaration(container) || isNodeDescendantOf(node, container.body))) {
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;
}
@@ -56221,17 +56394,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getArrayElementTypeNode(node) {
switch (node.kind) {
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return getArrayElementTypeNode(node.type);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
if (node.elements.length === 1) {
node = node.elements[0];
- if (node.kind === 191 /* RestType */ || node.kind === 202 /* NamedTupleMember */ && node.dotDotDotToken) {
+ if (node.kind === 193 /* RestType */ || node.kind === 204 /* NamedTupleMember */ && node.dotDotDotToken) {
return getArrayElementTypeNode(node.type);
}
}
break;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return node.elementType;
}
return void 0;
@@ -56246,8 +56419,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeFromTypeNodeWorker(node) {
switch (node.kind) {
case 132 /* AnyKeyword */:
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
return anyType;
case 159 /* UnknownKeyword */:
return unknownType;
@@ -56273,66 +56446,66 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return node.flags & 262144 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType;
case 140 /* IntrinsicKeyword */:
return intrinsicMarkerType;
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 109 /* ThisKeyword */:
return getTypeFromThisTypeNode(node);
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return getTypeFromLiteralTypeNode(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return getTypeFromTypeReference(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return node.assertsModifier ? voidType : booleanType;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return getTypeFromTypeReference(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return getTypeFromTypeQueryNode(node);
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
return getTypeFromArrayOrTupleTypeNode(node);
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return getTypeFromOptionalTypeNode(node);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return getTypeFromUnionTypeNode(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return getTypeFromIntersectionTypeNode(node);
- case 323 /* JSDocNullableType */:
+ case 326 /* JSDocNullableType */:
return getTypeFromJSDocNullableTypeNode(node);
- case 325 /* JSDocOptionalType */:
+ case 328 /* JSDocOptionalType */:
return addOptionality(getTypeFromTypeNode(node.type));
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return getTypeFromNamedTupleTypeNode(node);
- case 196 /* ParenthesizedType */:
- case 324 /* JSDocNonNullableType */:
- case 318 /* JSDocTypeExpression */:
+ case 198 /* ParenthesizedType */:
+ case 327 /* JSDocNonNullableType */:
+ case 321 /* JSDocTypeExpression */:
return getTypeFromTypeNode(node.type);
- case 191 /* RestType */:
+ case 193 /* RestType */:
return getTypeFromRestTypeNode(node);
- case 327 /* JSDocVariadicType */:
+ case 330 /* JSDocVariadicType */:
return getTypeFromJSDocVariadicType(node);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 326 /* JSDocFunctionType */:
- case 332 /* JSDocSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 329 /* JSDocFunctionType */:
+ case 335 /* JSDocSignature */:
return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return getTypeFromTypeOperatorNode(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return getTypeFromIndexedAccessTypeNode(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return getTypeFromMappedTypeNode(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return getTypeFromConditionalTypeNode(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return getTypeFromInferTypeNode(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return getTypeFromTemplateTypeNode(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return getTypeFromImportTypeNode(node);
case 79 /* Identifier */:
- case 165 /* QualifiedName */:
- case 211 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
const symbol = getSymbolAtLocation(node);
return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType;
default:
@@ -56527,13 +56700,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type;
}
function maybeTypeParameterReference(node) {
- return !(node.parent.kind === 183 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 205 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
+ return !(node.parent.kind === 185 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 207 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
}
function isTypeParameterPossiblyReferenced(tp, node) {
if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {
const container = tp.symbol.declarations[0].parent;
for (let n = node; n !== container; n = n.parent) {
- if (!n || n.kind === 242 /* Block */ || n.kind === 194 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) {
+ if (!n || n.kind === 244 /* Block */ || n.kind === 196 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) {
return true;
}
}
@@ -56542,17 +56715,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
function containsReference(node2) {
switch (node2.kind) {
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return !!tp.isThisType;
case 79 /* Identifier */:
return !tp.isThisType && isPartOfTypeNode(node2) && maybeTypeParameterReference(node2) && getTypeFromTypeNodeWorker(node2) === tp;
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
const entityName = node2.exprName;
const firstIdentifier = getFirstIdentifier(entityName);
const firstIdentifierSymbol = getResolvedSymbol(firstIdentifier);
const tpDeclaration = tp.symbol.declarations[0];
let tpScope;
- if (tpDeclaration.kind === 167 /* TypeParameter */) {
+ if (tpDeclaration.kind === 168 /* TypeParameter */) {
tpScope = tpDeclaration.parent;
} else if (tp.isThisType) {
tpScope = tpDeclaration;
@@ -56563,8 +56736,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return some(firstIdentifierSymbol.declarations, (idDecl) => isNodeDescendantOf(idDecl, tpScope)) || some(node2.typeArguments, containsReference);
}
return true;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return !node2.type && !!node2.body || some(node2.typeParameters, containsReference) || some(node2.parameters, containsReference) || !!node2.type && containsReference(node2.type);
}
return !!forEachChild(node2, containsReference);
@@ -56795,32 +56968,32 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
}
function isContextSensitive(node) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
switch (node.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
return isContextSensitiveFunctionLikeDeclaration(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return some(node.properties, isContextSensitive);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return some(node.elements, isContextSensitive);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right));
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return isContextSensitive(node.initializer);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isContextSensitive(node.expression);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return some(node.properties, isContextSensitive) || isJsxOpeningElement(node.parent) && some(node.parent.parent.children, isContextSensitive);
- case 294 /* JsxAttribute */: {
+ case 297 /* JsxAttribute */: {
const { initializer } = node;
return !!initializer && isContextSensitive(initializer);
}
- case 297 /* JsxExpression */: {
+ case 300 /* JsxExpression */: {
const { expression } = node;
return !!expression && isContextSensitive(expression);
}
@@ -56831,7 +57004,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
}
function hasContextSensitiveReturnExpression(node) {
- return !node.typeParameters && !getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 242 /* Block */ && isContextSensitive(node.body);
+ return !node.typeParameters && !getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 244 /* Block */ && isContextSensitive(node.body);
}
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func);
@@ -56904,23 +57077,23 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
switch (node.kind) {
- case 297 /* JsxExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 300 /* JsxExpression */:
+ case 219 /* ParenthesizedExpression */:
return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (node.operatorToken.kind) {
case 63 /* EqualsToken */:
case 27 /* CommaToken */:
return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
}
break;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer);
}
return false;
@@ -57094,16 +57267,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) {
switch (child.kind) {
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return { errorNode: child, innerExpression: child.expression, nameType };
case 11 /* JsxText */:
if (child.containsOnlyTriviaWhiteSpaces) {
break;
}
return { errorNode: child, innerExpression: void 0, nameType, errorMessage: getInvalidTextDiagnostic() };
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
return { errorNode: child, innerExpression: child, nameType };
default:
return Debug.assertNever(child, "Found invalid jsx child");
@@ -57229,13 +57402,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
}
switch (prop.kind) {
- case 178 /* SetAccessor */:
- case 177 /* GetAccessor */:
- case 174 /* MethodDeclaration */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 180 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 309 /* ShorthandPropertyAssignment */:
yield { errorNode: prop.name, innerExpression: void 0, nameType: type };
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type, errorMessage: isComputedNonLiteralName(prop.name) ? Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 : void 0 };
break;
default:
@@ -57289,7 +57462,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers);
}
const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
- const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 174 /* MethodDeclaration */ && kind !== 173 /* MethodSignature */ && kind !== 176 /* Constructor */;
+ const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 176 /* MethodDeclaration */ && kind !== 175 /* MethodSignature */ && kind !== 178 /* Constructor */;
let result = -1 /* True */;
const sourceThisType = getThisTypeOfSignature(source);
if (sourceThisType && sourceThisType !== voidType) {
@@ -59135,7 +59308,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const sourceSignature = first(sourceSignatures);
const targetSignature = first(targetSignatures);
result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, incompatibleReporter(sourceSignature, targetSignature));
- if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 176 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 176 /* Constructor */)) {
+ if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 178 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 178 /* Constructor */)) {
const constructSignatureToString = (signature) => signatureToString(signature, void 0, 262144 /* WriteArrowStyleSignature */, kind);
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature));
reportError(Diagnostics.Types_of_construct_signatures_are_incompatible);
@@ -59753,7 +59926,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const target = type.target;
if (getObjectFlags(target) & 1 /* Class */) {
const baseTypeNode = getBaseTypeNodeOfClass(target);
- if (baseTypeNode && baseTypeNode.expression.kind !== 79 /* Identifier */ && baseTypeNode.expression.kind !== 211 /* PropertyAccessExpression */) {
+ if (baseTypeNode && baseTypeNode.expression.kind !== 79 /* Identifier */ && baseTypeNode.expression.kind !== 213 /* PropertyAccessExpression */) {
return void 0;
}
}
@@ -60120,12 +60293,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let diagnostic;
switch (declaration.kind) {
- case 227 /* BinaryExpression */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 229 /* BinaryExpression */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
diagnostic = noImplicitAny ? Diagnostics.Member_0_implicitly_has_an_1_type : Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
const param = declaration;
if (isIdentifier(param.name) && (isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(param, param.name.escapedText, 788968 /* Type */, void 0, param.name.escapedText, true) || param.name.originalKeywordKind && isTypeNodeKind(param.name.originalKeywordKind))) {
const newName = "arg" + param.parent.parameters.indexOf(param);
@@ -60135,22 +60308,22 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
diagnostic = Diagnostics.Binding_element_0_implicitly_has_an_1_type;
if (!noImplicitAny) {
return;
}
break;
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
return;
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
if (noImplicitAny && !declaration.name) {
if (wideningKind === 3 /* GeneratorYield */) {
error(declaration, Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString);
@@ -60161,7 +60334,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
diagnostic = !noImplicitAny ? Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage : wideningKind === 3 /* GeneratorYield */ ? Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type;
break;
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
if (noImplicitAny) {
error(declaration, Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type);
}
@@ -60258,7 +60431,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function inferFromIntraExpressionSites(context) {
if (context.intraExpressionInferenceSites) {
for (const { node, type } of context.intraExpressionInferenceSites) {
- const contextualType = node.kind === 174 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType(node, 2 /* NoConstraints */);
+ const contextualType = node.kind === 176 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType(node, 2 /* NoConstraints */);
if (contextualType) {
inferTypes(context.inferences, type, contextualType);
}
@@ -60310,8 +60483,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isNonGenericTopLevelType(type) {
if (type.aliasSymbol && !type.aliasTypeArguments) {
- const declaration = getDeclarationOfKind(type.aliasSymbol, 268 /* TypeAliasDeclaration */);
- return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 314 /* SourceFile */ ? true : n.kind === 270 /* ModuleDeclaration */ ? false : "quit"));
+ const declaration = getDeclarationOfKind(type.aliasSymbol, 271 /* TypeAliasDeclaration */);
+ return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 317 /* SourceFile */ ? true : n.kind === 273 /* ModuleDeclaration */ ? false : "quit"));
}
return false;
}
@@ -61056,7 +61229,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function inferFromSignature(source, target) {
const saveBivariant = bivariant;
const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
- bivariant = bivariant || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 176 /* Constructor */;
+ bivariant = bivariant || kind === 176 /* MethodDeclaration */ || kind === 175 /* MethodSignature */ || kind === 178 /* Constructor */;
applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
bivariant = saveBivariant;
applyToReturnTypes(source, target, inferFromTypes);
@@ -61212,7 +61385,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function;
}
default:
- if (node.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.parent.kind === 309 /* ShorthandPropertyAssignment */) {
return Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;
} else {
return Diagnostics.Cannot_find_name_0;
@@ -61237,7 +61410,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isInTypeQuery(node) {
return !!findAncestor(
node,
- (n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 79 /* Identifier */ || n.kind === 165 /* QualifiedName */ ? false : "quit"
+ (n) => n.kind === 188 /* TypeQuery */ ? true : n.kind === 79 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
);
}
function getFlowCacheKey(node, declaredType, initialType, flowContainer) {
@@ -61249,59 +61422,59 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
case 109 /* ThisKeyword */:
return `0|${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}`;
- case 236 /* NonNullExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
const left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer);
return left && left + "." + node.right.escapedText;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const propName = getAccessedPropertyName(node);
if (propName !== void 0) {
const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
return key && key + "." + propName;
}
break;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
return `${getNodeId(node)}#${getTypeId(declaredType)}`;
}
return void 0;
}
function isMatchingReference(source, target) {
switch (target.kind) {
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return isMatchingReference(source, target.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isAssignmentExpression(target) && isMatchingReference(source, target.left) || isBinaryExpression(target) && target.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source, target.right);
}
switch (source.kind) {
- case 237 /* MetaProperty */:
- return target.kind === 237 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText;
+ case 239 /* MetaProperty */:
+ return target.kind === 239 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText;
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
- return isThisInTypeQuery(source) ? target.kind === 109 /* ThisKeyword */ : target.kind === 79 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || (target.kind === 261 /* VariableDeclaration */ || target.kind === 208 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
+ return isThisInTypeQuery(source) ? target.kind === 109 /* ThisKeyword */ : target.kind === 79 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || (target.kind === 263 /* VariableDeclaration */ || target.kind === 210 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
case 109 /* ThisKeyword */:
return target.kind === 109 /* ThisKeyword */;
case 107 /* SuperKeyword */:
return target.kind === 107 /* SuperKeyword */;
- case 236 /* NonNullExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
return isMatchingReference(source.expression, target);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const sourcePropertyName = getAccessedPropertyName(source);
const targetPropertyName = isAccessExpression(target) ? getAccessedPropertyName(target) : void 0;
return sourcePropertyName !== void 0 && targetPropertyName !== void 0 && targetPropertyName === sourcePropertyName && isMatchingReference(source.expression, target.expression);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return isAccessExpression(target) && source.right.escapedText === getAccessedPropertyName(target) && isMatchingReference(source.left, target.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isBinaryExpression(source) && source.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source.right, target);
}
return false;
@@ -61451,7 +61624,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getMatchingUnionConstituentForObjectLiteral(unionType, node) {
const keyPropertyName = getKeyPropertyName(unionType);
- const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 305 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer));
+ const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 308 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer));
const propType = propNode && getContextFreeTypeOfExpression(propNode.initializer);
return propType && getConstituentTypeForKeyType(unionType, propType);
}
@@ -61466,7 +61639,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (expression.expression.kind === 211 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) {
+ if (expression.expression.kind === 213 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) {
return true;
}
return false;
@@ -61627,11 +61800,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, void 0) || errorType);
}
function getAssignedTypeOfBinaryExpression(node) {
- const isDestructuringDefaultAssignment = node.parent.kind === 209 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 305 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);
+ const isDestructuringDefaultAssignment = node.parent.kind === 211 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 308 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);
return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right);
}
function isDestructuringAssignmentTarget(parent) {
- return parent.parent.kind === 227 /* BinaryExpression */ && parent.parent.left === parent || parent.parent.kind === 251 /* ForOfStatement */ && parent.parent.initializer === parent;
+ return parent.parent.kind === 229 /* BinaryExpression */ && parent.parent.left === parent || parent.parent.kind === 253 /* ForOfStatement */ && parent.parent.initializer === parent;
}
function getAssignedTypeOfArrayLiteralElement(node, element) {
return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element));
@@ -61648,21 +61821,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getAssignedType(node) {
const { parent } = node;
switch (parent.kind) {
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return stringType;
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return checkRightHandSideOfForOf(parent) || errorType;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return getAssignedTypeOfBinaryExpression(parent);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return undefinedType;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return getAssignedTypeOfArrayLiteralElement(parent, node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return getAssignedTypeOfSpreadExpression(parent);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getAssignedTypeOfPropertyAssignment(parent);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return getAssignedTypeOfShorthandPropertyAssignment(parent);
}
return errorType;
@@ -61670,7 +61843,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getInitialTypeOfBindingElement(node) {
const pattern = node.parent;
const parentType = getInitialType(pattern.parent);
- const type = pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType);
+ const type = pattern.kind === 208 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType);
return getTypeWithDefault(type, node.initializer);
}
function getTypeOfInitializer(node) {
@@ -61681,25 +61854,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.initializer) {
return getTypeOfInitializer(node.initializer);
}
- if (node.parent.parent.kind === 250 /* ForInStatement */) {
+ if (node.parent.parent.kind === 252 /* ForInStatement */) {
return stringType;
}
- if (node.parent.parent.kind === 251 /* ForOfStatement */) {
+ if (node.parent.parent.kind === 253 /* ForOfStatement */) {
return checkRightHandSideOfForOf(node.parent.parent) || errorType;
}
return errorType;
}
function getInitialType(node) {
- return node.kind === 261 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node);
+ return node.kind === 263 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node);
}
function isEmptyArrayAssignment(node) {
- return node.kind === 261 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 208 /* BindingElement */ && node.parent.kind === 227 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right);
+ return node.kind === 263 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 210 /* BindingElement */ && node.parent.kind === 229 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right);
}
function getReferenceCandidate(node) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return getReferenceCandidate(node.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (node.operatorToken.kind) {
case 63 /* EqualsToken */:
case 75 /* BarBarEqualsToken */:
@@ -61714,10 +61887,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getReferenceRoot(node) {
const { parent } = node;
- return parent.kind === 217 /* ParenthesizedExpression */ || parent.kind === 227 /* BinaryExpression */ && parent.operatorToken.kind === 63 /* EqualsToken */ && parent.left === node || parent.kind === 227 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node;
+ return parent.kind === 219 /* ParenthesizedExpression */ || parent.kind === 229 /* BinaryExpression */ && parent.operatorToken.kind === 63 /* EqualsToken */ && parent.left === node || parent.kind === 229 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node;
}
function getTypeOfSwitchClause(clause) {
- if (clause.kind === 298 /* CaseClause */) {
+ if (clause.kind === 301 /* CaseClause */) {
return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression));
}
return neverType;
@@ -61733,12 +61906,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return links.switchTypes;
}
function getSwitchClauseTypeOfWitnesses(switchStatement) {
- if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 298 /* CaseClause */ && !isStringLiteralLike(clause.expression))) {
+ if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 301 /* CaseClause */ && !isStringLiteralLike(clause.expression))) {
return void 0;
}
const witnesses = [];
for (const clause of switchStatement.caseBlock.clauses) {
- const text = clause.kind === 298 /* CaseClause */ ? clause.expression.text : void 0;
+ const text = clause.kind === 301 /* CaseClause */ ? clause.expression.text : void 0;
witnesses.push(text && !contains(witnesses, text) ? text : void 0);
}
return witnesses;
@@ -61888,8 +62061,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isEvolvingArrayOperationTarget(node) {
const root = getReferenceRoot(node);
const parent = root.parent;
- const isLengthPushOrUnshift = isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || parent.parent.kind === 213 /* CallExpression */ && isIdentifier(parent.name) && isPushOrUnshiftIdentifier(parent.name));
- const isElementAssignment = parent.kind === 212 /* ElementAccessExpression */ && parent.expression === root && parent.parent.kind === 227 /* BinaryExpression */ && parent.parent.operatorToken.kind === 63 /* EqualsToken */ && parent.parent.left === parent && !isAssignmentTarget(parent.parent) && isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 296 /* NumberLike */);
+ const isLengthPushOrUnshift = isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || parent.parent.kind === 215 /* CallExpression */ && isIdentifier(parent.name) && isPushOrUnshiftIdentifier(parent.name));
+ const isElementAssignment = parent.kind === 214 /* ElementAccessExpression */ && parent.expression === root && parent.parent.kind === 229 /* BinaryExpression */ && parent.parent.operatorToken.kind === 63 /* EqualsToken */ && parent.parent.left === parent && !isAssignmentTarget(parent.parent) && isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 296 /* NumberLike */);
return isLengthPushOrUnshift || isElementAssignment;
}
function isDeclarationWithExplicitTypeAnnotation(node) {
@@ -61912,7 +62085,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isDeclarationWithExplicitTypeAnnotation(declaration)) {
return getTypeOfSymbol(symbol);
}
- if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) {
+ if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 253 /* ForOfStatement */) {
const statement = declaration.parent.parent;
const expressionType = getTypeOfDottedName(statement.expression, void 0);
if (expressionType) {
@@ -61936,7 +62109,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getExplicitThisType(node);
case 107 /* SuperKeyword */:
return checkSuperExpression(node);
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const type = getTypeOfDottedName(node.expression, diagnostic);
if (type) {
const name = node.name;
@@ -61953,7 +62126,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return void 0;
}
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return getTypeOfDottedName(node.expression, diagnostic);
}
}
@@ -61963,7 +62136,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let signature = links.effectsSignature;
if (signature === void 0) {
let funcType;
- if (node.parent.kind === 245 /* ExpressionStatement */) {
+ if (node.parent.kind === 247 /* ExpressionStatement */) {
funcType = getTypeOfDottedName(node.expression, void 0);
} else if (node.expression.kind !== 107 /* SuperKeyword */) {
if (isOptionalChain(node)) {
@@ -62005,7 +62178,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isFalseExpression(expr) {
const node = skipParentheses(expr, true);
- return node.kind === 96 /* FalseKeyword */ || node.kind === 227 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right));
+ return node.kind === 96 /* FalseKeyword */ || node.kind === 229 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right));
}
function isReachableFlowNodeWorker(flow, noCacheCheck) {
while (true) {
@@ -62104,8 +62277,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const symbol = getResolvedSymbol(node);
return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
}
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
}
return false;
@@ -62125,7 +62298,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode));
sharedFlowCount = sharedFlowStart;
const resultType = getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
- if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 236 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
+ if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 238 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
return declaredType;
}
return resultType === nonNullUnknownType ? unknownType : resultType;
@@ -62194,7 +62367,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
target.antecedents = saveAntecedents;
} else if (flags & 2 /* Start */) {
const container = flow.node;
- if (container && container !== flowContainer && reference.kind !== 211 /* PropertyAccessExpression */ && reference.kind !== 212 /* ElementAccessExpression */ && reference.kind !== 109 /* ThisKeyword */) {
+ if (container && container !== flowContainer && reference.kind !== 213 /* PropertyAccessExpression */ && reference.kind !== 214 /* ElementAccessExpression */ && reference.kind !== 109 /* ThisKeyword */) {
flow = container.flowNode;
continue;
}
@@ -62213,7 +62386,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getInitialOrAssignedType(flow) {
const node = flow.node;
- return getNarrowableTypeForReference(node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference);
+ return getNarrowableTypeForReference(node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference);
}
function getTypeAtFlowAssignment(flow) {
const node = flow.node;
@@ -62243,13 +62416,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (isVariableDeclaration(node) && (isInJSFile(node) || isVarConst(node))) {
const init = getDeclaredExpandoInitializer(node);
- if (init && (init.kind === 218 /* FunctionExpression */ || init.kind === 219 /* ArrowFunction */)) {
+ if (init && (init.kind === 220 /* FunctionExpression */ || init.kind === 221 /* ArrowFunction */)) {
return getTypeAtFlowNode(flow.antecedent);
}
}
return declaredType;
}
- if (isVariableDeclaration(node) && node.parent.parent.kind === 250 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
+ if (isVariableDeclaration(node) && node.parent.parent.kind === 252 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))));
}
return void 0;
@@ -62259,7 +62432,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.kind === 96 /* FalseKeyword */) {
return unreachableNeverType;
}
- if (node.kind === 227 /* BinaryExpression */) {
+ if (node.kind === 229 /* BinaryExpression */) {
if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) {
return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right);
}
@@ -62288,13 +62461,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeAtFlowArrayMutation(flow) {
if (declaredType === autoType || declaredType === autoArrayType) {
const node = flow.node;
- const expr = node.kind === 213 /* CallExpression */ ? node.expression.expression : node.left.expression;
+ const expr = node.kind === 215 /* CallExpression */ ? node.expression.expression : node.left.expression;
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
const flowType = getTypeAtFlowNode(flow.antecedent);
const type = getTypeFromFlowType(flowType);
if (getObjectFlags(type) & 256 /* EvolvingArray */) {
let evolvedType2 = type;
- if (node.kind === 213 /* CallExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
for (const arg of node.arguments) {
evolvedType2 = addEvolvingArrayElementType(evolvedType2, arg);
}
@@ -62331,7 +62504,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let type = getTypeFromFlowType(flowType);
if (isMatchingReference(reference, expr)) {
type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
- } else if (expr.kind === 222 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
+ } else if (expr.kind === 224 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
} else {
if (strictNullChecks) {
@@ -62343,7 +62516,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
flow.clauseEnd,
(t) => !(t.flags & (32768 /* Undefined */ | 131072 /* Never */))
);
- } else if (expr.kind === 222 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) {
+ } else if (expr.kind === 224 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) {
type = narrowTypeBySwitchOptionalChainContainment(
type,
flow.switchStatement,
@@ -62592,10 +62765,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const operator = expr.operatorToken.kind;
const left = getReferenceCandidate(expr.left);
const right = getReferenceCandidate(expr.right);
- if (left.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(right)) {
+ if (left.kind === 224 /* TypeOfExpression */ && isStringLiteralLike(right)) {
return narrowTypeByTypeof(type, left, operator, right, assumeTrue);
}
- if (right.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(left)) {
+ if (right.kind === 224 /* TypeOfExpression */ && isStringLiteralLike(left)) {
return narrowTypeByTypeof(type, right, operator, left, assumeTrue);
}
if (isMatchingReference(reference, left)) {
@@ -62793,7 +62966,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!witnesses) {
return type;
}
- const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 299 /* DefaultClause */);
+ const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 302 /* DefaultClause */);
const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd;
if (hasDefaultClause) {
const notEqualFacts = getNotEqualFactsFromTypeofSwitch(clauseStart, clauseEnd, witnesses);
@@ -62946,17 +63119,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
case 109 /* ThisKeyword */:
case 107 /* SuperKeyword */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return narrowTypeByTruthiness(type, expr, assumeTrue);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return narrowTypeByCallExpression(type, expr, assumeTrue);
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return narrowType(type, expr.expression, assumeTrue);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
if (expr.operator === 53 /* ExclamationToken */) {
return narrowType(type, expr.operand, !assumeTrue);
}
@@ -62994,7 +63167,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getNonMissingTypeOfSymbol(symbol);
}
function getControlFlowContainer(node) {
- return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 271 /* ModuleBlock */ || node2.kind === 314 /* SourceFile */ || node2.kind === 171 /* PropertyDeclaration */ || node2.kind === 172 /* AnnotationPropertyDeclaration */);
+ return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 274 /* ModuleBlock */ || node2.kind === 317 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */ || node2.kind === 173 /* AnnotationPropertyDeclaration */);
}
function isSymbolAssigned(symbol) {
if (!symbol.valueDeclaration) {
@@ -63030,7 +63203,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function removeOptionalityFromDeclaredType(declaredType, declaration) {
if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) {
- const annotationIncludesUndefined = strictNullChecks && declaration.kind === 168 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
+ const annotationIncludesUndefined = strictNullChecks && declaration.kind === 169 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
popTypeResolution();
return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
} else {
@@ -63040,7 +63213,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isConstraintPosition(type, node) {
const parent = node.parent;
- return parent.kind === 211 /* PropertyAccessExpression */ || parent.kind === 165 /* QualifiedName */ || parent.kind === 213 /* CallExpression */ && parent.expression === node || parent.kind === 212 /* ElementAccessExpression */ && parent.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
+ return parent.kind === 213 /* PropertyAccessExpression */ || parent.kind === 166 /* QualifiedName */ || parent.kind === 215 /* CallExpression */ && parent.expression === node || parent.kind === 214 /* ElementAccessExpression */ && parent.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
}
function isGenericTypeWithUnionConstraint(type) {
return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithUnionConstraint) : !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */));
@@ -63088,14 +63261,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (declaration) {
if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
const parent = declaration.parent.parent;
- if (parent.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent.kind === 168 /* Parameter */) {
+ if (parent.kind === 263 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent.kind === 169 /* Parameter */) {
const links = getNodeLinks(parent);
if (!(links.flags & 268435456 /* InCheckIdentifier */)) {
links.flags |= 268435456 /* InCheckIdentifier */;
const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
links.flags &= ~268435456 /* InCheckIdentifier */;
- if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent.kind === 168 /* Parameter */ && isSymbolAssigned(symbol))) {
+ if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
const pattern = declaration.parent;
const narrowedType = getFlowTypeOfReference(pattern, parentTypeConstraint, parentTypeConstraint, void 0, location.flowNode);
if (narrowedType.flags & 131072 /* Never */) {
@@ -63138,7 +63311,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const container = getContainingFunction(node);
if (languageVersion < 2 /* ES2015 */) {
- if (container.kind === 219 /* ArrowFunction */) {
+ if (container.kind === 221 /* ArrowFunction */) {
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
} else if (hasSyntacticModifier(container, 512 /* Async */)) {
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
@@ -63159,7 +63332,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let declaration = localOrExportSymbol.valueDeclaration;
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
- if (declaration.kind === 264 /* ClassDeclaration */ && nodeIsDecorated(declaration)) {
+ if (declaration.kind === 266 /* ClassDeclaration */ && nodeIsDecorated(declaration)) {
let container = getContainingClass(node);
while (container !== void 0) {
if (container === declaration && container.name !== node) {
@@ -63169,9 +63342,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
container = getContainingClass(container);
}
- } else if (declaration.kind === 232 /* ClassExpression */) {
+ } else if (declaration.kind === 234 /* ClassExpression */) {
let container = getThisContainer(node, false);
- while (container.kind !== 314 /* SourceFile */) {
+ while (container.kind !== 317 /* SourceFile */) {
if (container.parent === declaration) {
if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */;
@@ -63219,16 +63392,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type;
}
type = getNarrowableTypeForReference(type, node, checkMode);
- const isParameter2 = getRootDeclaration(declaration).kind === 168 /* Parameter */;
+ const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */;
const declarationContainer = getControlFlowContainer(declaration);
let flowContainer = getControlFlowContainer(node);
const isOuterVariable = flowContainer !== declarationContainer;
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
- while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 220 /* FunctionExpression */ || flowContainer.kind === 221 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
flowContainer = getControlFlowContainer(flowContainer);
}
- const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || node.parent.kind === 284 /* ExportSpecifier */) || node.parent.kind === 236 /* NonNullExpression */ || declaration.kind === 261 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
+ const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || node.parent.kind === 287 /* ExportSpecifier */) || node.parent.kind === 238 /* NonNullExpression */ || declaration.kind === 263 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
@@ -63278,7 +63451,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return findAncestor(node, (n) => !n || nodeStartsNewLexicalEnvironment(n) ? "quit" : isIterationStatement(n, false));
}
function checkNestedBlockScopedBinding(node, symbol) {
- if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 301 /* CatchClause */) {
+ if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 304 /* CatchClause */) {
return;
}
const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration);
@@ -63288,7 +63461,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isCaptured) {
let capturesBlockScopeBindingInLoopBody = true;
if (isForStatement(container)) {
- const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */);
+ const varDeclList = getAncestor(symbol.valueDeclaration, 264 /* VariableDeclarationList */);
if (varDeclList && varDeclList.parent === container) {
const part = getPartOfForStatementContainingNode(node.parent, container);
if (part) {
@@ -63307,7 +63480,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
if (isForStatement(container)) {
- const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */);
+ const varDeclList = getAncestor(symbol.valueDeclaration, 264 /* VariableDeclarationList */);
if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */;
}
@@ -63324,13 +63497,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isAssignedInBodyOfForStatement(node, container) {
let current = node;
- while (current.parent.kind === 217 /* ParenthesizedExpression */) {
+ while (current.parent.kind === 219 /* ParenthesizedExpression */) {
current = current.parent;
}
let isAssigned = false;
if (isAssignmentTarget(current)) {
isAssigned = true;
- } else if (current.parent.kind === 225 /* PrefixUnaryExpression */ || current.parent.kind === 226 /* PostfixUnaryExpression */) {
+ } else if (current.parent.kind === 227 /* PrefixUnaryExpression */ || current.parent.kind === 228 /* PostfixUnaryExpression */) {
const expr = current.parent;
isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */;
}
@@ -63341,7 +63514,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function captureLexicalThis(node, container) {
getNodeLinks(node).flags |= 2 /* LexicalThis */;
- if (container.kind === 171 /* PropertyDeclaration */ || container.kind === 176 /* Constructor */) {
+ if (container.kind === 172 /* PropertyDeclaration */ || container.kind === 178 /* Constructor */) {
const classNode = container.parent;
getNodeLinks(classNode).flags |= 4 /* CaptureThis */;
} else {
@@ -63375,27 +63548,27 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const isNodeInTypeQuery = isInTypeQuery(node);
let container = getThisContainer(node, true);
let capturedByArrowFunction = false;
- if (container.kind === 176 /* Constructor */) {
+ if (container.kind === 178 /* Constructor */) {
checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class);
}
- if (container.kind === 219 /* ArrowFunction */) {
+ if (container.kind === 221 /* ArrowFunction */) {
container = getThisContainer(container, false);
capturedByArrowFunction = true;
}
checkThisInStaticClassFieldInitializerInDecoratedClass(node, container);
switch (container.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
error(node, Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
error(node, Diagnostics.this_cannot_be_referenced_in_current_location);
break;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
if (isInConstructorArgumentInitializer(node, container)) {
error(node, Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
}
break;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
error(node, Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);
break;
}
@@ -63469,13 +63642,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getClassNameFromPrototypeMethod(container) {
- if (container.kind === 218 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) {
+ if (container.kind === 220 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) {
return container.parent.left.expression.expression;
- } else if (container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) {
+ } else if (container.kind === 176 /* MethodDeclaration */ && container.parent.kind === 212 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) {
return container.parent.parent.left.expression;
- } else if (container.kind === 218 /* FunctionExpression */ && container.parent.kind === 305 /* PropertyAssignment */ && container.parent.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) {
+ } else if (container.kind === 220 /* FunctionExpression */ && container.parent.kind === 308 /* PropertyAssignment */ && container.parent.parent.kind === 212 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) {
return container.parent.parent.parent.left.expression;
- } else if (container.kind === 218 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {
+ } else if (container.kind === 220 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {
return container.parent.parent.parent.arguments[0].expression;
} else if (isMethodDeclaration(container) && isIdentifier(container.name) && (container.name.escapedText === "value" || container.name.escapedText === "get" || container.name.escapedText === "set") && isObjectLiteralExpression(container.parent) && isCallExpression(container.parent.parent) && container.parent.parent.arguments[2] === container.parent && getAssignmentDeclarationKind(container.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {
return container.parent.parent.arguments[0].expression;
@@ -63483,7 +63656,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTypeForThisExpressionFromJSDoc(node) {
const jsdocType = getJSDocType(node);
- if (jsdocType && jsdocType.kind === 326 /* JSDocFunctionType */) {
+ if (jsdocType && jsdocType.kind === 329 /* JSDocFunctionType */) {
const jsDocFunctionType = jsdocType;
if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && jsDocFunctionType.parameters[0].name.escapedText === "this" /* This */) {
return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type);
@@ -63495,16 +63668,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isInConstructorArgumentInitializer(node, constructorDecl) {
- return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 168 /* Parameter */ && n.parent === constructorDecl);
+ return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 169 /* Parameter */ && n.parent === constructorDecl);
}
function checkSuperExpression(node) {
- const isCallExpression2 = node.parent.kind === 213 /* CallExpression */ && node.parent.expression === node;
+ const isCallExpression2 = node.parent.kind === 215 /* CallExpression */ && node.parent.expression === node;
const immediateContainer = getSuperContainer(node, true);
let container = immediateContainer;
let needToCaptureLexicalThis = false;
let inAsyncFunction = false;
if (!isCallExpression2) {
- while (container && container.kind === 219 /* ArrowFunction */) {
+ while (container && container.kind === 221 /* ArrowFunction */) {
if (hasSyntacticModifier(container, 512 /* Async */))
inAsyncFunction = true;
container = getSuperContainer(container, true);
@@ -63516,19 +63689,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const canUseSuperExpression = isLegalUsageOfSuperExpression(container);
let nodeCheckFlag = 0;
if (!canUseSuperExpression) {
- const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 166 /* ComputedPropertyName */);
- if (current && current.kind === 166 /* ComputedPropertyName */) {
+ const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 167 /* ComputedPropertyName */);
+ if (current && current.kind === 167 /* ComputedPropertyName */) {
error(node, Diagnostics.super_cannot_be_referenced_in_a_computed_property_name);
} else if (isCallExpression2) {
error(node, Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors);
- } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 210 /* ObjectLiteralExpression */)) {
+ } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 212 /* ObjectLiteralExpression */)) {
error(node, Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions);
} else {
error(node, Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class);
}
return errorType;
}
- if (!isCallExpression2 && immediateContainer.kind === 176 /* Constructor */) {
+ if (!isCallExpression2 && immediateContainer.kind === 178 /* Constructor */) {
checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class);
}
if (isStatic(container) || isCallExpression2) {
@@ -63544,7 +63717,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
nodeCheckFlag = 256 /* SuperInstance */;
}
getNodeLinks(node).flags |= nodeCheckFlag;
- if (container.kind === 174 /* MethodDeclaration */ && inAsyncFunction) {
+ if (container.kind === 176 /* MethodDeclaration */ && inAsyncFunction) {
if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) {
getNodeLinks(container).flags |= 4096 /* MethodWithSuperPropertyAssignmentInAsync */;
} else {
@@ -63554,7 +63727,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (needToCaptureLexicalThis) {
captureLexicalThis(node.parent, container);
}
- if (container.parent.kind === 210 /* ObjectLiteralExpression */) {
+ if (container.parent.kind === 212 /* ObjectLiteralExpression */) {
if (languageVersion < 2 /* ES2015 */) {
error(node, Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);
return errorType;
@@ -63572,7 +63745,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!baseClassType) {
return errorType;
}
- if (container.kind === 176 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) {
+ if (container.kind === 178 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) {
error(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
return errorType;
}
@@ -63582,13 +63755,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
if (isCallExpression2) {
- return container2.kind === 176 /* Constructor */;
+ return container2.kind === 178 /* Constructor */;
} else {
- if (isClassLike(container2.parent) || container2.parent.kind === 210 /* ObjectLiteralExpression */) {
+ if (isClassLike(container2.parent) || container2.parent.kind === 212 /* ObjectLiteralExpression */) {
if (isStatic(container2)) {
- return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 171 /* PropertyDeclaration */ || container2.kind === 175 /* ClassStaticBlockDeclaration */;
+ return container2.kind === 176 /* MethodDeclaration */ || container2.kind === 175 /* MethodSignature */ || container2.kind === 179 /* GetAccessor */ || container2.kind === 180 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 177 /* ClassStaticBlockDeclaration */;
} else {
- return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 171 /* PropertyDeclaration */ || container2.kind === 170 /* PropertySignature */ || container2.kind === 176 /* Constructor */;
+ return container2.kind === 176 /* MethodDeclaration */ || container2.kind === 175 /* MethodSignature */ || container2.kind === 179 /* GetAccessor */ || container2.kind === 180 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 171 /* PropertySignature */ || container2.kind === 178 /* Constructor */;
}
}
}
@@ -63596,7 +63769,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getContainingObjectLiteral(func) {
- return (func.kind === 174 /* MethodDeclaration */ || func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) && func.parent.kind === 210 /* ObjectLiteralExpression */ ? func.parent : func.kind === 218 /* FunctionExpression */ && func.parent.kind === 305 /* PropertyAssignment */ ? func.parent.parent : void 0;
+ return (func.kind === 176 /* MethodDeclaration */ || func.kind === 179 /* GetAccessor */ || func.kind === 180 /* SetAccessor */) && func.parent.kind === 212 /* ObjectLiteralExpression */ ? func.parent : func.kind === 220 /* FunctionExpression */ && func.parent.kind === 308 /* PropertyAssignment */ ? func.parent.parent : void 0;
}
function getThisTypeArgument(type) {
return getObjectFlags(type) & 4 /* Reference */ && type.target === globalThisType ? getTypeArguments(type)[0] : void 0;
@@ -63607,7 +63780,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
}
function getContextualThisParameterType(func) {
- if (func.kind === 219 /* ArrowFunction */) {
+ if (func.kind === 221 /* ArrowFunction */) {
return void 0;
}
if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
@@ -63631,7 +63804,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (thisType) {
return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral)));
}
- if (literal.parent.kind !== 305 /* PropertyAssignment */) {
+ if (literal.parent.kind !== 308 /* PropertyAssignment */) {
break;
}
literal = literal.parent.parent;
@@ -63640,7 +63813,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getWidenedType(contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral));
}
const parent = walkUpParenthesizedExpressions(func.parent);
- if (parent.kind === 227 /* BinaryExpression */ && parent.operatorToken.kind === 63 /* EqualsToken */) {
+ if (parent.kind === 229 /* BinaryExpression */ && parent.operatorToken.kind === 63 /* EqualsToken */) {
const target = parent.left;
if (isAccessExpression(target)) {
const { expression } = target;
@@ -63687,11 +63860,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getTypeFromTypeNode(typeNode);
}
switch (declaration.kind) {
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return getContextuallyTypedParameterType(declaration);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getContextualTypeForBindingElement(declaration, contextFlags);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (isStatic(declaration)) {
return getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags);
}
@@ -63700,10 +63873,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getContextualTypeForBindingElement(declaration, contextFlags) {
const parent = declaration.parent.parent;
const name = declaration.propertyName || declaration.name;
- const parentType = getContextualTypeForVariableLikeDeclaration(parent, contextFlags) || parent.kind !== 208 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */);
+ const parentType = getContextualTypeForVariableLikeDeclaration(parent, contextFlags) || parent.kind !== 210 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */);
if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name))
return void 0;
- if (parent.name.kind === 207 /* ArrayBindingPattern */) {
+ if (parent.name.kind === 209 /* ArrayBindingPattern */) {
const index = indexOfNode(declaration.parent.elements, declaration);
if (index < 0)
return void 0;
@@ -63836,7 +64009,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return signatureHasRestParameter(signature) && argIndex >= restIndex ? getIndexedAccessType(getTypeOfSymbol(signature.parameters[restIndex]), getNumberLiteralType(argIndex - restIndex), 256 /* Contextual */) : getTypeAtPosition(signature, argIndex);
}
function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {
- if (template.parent.kind === 215 /* TaggedTemplateExpression */) {
+ if (template.parent.kind === 217 /* TaggedTemplateExpression */) {
return getContextualTypeForArgument(template.parent, substitutionExpression);
}
return void 0;
@@ -64095,10 +64268,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
case 157 /* UndefinedKeyword */:
return true;
- case 211 /* PropertyAccessExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 219 /* ParenthesizedExpression */:
return isPossiblyDiscriminantValue(node.expression);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return !node.expression || isPossiblyDiscriminantValue(node.expression);
}
return false;
@@ -64108,7 +64281,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
contextualType,
concatenate(
map(
- filter(node.properties, (p) => !!p.symbol && p.kind === 305 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName)),
+ filter(node.properties, (p) => !!p.symbol && p.kind === 308 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName)),
(prop) => [() => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
),
map(
@@ -64128,7 +64301,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
contextualType,
concatenate(
map(
- filter(node.properties, (p) => !!p.symbol && p.kind === 294 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))),
+ filter(node.properties, (p) => !!p.symbol && p.kind === 297 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))),
(prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
),
map(
@@ -64185,63 +64358,63 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const { parent } = node;
switch (parent.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 210 /* BindingElement */:
return getContextualTypeForInitializerExpression(node, contextFlags);
- case 219 /* ArrowFunction */:
- case 254 /* ReturnStatement */:
+ case 221 /* ArrowFunction */:
+ case 256 /* ReturnStatement */:
return getContextualTypeForReturnExpression(node, contextFlags);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return getContextualTypeForYieldOperand(parent, contextFlags);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return getContextualTypeForAwaitOperand(parent, contextFlags);
- case 213 /* CallExpression */:
- case 220 /* EtsComponentExpression */:
+ case 215 /* CallExpression */:
+ case 222 /* EtsComponentExpression */:
if (isInEtsFile(parent) && parent.expression.kind === 101 /* ImportKeyword */) {
return stringType;
}
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return getContextualTypeForArgument(parent, node);
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return isConstTypeReference(parent.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(parent.type);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return getContextualTypeForBinaryOperand(node, contextFlags);
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return getContextualTypeForObjectLiteralElement(parent, contextFlags);
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return getContextualType(parent.parent, contextFlags);
- case 209 /* ArrayLiteralExpression */: {
+ case 211 /* ArrayLiteralExpression */: {
const arrayLiteral = parent;
const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags);
return getContextualTypeForElementExpression(type, indexOfNode(arrayLiteral.elements, node));
}
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return getContextualTypeForConditionalOperand(node, contextFlags);
- case 240 /* TemplateSpan */:
- Debug.assert(parent.parent.kind === 229 /* TemplateExpression */);
+ case 242 /* TemplateSpan */:
+ Debug.assert(parent.parent.kind === 231 /* TemplateExpression */);
return getContextualTypeForSubstitutionExpression(parent.parent, node);
- case 217 /* ParenthesizedExpression */: {
+ case 219 /* ParenthesizedExpression */: {
const tag = isInJSFile(parent) ? getJSDocTypeTag(parent) : void 0;
return !tag ? getContextualType(parent, contextFlags) : isJSDocTypeTag(tag) && isConstTypeReference(tag.typeExpression.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(tag.typeExpression.type);
}
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return getContextualType(parent, contextFlags);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return getTypeFromTypeNode(parent.type);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return tryGetTypeFromEffectiveTypeNode(parent);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return getContextualTypeForJsxExpression(parent, contextFlags);
- case 294 /* JsxAttribute */:
- case 296 /* JsxSpreadAttribute */:
+ case 297 /* JsxAttribute */:
+ case 299 /* JsxSpreadAttribute */:
return getContextualTypeForJsxAttribute(parent, contextFlags);
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return getContextualJsxElementAttributesType(parent, contextFlags);
}
return void 0;
@@ -64463,7 +64636,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return isFunctionExpressionOrArrowFunction(node) || isObjectLiteralMethod(node) ? getContextualSignature(node) : void 0;
}
function getContextualSignature(node) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
const typeTagSignature = getSignatureOfTypeTag(node);
if (typeTagSignature) {
return typeTagSignature;
@@ -64504,7 +64677,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type;
}
function hasDefaultValue(node) {
- return node.kind === 208 /* BindingElement */ && !!node.initializer || node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */;
+ return node.kind === 210 /* BindingElement */ && !!node.initializer || node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */;
}
function checkArrayLiteral(node, checkMode, forceTuple) {
const elements = node.elements;
@@ -64517,7 +64690,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let hasOmittedExpression = false;
for (let i = 0; i < elementCount; i++) {
const e = elements[i];
- if (e.kind === 231 /* SpreadElement */) {
+ if (e.kind === 233 /* SpreadElement */) {
if (languageVersion < 2 /* ES2015 */) {
checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
}
@@ -64533,7 +64706,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
elementTypes.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, e.expression));
elementFlags.push(4 /* Rest */);
}
- } else if (exactOptionalPropertyTypes && e.kind === 233 /* OmittedExpression */) {
+ } else if (exactOptionalPropertyTypes && e.kind === 235 /* OmittedExpression */) {
hasOmittedExpression = true;
elementTypes.push(missingType);
elementFlags.push(2 /* Optional */);
@@ -64570,7 +64743,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isNumericName(name) {
switch (name.kind) {
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return isNumericComputedName(name);
case 79 /* Identifier */:
return isNumericLiteralName(name.escapedText);
@@ -64587,7 +64760,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkComputedPropertyName(node) {
const links = getNodeLinks(node.expression);
if (!links.resolvedType) {
- if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 102 /* InKeyword */ && node.parent.kind !== 177 /* GetAccessor */ && node.parent.kind !== 178 /* SetAccessor */) {
+ if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 102 /* InKeyword */ && node.parent.kind !== 179 /* GetAccessor */ && node.parent.kind !== 180 /* SetAccessor */) {
return links.resolvedType = errorType;
}
links.resolvedType = checkExpression(node.expression);
@@ -64646,7 +64819,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let propertiesArray = [];
let spread = emptyObjectType;
const contextualType = getApparentTypeOfContextualType(node, void 0);
- const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 206 /* ObjectBindingPattern */ || contextualType.pattern.kind === 210 /* ObjectLiteralExpression */);
+ const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 208 /* ObjectBindingPattern */ || contextualType.pattern.kind === 212 /* ObjectLiteralExpression */);
const inConstContext = isConstContext(node);
const checkFlags = inConstContext ? 8 /* Readonly */ : 0;
const isInJavascript = isInJSFile(node) && !isInJsonFile(node);
@@ -64665,9 +64838,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let offset = 0;
for (const memberDecl of node.properties) {
let member = getSymbolOfNode(memberDecl);
- const computedNameType = memberDecl.name && memberDecl.name.kind === 166 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
- if (memberDecl.kind === 305 /* PropertyAssignment */ || memberDecl.kind === 306 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
- let type = memberDecl.kind === 305 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : memberDecl.kind === 306 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode);
+ const computedNameType = memberDecl.name && memberDecl.name.kind === 167 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
+ if (memberDecl.kind === 308 /* PropertyAssignment */ || memberDecl.kind === 309 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
+ let type = memberDecl.kind === 308 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : memberDecl.kind === 309 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode);
if (isInJavascript) {
const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
if (jsDocType) {
@@ -64684,7 +64857,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
prop.nameType = nameType;
}
if (inDestructuringPattern) {
- const isOptional = memberDecl.kind === 305 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 306 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer;
+ const isOptional = memberDecl.kind === 308 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 309 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer;
if (isOptional) {
prop.flags |= 16777216 /* Optional */;
}
@@ -64710,16 +64883,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
prop.target = member;
member = prop;
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
- if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 305 /* PropertyAssignment */ || memberDecl.kind === 174 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
+ if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 308 /* PropertyAssignment */ || memberDecl.kind === 176 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
const inferenceContext = getInferenceContext(node);
Debug.assert(inferenceContext);
- const inferenceNode = memberDecl.kind === 305 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
+ const inferenceNode = memberDecl.kind === 308 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type);
}
if (type.symbol && type.symbol.flags & 268435456 /* Annotation */) {
error(memberDecl, Diagnostics.Annotation_cannot_be_used_as_a_value);
}
- } else if (memberDecl.kind === 307 /* SpreadAssignment */) {
+ } else if (memberDecl.kind === 310 /* SpreadAssignment */) {
if (languageVersion < 2 /* ES2015 */) {
checkExternalEmitHelpers(memberDecl, 2 /* Assign */);
}
@@ -64748,7 +64921,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
continue;
} else {
- Debug.assert(memberDecl.kind === 177 /* GetAccessor */ || memberDecl.kind === 178 /* SetAccessor */);
+ Debug.assert(memberDecl.kind === 179 /* GetAccessor */ || memberDecl.kind === 180 /* SetAccessor */);
checkNodeDeferred(memberDecl);
}
if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) {
@@ -64772,13 +64945,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (contextualTypeHasPattern) {
const rootPatternParent = findAncestor(
contextualType.pattern.parent,
- (n) => n.kind === 261 /* VariableDeclaration */ || n.kind === 227 /* BinaryExpression */ || n.kind === 168 /* Parameter */
+ (n) => n.kind === 263 /* VariableDeclaration */ || n.kind === 229 /* BinaryExpression */ || n.kind === 169 /* Parameter */
);
const spreadOrOutsideRootObject = findAncestor(
node,
- (n) => n === rootPatternParent || n.kind === 307 /* SpreadAssignment */
+ (n) => n === rootPatternParent || n.kind === 310 /* SpreadAssignment */
);
- if (spreadOrOutsideRootObject.kind !== 307 /* SpreadAssignment */) {
+ if (spreadOrOutsideRootObject.kind !== 310 /* SpreadAssignment */) {
for (const prop of getPropertiesOfType(contextualType)) {
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
if (!(prop.flags & 16777216 /* Optional */)) {
@@ -64907,7 +65080,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
} else {
- Debug.assert(attributeDecl.kind === 296 /* JsxSpreadAttribute */);
+ Debug.assert(attributeDecl.kind === 299 /* JsxSpreadAttribute */);
if (attributesTable.size > 0) {
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false);
attributesTable = createSymbolTable();
@@ -64932,7 +65105,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false);
}
}
- const parent = openingLikeElement.parent.kind === 287 /* JsxElement */ ? openingLikeElement.parent : void 0;
+ const parent = openingLikeElement.parent.kind === 290 /* JsxElement */ ? openingLikeElement.parent : void 0;
if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) {
const childrenTypes = checkJsxChildren(parent, checkMode);
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
@@ -64978,7 +65151,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!child.containsOnlyTriviaWhiteSpaces) {
childrenTypes.push(stringType);
}
- } else if (child.kind === 297 /* JsxExpression */ && !child.expression) {
+ } else if (child.kind === 300 /* JsxExpression */ && !child.expression) {
continue;
} else {
childrenTypes.push(checkExpressionForMutableLocation(child, checkMode));
@@ -65295,7 +65468,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkPropertyAccessibility(node, isSuper, writing, type, prop, reportError = true) {
- const errorNode = !reportError ? void 0 : node.kind === 165 /* QualifiedName */ ? node.right : node.kind === 205 /* ImportType */ ? node : node.kind === 208 /* BindingElement */ && node.propertyName ? node.propertyName : node.name;
+ const errorNode = !reportError ? void 0 : node.kind === 166 /* QualifiedName */ ? node.right : node.kind === 207 /* ImportType */ ? node : node.kind === 210 /* BindingElement */ && node.propertyName ? node.propertyName : node.name;
return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode);
}
function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) {
@@ -65508,7 +65681,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return checkPropertyAccessExpressionOrQualifiedName(node, node.left, leftType, node.right, checkMode);
}
function isMethodAccessForCall(node) {
- while (node.parent.kind === 217 /* ParenthesizedExpression */) {
+ while (node.parent.kind === 219 /* ParenthesizedExpression */) {
node = node.parent;
}
return isCallOrNewExpression(node.parent) && node.parent.expression === node;
@@ -65663,7 +65836,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return isErrorType(apparentType) ? errorType : apparentType;
}
- prop = getPropertyOfType(apparentType, right.escapedText, false, node.kind === 165 /* QualifiedName */);
+ prop = getPropertyOfType(apparentType, right.escapedText, false, node.kind === 166 /* QualifiedName */);
if (!prop) {
const etsComponentExpressionNode = getEtsComponentExpressionInnerCallExpressionNode(node) || getRootEtsComponentInnerCallExpressionNode(node);
const locals = getSourceFileOfNode(node).locals;
@@ -65688,7 +65861,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 308 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {
+ if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 311 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {
markAliasReferenced(parentSymbol, node);
}
let propType;
@@ -65786,7 +65959,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (declaration && isPropertyWithoutInitializer(declaration)) {
if (!isStatic(declaration)) {
const flowContainer = getControlFlowContainer(node);
- if (flowContainer.kind === 176 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 16777216 /* Ambient */)) {
+ if (flowContainer.kind === 178 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 16777216 /* Ambient */)) {
assumeUninitialized = true;
}
}
@@ -65830,7 +66003,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!needInitialization && !(hasRequireDecorator && checkStructPropertyPosition(valueDeclaration, node))) {
diagnosticMessage = error(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
}
- } else if (valueDeclaration.kind === 264 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 16777216 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
+ } else if (valueDeclaration.kind === 266 /* ClassDeclaration */ && node.parent.kind !== 185 /* TypeReference */ && !(valueDeclaration.flags & 16777216 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
diagnosticMessage = error(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
}
if (diagnosticMessage) {
@@ -65843,25 +66016,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isInPropertyInitializerOrClassStaticBlock(node) {
return !!findAncestor(node, (node2) => {
switch (node2.kind) {
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return true;
- case 305 /* PropertyAssignment */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 307 /* SpreadAssignment */:
- case 166 /* ComputedPropertyName */:
- case 240 /* TemplateSpan */:
- case 297 /* JsxExpression */:
- case 294 /* JsxAttribute */:
- case 295 /* JsxAttributes */:
- case 296 /* JsxSpreadAttribute */:
- case 289 /* JsxOpeningElement */:
- case 234 /* ExpressionWithTypeArguments */:
- case 300 /* HeritageClause */:
+ case 308 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 310 /* SpreadAssignment */:
+ case 167 /* ComputedPropertyName */:
+ case 242 /* TemplateSpan */:
+ case 300 /* JsxExpression */:
+ case 297 /* JsxAttribute */:
+ case 298 /* JsxAttributes */:
+ case 299 /* JsxSpreadAttribute */:
+ case 292 /* JsxOpeningElement */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 303 /* HeritageClause */:
return false;
- case 219 /* ArrowFunction */:
- case 245 /* ExpressionStatement */:
+ case 221 /* ArrowFunction */:
+ case 247 /* ExpressionStatement */:
return isBlock(node2.parent) && isClassStaticBlockDeclaration(node2.parent.parent) ? true : "quit";
default:
return isExpressionNode(node2) ? false : "quit";
@@ -66096,18 +66269,18 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isValidPropertyAccess(node, propertyName) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return isValidPropertyAccessWithType(node, node.expression.kind === 107 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression)));
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return isValidPropertyAccessWithType(node, false, propertyName, getWidenedType(checkExpression(node.left)));
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return isValidPropertyAccessWithType(node, false, propertyName, getTypeFromTypeNode(node));
}
}
function isValidPropertyAccessForCompletions(node, type, property) {
return isPropertyAccessible(
node,
- node.kind === 211 /* PropertyAccessExpression */ && node.expression.kind === 107 /* SuperKeyword */,
+ node.kind === 213 /* PropertyAccessExpression */ && node.expression.kind === 107 /* SuperKeyword */,
false,
type,
property
@@ -66132,7 +66305,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getForInVariableSymbol(node) {
const initializer = node.initializer;
- if (initializer.kind === 262 /* VariableDeclarationList */) {
+ if (initializer.kind === 264 /* VariableDeclarationList */) {
const variable = initializer.declarations[0];
if (variable && !isBindingPattern(variable.name)) {
return getSymbolOfNode(variable);
@@ -66153,7 +66326,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let child = expr;
let node = expr.parent;
while (node) {
- if (node.kind === 250 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
+ if (node.kind === 252 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
return true;
}
child = node;
@@ -66197,11 +66370,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (callLikeExpressionMayHaveTypeArguments(node)) {
forEach(node.typeArguments, checkSourceElement);
}
- if (node.kind === 215 /* TaggedTemplateExpression */) {
+ if (node.kind === 217 /* TaggedTemplateExpression */) {
checkExpression(node.template);
} else if (isJsxOpeningLikeElement(node)) {
checkExpression(node.attributes);
- } else if (node.kind !== 169 /* Decorator */) {
+ } else if (node.kind !== 170 /* Decorator */) {
forEach(node.arguments, (argument) => {
checkExpression(argument);
});
@@ -66246,7 +66419,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isSpreadArgument(arg) {
- return !!arg && (arg.kind === 231 /* SpreadElement */ || arg.kind === 238 /* SyntheticExpression */ && arg.isSpread);
+ return !!arg && (arg.kind === 233 /* SpreadElement */ || arg.kind === 240 /* SyntheticExpression */ && arg.isSpread);
}
function getSpreadArgumentIndex(args) {
return findIndex(args, isSpreadArgument);
@@ -66262,9 +66435,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let callIsIncomplete = false;
let effectiveParameterCount = getParameterCount(signature);
let effectiveMinimumArguments = getMinArgumentCount(signature);
- if (node.kind === 215 /* TaggedTemplateExpression */) {
+ if (node.kind === 217 /* TaggedTemplateExpression */) {
argCount = args.length;
- if (node.template.kind === 229 /* TemplateExpression */) {
+ if (node.template.kind === 231 /* TemplateExpression */) {
const lastSpan = last(node.template.templateSpans);
callIsIncomplete = nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated;
} else {
@@ -66272,7 +66445,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
Debug.assert(templateLiteral.kind === 14 /* NoSubstitutionTemplateLiteral */);
callIsIncomplete = !!templateLiteral.isUnterminated;
}
- } else if (node.kind === 169 /* Decorator */) {
+ } else if (node.kind === 170 /* Decorator */) {
argCount = getDecoratorArgumentCount(node, signature);
} else if (isJsxOpeningLikeElement(node)) {
callIsIncomplete = node.attributes.end === node.end;
@@ -66283,7 +66456,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
effectiveParameterCount = args.length === 0 ? effectiveParameterCount : 1;
effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1);
} else if (!node.arguments) {
- Debug.assert(node.kind === 214 /* NewExpression */);
+ Debug.assert(node.kind === 216 /* NewExpression */);
return getMinArgumentCount(signature) === 0;
} else {
argCount = signatureHelpTrailingComma ? args.length + 1 : args.length;
@@ -66364,7 +66537,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isJsxOpeningLikeElement(node)) {
return inferJsxTypeArguments(node, signature, checkMode, context);
}
- if (node.kind !== 169 /* Decorator */) {
+ if (node.kind !== 170 /* Decorator */) {
const skipBindingPatterns = every(signature.typeParameters, (p) => !!getDefaultFromTypeParameter(p));
const contextualType = getContextualType(node, skipBindingPatterns ? 8 /* SkipBindingPatterns */ : 0 /* None */);
if (contextualType) {
@@ -66401,7 +66574,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
for (let i = 0; i < argCount; i++) {
const arg = args[i];
- if (arg.kind !== 233 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
+ if (arg.kind !== 235 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
const paramType = getTypeAtPosition(signature, i);
if (couldContainTypeVariables(paramType)) {
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -66422,7 +66595,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (index >= argCount - 1) {
const arg = args[argCount - 1];
if (isSpreadArgument(arg)) {
- return getMutableArrayOrTupleType(arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode));
+ return getMutableArrayOrTupleType(arg.kind === 240 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode));
}
}
const types = [];
@@ -66431,12 +66604,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
for (let i = index; i < argCount; i++) {
const arg = args[i];
if (isSpreadArgument(arg)) {
- const spreadType = arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression);
+ const spreadType = arg.kind === 240 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression);
if (isArrayLikeType(spreadType)) {
types.push(spreadType);
flags.push(8 /* Variadic */);
} else {
- types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 231 /* SpreadElement */ ? arg.expression : arg));
+ types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 233 /* SpreadElement */ ? arg.expression : arg));
flags.push(4 /* Rest */);
}
} else {
@@ -66446,7 +66619,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType));
flags.push(1 /* Required */);
}
- if (arg.kind === 238 /* SyntheticExpression */ && arg.tupleNameSource) {
+ if (arg.kind === 240 /* SyntheticExpression */ && arg.tupleNameSource) {
names.push(arg.tupleNameSource);
}
}
@@ -66589,7 +66762,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
const thisType = getThisTypeOfSignature(signature);
- if (thisType && thisType !== voidType && node.kind !== 214 /* NewExpression */) {
+ if (thisType && thisType !== voidType && node.kind !== 216 /* NewExpression */) {
const thisArgumentNode = getThisArgumentOfCall(node);
const thisArgumentType = getThisArgumentType(thisArgumentNode);
const errorNode = reportErrors2 ? thisArgumentNode || node : void 0;
@@ -66604,7 +66777,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length;
for (let i = 0; i < argCount; i++) {
const arg = args[i];
- if (arg.kind !== 233 /* OmittedExpression */) {
+ if (arg.kind !== 235 /* OmittedExpression */) {
const paramType = getTypeAtPosition(signature, i);
const argType = checkExpressionWithContextualType(arg, paramType, void 0, checkMode);
const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;
@@ -66639,7 +66812,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getThisArgumentOfCall(node) {
- const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : void 0;
+ const expression = node.kind === 215 /* CallExpression */ ? node.expression : node.kind === 217 /* TaggedTemplateExpression */ ? node.tag : void 0;
if (expression) {
const callee = skipOuterExpressions(expression);
if (isAccessExpression(callee)) {
@@ -66654,17 +66827,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
}
function getEffectiveCallArguments(node) {
- if (node.kind === 215 /* TaggedTemplateExpression */) {
+ if (node.kind === 217 /* TaggedTemplateExpression */) {
const template = node.template;
const args2 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())];
- if (template.kind === 229 /* TemplateExpression */) {
+ if (template.kind === 231 /* TemplateExpression */) {
forEach(template.templateSpans, (span) => {
args2.push(span.expression);
});
}
return args2;
}
- if (node.kind === 169 /* Decorator */) {
+ if (node.kind === 170 /* Decorator */) {
return getEffectiveDecoratorArguments(node);
}
if (isJsxOpeningLikeElement(node)) {
@@ -66676,7 +66849,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const effectiveArgs = args.slice(0, spreadIndex);
for (let i = spreadIndex; i < args.length; i++) {
const arg = args[i];
- const spreadType = arg.kind === 231 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
+ const spreadType = arg.kind === 233 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
if (spreadType && isTupleType(spreadType)) {
forEach(getTypeArguments(spreadType), (t, i2) => {
var _a2;
@@ -66701,30 +66874,30 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const parent = node.parent;
const expr = node.expression;
switch (parent.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return [
createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent)))
];
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
const func = parent.parent;
return [
- createSyntheticExpression(expr, parent.parent.kind === 176 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),
+ createSyntheticExpression(expr, parent.parent.kind === 178 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),
createSyntheticExpression(expr, anyType),
createSyntheticExpression(expr, numberType)
];
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent) || hasAccessorModifier(parent));
return [
createSyntheticExpression(expr, getParentTypeOfClassElement(parent)),
createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)),
createSyntheticExpression(expr, hasPropDesc ? createTypedPropertyDescriptorType(getTypeOfNode(parent)) : anyType)
];
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (isEtsFunctionDecorators(getNameOfDecorator(node), compilerOptions)) {
const symbol = getSymbolOfNode(expr);
return symbol ? [
@@ -66737,19 +66910,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getDecoratorArgumentCount(node, signature) {
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return 1;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return hasAccessorModifier(node.parent) ? 3 : 2;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return 3;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (isEtsFunctionDecorators(getNameOfDecorator(node), compilerOptions)) {
return isCallExpression(node.expression) ? 1 : 0;
}
@@ -66876,10 +67049,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
}
function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) {
- const isTaggedTemplate = node.kind === 215 /* TaggedTemplateExpression */;
- const isDecorator2 = node.kind === 169 /* Decorator */;
+ const isTaggedTemplate = node.kind === 217 /* TaggedTemplateExpression */;
+ const isDecorator2 = node.kind === 170 /* Decorator */;
const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
- const isEtsComponentExpression2 = node.kind === 220 /* EtsComponentExpression */;
+ const isEtsComponentExpression2 = node.kind === 222 /* EtsComponentExpression */;
const reportErrors2 = !candidatesOutArray;
let typeArguments;
let virtual;
@@ -66909,7 +67082,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let candidateForArgumentArityError;
let candidateForTypeArgumentError;
let result;
- const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 213 /* CallExpression */ && node.arguments.hasTrailingComma;
+ const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 215 /* CallExpression */ && node.arguments.hasTrailingComma;
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
}
@@ -67359,7 +67532,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const declaration = signature.declaration;
const modifiers = getSelectedEffectiveModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */);
- if (!modifiers || declaration.kind !== 176 /* Constructor */) {
+ if (!modifiers || declaration.kind !== 178 /* Constructor */) {
return true;
}
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol);
@@ -67501,19 +67674,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getDiagnosticHeadMessageForDecoratorResolution(node) {
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
const decoratorName = getNameOfDecorator(node);
if (isEtsFunctionDecorators(decoratorName, compilerOptions)) {
return Diagnostics.Unable_to_resolve_signature_of_function_decorator_when_decorators_are_not_valid;
@@ -67673,20 +67846,20 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function resolveSignature(node, candidatesOutArray, checkMode) {
switch (node.kind) {
- case 213 /* CallExpression */:
- case 220 /* EtsComponentExpression */:
+ case 215 /* CallExpression */:
+ case 222 /* EtsComponentExpression */:
return resolveCallExpression(node, candidatesOutArray, checkMode);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return resolveNewExpression(node, candidatesOutArray, checkMode);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
if (isAnnotation(node)) {
return resolveAnnotation(node);
}
return resolveDecorator(node, candidatesOutArray, checkMode);
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode);
}
}
@@ -67791,7 +67964,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
let parent = node.parent;
- while (parent && parent.kind === 211 /* PropertyAccessExpression */) {
+ while (parent && parent.kind === 213 /* PropertyAccessExpression */) {
parent = parent.parent;
}
if (parent && isBinaryExpression(parent) && isPrototypeAccess(parent.left) && parent.operatorToken.kind === 63 /* EqualsToken */) {
@@ -67810,9 +67983,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.expression.kind === 107 /* SuperKeyword */) {
return voidType;
}
- if (node.kind === 214 /* NewExpression */) {
+ if (node.kind === 216 /* NewExpression */) {
const declaration = signature.declaration;
- if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
+ if (declaration && declaration.kind !== 178 /* Constructor */ && declaration.kind !== 182 /* ConstructSignature */ && declaration.kind !== 187 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
if (noImplicitAny) {
error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);
}
@@ -67826,7 +67999,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) {
return getESSymbolLikeTypeForNode(walkUpParenthesizedExpressions(node.parent));
}
- if (node.kind === 213 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 245 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) {
+ if (node.kind === 215 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 247 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) {
if (!isDottedName(node.expression)) {
error(node.expression, Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);
} else if (!getEffectsSignature(node)) {
@@ -67846,7 +68019,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.expression, Diagnostics.UI_component_0_cannot_be_used_in_this_place, diagnosticName(node.expression));
}
const signatureDeclaration = signature.declaration;
- if (node.kind === 213 /* CallExpression */ && signatureDeclaration && !isJSDocSignature(signatureDeclaration) && (isMethodDeclaration(signatureDeclaration) || isMethodSignature(signatureDeclaration) || isFunctionDeclaration(signatureDeclaration))) {
+ if (node.kind === 215 /* CallExpression */ && signatureDeclaration && !isJSDocSignature(signatureDeclaration) && (isMethodDeclaration(signatureDeclaration) || isMethodSignature(signatureDeclaration) || isFunctionDeclaration(signatureDeclaration))) {
if (shouldCheckThrows(signatureDeclaration) && !hasAsyncErrorCallbacks(signatureDeclaration)) {
checkThrowableFunction(node);
}
@@ -68186,20 +68359,20 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getDeprecatedSuggestionNode(node) {
node = skipParentheses(node);
switch (node.kind) {
- case 213 /* CallExpression */:
- case 169 /* Decorator */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 170 /* Decorator */:
+ case 216 /* NewExpression */:
return getDeprecatedSuggestionNode(node.expression);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return getDeprecatedSuggestionNode(node.tag);
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return getDeprecatedSuggestionNode(node.tagName);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return node.argumentExpression;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return node.name;
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
const typeReference = node;
return isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference;
default:
@@ -68308,7 +68481,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (resolvedRequire.flags & 2097152 /* Alias */) {
return false;
}
- const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 263 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 261 /* VariableDeclaration */ : 0 /* Unknown */;
+ const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 265 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 263 /* VariableDeclaration */ : 0 /* Unknown */;
if (targetDeclarationKind !== 0 /* Unknown */) {
const decl = getDeclarationOfKind(resolvedRequire, targetDeclarationKind);
return !!decl && !!(decl.flags & 16777216 /* Ambient */);
@@ -68326,7 +68499,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getReturnTypeOfSignature(signature);
}
function checkAssertion(node) {
- if (node.kind === 216 /* TypeAssertionExpression */) {
+ if (node.kind === 218 /* TypeAssertionExpression */) {
const file = getSourceFileOfNode(node);
if (file && fileExtensionIsOneOf(file.fileName, [".cts" /* Cts */, ".mts" /* Mts */])) {
grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
@@ -68342,18 +68515,18 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 9 /* BigIntLiteral */:
case 111 /* TrueKeyword */:
case 96 /* FalseKeyword */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 229 /* TemplateExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 231 /* TemplateExpression */:
return true;
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isValidConstAssertionArgument(node.expression);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const op = node.operator;
const arg = node.operand;
return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = node.expression;
let symbol = getTypeOfNode(expr).symbol;
if (symbol && symbol.flags & 2097152 /* Alias */) {
@@ -68399,7 +68572,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkExpressionWithTypeArguments(node) {
checkGrammarExpressionWithTypeArguments(node);
- const exprType = node.kind === 234 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
+ const exprType = node.kind === 236 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
const typeArguments = node.typeArguments;
if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) {
return exprType;
@@ -68494,7 +68667,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!container) {
error(node, Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target");
return errorType;
- } else if (container.kind === 176 /* Constructor */) {
+ } else if (container.kind === 178 /* Constructor */) {
const symbol = getSymbolOfNode(container.parent);
return getTypeOfSymbol(symbol);
} else {
@@ -68544,7 +68717,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getParameterIdentifierNameAtPosition(signature, pos) {
var _a2;
- if (((_a2 = signature.declaration) == null ? void 0 : _a2.kind) === 326 /* JSDocFunctionType */) {
+ if (((_a2 = signature.declaration) == null ? void 0 : _a2.kind) === 329 /* JSDocFunctionType */) {
return void 0;
}
const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
@@ -68576,7 +68749,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return symbol.valueDeclaration && isParameter(symbol.valueDeclaration) && isIdentifier(symbol.valueDeclaration.name);
}
function isValidDeclarationForTupleLabel(d) {
- return d.kind === 202 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name);
+ return d.kind === 204 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name);
}
function getNameableDeclarationAtPosition(signature, pos) {
const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
@@ -68835,7 +69008,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let yieldType;
let nextType;
let fallbackReturnType = voidType;
- if (func.body.kind !== 242 /* Block */) {
+ if (func.body.kind !== 244 /* Block */) {
returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */);
if (isAsync) {
returnType = unwrapAwaitedType(checkAwaitedType(returnType, false, func, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member));
@@ -68969,7 +69142,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return links.isExhaustive;
}
function computeExhaustiveSwitchStatement(node) {
- if (node.expression.kind === 222 /* TypeOfExpression */) {
+ if (node.expression.kind === 224 /* TypeOfExpression */) {
const witnesses = getSwitchClauseTypeOfWitnesses(node);
if (!witnesses) {
return false;
@@ -69024,11 +69197,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function mayReturnNever(func) {
switch (func.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
- case 174 /* MethodDeclaration */:
- return func.parent.kind === 210 /* ObjectLiteralExpression */;
+ case 176 /* MethodDeclaration */:
+ return func.parent.kind === 212 /* ObjectLiteralExpression */;
default:
return false;
}
@@ -69070,7 +69243,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return judgeReturnTypeOfStyles();
}
}
- if (func.kind === 173 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 242 /* Block */ || !functionHasImplicitReturn(func)) {
+ if (func.kind === 175 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 244 /* Block */ || !functionHasImplicitReturn(func)) {
return;
}
const hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */;
@@ -69106,7 +69279,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
checkNodeDeferred(node);
if (isFunctionExpression(node)) {
checkCollisionsForDeclarationName(node, node.name);
@@ -69129,7 +69302,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return anyFunctionType;
}
const hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
- if (!hasGrammarError && node.kind === 218 /* FunctionExpression */) {
+ if (!hasGrammarError && node.kind === 220 /* FunctionExpression */) {
checkGrammarForGenerator(node);
}
contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -69173,7 +69346,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
const functionFlags = getFunctionFlags(node);
const returnType = getReturnTypeFromAnnotation(node);
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
@@ -69181,7 +69354,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!getEffectiveReturnTypeNode(node)) {
getReturnTypeOfSignature(getSignatureFromDeclaration(node));
}
- if (node.body.kind === 242 /* Block */) {
+ if (node.body.kind === 244 /* Block */) {
checkSourceElement(node.body);
} else {
const exprType = checkExpression(node.body);
@@ -69247,7 +69420,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isReadonlySymbol(symbol)) {
if (symbol.flags & 4 /* Property */ && isAccessExpression(expr) && expr.expression.kind === 109 /* ThisKeyword */) {
const ctor = getContainingFunction(expr);
- if (!(ctor && (ctor.kind === 176 /* Constructor */ || isJSConstructor(ctor)))) {
+ if (!(ctor && (ctor.kind === 178 /* Constructor */ || isJSConstructor(ctor)))) {
return true;
}
if (symbol.valueDeclaration) {
@@ -69268,7 +69441,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const symbol2 = getNodeLinks(node).resolvedSymbol;
if (symbol2.flags & 2097152 /* Alias */) {
const declaration = getDeclarationOfAliasSymbol(symbol2);
- return !!declaration && declaration.kind === 277 /* NamespaceImport */;
+ return !!declaration && declaration.kind === 280 /* NamespaceImport */;
}
}
}
@@ -69373,7 +69546,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!hasParseDiagnostics(sourceFile)) {
const span = getSpanOfTokenAtPosition(sourceFile, node.pos);
const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);
- if (container && container.kind !== 176 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) {
+ if (container && container.kind !== 178 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) {
const relatedInfo = createDiagnosticForNode(container, Diagnostics.Did_you_mean_to_mark_this_function_as_async);
addRelatedInfo(diagnostic, relatedInfo);
}
@@ -69566,7 +69739,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis = false) {
const properties = node.properties;
const property = properties[propertyIndex];
- if (property.kind === 305 /* PropertyAssignment */ || property.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (property.kind === 308 /* PropertyAssignment */ || property.kind === 309 /* ShorthandPropertyAssignment */) {
const name = property.name;
const exprType = getLiteralTypeFromPropertyName(name);
if (isTypeUsableAsPropertyName(exprType)) {
@@ -69579,8 +69752,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const elementType = getIndexedAccessType(objectLiteralType, exprType, 32 /* ExpressionPosition */, name);
const type = getFlowTypeOfDestructuring(property, elementType);
- return checkDestructuringAssignment(property.kind === 306 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);
- } else if (property.kind === 307 /* SpreadAssignment */) {
+ return checkDestructuringAssignment(property.kind === 309 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);
+ } else if (property.kind === 310 /* SpreadAssignment */) {
if (propertyIndex < properties.length - 1) {
error(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
} else {
@@ -69612,7 +69785,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let inBoundsType = compilerOptions.noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType;
for (let i = 0; i < elements.length; i++) {
let type = possiblyOutOfBoundsType;
- if (node.elements[i].kind === 231 /* SpreadElement */) {
+ if (node.elements[i].kind === 233 /* SpreadElement */) {
type = inBoundsType = inBoundsType != null ? inBoundsType : checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType;
}
checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode);
@@ -69622,8 +69795,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) {
const elements = node.elements;
const element = elements[elementIndex];
- if (element.kind !== 233 /* OmittedExpression */) {
- if (element.kind !== 231 /* SpreadElement */) {
+ if (element.kind !== 235 /* OmittedExpression */) {
+ if (element.kind !== 233 /* SpreadElement */) {
const indexType = getNumberLiteralType(elementIndex);
if (isArrayLikeType(sourceType)) {
const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(element) ? 16 /* NoTupleBoundsCheck */ : 0);
@@ -69638,7 +69811,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
} else {
const restExpression = element.expression;
- if (restExpression.kind === 227 /* BinaryExpression */ && restExpression.operatorToken.kind === 63 /* EqualsToken */) {
+ if (restExpression.kind === 229 /* BinaryExpression */ && restExpression.operatorToken.kind === 63 /* EqualsToken */) {
error(restExpression.operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer);
} else {
checkGrammarForDisallowedTrailingComma(node.elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);
@@ -69651,7 +69824,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) {
let target;
- if (exprOrAssignment.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (exprOrAssignment.kind === 309 /* ShorthandPropertyAssignment */) {
const prop = exprOrAssignment;
if (prop.objectAssignmentInitializer) {
if (strictNullChecks && !(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216 /* IsUndefined */)) {
@@ -69663,25 +69836,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
target = exprOrAssignment;
}
- if (target.kind === 227 /* BinaryExpression */ && target.operatorToken.kind === 63 /* EqualsToken */) {
+ if (target.kind === 229 /* BinaryExpression */ && target.operatorToken.kind === 63 /* EqualsToken */) {
checkBinaryExpression(target, checkMode);
target = target.left;
if (strictNullChecks) {
sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);
}
}
- if (target.kind === 210 /* ObjectLiteralExpression */) {
+ if (target.kind === 212 /* ObjectLiteralExpression */) {
return checkObjectLiteralAssignment(target, sourceType, rightIsThis);
}
- if (target.kind === 209 /* ArrayLiteralExpression */) {
+ if (target.kind === 211 /* ArrayLiteralExpression */) {
return checkArrayLiteralAssignment(target, sourceType, checkMode);
}
return checkReferenceAssignment(target, sourceType, checkMode);
}
function checkReferenceAssignment(target, sourceType, checkMode) {
const targetType = checkExpression(target, checkMode);
- const error2 = target.parent.kind === 307 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;
- const optionalError = target.parent.kind === 307 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;
+ const error2 = target.parent.kind === 310 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;
+ const optionalError = target.parent.kind === 310 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;
if (checkReferenceExpression(target, error2, optionalError)) {
checkTypeAssignableToAndOptionallyElaborate(sourceType, targetType, target, target);
}
@@ -69696,8 +69869,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
case 10 /* StringLiteral */:
case 13 /* RegularExpressionLiteral */:
- case 215 /* TaggedTemplateExpression */:
- case 229 /* TemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 231 /* TemplateExpression */:
case 14 /* NoSubstitutionTemplateLiteral */:
case 8 /* NumericLiteral */:
case 9 /* BigIntLiteral */:
@@ -69705,25 +69878,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 96 /* FalseKeyword */:
case 105 /* NullKeyword */:
case 157 /* UndefinedKeyword */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
- case 219 /* ArrowFunction */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 222 /* TypeOfExpression */:
- case 236 /* NonNullExpression */:
- case 288 /* JsxSelfClosingElement */:
- case 287 /* JsxElement */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 224 /* TypeOfExpression */:
+ case 238 /* NonNullExpression */:
+ case 291 /* JsxSelfClosingElement */:
+ case 290 /* JsxElement */:
return true;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isAssignmentOperator(node.operatorToken.kind)) {
return false;
}
return isSideEffectFree(node.left) && isSideEffectFree(node.right);
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
switch (node.operator) {
case 53 /* ExclamationToken */:
case 39 /* PlusToken */:
@@ -69732,9 +69905,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
return false;
- case 223 /* VoidExpression */:
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 225 /* VoidExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
default:
return false;
}
@@ -69770,7 +69943,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
checkGrammarNullishCoalesceWithLogicalExpression(node);
const operator = node.operatorToken.kind;
- if (operator === 63 /* EqualsToken */ && (node.left.kind === 210 /* ObjectLiteralExpression */ || node.left.kind === 209 /* ArrayLiteralExpression */)) {
+ if (operator === 63 /* EqualsToken */ && (node.left.kind === 212 /* ObjectLiteralExpression */ || node.left.kind === 211 /* ArrayLiteralExpression */)) {
state.skip = true;
setLastResult(state, checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 109 /* ThisKeyword */));
return state;
@@ -69792,7 +69965,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) {
if (operator === 55 /* AmpersandAmpersandToken */) {
let parent = node.parent;
- while (parent.kind === 217 /* ParenthesizedExpression */ || isBinaryExpression(parent) && (parent.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || parent.operatorToken.kind === 56 /* BarBarToken */)) {
+ while (parent.kind === 219 /* ParenthesizedExpression */ || isBinaryExpression(parent) && (parent.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || parent.operatorToken.kind === 56 /* BarBarToken */)) {
parent = parent.parent;
}
checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent) ? parent.thenStatement : void 0);
@@ -69859,7 +70032,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) {
const operator = operatorToken.kind;
- if (operator === 63 /* EqualsToken */ && (left.kind === 210 /* ObjectLiteralExpression */ || left.kind === 209 /* ArrayLiteralExpression */)) {
+ if (operator === 63 /* EqualsToken */ && (left.kind === 212 /* ObjectLiteralExpression */ || left.kind === 211 /* ArrayLiteralExpression */)) {
return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 109 /* ThisKeyword */);
}
let leftType;
@@ -70297,7 +70470,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */));
}
function getContextNode(node) {
- if (node.kind === 295 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) {
+ if (node.kind === 298 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) {
return node.parent.parent;
}
return node;
@@ -70338,12 +70511,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isTypeAssertion(node) {
node = skipParentheses(node, true);
- return node.kind === 216 /* TypeAssertionExpression */ || node.kind === 235 /* AsExpression */ || isJSDocTypeAssertion(node);
+ return node.kind === 218 /* TypeAssertionExpression */ || node.kind === 237 /* AsExpression */ || isJSDocTypeAssertion(node);
}
function checkDeclarationInitializer(declaration, checkMode, contextualType) {
const initializer = getEffectiveInitializer(declaration);
const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, void 0, checkMode || 0 /* Normal */) : checkExpressionCached(initializer, checkMode));
- return isParameter(declaration) && declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type;
+ return isParameter(declaration) && declaration.name.kind === 209 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type;
}
function padTupleType(type, pattern) {
const patternElements = pattern.elements;
@@ -70351,7 +70524,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const elementFlags = type.target.elementFlags.slice();
for (let i = getTypeReferenceArity(type); i < patternElements.length; i++) {
const e = patternElements[i];
- if (i < patternElements.length - 1 || !(e.kind === 208 /* BindingElement */ && e.dotDotDotToken)) {
+ if (i < patternElements.length - 1 || !(e.kind === 210 /* BindingElement */ && e.dotDotDotToken)) {
elementTypes.push(!isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, false, false) : anyType);
elementFlags.push(2 /* Optional */);
if (!isOmittedExpression(e) && !hasDefaultValue(e)) {
@@ -70397,14 +70570,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) : isTypeAssertion(node) ? type : getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType(node, void 0) : contextualType, node, void 0));
}
function checkPropertyAssignment(node, checkMode) {
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
return checkExpressionForMutableLocation(node.initializer, checkMode);
}
function checkObjectLiteralMethod(node, checkMode) {
checkGrammarMethod(node);
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
const uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -70610,7 +70783,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type;
}
function checkConstEnumAccess(node, type) {
- const ok = node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 79 /* Identifier */ || node.kind === 165 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 186 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 284 /* ExportSpecifier */;
+ const ok = node.parent.kind === 213 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 214 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 79 /* Identifier */ || node.kind === 166 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 188 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 287 /* ExportSpecifier */;
if (!ok) {
error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);
}
@@ -70633,9 +70806,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
}
@@ -70666,87 +70839,87 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return trueType;
case 96 /* FalseKeyword */:
return falseType;
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return checkTemplateExpression(node);
case 13 /* RegularExpressionLiteral */:
return globalRegExpType;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return checkArrayLiteral(node, checkMode, forceTuple);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return checkObjectLiteral(node, checkMode);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return checkPropertyAccessExpression(node, checkMode);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return checkQualifiedName(node, checkMode);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return checkIndexedAccess(node, checkMode);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (node.expression.kind === 101 /* ImportKeyword */) {
return checkImportCallExpression(node);
}
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return checkCallExpression(node, checkMode);
- case 220 /* EtsComponentExpression */:
+ case 222 /* EtsComponentExpression */:
const newNode = node;
if (newNode.body && newNode.body.statements.length) {
traverseEtsComponentStatements(newNode.body.statements, checkMode);
}
return checkCallExpression(node, checkMode);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return checkTaggedTemplateExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return checkParenthesizedExpression(node, checkMode);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return checkClassExpression(node);
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return checkTypeOfExpression(node);
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return checkAssertion(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return checkNonNullAssertion(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return checkExpressionWithTypeArguments(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return checkSatisfiesExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return checkMetaProperty(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return checkDeleteExpression(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return checkVoidExpression(node);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return checkAwaitExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return checkPrefixUnaryExpression(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return checkPostfixUnaryExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return checkBinaryExpression(node, checkMode);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return checkConditionalExpression(node, checkMode);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return checkSpreadExpression(node, checkMode);
- case 233 /* OmittedExpression */:
+ case 235 /* OmittedExpression */:
return undefinedWideningType;
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return checkYieldExpression(node);
- case 238 /* SyntheticExpression */:
+ case 240 /* SyntheticExpression */:
return checkSyntheticExpression(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return checkJsxExpression(node, checkMode);
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return checkJsxElement(node, checkMode);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return checkJsxSelfClosingElement(node, checkMode);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return checkJsxFragment(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return checkJsxAttributes(node, checkMode);
- case 289 /* JsxOpeningElement */:
+ case 292 /* JsxOpeningElement */:
Debug.fail("Shouldn't ever directly check a JsxOpeningElement");
}
return errorType;
@@ -70831,10 +71004,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkVariableLikeDeclaration(node);
const func = getContainingFunction(node);
if (hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) {
- if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) {
+ if (!(func.kind === 178 /* Constructor */ && nodeIsPresent(func.body))) {
error(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
}
- if (func.kind === 176 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") {
+ if (func.kind === 178 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") {
error(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name);
}
}
@@ -70845,13 +71018,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (func.parameters.indexOf(node) !== 0) {
error(node, Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText);
}
- if (func.kind === 176 /* Constructor */ || func.kind === 180 /* ConstructSignature */ || func.kind === 185 /* ConstructorType */) {
+ if (func.kind === 178 /* Constructor */ || func.kind === 182 /* ConstructSignature */ || func.kind === 187 /* ConstructorType */) {
error(node, Diagnostics.A_constructor_cannot_have_a_this_parameter);
}
- if (func.kind === 219 /* ArrowFunction */) {
+ if (func.kind === 221 /* ArrowFunction */) {
error(node, Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
}
- if (func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) {
+ if (func.kind === 179 /* GetAccessor */ || func.kind === 180 /* SetAccessor */) {
error(node, Diagnostics.get_and_set_accessors_cannot_declare_this_parameters);
}
}
@@ -70906,13 +71079,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTypePredicateParent(node) {
switch (node.parent.kind) {
- case 219 /* ArrowFunction */:
- case 179 /* CallSignature */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 184 /* FunctionType */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 221 /* ArrowFunction */:
+ case 181 /* CallSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 186 /* FunctionType */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
const parent = node.parent;
if (node === parent.type) {
return parent;
@@ -70932,7 +71105,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
predicateVariableName
);
return true;
- } else if (name.kind === 207 /* ArrayBindingPattern */ || name.kind === 206 /* ObjectBindingPattern */) {
+ } else if (name.kind === 209 /* ArrayBindingPattern */ || name.kind === 208 /* ObjectBindingPattern */) {
if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(
name,
predicateVariableNode,
@@ -70944,9 +71117,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkSignatureDeclaration(node) {
- if (node.kind === 181 /* IndexSignature */) {
+ if (node.kind === 183 /* IndexSignature */) {
checkGrammarIndexSignature(node);
- } else if (node.kind === 184 /* FunctionType */ || node.kind === 263 /* FunctionDeclaration */ || node.kind === 185 /* ConstructorType */ || node.kind === 179 /* CallSignature */ || node.kind === 176 /* Constructor */ || node.kind === 180 /* ConstructSignature */) {
+ } else if (node.kind === 186 /* FunctionType */ || node.kind === 265 /* FunctionDeclaration */ || node.kind === 187 /* ConstructorType */ || node.kind === 181 /* CallSignature */ || node.kind === 178 /* Constructor */ || node.kind === 182 /* ConstructSignature */) {
checkGrammarFunctionLikeDeclaration(node);
}
const functionFlags = getFunctionFlags(node);
@@ -70973,10 +71146,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const returnTypeNode = getEffectiveReturnTypeNode(node);
if (noImplicitAny && !returnTypeNode) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
error(node, Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
error(node, Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
}
@@ -70998,7 +71171,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkAsyncFunctionReturnType(node, returnTypeNode);
}
}
- if (node.kind !== 181 /* IndexSignature */ && node.kind !== 326 /* JSDocFunctionType */) {
+ if (node.kind !== 183 /* IndexSignature */ && node.kind !== 329 /* JSDocFunctionType */) {
registerForUnusedIdentifiersCheck(node);
}
}
@@ -71008,7 +71181,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const staticNames = new Map2();
const privateIdentifiers = new Map2();
for (const member of node.members) {
- if (member.kind === 176 /* Constructor */) {
+ if (member.kind === 178 /* Constructor */) {
for (const param of member.parameters) {
if (isParameterPropertyDeclaration(param, member) && !isBindingPattern(param.name)) {
addName(instanceNames, param.name, param.name.escapedText, 3 /* GetOrSetAccessor */);
@@ -71026,19 +71199,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const memberName = name && getPropertyNameForPropertyNameNode(name);
if (memberName) {
switch (member.kind) {
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
addName(names, name, memberName, 1 /* GetAccessor */ | privateStaticFlags);
break;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
addName(names, name, memberName, 2 /* SetAccessor */ | privateStaticFlags);
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags);
break;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags);
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
addName(names, name, memberName, 8 /* Method */ | privateStaticFlags);
break;
}
@@ -71091,7 +71264,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkObjectTypeForDuplicateDeclarations(node) {
const names = new Map2();
for (const member of node.members) {
- if (member.kind === 170 /* PropertySignature */) {
+ if (member.kind === 171 /* PropertySignature */) {
let memberName;
const name = member.name;
switch (name.kind) {
@@ -71115,7 +71288,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkTypeForDuplicateIndexSignatures(node) {
- if (node.kind === 267 /* InterfaceDeclaration */) {
+ if (node.kind === 270 /* InterfaceDeclaration */) {
const nodeSymbol = getSymbolOfNode(node);
if (nodeSymbol.declarations && nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {
return;
@@ -71151,7 +71324,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (type.symbol.declarations) {
for (const decl of type.symbol.declarations) {
- if (decl.kind === 269 /* EnumDeclaration */) {
+ if (decl.kind === 272 /* EnumDeclaration */) {
const members = decl.members;
for (let i = 0; i < members.length; ++i) {
if (i > 1 && typeof getConstantValue2(members[i - 1]) !== typeof getConstantValue2(members[i])) {
@@ -71223,7 +71396,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function evaluateAnnotationPropertyConstantExpression(expr) {
switch (expr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const value = evaluateAnnotationPropertyConstantExpression(expr.operand);
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean") {
switch (expr.operator) {
@@ -71242,7 +71415,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const left = evaluateAnnotationPropertyConstantExpression(expr.left);
const right = evaluateAnnotationPropertyConstantExpression(expr.right);
if (left !== void 0 && right !== void 0 && typeof left === typeof right) {
@@ -71311,7 +71484,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
const elements = expr.elements;
const result = new Array(elements.length);
for (let i = 0; i < elements.length; ++i) {
@@ -71335,7 +71508,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
checkGrammarNumericLiteral(expr);
return +expr.text;
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return evaluateAnnotationPropertyConstantExpression(expr.expression);
case 79 /* Identifier */:
if (isInfinityOrNaNString(expr.escapedText)) {
@@ -71349,7 +71522,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return evaluateAnnotationPropertyConstantExpression(symbol.valueDeclaration.initializer);
}
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isConstantMemberAccess(expr)) {
return getConstantValue2(expr);
}
@@ -71368,7 +71541,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
checkVariableLikeDeclaration(node);
setNodeLinksForPrivateIdentifierScope(node);
- if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 171 /* PropertyDeclaration */ && node.initializer) {
+ if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 172 /* PropertyDeclaration */ && node.initializer) {
error(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name));
}
if (isAnnotationPropertyDeclaration(node)) {
@@ -71459,7 +71632,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.name, Diagnostics.Class_constructor_may_not_be_a_generator);
}
checkFunctionOrMethodDeclaration(node);
- if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 174 /* MethodDeclaration */ && node.body) {
+ if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 176 /* MethodDeclaration */ && node.body) {
error(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name));
}
if (isPrivateIdentifier(node.name) && !getContainingClass(node)) {
@@ -71507,7 +71680,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isPrivateIdentifierClassElementDeclaration(n)) {
return true;
}
- return n.kind === 171 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer;
+ return n.kind === 172 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer;
}
function checkConstructorDeclarationDiagnostics() {
const containingClassDecl = node.parent;
@@ -71570,20 +71743,20 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkGrammarComputedPropertyName(node.name);
checkDecorators(node);
checkSignatureDeclaration(node);
- if (node.kind === 177 /* GetAccessor */) {
+ if (node.kind === 179 /* GetAccessor */) {
if (!(node.flags & 16777216 /* Ambient */) && nodeIsPresent(node.body) && node.flags & 256 /* HasImplicitReturn */) {
if (!(node.flags & 512 /* HasExplicitReturn */)) {
error(node.name, Diagnostics.A_get_accessor_must_return_a_value);
}
}
}
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
if (hasBindableName(node)) {
const symbol = getSymbolOfNode(node);
- const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */);
- const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */);
+ const getter = getDeclarationOfKind(symbol, 179 /* GetAccessor */);
+ const setter = getDeclarationOfKind(symbol, 180 /* SetAccessor */);
if (getter && setter && !(getNodeCheckFlags(getter) & 1 /* TypeChecked */)) {
getNodeLinks(getter).flags |= 1 /* TypeChecked */;
const getterFlags = getEffectiveModifierFlags(getter);
@@ -71604,7 +71777,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
const returnType = getTypeOfAccessors(getSymbolOfNode(node));
- if (node.kind === 177 /* GetAccessor */) {
+ if (node.kind === 179 /* GetAccessor */) {
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
}
}
@@ -71659,7 +71832,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkTypeReferenceNode(node) {
checkGrammarTypeArguments(node, node.typeArguments);
- if (node.kind === 183 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) {
+ if (node.kind === 185 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) {
grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
}
forEach(node.typeArguments, checkSourceElement);
@@ -71723,7 +71896,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let seenRestElement = false;
const hasNamedElement = some(elementTypes, isNamedTupleMember);
for (const e of elementTypes) {
- if (e.kind !== 202 /* NamedTupleMember */ && hasNamedElement) {
+ if (e.kind !== 204 /* NamedTupleMember */ && hasNamedElement) {
grammarErrorOnNode(e, Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names);
break;
}
@@ -71768,7 +71941,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const objectType = type.objectType;
const indexType = type.indexType;
if (isTypeAssignableTo(indexType, getIndexType(objectType, false))) {
- if (accessNode.kind === 212 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
+ if (accessNode.kind === 214 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
}
return type;
@@ -71829,7 +72002,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
forEachChild(node, checkSourceElement);
}
function checkInferType(node) {
- if (!findAncestor(node, (n) => n.parent && n.parent.kind === 194 /* ConditionalType */ && n.parent.extendsType === n)) {
+ if (!findAncestor(node, (n) => n.parent && n.parent.kind === 196 /* ConditionalType */ && n.parent.extendsType === n)) {
grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
}
checkSourceElement(node.typeParameter);
@@ -71839,7 +72012,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!links.typeParametersChecked) {
links.typeParametersChecked = true;
const typeParameter = getDeclaredTypeOfTypeParameter(symbol);
- const declarations = getDeclarationsOfKind(symbol, 167 /* TypeParameter */);
+ const declarations = getDeclarationsOfKind(symbol, 168 /* TypeParameter */);
if (!areTypeParametersIdentical(declarations, [typeParameter], (decl) => [decl])) {
const name = symbolToString(symbol);
for (const declaration of declarations) {
@@ -71877,10 +72050,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.dotDotDotToken && node.questionToken) {
grammarErrorOnNode(node, Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest);
}
- if (node.type.kind === 190 /* OptionalType */) {
+ if (node.type.kind === 192 /* OptionalType */) {
grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type);
}
- if (node.type.kind === 191 /* RestType */) {
+ if (node.type.kind === 193 /* RestType */) {
grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type);
}
checkSourceElement(node.type);
@@ -71891,7 +72064,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getEffectiveDeclarationFlags(n, flagsToCheck) {
let flags = getCombinedModifierFlags(n);
- if (n.parent.kind !== 267 /* InterfaceDeclaration */ && n.parent.kind !== 264 /* ClassDeclaration */ && n.parent.kind !== 232 /* ClassExpression */ && n.flags & 16777216 /* Ambient */) {
+ if (n.parent.kind !== 270 /* InterfaceDeclaration */ && n.parent.kind !== 266 /* ClassDeclaration */ && n.parent.kind !== 234 /* ClassExpression */ && n.flags & 16777216 /* Ambient */) {
if (!(flags & 2 /* Ambient */) && !(isModuleBlock(n.parent) && isModuleDeclaration(n.parent.parent) && isGlobalScopeAugmentation(n.parent.parent))) {
flags |= 1 /* Export */;
}
@@ -71964,7 +72137,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const errorNode2 = subsequentNode.name || subsequentNode;
const subsequentName = subsequentNode.name;
if (node.name && subsequentName && (isPrivateIdentifier(node.name) && isPrivateIdentifier(subsequentName) && node.name.escapedText === subsequentName.escapedText || isComputedPropertyName(node.name) && isComputedPropertyName(subsequentName) || isPropertyNameLiteral(node.name) && isPropertyNameLiteral(subsequentName) && getEscapedTextOfIdentifierOrLiteral(node.name) === getEscapedTextOfIdentifierOrLiteral(subsequentName))) {
- const reportError = (node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode);
+ const reportError = (node.kind === 176 /* MethodDeclaration */ || node.kind === 175 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode);
if (reportError) {
const diagnostic = isStatic(node) ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static;
error(errorNode2, diagnostic);
@@ -71996,14 +72169,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
for (const current of declarations) {
const node = current;
const inAmbientContext = node.flags & 16777216 /* Ambient */;
- const inAmbientContextOrInterface = node.parent && (node.parent.kind === 267 /* InterfaceDeclaration */ || node.parent.kind === 187 /* TypeLiteral */) || inAmbientContext;
+ const inAmbientContextOrInterface = node.parent && (node.parent.kind === 270 /* InterfaceDeclaration */ || node.parent.kind === 189 /* TypeLiteral */) || inAmbientContext;
if (inAmbientContextOrInterface) {
previousDeclaration = void 0;
}
- if ((node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */) && !inAmbientContext) {
+ if ((node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */) && !inAmbientContext) {
hasNonAmbientClass = true;
}
- if (node.kind === 263 /* FunctionDeclaration */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 176 /* Constructor */) {
+ if (node.kind === 265 /* FunctionDeclaration */ || node.kind === 176 /* MethodDeclaration */ || node.kind === 175 /* MethodSignature */ || node.kind === 178 /* Constructor */) {
functionDeclarations.push(node);
const currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);
someNodeFlags |= currentNodeFlags;
@@ -72045,9 +72218,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
}
if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 /* Function */ && declarations) {
- const relatedDiagnostics = filter(declarations, (d) => d.kind === 264 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class));
+ const relatedDiagnostics = filter(declarations, (d) => d.kind === 266 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class));
forEach(declarations, (declaration) => {
- const diagnostic = declaration.kind === 264 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 263 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0;
+ const diagnostic = declaration.kind === 266 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 265 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0;
if (diagnostic) {
addRelatedInfo(
error(getNameOfDeclaration(declaration) || declaration, diagnostic, symbolName(symbol)),
@@ -72126,43 +72299,43 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getDeclarationSpaces(decl) {
let d = decl;
switch (d.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return 2 /* ExportType */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return isAmbientModule(d) || getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */;
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
return 2 /* ExportType */ | 1 /* ExportValue */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */;
- case 280 /* ExportAssignment */:
- case 227 /* BinaryExpression */:
+ case 283 /* ExportAssignment */:
+ case 229 /* BinaryExpression */:
const node2 = d;
const expression = isExportAssignment(node2) ? node2.expression : node2.right;
if (!isEntityNameExpression(expression)) {
return 1 /* ExportValue */;
}
d = expression;
- case 274 /* ImportEqualsDeclaration */:
- case 277 /* NamespaceImport */:
- case 276 /* ImportClause */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 280 /* NamespaceImport */:
+ case 279 /* ImportClause */:
let result = 0 /* None */;
const target = resolveAlias(getSymbolOfNode(d));
forEach(target.declarations, (d2) => {
result |= getDeclarationSpaces(d2);
});
return result;
- case 261 /* VariableDeclaration */:
- case 208 /* BindingElement */:
- case 263 /* FunctionDeclaration */:
- case 279 /* ImportSpecifier */:
+ case 263 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 265 /* FunctionDeclaration */:
+ case 282 /* ImportSpecifier */:
case 79 /* Identifier */:
return 1 /* ExportValue */;
default:
@@ -72413,21 +72586,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let headMessage;
let expectedReturnType;
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
const classSymbol = getSymbolOfNode(node.parent);
const classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
expectedReturnType = voidType;
break;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
const methodType = getTypeOfNode(node.parent);
const descriptorType = createTypedPropertyDescriptorType(methodType);
@@ -72473,15 +72646,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getEntityNameForDecoratorMetadata(node) {
if (node) {
switch (node.kind) {
- case 193 /* IntersectionType */:
- case 192 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 194 /* UnionType */:
return getEntityNameForDecoratorMetadataFromTypeList(node.types);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]);
- case 196 /* ParenthesizedType */:
- case 202 /* NamedTupleMember */:
+ case 198 /* ParenthesizedType */:
+ case 204 /* NamedTupleMember */:
return getEntityNameForDecoratorMetadata(node.type);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return node.typeName;
}
}
@@ -72489,13 +72662,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getEntityNameForDecoratorMetadataFromTypeList(types) {
let commonEntityName;
for (let typeNode of types) {
- while (typeNode.kind === 196 /* ParenthesizedType */ || typeNode.kind === 202 /* NamedTupleMember */) {
+ while (typeNode.kind === 198 /* ParenthesizedType */ || typeNode.kind === 204 /* NamedTupleMember */) {
typeNode = typeNode.type;
}
if (typeNode.kind === 145 /* NeverKeyword */) {
continue;
}
- if (!strictNullChecks && (typeNode.kind === 201 /* LiteralType */ && typeNode.literal.kind === 105 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) {
+ if (!strictNullChecks && (typeNode.kind === 203 /* LiteralType */ && typeNode.literal.kind === 105 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) {
continue;
}
const individualEntityName = getEntityNameForDecoratorMetadata(typeNode);
@@ -72555,9 +72728,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
switch (annotatedDecl.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
const enclosingDecl = annotatedDecl.parent;
Debug.assert(isClassDeclaration(enclosingDecl));
if (hasSyntacticModifier(enclosingDecl, 256 /* Abstract */)) {
@@ -72588,10 +72761,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
ident = da.expression;
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
ident = da.expression;
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
ident = getIdentifierFromEntityNameExpression(da.expression.expression);
break;
default:
@@ -72646,13 +72819,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */);
- if (node.kind === 168 /* Parameter */) {
+ if (node.kind === 169 /* Parameter */) {
checkExternalEmitHelpers(firstDecorator, 32 /* Param */);
}
if (compilerOptions.emitDecoratorMetadata) {
checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */);
switch (node.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const constructor = getFirstConstructorWithBody(node);
if (constructor) {
for (const parameter of constructor.parameters) {
@@ -72660,22 +72833,22 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- const otherKind = node.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */;
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ const otherKind = node.kind === 179 /* GetAccessor */ ? 180 /* SetAccessor */ : 179 /* GetAccessor */;
const otherAccessor = getDeclarationOfKind(getSymbolOfNode(node), otherKind);
markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
for (const parameter of node.parameters) {
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
}
markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(node));
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveTypeAnnotationNode(node));
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node));
const containingSignature = node.parent;
for (const parameter of containingSignature.parameters) {
@@ -72773,7 +72946,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
return node;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return node.name;
default:
return void 0;
@@ -72784,7 +72957,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkDecorators(node);
checkSignatureDeclaration(node);
const functionFlags = getFunctionFlags(node);
- if (node.name && node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name && node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
if (hasBindableName(node)) {
@@ -72800,7 +72973,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkFunctionOrConstructorSymbol(symbol);
}
}
- const body = node.kind === 173 /* MethodSignature */ ? void 0 : node.body;
+ const body = node.kind === 175 /* MethodSignature */ ? void 0 : node.body;
checkSourceElement(body);
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node));
addLazyDiagnostic(checkFunctionOrMethodDeclarationDiagnostics);
@@ -72836,43 +73009,43 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) {
for (const node of potentiallyUnusedIdentifiers) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
checkUnusedClassMembers(node, addDiagnostic);
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 314 /* SourceFile */:
- case 270 /* ModuleDeclaration */:
- case 242 /* Block */:
- case 272 /* CaseBlock */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 317 /* SourceFile */:
+ case 273 /* ModuleDeclaration */:
+ case 244 /* Block */:
+ case 275 /* CaseBlock */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
checkUnusedLocalsAndParameters(node, addDiagnostic);
break;
- case 176 /* Constructor */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
if (node.body) {
checkUnusedLocalsAndParameters(node, addDiagnostic);
}
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 195 /* InferType */:
+ case 197 /* InferType */:
checkUnusedInferTypeParameter(node, addDiagnostic);
break;
default:
@@ -72891,11 +73064,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkUnusedClassMembers(node, addDiagnostic) {
for (const member of node.members) {
switch (member.kind) {
- case 174 /* MethodDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- if (member.kind === 178 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) {
+ case 176 /* MethodDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ if (member.kind === 180 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) {
break;
}
const symbol = getSymbolOfNode(member);
@@ -72903,16 +73076,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
addDiagnostic(member, 0 /* Local */, createDiagnosticForNode(member.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
}
break;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
for (const parameter of member.parameters) {
if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter, 8 /* Private */)) {
addDiagnostic(parameter, 0 /* Local */, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol)));
}
}
break;
- case 181 /* IndexSignature */:
- case 241 /* SemicolonClassElement */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 183 /* IndexSignature */:
+ case 243 /* SemicolonClassElement */:
+ case 177 /* ClassStaticBlockDeclaration */:
break;
default:
Debug.fail("Unexpected class member");
@@ -72936,7 +73109,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
const name = idText(typeParameter.name);
const { parent } = typeParameter;
- if (parent.kind !== 195 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) {
+ if (parent.kind !== 197 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) {
if (tryAddToSet(seenParentsWithEveryUnused, parent)) {
const sourceFile = getSourceFileOfNode(parent);
const range = isJSDocTemplateTag(parent) ? rangeOfNode(parent) : rangeOfTypeParameters(sourceFile, parent.typeParameters);
@@ -73016,7 +73189,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
unusedImports.forEach(([importClause, unuseds]) => {
const importDecl = importClause.parent;
- const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 277 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0);
+ const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 280 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0);
if (nDeclarations === unuseds.length) {
addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 ? createDiagnosticForNode(importDecl, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(first(unuseds).name)) : createDiagnosticForNode(importDecl, Diagnostics.All_imports_in_import_declaration_are_unused));
} else {
@@ -73027,7 +73200,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
unusedDestructures.forEach(([bindingPattern, bindingElements]) => {
const kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */;
if (bindingPattern.elements.length === bindingElements.length) {
- if (bindingElements.length === 1 && bindingPattern.parent.kind === 261 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 262 /* VariableDeclarationList */) {
+ if (bindingElements.length === 1 && bindingPattern.parent.kind === 263 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 264 /* VariableDeclarationList */) {
addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId);
} else {
addDiagnostic(bindingPattern, kind, bindingElements.length === 1 ? createDiagnosticForNode(bindingPattern, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(bindingElements).name)) : createDiagnosticForNode(bindingPattern, Diagnostics.All_destructured_elements_are_unused));
@@ -73040,7 +73213,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
unusedVariables.forEach(([declarationList, declarations]) => {
if (declarationList.declarations.length === declarations.length) {
- addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 244 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused));
+ addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 246 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused));
} else {
for (const decl of declarations) {
addDiagnostic(decl, 0 /* Local */, createDiagnosticForNode(decl, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(decl.name)));
@@ -73069,21 +73242,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (name.kind) {
case 79 /* Identifier */:
return idText(name);
- case 207 /* ArrayBindingPattern */:
- case 206 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
return bindingNameText(cast(first(name.elements), isBindingElement).name);
default:
return Debug.assertNever(name);
}
}
function isImportedDeclaration(node) {
- return node.kind === 276 /* ImportClause */ || node.kind === 279 /* ImportSpecifier */ || node.kind === 277 /* NamespaceImport */;
+ return node.kind === 279 /* ImportClause */ || node.kind === 282 /* ImportSpecifier */ || node.kind === 280 /* NamespaceImport */;
}
function importClauseFromImported(decl) {
- return decl.kind === 276 /* ImportClause */ ? decl : decl.kind === 277 /* NamespaceImport */ ? decl.parent : decl.parent.parent;
+ return decl.kind === 279 /* ImportClause */ ? decl : decl.kind === 280 /* NamespaceImport */ ? decl.parent : decl.parent.parent;
}
function checkBlock(node) {
- if (node.kind === 242 /* Block */) {
+ if (node.kind === 244 /* Block */) {
checkGrammarStatementInAmbientContext(node);
}
if (isFunctionOrModuleBlock(node)) {
@@ -73111,7 +73284,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if ((identifier == null ? void 0 : identifier.escapedText) !== name) {
return false;
}
- if (node.kind === 171 /* PropertyDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */ || node.kind === 305 /* PropertyAssignment */) {
+ if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 176 /* MethodDeclaration */ || node.kind === 175 /* MethodSignature */ || node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */ || node.kind === 308 /* PropertyAssignment */) {
return false;
}
if (node.flags & 16777216 /* Ambient */) {
@@ -73167,7 +73340,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const parent = getDeclarationContainer(node);
- if (parent.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(parent)) {
+ if (parent.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(parent)) {
errorSkippedOn(
"noEmit",
name,
@@ -73185,7 +73358,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const parent = getDeclarationContainer(node);
- if (parent.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) {
+ if (parent.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) {
errorSkippedOn(
"noEmit",
name,
@@ -73267,7 +73440,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if ((getCombinedNodeFlags(node) & 3 /* BlockScoped */) !== 0 || isParameterDeclaration(node)) {
return;
}
- if (node.kind === 261 /* VariableDeclaration */ && !node.initializer) {
+ if (node.kind === 263 /* VariableDeclaration */ && !node.initializer) {
return;
}
const symbol = getSymbolOfNode(node);
@@ -73277,9 +73450,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const localDeclarationSymbol = resolveName(node, node.name.escapedText, 3 /* Variable */, void 0, void 0, false);
if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) {
if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) {
- const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 262 /* VariableDeclarationList */);
- const container = varDeclList.parent.kind === 244 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0;
- const namesShareScope = container && (container.kind === 242 /* Block */ && isFunctionLike(container.parent) || container.kind === 271 /* ModuleBlock */ || container.kind === 270 /* ModuleDeclaration */ || container.kind === 314 /* SourceFile */);
+ const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 264 /* VariableDeclarationList */);
+ const container = varDeclList.parent.kind === 246 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0;
+ const namesShareScope = container && (container.kind === 244 /* Block */ && isFunctionLike(container.parent) || container.kind === 274 /* ModuleBlock */ || container.kind === 273 /* ModuleDeclaration */ || container.kind === 317 /* SourceFile */);
if (!namesShareScope) {
const name = symbolToString(localDeclarationSymbol);
error(node, Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name);
@@ -73300,7 +73473,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!node.name) {
return;
}
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
if (hasOnlyExpressionInitializer(node) && node.initializer) {
checkExpressionCached(node.initializer);
@@ -73314,7 +73487,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ES2018 */) {
checkExternalEmitHelpers(node, 4 /* Rest */);
}
- if (node.propertyName && node.propertyName.kind === 166 /* ComputedPropertyName */) {
+ if (node.propertyName && node.propertyName.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.propertyName);
}
const parent = node.parent.parent;
@@ -73334,7 +73507,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
if (isBindingPattern(node.name)) {
- if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
+ if (node.name.kind === 209 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
checkExternalEmitHelpers(node, 512 /* Read */);
}
forEach(node.name.elements, checkSourceElement);
@@ -73344,7 +73517,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
if (isBindingPattern(node.name)) {
- const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 250 /* ForInStatement */;
+ const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 252 /* ForInStatement */;
const needCheckWidenedType = !some(node.name.elements, not(isOmittedExpression));
if (needCheckInitializer || needCheckWidenedType) {
const widenedType = getWidenedTypeForVariableLikeDeclaration(node);
@@ -73367,7 +73540,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const symbol = getSymbolOfNode(node);
- if (symbol.flags & 2097152 /* Alias */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 208 /* BindingElement */ ? node.parent.parent : node)) {
+ if (symbol.flags & 2097152 /* Alias */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 210 /* BindingElement */ ? node.parent.parent : node)) {
checkAliasSymbol(node);
return;
}
@@ -73376,7 +73549,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const initializer = hasOnlyExpressionInitializer(node) && getEffectiveInitializer(node);
if (initializer) {
const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((_a2 = symbol.exports) == null ? void 0 : _a2.size);
- if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 250 /* ForInStatement */) {
+ if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 252 /* ForInStatement */) {
checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, void 0);
}
}
@@ -73397,9 +73570,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name));
}
}
- if (node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 170 /* PropertySignature */ && node.kind !== 172 /* AnnotationPropertyDeclaration */) {
+ if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 173 /* AnnotationPropertyDeclaration */) {
checkExportsOnMergedDeclarations(node);
- if (node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
+ if (node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */) {
checkVarDeclaredNamesNotShadowed(node);
}
checkCollisionsForDeclarationName(node, node.name);
@@ -73407,7 +73580,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) {
const nextDeclarationName = getNameOfDeclaration(nextDeclaration);
- const message = nextDeclaration.kind === 171 /* PropertyDeclaration */ || nextDeclaration.kind === 170 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;
+ const message = nextDeclaration.kind === 172 /* PropertyDeclaration */ || nextDeclaration.kind === 171 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;
const declName = declarationNameToString(nextDeclarationName);
const err = error(
nextDeclarationName,
@@ -73424,7 +73597,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function areDeclarationFlagsIdentical(left, right) {
- if (left.kind === 168 /* Parameter */ && right.kind === 261 /* VariableDeclaration */ || left.kind === 261 /* VariableDeclaration */ && right.kind === 168 /* Parameter */) {
+ if (left.kind === 169 /* Parameter */ && right.kind === 263 /* VariableDeclaration */ || left.kind === 263 /* VariableDeclaration */ && right.kind === 169 /* Parameter */) {
return true;
}
if (hasQuestionToken(left) !== hasQuestionToken(right)) {
@@ -73460,7 +73633,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const type = checkTruthinessExpression(node.expression);
checkTestingKnownTruthyCallableOrAwaitableType(node.expression, type, node.thenStatement);
checkSourceElement(node.thenStatement);
- if (node.thenStatement.kind === 243 /* EmptyStatement */) {
+ if (node.thenStatement.kind === 245 /* EmptyStatement */) {
error(node.thenStatement, Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
}
checkSourceElement(node.elseStatement);
@@ -73576,12 +73749,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkForStatement(node) {
if (!checkGrammarStatementInAmbientContext(node)) {
- if (node.initializer && node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer && node.initializer.kind === 264 /* VariableDeclarationList */) {
checkGrammarVariableDeclarationList(node.initializer);
}
}
if (node.initializer) {
- if (node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind === 264 /* VariableDeclarationList */) {
forEach(node.initializer.declarations, checkVariableDeclaration);
} else {
checkExpression(node.initializer);
@@ -73611,12 +73784,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ES2015 */) {
checkExternalEmitHelpers(node, 256 /* ForOfIncludes */);
}
- if (node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind === 264 /* VariableDeclarationList */) {
checkForInOrForOfVariableDeclaration(node);
} else {
const varExpr = node.initializer;
const iteratedType = checkRightHandSideOfForOf(node);
- if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) {
+ if (varExpr.kind === 211 /* ArrayLiteralExpression */ || varExpr.kind === 212 /* ObjectLiteralExpression */) {
checkDestructuringAssignment(varExpr, iteratedType || errorType);
} else {
const leftType = checkExpression(varExpr);
@@ -73638,7 +73811,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkForInStatement(node) {
checkGrammarForInOrForOfStatement(node);
const rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression));
- if (node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind === 264 /* VariableDeclarationList */) {
const variable = node.initializer.declarations[0];
if (variable && isBindingPattern(variable.name)) {
error(variable.name, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
@@ -73647,7 +73820,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
const varExpr = node.initializer;
const leftType = checkExpression(varExpr);
- if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) {
+ if (varExpr.kind === 211 /* ArrayLiteralExpression */ || varExpr.kind === 212 /* ObjectLiteralExpression */) {
error(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
} else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) {
error(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any);
@@ -74204,11 +74377,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const functionFlags = getFunctionFlags(container);
if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) {
const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
- if (container.kind === 178 /* SetAccessor */) {
+ if (container.kind === 180 /* SetAccessor */) {
if (node.expression) {
error(node, Diagnostics.Setters_cannot_return_a_value);
}
- } else if (container.kind === 176 /* Constructor */) {
+ } else if (container.kind === 178 /* Constructor */) {
if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) {
error(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
}
@@ -74219,7 +74392,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression);
}
}
- } else if (container.kind !== 176 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) {
+ } else if (container.kind !== 178 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) {
error(node, Diagnostics.Not_all_code_paths_return_a_value);
}
}
@@ -74244,7 +74417,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const expressionType = checkExpression(node.expression);
const expressionIsLiteral = isLiteralType(expressionType);
forEach(node.caseBlock.clauses, (clause) => {
- if (clause.kind === 299 /* DefaultClause */ && !hasDuplicateDefaultClause) {
+ if (clause.kind === 302 /* DefaultClause */ && !hasDuplicateDefaultClause) {
if (firstDefaultClause === void 0) {
firstDefaultClause = clause;
} else {
@@ -74252,7 +74425,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
hasDuplicateDefaultClause = true;
}
}
- if (clause.kind === 298 /* CaseClause */) {
+ if (clause.kind === 301 /* CaseClause */) {
addLazyDiagnostic(createLazyCaseClauseDiagnostics(clause));
}
forEach(clause.statements, checkSourceElement);
@@ -74284,7 +74457,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isFunctionLike(current)) {
return "quit";
}
- if (current.kind === 257 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) {
+ if (current.kind === 259 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) {
grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNode(node.label));
return true;
}
@@ -74368,8 +74541,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const indexInfos = getApplicableIndexInfos(type, propNameType);
- const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 267 /* InterfaceDeclaration */) : void 0;
- const propDeclaration = declaration && declaration.kind === 227 /* BinaryExpression */ || name && name.kind === 166 /* ComputedPropertyName */ ? declaration : void 0;
+ const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 270 /* InterfaceDeclaration */) : void 0;
+ const propDeclaration = declaration && declaration.kind === 229 /* BinaryExpression */ || name && name.kind === 167 /* ComputedPropertyName */ ? declaration : void 0;
const localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : void 0;
for (const info of indexInfos) {
const localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : void 0;
@@ -74393,7 +74566,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkIndexConstraintForIndexSignature(type, checkInfo) {
const declaration = checkInfo.declaration;
const indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
- const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 267 /* InterfaceDeclaration */) : void 0;
+ const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 270 /* InterfaceDeclaration */) : void 0;
const localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : void 0;
for (const info of indexInfos) {
if (info === checkInfo)
@@ -74498,7 +74671,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkTypeParametersNotReferenced(root, typeParameters, index) {
visit(root);
function visit(node) {
- if (node.kind === 183 /* TypeReference */) {
+ if (node.kind === 185 /* TypeReference */) {
const type = getTypeFromTypeReference(node);
if (type.flags & 262144 /* TypeParameter */) {
for (let i = index; i < typeParameters.length; i++) {
@@ -74925,7 +75098,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getCheckFlags(s) & 1 /* Instantiated */ ? s.target : s;
}
function getClassOrInterfaceDeclarationsOfSymbol(symbol) {
- return filter(symbol.declarations, (d) => d.kind === 264 /* ClassDeclaration */ || d.kind === 267 /* InterfaceDeclaration */);
+ return filter(symbol.declarations, (d) => d.kind === 266 /* ClassDeclaration */ || d.kind === 270 /* InterfaceDeclaration */);
}
function checkKindsOfPropertyMemberOverrides(type, baseType) {
var _a2, _b, _c, _d;
@@ -74955,7 +75128,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue basePropertyCheck;
}
}
- if (derivedClassDecl.kind === 232 /* ClassExpression */) {
+ if (derivedClassDecl.kind === 234 /* ClassExpression */) {
error(
derivedClassDecl,
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
@@ -74990,7 +75163,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
} else if (useDefineForClassFields) {
- const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 171 /* PropertyDeclaration */ && !d.initializer);
+ const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer);
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_d = derived.declarations) == null ? void 0 : _d.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
const propName = uninitialized.name;
@@ -75093,7 +75266,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isPropertyWithoutInitializer(node) {
- return node.kind === 171 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer;
+ return node.kind === 172 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer;
}
function isPropertyInitializedInStaticBlocks(propName, propType, staticBlocks, startPos, endPos) {
for (const staticBlock of staticBlocks) {
@@ -75127,7 +75300,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkExportsOnMergedDeclarations(node);
const symbol = getSymbolOfNode(node);
checkTypeParameterListsIdentical(symbol);
- const firstInterfaceDecl = getDeclarationOfKind(symbol, 267 /* InterfaceDeclaration */);
+ const firstInterfaceDecl = getDeclarationOfKind(symbol, 270 /* InterfaceDeclaration */);
if (node === firstInterfaceDecl) {
const type = getDeclaredTypeOfSymbol(symbol);
const typeWithThis = getTypeWithThisArgument(type);
@@ -75226,7 +75399,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return value;
function evaluate(expr) {
switch (expr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const value2 = evaluate(expr.operand);
if (typeof value2 === "number") {
switch (expr.operator) {
@@ -75239,7 +75412,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const left = evaluate(expr.left);
const right = evaluate(expr.right);
if (typeof left === "number" && typeof right === "number") {
@@ -75279,7 +75452,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
checkGrammarNumericLiteral(expr);
return +expr.text;
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return evaluate(expr.expression);
case 79 /* Identifier */:
const identifier = expr;
@@ -75287,13 +75460,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return +identifier.escapedText;
}
return nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isConstantMemberAccess(expr)) {
const type = getTypeOfExpression(expr.expression);
if (type.symbol && type.symbol.flags & 384 /* Enum */) {
let name;
- if (expr.kind === 211 /* PropertyAccessExpression */) {
+ if (expr.kind === 213 /* PropertyAccessExpression */) {
name = expr.name.escapedText;
} else {
name = escapeLeadingUnderscores(cast(expr.argumentExpression, isLiteralExpression).text);
@@ -75327,7 +75500,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (type === errorType) {
return false;
}
- return node.kind === 79 /* Identifier */ || node.kind === 211 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || node.kind === 212 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && isStringLiteralLike(node.argumentExpression);
+ return node.kind === 79 /* Identifier */ || node.kind === 213 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || node.kind === 214 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && isStringLiteralLike(node.argumentExpression);
}
function checkEnumDeclaration(node) {
addLazyDiagnostic(() => checkEnumDeclarationWorker(node));
@@ -75351,7 +75524,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let seenEnumMissingInitialInitializer = false;
forEach(enumSymbol.declarations, (declaration) => {
- if (declaration.kind !== 269 /* EnumDeclaration */) {
+ if (declaration.kind !== 272 /* EnumDeclaration */) {
return false;
}
const enumDeclaration = declaration;
@@ -75378,7 +75551,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const declarations = symbol.declarations;
if (declarations) {
for (const declaration of declarations) {
- if ((declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 263 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 16777216 /* Ambient */)) {
+ if ((declaration.kind === 266 /* ClassDeclaration */ || declaration.kind === 265 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 16777216 /* Ambient */)) {
return declaration;
}
}
@@ -75434,7 +75607,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged);
}
}
- const mergedClass = getDeclarationOfKind(symbol, 264 /* ClassDeclaration */);
+ const mergedClass = getDeclarationOfKind(symbol, 266 /* ClassDeclaration */);
if (mergedClass && inSameLexicalScope(node, mergedClass)) {
getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */;
}
@@ -75465,21 +75638,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkModuleAugmentationElement(node, isGlobalAugmentation) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
for (const decl of node.declarationList.declarations) {
checkModuleAugmentationElement(decl, isGlobalAugmentation);
}
break;
- case 280 /* ExportAssignment */:
- case 281 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 284 /* ExportDeclaration */:
grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
break;
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
break;
- case 208 /* BindingElement */:
- case 261 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
const name = node.name;
if (isBindingPattern(name)) {
for (const el of name.elements) {
@@ -75487,12 +75660,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
break;
}
- case 264 /* ClassDeclaration */:
- case 269 /* EnumDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
if (isGlobalAugmentation) {
return;
}
@@ -75503,12 +75676,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
return node;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
do {
node = node.left;
} while (node.kind !== 79 /* Identifier */);
return node;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
do {
if (isModuleExportsAccessExpression(node.expression) && !isPrivateIdentifier(node.name)) {
return node.name;
@@ -75527,9 +75700,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(moduleName, Diagnostics.String_literal_expected);
return false;
}
- const inAmbientExternalModule = node.parent.kind === 271 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
- if (node.parent.kind !== 314 /* SourceFile */ && !inAmbientExternalModule) {
- error(moduleName, node.kind === 281 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
+ const inAmbientExternalModule = node.parent.kind === 274 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
+ if (node.parent.kind !== 317 /* SourceFile */ && !inAmbientExternalModule) {
+ error(moduleName, node.kind === 284 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
return false;
}
if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) {
@@ -75558,8 +75731,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
symbol = getMergedSymbol(symbol.exportSymbol || symbol);
if (isInJSFile(node) && !(target.flags & 111551 /* Value */) && !isTypeOnlyImportOrExportDeclaration(node)) {
const errorNode = isImportOrExportSpecifier(node) ? node.propertyName || node.name : isNamedDeclaration(node) ? node.name : node;
- Debug.assert(node.kind !== 283 /* NamespaceExport */);
- if (node.kind === 284 /* ExportSpecifier */) {
+ Debug.assert(node.kind !== 286 /* NamespaceExport */);
+ if (node.kind === 287 /* ExportSpecifier */) {
const diag2 = error(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
const alreadyExportedSymbol = (_b = (_a2 = getSourceFileOfNode(node).symbol) == null ? void 0 : _a2.exports) == null ? void 0 : _b.get((node.propertyName || node.name).escapedText);
if (alreadyExportedSymbol === target) {
@@ -75573,7 +75746,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
} else {
- Debug.assert(node.kind !== 261 /* VariableDeclaration */);
+ Debug.assert(node.kind !== 263 /* VariableDeclaration */);
const importDeclaration = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration));
const moduleSpecifier = (_e = importDeclaration && ((_d = tryGetModuleSpecifierFromDeclaration(importDeclaration)) == null ? void 0 : _d.text)) != null ? _e : "...";
const importedIdentifier = unescapeLeadingUnderscores(isIdentifier(errorNode) ? errorNode.escapedText : symbol.escapedName);
@@ -75589,7 +75762,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const targetFlags = getAllSymbolFlags(target);
const excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) | (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0);
if (targetFlags & excludedMeanings) {
- const message = node.kind === 284 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
+ const message = node.kind === 287 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
error(node, message, symbolToString(symbol));
}
if (compilerOptions.isolatedModules && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216 /* Ambient */)) {
@@ -75597,25 +75770,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const isType = !(targetFlags & 111551 /* Value */);
if (isType || typeOnlyAlias) {
switch (node.kind) {
- case 276 /* ImportClause */:
- case 279 /* ImportSpecifier */:
- case 274 /* ImportEqualsDeclaration */: {
+ case 279 /* ImportClause */:
+ case 282 /* ImportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */: {
if (compilerOptions.preserveValueImports) {
Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name");
const message = isType ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled;
- const name = idText(node.kind === 279 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
+ const name = idText(node.kind === 282 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
addTypeOnlyDeclarationRelatedInfo(
error(node, message, name),
isType ? void 0 : typeOnlyAlias,
name
);
}
- if (isType && node.kind === 274 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) {
+ if (isType && node.kind === 277 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) {
error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided);
}
break;
}
- case 284 /* ExportSpecifier */: {
+ case 287 /* ExportSpecifier */: {
if (getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) {
const message = isType ? Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled;
const name = idText(node.propertyName || node.name);
@@ -75684,7 +75857,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkImportBinding(node) {
checkCollisionsForDeclarationName(node, node.name);
checkAliasSymbol(node);
- if (node.kind === 279 /* ImportSpecifier */ && idText(node.propertyName || node.name) === "default" && getESModuleInterop(compilerOptions) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
+ if (node.kind === 282 /* ImportSpecifier */ && idText(node.propertyName || node.name) === "default" && getESModuleInterop(compilerOptions) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
}
}
@@ -75731,7 +75904,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkImportBinding(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (importClause.namedBindings.kind === 280 /* NamespaceImport */) {
checkImportBinding(importClause.namedBindings);
if (moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && getESModuleInterop(compilerOptions)) {
checkExternalEmitHelpers(node, 65536 /* ImportStar */);
@@ -75757,7 +75930,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (hasSyntacticModifier(node, 1 /* Export */)) {
markExportAsReferenced(node);
}
- if (node.moduleReference.kind !== 286 /* ExternalModuleReference */) {
+ if (node.moduleReference.kind !== 289 /* ExternalModuleReference */) {
const target = resolveAlias(getSymbolOfNode(node));
if (target !== unknownSymbol) {
const targetFlags = getAllSymbolFlags(target);
@@ -75795,9 +75968,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
if (node.exportClause && !isNamespaceExport(node.exportClause)) {
forEach(node.exportClause.elements, checkExportSpecifier);
- const inAmbientExternalModule = node.parent.kind === 271 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
- const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 271 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 16777216 /* Ambient */;
- if (node.parent.kind !== 314 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
+ const inAmbientExternalModule = node.parent.kind === 274 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
+ const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 274 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 16777216 /* Ambient */;
+ if (node.parent.kind !== 317 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
error(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
}
} else {
@@ -75823,7 +75996,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkGrammarExportDeclaration(node) {
var _a2;
if (node.isTypeOnly) {
- if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 282 /* NamedExports */) {
+ if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 285 /* NamedExports */) {
return checkGrammarNamedImportsOrExports(node.exportClause);
} else {
return grammarErrorOnNode(node, Diagnostics.Only_named_exports_may_use_export_type);
@@ -75832,7 +76005,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function checkGrammarModuleElementContext(node, errorMessage) {
- const isInAppropriateContext = node.parent.kind === 314 /* SourceFile */ || node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 270 /* ModuleDeclaration */;
+ const isInAppropriateContext = node.parent.kind === 317 /* SourceFile */ || node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 273 /* ModuleDeclaration */;
if (!isInAppropriateContext) {
grammarErrorOnFirstToken(node, errorMessage);
}
@@ -75905,7 +76078,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
ident = node.expression;
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
ident = node.expression;
break;
default:
@@ -75930,8 +76103,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
return;
}
- const container = node.parent.kind === 314 /* SourceFile */ ? node.parent : node.parent.parent;
- if (container.kind === 270 /* ModuleDeclaration */ && !isAmbientModule(container)) {
+ const container = node.parent.kind === 317 /* SourceFile */ ? node.parent : node.parent.parent;
+ if (container.kind === 273 /* ModuleDeclaration */ && !isAmbientModule(container)) {
if (node.isExportEquals) {
error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
} else {
@@ -76043,186 +76216,188 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
cancellationToken.throwIfCancellationRequested();
}
}
- if (kind >= 244 /* FirstStatement */ && kind <= 260 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) {
+ if (kind >= 246 /* FirstStatement */ && kind <= 262 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) {
errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, Diagnostics.Unreachable_code_detected);
}
switch (kind) {
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return checkTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return checkParameter(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return checkPropertyDeclaration(node);
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
return checkPropertySignature(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return checkPropertyDeclaration(node);
- case 185 /* ConstructorType */:
- case 184 /* FunctionType */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 187 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return checkSignatureDeclaration(node);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return checkMethodDeclaration(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return checkClassStaticBlockDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return checkConstructorDeclaration(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return checkAccessorDeclaration(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return checkTypeReferenceNode(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return checkTypePredicate(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return checkTypeQuery(node);
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return checkTypeLiteral(node);
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return checkArrayType(node);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
return checkTupleType(node);
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return checkUnionOrIntersectionType(node);
- case 196 /* ParenthesizedType */:
- case 190 /* OptionalType */:
- case 191 /* RestType */:
+ case 198 /* ParenthesizedType */:
+ case 192 /* OptionalType */:
+ case 193 /* RestType */:
return checkSourceElement(node.type);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return checkThisType(node);
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return checkTypeOperator(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return checkConditionalType(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return checkInferType(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return checkTemplateLiteralType(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return checkImportType(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return checkNamedTupleMember(node);
- case 337 /* JSDocAugmentsTag */:
+ case 340 /* JSDocAugmentsTag */:
return checkJSDocAugmentsTag(node);
- case 338 /* JSDocImplementsTag */:
+ case 341 /* JSDocImplementsTag */:
return checkJSDocImplementsTag(node);
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return checkJSDocTypeAliasTag(node);
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return checkJSDocTemplateTag(node);
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return checkJSDocTypeTag(node);
- case 333 /* JSDocLink */:
- case 334 /* JSDocLinkCode */:
- case 335 /* JSDocLinkPlain */:
+ case 336 /* JSDocLink */:
+ case 337 /* JSDocLinkCode */:
+ case 338 /* JSDocLinkPlain */:
return checkJSDocLinkLikeTag(node);
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
return checkJSDocParameterTag(node);
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
return checkJSDocPropertyTag(node);
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
checkJSDocFunctionType(node);
- case 324 /* JSDocNonNullableType */:
- case 323 /* JSDocNullableType */:
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
- case 331 /* JSDocTypeLiteral */:
+ case 327 /* JSDocNonNullableType */:
+ case 326 /* JSDocNullableType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
+ case 334 /* JSDocTypeLiteral */:
checkJSDocTypeIsInJsFile(node);
forEachChild(node, checkSourceElement);
return;
- case 327 /* JSDocVariadicType */:
+ case 330 /* JSDocVariadicType */:
checkJSDocVariadicType(node);
return;
- case 318 /* JSDocTypeExpression */:
+ case 321 /* JSDocTypeExpression */:
return checkSourceElement(node.type);
- case 342 /* JSDocPublicTag */:
- case 344 /* JSDocProtectedTag */:
- case 343 /* JSDocPrivateTag */:
+ case 345 /* JSDocPublicTag */:
+ case 347 /* JSDocProtectedTag */:
+ case 346 /* JSDocPrivateTag */:
return checkJSDocAccessibilityModifiers(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return checkIndexedAccessType(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return checkMappedType(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return checkFunctionDeclaration(node);
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
return checkBlock(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return checkVariableStatement(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return checkExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return checkIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return checkDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return checkWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return checkForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return checkForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return checkForOfStatement(node);
- case 252 /* ContinueStatement */:
- case 253 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
return checkBreakOrContinueStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return checkReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return checkWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return checkSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return checkLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return checkThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return checkTryStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return checkVariableDeclaration(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return checkBindingElement(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return checkClassDeclaration(node);
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return checkStructDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return checkAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return;
+ case 270 /* InterfaceDeclaration */:
return checkInterfaceDeclaration(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return checkTypeAliasDeclaration(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return checkEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return checkModuleDeclaration(node);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return checkImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return checkImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return checkExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return checkExportAssignment(node);
- case 243 /* EmptyStatement */:
- case 260 /* DebuggerStatement */:
+ case 245 /* EmptyStatement */:
+ case 262 /* DebuggerStatement */:
checkGrammarStatementInAmbientContext(node);
return;
- case 285 /* MissingDeclaration */:
+ case 288 /* MissingDeclaration */:
return checkMissingDeclaration(node);
}
}
@@ -76309,33 +76484,33 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
currentNode = node;
instantiationCount = 0;
switch (node.kind) {
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 215 /* TaggedTemplateExpression */:
- case 169 /* Decorator */:
- case 289 /* JsxOpeningElement */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 170 /* Decorator */:
+ case 292 /* JsxOpeningElement */:
resolveUntypedCall(node);
break;
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
checkFunctionExpressionOrObjectLiteralMethodDeferred(node);
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
checkAccessorDeclaration(node);
break;
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
checkClassExpressionDeferred(node);
break;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
checkTypeParameterDeferred(node);
break;
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
checkJsxSelfClosingElementDeferred(node);
break;
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
checkJsxElementDeferred(node);
break;
}
@@ -76499,27 +76674,27 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
copySymbols(location.locals, meaning);
}
switch (location.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (!isExternalModule(location))
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
copyLocallyVisibleExportSymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */);
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */);
break;
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
const className = location.name;
if (className) {
copySymbol(location.symbol, meaning);
}
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
if (!isStaticSymbol) {
copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */);
}
break;
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
const funcName = location.name;
if (funcName) {
copySymbol(location.symbol, meaning);
@@ -76552,7 +76727,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function copyLocallyVisibleExportSymbols(source, meaning2) {
if (meaning2) {
source.forEach((symbol) => {
- if (!getDeclarationOfKind(symbol, 284 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 283 /* NamespaceExport */)) {
+ if (!getDeclarationOfKind(symbol, 287 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 286 /* NamespaceExport */)) {
copySymbol(symbol, meaning2);
}
});
@@ -76563,16 +76738,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return name.kind === 79 /* Identifier */ && isTypeDeclaration(name.parent) && getNameOfDeclaration(name.parent) === name;
}
function isTypeReferenceIdentifier(node) {
- while (node.parent.kind === 165 /* QualifiedName */) {
+ while (node.parent.kind === 166 /* QualifiedName */) {
node = node.parent;
}
- return node.parent.kind === 183 /* TypeReference */;
+ return node.parent.kind === 185 /* TypeReference */;
}
function isHeritageClauseElementIdentifier(node) {
- while (node.parent.kind === 211 /* PropertyAccessExpression */) {
+ while (node.parent.kind === 213 /* PropertyAccessExpression */) {
node = node.parent;
}
- return node.parent.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.parent.kind === 236 /* ExpressionWithTypeArguments */;
}
function forEachEnclosingClass(node, callback) {
let result;
@@ -76599,13 +76774,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return !!forEachEnclosingClass(node, (n) => n === classDeclaration);
}
function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {
- while (nodeOnRightSide.parent.kind === 165 /* QualifiedName */) {
+ while (nodeOnRightSide.parent.kind === 166 /* QualifiedName */) {
nodeOnRightSide = nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 274 /* ImportEqualsDeclaration */) {
+ if (nodeOnRightSide.parent.kind === 277 /* ImportEqualsDeclaration */) {
return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : void 0;
}
- if (nodeOnRightSide.parent.kind === 280 /* ExportAssignment */) {
+ if (nodeOnRightSide.parent.kind === 283 /* ExportAssignment */) {
return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : void 0;
}
return void 0;
@@ -76631,7 +76806,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
node = parent;
parent = parent.parent;
}
- if (parent && parent.kind === 205 /* ImportType */ && parent.qualifier === node) {
+ if (parent && parent.kind === 207 /* ImportType */ && parent.qualifier === node) {
return parent;
}
return void 0;
@@ -76640,7 +76815,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isDeclarationName(name)) {
return getSymbolOfNode(name.parent);
}
- if (isInJSFile(name) && name.parent.kind === 211 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) {
+ if (isInJSFile(name) && name.parent.kind === 213 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) {
if (!isPrivateIdentifier(name) && !isJSDocMemberName(name)) {
const specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name);
if (specialPropertyAssignmentSymbol) {
@@ -76648,7 +76823,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (name.parent.kind === 280 /* ExportAssignment */ && isEntityNameExpression(name)) {
+ if (name.parent.kind === 283 /* ExportAssignment */ && isEntityNameExpression(name)) {
const success = resolveEntityName(
name,
111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */,
@@ -76658,7 +76833,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return success;
}
} else if (isEntityName(name) && isInRightSideOfImportOrExportAssignment(name)) {
- const importEqualsDeclaration = getAncestor(name, 274 /* ImportEqualsDeclaration */);
+ const importEqualsDeclaration = getAncestor(name, 277 /* ImportEqualsDeclaration */);
Debug.assert(importEqualsDeclaration !== void 0);
return getSymbolOfPartOfRightHandSideOfImportEquals(name, true);
}
@@ -76675,7 +76850,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (isHeritageClauseElementIdentifier(name)) {
let meaning = 0 /* None */;
- if (name.parent.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (name.parent.kind === 236 /* ExpressionWithTypeArguments */) {
meaning = 788968 /* Type */;
if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) {
meaning |= 111551 /* Value */;
@@ -76689,10 +76864,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return entityNameSymbol;
}
}
- if (name.parent.kind === 349 /* JSDocParameterTag */) {
+ if (name.parent.kind === 352 /* JSDocParameterTag */) {
return getParameterSymbolFromJSDoc(name.parent);
}
- if (name.parent.kind === 167 /* TypeParameter */ && name.parent.parent.kind === 353 /* JSDocTemplateTag */) {
+ if (name.parent.kind === 168 /* TypeParameter */ && name.parent.parent.kind === 356 /* JSDocTemplateTag */) {
Debug.assert(!isInJSFile(name));
const typeParameter = getTypeParameterFromJsDoc(name.parent);
return typeParameter && typeParameter.symbol;
@@ -76724,12 +76899,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
} else if (isPrivateIdentifier(name)) {
return getSymbolForPrivateIdentifierExpression(name);
- } else if (name.kind === 211 /* PropertyAccessExpression */ || name.kind === 165 /* QualifiedName */) {
+ } else if (name.kind === 213 /* PropertyAccessExpression */ || name.kind === 166 /* QualifiedName */) {
const links = getNodeLinks(name);
if (links.resolvedSymbol) {
return links.resolvedSymbol;
}
- if (name.kind === 211 /* PropertyAccessExpression */) {
+ if (name.kind === 213 /* PropertyAccessExpression */) {
checkPropertyAccessExpression(name, 0 /* Normal */);
if (!links.resolvedSymbol) {
const expressionType = checkExpressionCached(name.expression);
@@ -76769,11 +76944,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return resolveJSDocMemberName(name);
}
} else if (isTypeReferenceIdentifier(name)) {
- const meaning = name.parent.kind === 183 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */;
+ const meaning = name.parent.kind === 185 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */;
const symbol = resolveEntityName(name, meaning, true, true);
return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name);
}
- if (name.parent.kind === 182 /* TypePredicate */) {
+ if (name.parent.kind === 184 /* TypePredicate */) {
return resolveEntityName(name, 1 /* FunctionScopedVariable */, true);
}
return void 0;
@@ -76798,7 +76973,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getSymbolAtLocation(node, ignoreErrors) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return isExternalModule(node) ? getMergedSymbol(node.symbol) : void 0;
}
const { parent } = node;
@@ -76815,7 +76990,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.kind === 79 /* Identifier */) {
if (isInRightSideOfImportOrExportAssignment(node)) {
return getSymbolOfNameOrPropertyAccessExpression(node);
- } else if (parent.kind === 208 /* BindingElement */ && grandParent.kind === 206 /* ObjectBindingPattern */ && node === parent.propertyName) {
+ } else if (parent.kind === 210 /* BindingElement */ && grandParent.kind === 208 /* ObjectBindingPattern */ && node === parent.propertyName) {
const typeOfPattern = getTypeOfNode(grandParent);
const propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText);
if (propertyDeclaration) {
@@ -76834,8 +77009,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
- case 211 /* PropertyAccessExpression */:
- case 165 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
if (!isThisInTypeQuery(node)) {
return getSymbolOfNameOrPropertyAccessExpression(node);
}
@@ -76850,19 +77025,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isInExpressionContext(node)) {
return checkExpression(node).symbol;
}
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return getTypeFromThisTypeNode(node).symbol;
case 107 /* SuperKeyword */:
return checkExpression(node).symbol;
case 136 /* ConstructorKeyword */:
const constructorDeclaration = node.parent;
- if (constructorDeclaration && constructorDeclaration.kind === 176 /* Constructor */) {
+ if (constructorDeclaration && constructorDeclaration.kind === 178 /* Constructor */) {
return constructorDeclaration.parent.symbol;
}
return void 0;
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 275 /* ImportDeclaration */ || node.parent.kind === 281 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(node.parent, false) || isImportCall(node.parent)) || isLiteralTypeNode(node.parent) && isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent) {
+ if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 278 /* ImportDeclaration */ || node.parent.kind === 284 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(node.parent, false) || isImportCall(node.parent)) || isLiteralTypeNode(node.parent) && isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent) {
return resolveExternalModuleName(node, node, ignoreErrors);
}
if (isCallExpression(parent) && isBindableObjectDefinePropertyCall(parent) && parent.arguments[1] === node) {
@@ -76876,14 +77051,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 38 /* EqualsGreaterThanToken */:
case 84 /* ClassKeyword */:
return getSymbolOfNode(node.parent);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : void 0;
case 94 /* ExportKeyword */:
return isExportAssignment(node.parent) ? Debug.checkDefined(node.parent.symbol) : void 0;
case 101 /* ImportKeyword */:
case 104 /* NewKeyword */:
return isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : void 0;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return checkExpression(node).symbol;
default:
return void 0;
@@ -76899,7 +77074,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
function getShorthandAssignmentValueSymbol(location) {
- if (location && location.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (location && location.kind === 309 /* ShorthandPropertyAssignment */) {
return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */, true);
}
return void 0;
@@ -76984,16 +77159,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getTypeOfNode(node);
}
function getTypeOfAssignmentPattern(expr) {
- Debug.assert(expr.kind === 210 /* ObjectLiteralExpression */ || expr.kind === 209 /* ArrayLiteralExpression */);
- if (expr.parent.kind === 251 /* ForOfStatement */) {
+ Debug.assert(expr.kind === 212 /* ObjectLiteralExpression */ || expr.kind === 211 /* ArrayLiteralExpression */);
+ if (expr.parent.kind === 253 /* ForOfStatement */) {
const iteratedType = checkRightHandSideOfForOf(expr.parent);
return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 227 /* BinaryExpression */) {
+ if (expr.parent.kind === 229 /* BinaryExpression */) {
const iteratedType = getTypeOfExpression(expr.parent.right);
return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 305 /* PropertyAssignment */) {
+ if (expr.parent.kind === 308 /* PropertyAssignment */) {
const node2 = cast(expr.parent.parent, isObjectLiteralExpression);
const typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node2) || errorType;
const propertyIndex = indexOfNode(node2.properties, expr.parent);
@@ -77026,7 +77201,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
case 10 /* StringLiteral */:
return getStringLiteralType(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
const nameType = checkComputedPropertyName(name);
return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType;
default:
@@ -77117,7 +77292,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const parentSymbol = getParentOfSymbol(symbol);
if (parentSymbol) {
- if (parentSymbol.flags & 512 /* ValueModule */ && ((_a2 = parentSymbol.valueDeclaration) == null ? void 0 : _a2.kind) === 314 /* SourceFile */) {
+ if (parentSymbol.flags & 512 /* ValueModule */ && ((_a2 = parentSymbol.valueDeclaration) == null ? void 0 : _a2.kind) === 317 /* SourceFile */) {
const symbolFile = parentSymbol.valueDeclaration;
const referenceFile = getSourceFileOfNode(node);
const symbolIsUmdExport = symbolFile !== referenceFile;
@@ -77142,7 +77317,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
function isSymbolOfDestructuredElementOfCatchBinding(symbol) {
- return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 301 /* CatchClause */;
+ return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 304 /* CatchClause */;
}
function isSymbolOfDeclarationWithCollidingName(symbol) {
if (symbol.flags & 418 /* BlockScoped */ && symbol.valueDeclaration && !isSourceFile(symbol.valueDeclaration)) {
@@ -77156,7 +77331,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else if (nodeLinks2.flags & 262144 /* CapturedBlockScopedBinding */) {
const isDeclaredInLoop = nodeLinks2.flags & 524288 /* BlockScopedBindingInLoop */;
const inLoopInitializer = isIterationStatement(container, false);
- const inLoopBodyBlock = container.kind === 242 /* Block */ && isIterationStatement(container.parent, false);
+ const inLoopBodyBlock = container.kind === 244 /* Block */ && isIterationStatement(container.parent, false);
links.isDeclarationWithCollidingName = !isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || !inLoopInitializer && !inLoopBodyBlock);
} else {
links.isDeclarationWithCollidingName = false;
@@ -77191,25 +77366,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isValueAliasDeclaration(node) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return isAliasResolvedToValue(getSymbolOfNode(node));
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
const symbol = getSymbolOfNode(node);
return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportClause = node.exportClause;
return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return node.expression && node.expression.kind === 79 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true;
}
return false;
}
function isTopLevelValueImportEqualsWithEntityName(nodeIn) {
const node = getParseTreeNode(nodeIn, isImportEqualsDeclaration);
- if (node === void 0 || node.parent.kind !== 314 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) {
+ if (node === void 0 || node.parent.kind !== 317 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) {
return false;
}
const isValue = isAliasResolvedToValue(getSymbolOfNode(node));
@@ -77298,15 +77473,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function canHaveConstantValue(node) {
switch (node.kind) {
- case 308 /* EnumMember */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 311 /* EnumMember */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return true;
}
return false;
}
function getConstantValue2(node) {
- if (node.kind === 308 /* EnumMember */) {
+ if (node.kind === 311 /* EnumMember */) {
return getEnumMemberValue(node);
}
const symbol = getNodeLinks(node).resolvedSymbol;
@@ -77504,7 +77679,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
ident = node.expression;
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
ident = node.expression;
break;
default:
@@ -77611,12 +77786,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
getJsxFragmentFactoryEntity,
getAllAccessorDeclarations(accessor) {
accessor = getParseTreeNode(accessor, isGetOrSetAccessorDeclaration);
- const otherKind = accessor.kind === 178 /* SetAccessor */ ? 177 /* GetAccessor */ : 178 /* SetAccessor */;
+ const otherKind = accessor.kind === 180 /* SetAccessor */ ? 179 /* GetAccessor */ : 180 /* SetAccessor */;
const otherAccessor = getDeclarationOfKind(getSymbolOfNode(accessor), otherKind);
const firstAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? otherAccessor : accessor;
const secondAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? accessor : otherAccessor;
- const setAccessor = accessor.kind === 178 /* SetAccessor */ ? accessor : otherAccessor;
- const getAccessor = accessor.kind === 177 /* GetAccessor */ ? accessor : otherAccessor;
+ const setAccessor = accessor.kind === 180 /* SetAccessor */ ? accessor : otherAccessor;
+ const getAccessor = accessor.kind === 179 /* GetAccessor */ ? accessor : otherAccessor;
return {
firstAccessor,
secondAccessor,
@@ -77632,7 +77807,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
},
getDeclarationStatementsForSourceFile: (node, flags, tracker, bundled) => {
const n = getParseTreeNode(node);
- Debug.assert(n && n.kind === 314 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
+ Debug.assert(n && n.kind === 317 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
const sym = getSymbolOfNode(node);
if (!sym) {
return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled);
@@ -77744,18 +77919,18 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function isInHeritageClause(node) {
- return node.parent && node.parent.kind === 234 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 300 /* HeritageClause */;
+ return node.parent && node.parent.kind === 236 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 303 /* HeritageClause */;
}
function getTypeReferenceDirectivesForEntityName(node) {
if (!fileToDirective) {
return void 0;
}
let meaning;
- if (node.parent.kind === 166 /* ComputedPropertyName */) {
+ if (node.parent.kind === 167 /* ComputedPropertyName */) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
} else {
meaning = 788968 /* Type */ | 1920 /* Namespace */;
- if (node.kind === 79 /* Identifier */ && isInTypeQuery(node) || node.kind === 211 /* PropertyAccessExpression */ && !isInHeritageClause(node)) {
+ if (node.kind === 79 /* Identifier */ && isInTypeQuery(node) || node.kind === 213 /* PropertyAccessExpression */ && !isInHeritageClause(node)) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
}
}
@@ -77793,7 +77968,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
}
- if (current.valueDeclaration && current.valueDeclaration.kind === 314 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
+ if (current.valueDeclaration && current.valueDeclaration.kind === 317 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
return false;
}
for (const decl of symbol.declarations) {
@@ -77818,12 +77993,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getExternalModuleFileFromDeclaration(declaration) {
- const specifier = declaration.kind === 270 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration);
+ const specifier = declaration.kind === 273 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration);
const moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, void 0);
if (!moduleSymbol) {
return void 0;
}
- return getDeclarationOfKind(moduleSymbol, 314 /* SourceFile */);
+ return getDeclarationOfKind(moduleSymbol, 317 /* SourceFile */);
}
function initializeTypeChecker() {
for (const file of host.getSourceFiles()) {
@@ -78052,7 +78227,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
if (!nodeCanBeDecorated(node, node.parent, node.parent.parent, compilerOptions)) {
- const isMethodDeclarationAndNodeIsNotPresent = node.kind === 174 /* MethodDeclaration */ && !nodeIsPresent(node.body);
+ const isMethodDeclarationAndNodeIsNotPresent = node.kind === 176 /* MethodDeclaration */ && !nodeIsPresent(node.body);
const message = isMethodDeclarationAndNodeIsNotPresent ? Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload : Diagnostics.Decorators_are_not_valid_here;
for (const decorator of decorators) {
if (!grammarErrorOnNode(decorator, message)) {
@@ -78060,7 +78235,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
return true;
- } else if (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */) {
+ } else if (node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */) {
const accessors = getAllAccessorDeclarations(node.parent.members, node);
if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) {
return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
@@ -78080,21 +78255,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
}
if (modifier.kind !== 147 /* ReadonlyKeyword */) {
- if (node.kind === 170 /* PropertySignature */ || node.kind === 173 /* MethodSignature */) {
+ if (node.kind === 171 /* PropertySignature */ || node.kind === 175 /* MethodSignature */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind));
}
- if (node.kind === 181 /* IndexSignature */ && (modifier.kind !== 125 /* StaticKeyword */ || !isClassLike(node.parent))) {
+ if (node.kind === 183 /* IndexSignature */ && (modifier.kind !== 125 /* StaticKeyword */ || !isClassLike(node.parent))) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind));
}
}
if (modifier.kind !== 102 /* InKeyword */ && modifier.kind !== 146 /* OutKeyword */) {
- if (node.kind === 167 /* TypeParameter */) {
+ if (node.kind === 168 /* TypeParameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind));
}
}
switch (modifier.kind) {
case 86 /* ConstKeyword */:
- if (node.kind !== 269 /* EnumDeclaration */) {
+ if (node.kind !== 272 /* EnumDeclaration */) {
return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(86 /* ConstKeyword */));
}
break;
@@ -78129,7 +78304,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly");
} else if (flags & 512 /* Async */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
- } else if (node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ } else if (node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
} else if (flags & 256 /* Abstract */) {
if (modifier.kind === 122 /* PrivateKeyword */) {
@@ -78151,9 +78326,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
} else if (flags & 128 /* Accessor */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor");
- } else if (node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ } else if (node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
} else if (flags & 256 /* Abstract */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
@@ -78170,7 +78345,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly");
} else if (flags & 2 /* Ambient */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare");
- } else if (node.kind !== 171 /* PropertyDeclaration */) {
+ } else if (node.kind !== 172 /* PropertyDeclaration */) {
return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration);
}
flags |= 128 /* Accessor */;
@@ -78178,7 +78353,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 147 /* ReadonlyKeyword */:
if (flags & 64 /* Readonly */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly");
- } else if (node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 170 /* PropertySignature */ && node.kind !== 181 /* IndexSignature */ && node.kind !== 168 /* Parameter */) {
+ } else if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 183 /* IndexSignature */ && node.kind !== 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
}
flags |= 64 /* Readonly */;
@@ -78194,14 +78369,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
} else if (isClassLike(node.parent)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export");
}
flags |= 1 /* Export */;
break;
case 89 /* DefaultKeyword */:
- const container = node.parent.kind === 314 /* SourceFile */ ? node.parent : node.parent.parent;
- if (container.kind === 270 /* ModuleDeclaration */ && !isAmbientModule(container)) {
+ const container = node.parent.kind === 317 /* SourceFile */ ? node.parent : node.parent.parent;
+ if (container.kind === 273 /* ModuleDeclaration */ && !isAmbientModule(container)) {
return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
} else if (!(flags & 1 /* Export */)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default");
@@ -78217,9 +78392,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override");
} else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
- } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 271 /* ModuleBlock */) {
+ } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 274 /* ModuleBlock */) {
return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
} else if (isPrivateIdentifierClassElementDeclaration(node)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
@@ -78231,11 +78406,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (flags & 256 /* Abstract */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract");
}
- if (node.kind !== 264 /* ClassDeclaration */ && node.kind !== 185 /* ConstructorType */) {
- if (node.kind !== 174 /* MethodDeclaration */ && node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 177 /* GetAccessor */ && node.kind !== 178 /* SetAccessor */) {
+ if (node.kind !== 266 /* ClassDeclaration */ && node.kind !== 187 /* ConstructorType */) {
+ if (node.kind !== 176 /* MethodDeclaration */ && node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 179 /* GetAccessor */ && node.kind !== 180 /* SetAccessor */) {
return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
}
- if (!(node.parent.kind === 264 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) {
+ if (!(node.parent.kind === 266 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) {
return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);
}
if (flags & 32 /* Static */) {
@@ -78264,7 +78439,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async");
} else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
}
if (flags & 256 /* Abstract */) {
@@ -78277,7 +78452,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 146 /* OutKeyword */:
const inOutFlag = modifier.kind === 102 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */;
const inOutText = modifier.kind === 102 /* InKeyword */ ? "in" : "out";
- if (node.kind !== 167 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
+ if (node.kind !== 168 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
}
if (flags & inOutFlag) {
@@ -78290,7 +78465,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
}
- if (node.kind === 176 /* Constructor */) {
+ if (node.kind === 178 /* Constructor */) {
if (flags & 32 /* Static */) {
return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
}
@@ -78301,11 +78476,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async");
}
return false;
- } else if ((node.kind === 275 /* ImportDeclaration */ || node.kind === 274 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) {
+ } else if ((node.kind === 278 /* ImportDeclaration */ || node.kind === 277 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) {
return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
- } else if (node.kind === 168 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) {
+ } else if (node.kind === 169 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) {
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
- } else if (node.kind === 168 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && node.dotDotDotToken) {
+ } else if (node.kind === 169 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && node.dotDotDotToken) {
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
}
if (flags & 512 /* Async */) {
@@ -78318,49 +78493,51 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function shouldReportBadModifier(node) {
switch (node.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 270 /* ModuleDeclaration */:
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 168 /* Parameter */:
- case 167 /* TypeParameter */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 273 /* ModuleDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 169 /* Parameter */:
+ case 168 /* TypeParameter */:
return false;
- case 175 /* ClassStaticBlockDeclaration */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 273 /* NamespaceExportDeclaration */:
- case 184 /* FunctionType */:
- case 285 /* MissingDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 276 /* NamespaceExportDeclaration */:
+ case 186 /* FunctionType */:
+ case 288 /* MissingDeclaration */:
return true;
default:
- if (node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ if (node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
return false;
}
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return nodeHasAnyModifiersExcept(node, 133 /* AsyncKeyword */);
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 185 /* ConstructorType */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 187 /* ConstructorType */:
return nodeHasAnyModifiersExcept(node, 127 /* AbstractKeyword */);
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 244 /* VariableStatement */:
- case 268 /* TypeAliasDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 246 /* VariableStatement */:
+ case 271 /* TypeAliasDeclaration */:
return true;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return nodeHasAnyModifiersExcept(node, 86 /* ConstKeyword */);
default:
Debug.assertNever(node);
@@ -78378,10 +78555,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkGrammarAsyncModifier(node, asyncModifier) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return false;
}
return grammarErrorOnNode(asyncModifier, Diagnostics._0_modifier_cannot_be_used_here, "async");
@@ -78594,11 +78771,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function checkGrammarComputedPropertyName(node) {
- if (node.kind !== 166 /* ComputedPropertyName */) {
+ if (node.kind !== 167 /* ComputedPropertyName */) {
return false;
}
const computedPropertyName = node;
- if (computedPropertyName.expression.kind === 227 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) {
+ if (computedPropertyName.expression.kind === 229 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) {
return grammarErrorOnNode(computedPropertyName.expression, Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name);
}
return false;
@@ -78606,7 +78783,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkGrammarForGenerator(node) {
if (node.asteriskToken) {
Debug.assert(
- node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */ || node.kind === 174 /* MethodDeclaration */
+ node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */ || node.kind === 176 /* MethodDeclaration */
);
if (node.flags & 16777216 /* Ambient */) {
return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
@@ -78625,7 +78802,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkGrammarObjectLiteralExpression(node, inDestructuring) {
const seen = new Map2();
for (const prop of node.properties) {
- if (prop.kind === 307 /* SpreadAssignment */) {
+ if (prop.kind === 310 /* SpreadAssignment */) {
if (inDestructuring) {
const expression = skipParentheses(prop.expression);
if (isArrayLiteralExpression(expression) || isObjectLiteralExpression(expression)) {
@@ -78635,10 +78812,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
}
const name = prop.name;
- if (name.kind === 166 /* ComputedPropertyName */) {
+ if (name.kind === 167 /* ComputedPropertyName */) {
checkGrammarComputedPropertyName(name);
}
- if (prop.kind === 306 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
+ if (prop.kind === 309 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
grammarErrorOnNode(prop.equalsToken, Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);
}
if (name.kind === 80 /* PrivateIdentifier */) {
@@ -78646,7 +78823,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (canHaveModifiers(prop) && prop.modifiers) {
for (const mod of prop.modifiers) {
- if (isModifier(mod) && (mod.kind !== 133 /* AsyncKeyword */ || prop.kind !== 174 /* MethodDeclaration */)) {
+ if (isModifier(mod) && (mod.kind !== 133 /* AsyncKeyword */ || prop.kind !== 176 /* MethodDeclaration */)) {
grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod));
}
}
@@ -78657,8 +78834,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let currentKind;
switch (prop.kind) {
- case 306 /* ShorthandPropertyAssignment */:
- case 305 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
checkGrammarForInvalidExclamationToken(prop.exclamationToken, Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);
checkGrammarForInvalidQuestionMark(prop.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional);
if (name.kind === 8 /* NumericLiteral */) {
@@ -78666,13 +78843,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
currentKind = 4 /* PropertyAssignment */;
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
currentKind = 8 /* Method */;
break;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
currentKind = 1 /* GetAccessor */;
break;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
currentKind = 2 /* SetAccessor */;
break;
default:
@@ -78709,7 +78886,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkGrammarTypeArguments(node, node.typeArguments);
const seen = new Map2();
for (const attr of node.attributes.properties) {
- if (attr.kind === 296 /* JsxSpreadAttribute */) {
+ if (attr.kind === 299 /* JsxSpreadAttribute */) {
continue;
}
const { name, initializer } = attr;
@@ -78718,7 +78895,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
return grammarErrorOnNode(name, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
}
- if (initializer && initializer.kind === 297 /* JsxExpression */ && !initializer.expression) {
+ if (initializer && initializer.kind === 300 /* JsxExpression */ && !initializer.expression) {
return grammarErrorOnNode(initializer, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression);
}
}
@@ -78753,7 +78930,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) {
return true;
}
- if (forInOrOfStatement.kind === 251 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) {
+ if (forInOrOfStatement.kind === 253 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) {
if (!(forInOrOfStatement.flags & 32768 /* AwaitContext */)) {
const sourceFile = getSourceFileOfNode(forInOrOfStatement);
if (isInTopLevelContext(forInOrOfStatement)) {
@@ -78793,7 +78970,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!hasParseDiagnostics(sourceFile)) {
const diagnostic = createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);
const func = getContainingFunction(forInOrOfStatement);
- if (func && func.kind !== 176 /* Constructor */) {
+ if (func && func.kind !== 178 /* Constructor */) {
Debug.assert((getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function.");
const relatedInfo = createDiagnosticForNode(func, Diagnostics.Did_you_mean_to_mark_this_function_as_async);
addRelatedInfo(diagnostic, relatedInfo);
@@ -78809,7 +78986,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
grammarErrorOnNode(forInOrOfStatement.initializer, Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async);
return false;
}
- if (forInOrOfStatement.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (forInOrOfStatement.initializer.kind === 264 /* VariableDeclarationList */) {
const variableList = forInOrOfStatement.initializer;
if (!checkGrammarVariableDeclarationList(variableList)) {
const declarations = variableList.declarations;
@@ -78817,16 +78994,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
if (declarations.length > 1) {
- const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
+ const diagnostic = forInOrOfStatement.kind === 252 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic);
}
const firstDeclaration = declarations[0];
if (firstDeclaration.initializer) {
- const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
+ const diagnostic = forInOrOfStatement.kind === 252 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
return grammarErrorOnNode(firstDeclaration.name, diagnostic);
}
if (firstDeclaration.type) {
- const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
+ const diagnostic = forInOrOfStatement.kind === 252 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
return grammarErrorOnNode(firstDeclaration, diagnostic);
}
}
@@ -78834,7 +79011,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function checkGrammarAccessor(accessor) {
- if (!(accessor.flags & 16777216 /* Ambient */) && accessor.parent.kind !== 187 /* TypeLiteral */ && accessor.parent.kind !== 267 /* InterfaceDeclaration */) {
+ if (!(accessor.flags & 16777216 /* Ambient */) && accessor.parent.kind !== 189 /* TypeLiteral */ && accessor.parent.kind !== 270 /* InterfaceDeclaration */) {
if (languageVersion < 1 /* ES5 */) {
return grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);
}
@@ -78849,7 +79026,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (hasSyntacticModifier(accessor, 256 /* Abstract */)) {
return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation);
}
- if (accessor.parent.kind === 187 /* TypeLiteral */ || accessor.parent.kind === 267 /* InterfaceDeclaration */) {
+ if (accessor.parent.kind === 189 /* TypeLiteral */ || accessor.parent.kind === 270 /* InterfaceDeclaration */) {
return grammarErrorOnNode(accessor.body, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
}
@@ -78859,10 +79036,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!doesAccessorHaveCorrectParameterCount(accessor)) {
return grammarErrorOnNode(
accessor.name,
- accessor.kind === 177 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter
+ accessor.kind === 179 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter
);
}
- if (accessor.kind === 178 /* SetAccessor */) {
+ if (accessor.kind === 180 /* SetAccessor */) {
if (accessor.type) {
return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);
}
@@ -78880,10 +79057,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function doesAccessorHaveCorrectParameterCount(accessor) {
- return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 0 : 1);
+ return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 179 /* GetAccessor */ ? 0 : 1);
}
function getAccessorThisParameter(accessor) {
- if (accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 1 : 2)) {
+ if (accessor.parameters.length === (accessor.kind === 179 /* GetAccessor */ ? 1 : 2)) {
return getThisParameter(accessor);
}
}
@@ -78900,7 +79077,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
switch (parent.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
const decl = parent;
if (decl.name.kind !== 79 /* Identifier */) {
return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);
@@ -78912,12 +79089,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(parent.name, Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (!isStatic(parent) || !hasEffectiveReadonlyModifier(parent)) {
return grammarErrorOnNode(parent.name, Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);
}
break;
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
if (!hasSyntacticModifier(parent, 64 /* Readonly */)) {
return grammarErrorOnNode(parent.name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);
}
@@ -78926,7 +79103,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_here);
}
} else if (node.operator === 147 /* ReadonlyKeyword */) {
- if (node.type.kind !== 188 /* ArrayType */ && node.type.kind !== 189 /* TupleType */) {
+ if (node.type.kind !== 190 /* ArrayType */ && node.type.kind !== 191 /* TupleType */) {
return grammarErrorOnFirstToken(node, Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, tokenToString(154 /* SymbolKeyword */));
}
}
@@ -78940,8 +79117,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (checkGrammarFunctionLikeDeclaration(node)) {
return true;
}
- if (node.kind === 174 /* MethodDeclaration */) {
- if (node.parent.kind === 210 /* ObjectLiteralExpression */) {
+ if (node.kind === 176 /* MethodDeclaration */) {
+ if (node.parent.kind === 212 /* ObjectLiteralExpression */) {
if (node.modifiers && !(node.modifiers.length === 1 && first(node.modifiers).kind === 133 /* AsyncKeyword */)) {
return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here);
} else if (checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional)) {
@@ -78962,12 +79139,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (node.flags & 16777216 /* Ambient */) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
- } else if (node.kind === 174 /* MethodDeclaration */ && !node.body) {
+ } else if (node.kind === 176 /* MethodDeclaration */ && !node.body) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
}
- } else if (node.parent.kind === 267 /* InterfaceDeclaration */) {
+ } else if (node.parent.kind === 270 /* InterfaceDeclaration */) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
- } else if (node.parent.kind === 187 /* TypeLiteral */) {
+ } else if (node.parent.kind === 189 /* TypeLiteral */) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
}
}
@@ -78978,17 +79155,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary);
}
switch (current.kind) {
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
if (node.label && current.label.escapedText === node.label.escapedText) {
- const isMisplacedContinueLabel = node.kind === 252 /* ContinueStatement */ && !isIterationStatement(current.statement, true);
+ const isMisplacedContinueLabel = node.kind === 254 /* ContinueStatement */ && !isIterationStatement(current.statement, true);
if (isMisplacedContinueLabel) {
return grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);
}
return false;
}
break;
- case 256 /* SwitchStatement */:
- if (node.kind === 253 /* BreakStatement */ && !node.label) {
+ case 258 /* SwitchStatement */:
+ if (node.kind === 255 /* BreakStatement */ && !node.label) {
return false;
}
break;
@@ -79001,10 +79178,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
current = current.parent;
}
if (node.label) {
- const message = node.kind === 253 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
+ const message = node.kind === 255 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
} else {
- const message = node.kind === 253 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
+ const message = node.kind === 255 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
}
}
@@ -79024,10 +79201,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isStringOrNumberLiteralExpression(expr) {
- return isStringOrNumericLiteralLike(expr) || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */;
+ return isStringOrNumericLiteralLike(expr) || expr.kind === 227 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */;
}
function isBigIntLiteralExpression(expr) {
- return expr.kind === 9 /* BigIntLiteral */ || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */;
+ return expr.kind === 9 /* BigIntLiteral */ || expr.kind === 227 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */;
}
function isSimpleLiteralEnumReference(expr) {
if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) {
@@ -79049,7 +79226,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkGrammarVariableDeclaration(node) {
- if (node.parent.parent.kind !== 250 /* ForInStatement */ && node.parent.parent.kind !== 251 /* ForOfStatement */) {
+ if (node.parent.parent.kind !== 252 /* ForInStatement */ && node.parent.parent.kind !== 253 /* ForOfStatement */) {
if (node.flags & 16777216 /* Ambient */) {
checkAmbientInitializer(node);
} else if (!node.initializer) {
@@ -79061,7 +79238,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (node.exclamationToken && (node.parent.parent.kind !== 244 /* VariableStatement */ || !node.type || node.initializer || node.flags & 16777216 /* Ambient */)) {
+ if (node.exclamationToken && (node.parent.parent.kind !== 246 /* VariableStatement */ || !node.type || node.initializer || node.flags & 16777216 /* Ambient */)) {
const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context;
return grammarErrorOnNode(node.exclamationToken, message);
}
@@ -79113,15 +79290,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function allowLetAndConstDeclarations(parent) {
switch (parent.kind) {
- case 246 /* IfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 255 /* WithStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 248 /* IfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 257 /* WithStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
return false;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return allowLetAndConstDeclarations(parent.parent);
}
return true;
@@ -79223,7 +79400,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isAutoAccessorPropertyDeclaration(node) && checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_accessor_property_cannot_be_declared_optional)) {
return true;
}
- } else if (node.parent.kind === 267 /* InterfaceDeclaration */) {
+ } else if (node.parent.kind === 270 /* InterfaceDeclaration */) {
if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) {
return true;
}
@@ -79249,14 +79426,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
- if (node.kind === 267 /* InterfaceDeclaration */ || node.kind === 268 /* TypeAliasDeclaration */ || node.kind === 275 /* ImportDeclaration */ || node.kind === 274 /* ImportEqualsDeclaration */ || node.kind === 281 /* ExportDeclaration */ || node.kind === 280 /* ExportAssignment */ || node.kind === 273 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 1024 /* Default */)) {
+ if (node.kind === 270 /* InterfaceDeclaration */ || node.kind === 271 /* TypeAliasDeclaration */ || node.kind === 278 /* ImportDeclaration */ || node.kind === 277 /* ImportEqualsDeclaration */ || node.kind === 284 /* ExportDeclaration */ || node.kind === 283 /* ExportAssignment */ || node.kind === 276 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 1024 /* Default */)) {
return false;
}
return grammarErrorOnFirstToken(node, Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier);
}
function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) {
for (const decl of file.statements) {
- if (isDeclaration(decl) || decl.kind === 244 /* VariableStatement */) {
+ if (isDeclaration(decl) || decl.kind === 246 /* VariableStatement */) {
if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) {
return true;
}
@@ -79273,7 +79450,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!links.hasReportedStatementInAmbientContext && (isFunctionLike(node.parent) || isAccessor(node.parent))) {
return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
- if (node.parent.kind === 242 /* Block */ || node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ if (node.parent.kind === 244 /* Block */ || node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
const links2 = getNodeLinks(node.parent);
if (!links2.hasReportedStatementInAmbientContext) {
return links2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts);
@@ -79288,9 +79465,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let diagnosticMessage;
if (languageVersion >= 1 /* ES5 */) {
diagnosticMessage = Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0;
- } else if (isChildOfNodeWithKind(node, 201 /* LiteralType */)) {
+ } else if (isChildOfNodeWithKind(node, 203 /* LiteralType */)) {
diagnosticMessage = Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;
- } else if (isChildOfNodeWithKind(node, 308 /* EnumMember */)) {
+ } else if (isChildOfNodeWithKind(node, 311 /* EnumMember */)) {
diagnosticMessage = Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0;
}
if (diagnosticMessage) {
@@ -79350,7 +79527,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.isTypeOnly && node.name && node.namedBindings) {
return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);
}
- if (node.isTypeOnly && ((_a2 = node.namedBindings) == null ? void 0 : _a2.kind) === 278 /* NamedImports */) {
+ if (node.isTypeOnly && ((_a2 = node.namedBindings) == null ? void 0 : _a2.kind) === 281 /* NamedImports */) {
return checkGrammarNamedImportsOrExports(node.namedBindings);
}
return false;
@@ -79360,7 +79537,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (specifier.isTypeOnly) {
return grammarErrorOnFirstToken(
specifier,
- specifier.kind === 279 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement
+ specifier.kind === 282 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement
);
}
});
@@ -79469,12 +79646,12 @@ function isNotAccessor(declaration) {
return !isAccessor(declaration);
}
function isNotOverload(declaration) {
- return declaration.kind !== 263 /* FunctionDeclaration */ && declaration.kind !== 174 /* MethodDeclaration */ || !!declaration.body;
+ return declaration.kind !== 265 /* FunctionDeclaration */ && declaration.kind !== 176 /* MethodDeclaration */ || !!declaration.body;
}
function isDeclarationNameOrImportPropertyName(name) {
switch (name.parent.kind) {
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return isIdentifier(name);
default:
return isDeclarationName(name);
@@ -79752,20 +79929,20 @@ var visitEachChildTable = {
nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)
);
},
- [165 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [166 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateQualifiedName(
node,
nodeVisitor(node.left, visitor, isEntityName),
nodeVisitor(node.right, visitor, isIdentifier)
);
},
- [166 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [167 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateComputedPropertyName(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [167 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [168 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeParameterDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -79774,7 +79951,7 @@ var visitEachChildTable = {
nodeVisitor(node.default, visitor, isTypeNode)
);
},
- [168 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [169 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateParameterDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -79785,14 +79962,14 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [169 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [170 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDecorator(
node,
nodeVisitor(node.expression, visitor, isExpression),
node.annotationDeclaration
);
},
- [170 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [171 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updatePropertySignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -79801,7 +79978,16 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [171 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [174 /* OverloadPropertyDeclaration */]: function visitEachChildOfOverloadPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ return context.factory.updateOverloadPropertyDeclaration(
+ node,
+ nodesVisitor(node.modifiers, visitor, isModifier),
+ nodeVisitor(node.name, visitor, isPropertyName),
+ nodeVisitor(node.questionToken, tokenVisitor, isToken),
+ nodeVisitor(node.type, visitor, isTypeNode)
+ );
+ },
+ [172 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
var _a2;
return context.factory.updatePropertyDeclaration(
node,
@@ -79812,7 +79998,7 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [172 /* AnnotationPropertyDeclaration */]: function visitEachChildOfAnnotationPropertyDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [173 /* AnnotationPropertyDeclaration */]: function visitEachChildOfAnnotationPropertyDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAnnotationPropertyDeclaration(
node,
nodeVisitor(node.name, visitor, isPropertyName),
@@ -79820,7 +80006,7 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [173 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [175 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMethodSignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -79831,7 +80017,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [174 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [176 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMethodDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -79844,7 +80030,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [176 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [178 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructorDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -79852,7 +80038,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [177 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [179 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
if (context.isLexicalEnvironmentSuspended && context.isLexicalEnvironmentSuspended()) {
return context.factory.updateGetAccessorDeclaration(
node,
@@ -79873,7 +80059,7 @@ var visitEachChildTable = {
);
}
},
- [178 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [180 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
if (context.isLexicalEnvironmentSuspended && context.isLexicalEnvironmentSuspended()) {
return context.factory.updateSetAccessorDeclaration(
node,
@@ -79892,7 +80078,7 @@ var visitEachChildTable = {
);
}
},
- [175 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [177 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
context.startLexicalEnvironment();
context.suspendLexicalEnvironment();
return context.factory.updateClassStaticBlockDeclaration(
@@ -79900,7 +80086,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [179 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [181 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCallSignature(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -79908,7 +80094,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [180 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [182 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructSignature(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -79916,7 +80102,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [181 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [183 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIndexSignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -79924,7 +80110,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [182 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [184 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypePredicateNode(
node,
nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword),
@@ -79932,14 +80118,14 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [183 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [185 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeReferenceNode(
node,
nodeVisitor(node.typeName, visitor, isEntityName),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [184 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [186 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateFunctionTypeNode(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -79947,7 +80133,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [185 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [187 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructorTypeNode(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -79956,56 +80142,56 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [186 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [188 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeQueryNode(
node,
nodeVisitor(node.exprName, visitor, isEntityName),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [187 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [189 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeLiteralNode(
node,
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [188 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [190 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayTypeNode(
node,
nodeVisitor(node.elementType, visitor, isTypeNode)
);
},
- [189 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [191 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateTupleTypeNode(
node,
nodesVisitor(node.elements, visitor, isTypeNode)
);
},
- [190 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [192 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateOptionalTypeNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [191 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [193 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateRestTypeNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [192 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [194 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateUnionTypeNode(
node,
nodesVisitor(node.types, visitor, isTypeNode)
);
},
- [193 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [195 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateIntersectionTypeNode(
node,
nodesVisitor(node.types, visitor, isTypeNode)
);
},
- [194 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [196 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConditionalTypeNode(
node,
nodeVisitor(node.checkType, visitor, isTypeNode),
@@ -80014,13 +80200,13 @@ var visitEachChildTable = {
nodeVisitor(node.falseType, visitor, isTypeNode)
);
},
- [195 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [197 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateInferTypeNode(
node,
nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)
);
},
- [205 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [207 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportTypeNode(
node,
nodeVisitor(node.argument, visitor, isTypeNode),
@@ -80030,14 +80216,14 @@ var visitEachChildTable = {
node.isTypeOf
);
},
- [304 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [307 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportTypeAssertionContainer(
node,
nodeVisitor(node.assertClause, visitor, isAssertClause),
node.multiLine
);
},
- [202 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [204 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateNamedTupleMember(
node,
nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken),
@@ -80046,26 +80232,26 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [196 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [198 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateParenthesizedType(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [198 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [200 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeOperatorNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [199 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [201 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIndexedAccessTypeNode(
node,
nodeVisitor(node.objectType, visitor, isTypeNode),
nodeVisitor(node.indexType, visitor, isTypeNode)
);
},
- [200 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [202 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMappedTypeNode(
node,
nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken),
@@ -80076,39 +80262,39 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [201 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [203 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateLiteralTypeNode(
node,
nodeVisitor(node.literal, visitor, isExpression)
);
},
- [203 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [205 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateLiteralType(
node,
nodeVisitor(node.head, visitor, isTemplateHead),
nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan)
);
},
- [204 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [206 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateLiteralTypeSpan(
node,
nodeVisitor(node.type, visitor, isTypeNode),
nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)
);
},
- [206 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [208 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateObjectBindingPattern(
node,
nodesVisitor(node.elements, visitor, isBindingElement)
);
},
- [207 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [209 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayBindingPattern(
node,
nodesVisitor(node.elements, visitor, isArrayBindingElement)
);
},
- [208 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [210 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateBindingElement(
node,
nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken),
@@ -80117,19 +80303,19 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [209 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [211 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayLiteralExpression(
node,
nodesVisitor(node.elements, visitor, isExpression)
);
},
- [210 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [212 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateObjectLiteralExpression(
node,
nodesVisitor(node.properties, visitor, isObjectLiteralElementLike)
);
},
- [211 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [213 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -80141,7 +80327,7 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isMemberName)
);
},
- [212 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [214 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return isElementAccessChain(node) ? context.factory.updateElementAccessChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -80153,7 +80339,7 @@ var visitEachChildTable = {
nodeVisitor(node.argumentExpression, visitor, isExpression)
);
},
- [213 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [215 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return isCallChain(node) ? context.factory.updateCallChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -80167,7 +80353,7 @@ var visitEachChildTable = {
nodesVisitor(node.arguments, visitor, isExpression)
);
},
- [220 /* EtsComponentExpression */]: function visitEachChildOfEtsComponentExpression(node, visitor, context, nodesVisitor, nodeVisitor) {
+ [222 /* EtsComponentExpression */]: function visitEachChildOfEtsComponentExpression(node, visitor, context, nodesVisitor, nodeVisitor) {
return context.factory.updateEtsComponentExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -80175,7 +80361,7 @@ var visitEachChildTable = {
nodeVisitor(node.body, visitor, isBlock)
);
},
- [214 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [216 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNewExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -80183,7 +80369,7 @@ var visitEachChildTable = {
nodesVisitor(node.arguments, visitor, isExpression)
);
},
- [215 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [217 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTaggedTemplateExpression(
node,
nodeVisitor(node.tag, visitor, isExpression),
@@ -80191,20 +80377,20 @@ var visitEachChildTable = {
nodeVisitor(node.template, visitor, isTemplateLiteral)
);
},
- [216 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [218 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeAssertion(
node,
nodeVisitor(node.type, visitor, isTypeNode),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [217 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [219 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateParenthesizedExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [218 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [220 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateFunctionExpression(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -80216,7 +80402,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [219 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [221 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateArrowFunction(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -80227,43 +80413,43 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [221 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [223 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDeleteExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [222 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [224 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeOfExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [223 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [225 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateVoidExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [224 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [226 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAwaitExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [225 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [227 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePrefixUnaryExpression(
node,
nodeVisitor(node.operand, visitor, isExpression)
);
},
- [226 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [228 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePostfixUnaryExpression(
node,
nodeVisitor(node.operand, visitor, isExpression)
);
},
- [227 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [229 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateBinaryExpression(
node,
nodeVisitor(node.left, visitor, isExpression),
@@ -80271,7 +80457,7 @@ var visitEachChildTable = {
nodeVisitor(node.right, visitor, isExpression)
);
},
- [228 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [230 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateConditionalExpression(
node,
nodeVisitor(node.condition, visitor, isExpression),
@@ -80281,27 +80467,27 @@ var visitEachChildTable = {
nodeVisitor(node.whenFalse, visitor, isExpression)
);
},
- [229 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [231 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateExpression(
node,
nodeVisitor(node.head, visitor, isTemplateHead),
nodesVisitor(node.templateSpans, visitor, isTemplateSpan)
);
},
- [230 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [232 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateYieldExpression(
node,
nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [231 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [233 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSpreadElement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [232 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [234 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateClassExpression(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -80311,28 +80497,28 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [234 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [236 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExpressionWithTypeArguments(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [235 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [237 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAsExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [239 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [241 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSatisfiesExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [236 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [238 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return isOptionalChain(node) ? context.factory.updateNonNullChain(
node,
nodeVisitor(node.expression, visitor, isExpression)
@@ -80341,39 +80527,39 @@ var visitEachChildTable = {
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [237 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [239 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateMetaProperty(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [240 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [242 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateSpan(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)
);
},
- [242 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [244 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateBlock(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [244 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [246 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateVariableStatement(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)
);
},
- [245 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [247 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExpressionStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [246 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [248 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIfStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -80381,21 +80567,21 @@ var visitEachChildTable = {
nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [247 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [249 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDoStatement(
node,
visitIterationBody(node.statement, visitor, context, nodeVisitor),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [248 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [250 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateWhileStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [249 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [251 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateForStatement(
node,
nodeVisitor(node.initializer, visitor, isForInitializer),
@@ -80404,7 +80590,7 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [250 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [252 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateForInStatement(
node,
nodeVisitor(node.initializer, visitor, isForInitializer),
@@ -80412,7 +80598,7 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [251 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [253 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateForOfStatement(
node,
nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword),
@@ -80421,52 +80607,52 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [252 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [254 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateContinueStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier)
);
},
- [253 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [255 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateBreakStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier)
);
},
- [254 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [256 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateReturnStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [255 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [257 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateWithStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [256 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [258 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSwitchStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.caseBlock, visitor, isCaseBlock)
);
},
- [257 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [259 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateLabeledStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier),
nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [258 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [260 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateThrowStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [259 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [261 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTryStatement(
node,
nodeVisitor(node.tryBlock, visitor, isBlock),
@@ -80474,7 +80660,7 @@ var visitEachChildTable = {
nodeVisitor(node.finallyBlock, visitor, isBlock)
);
},
- [261 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [263 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateVariableDeclaration(
node,
nodeVisitor(node.name, visitor, isBindingName),
@@ -80483,13 +80669,13 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [262 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [264 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateVariableDeclarationList(
node,
nodesVisitor(node.declarations, visitor, isVariableDeclaration)
);
},
- [263 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [265 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateFunctionDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -80501,7 +80687,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [264 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [266 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateClassDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -80511,7 +80697,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [265 /* StructDeclaration */]: function visitEachChildOfStructDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [267 /* StructDeclaration */]: function visitEachChildOfStructDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateStructDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -80521,7 +80707,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [266 /* AnnotationDeclaration */]: function visitEachChildOfAnnotationDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [268 /* AnnotationDeclaration */]: function visitEachChildOfAnnotationDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAnnotationDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -80529,7 +80715,15 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isAnnotationElement)
);
},
- [267 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [269 /* OverloadDeclaration */]: function visitEachChildOfOverloadDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ return context.factory.updateOverloadDeclaration(
+ node,
+ nodesVisitor(node.modifiers, visitor, isModifier),
+ nodeVisitor(node.name, visitor, isIdentifier),
+ nodesVisitor(node.members, visitor, isOverloadElement)
+ );
+ },
+ [270 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateInterfaceDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -80539,7 +80733,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [268 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [271 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeAliasDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -80548,7 +80742,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [269 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [272 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateEnumDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -80556,7 +80750,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isEnumMember)
);
},
- [270 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [273 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateModuleDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -80564,25 +80758,25 @@ var visitEachChildTable = {
nodeVisitor(node.body, visitor, isModuleBody)
);
},
- [271 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [274 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateModuleBlock(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [272 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [275 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateCaseBlock(
node,
nodesVisitor(node.clauses, visitor, isCaseOrDefaultClause)
);
},
- [273 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [276 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceExportDeclaration(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [274 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [277 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportEqualsDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -80591,7 +80785,7 @@ var visitEachChildTable = {
nodeVisitor(node.moduleReference, visitor, isModuleReference)
);
},
- [275 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [278 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -80600,21 +80794,21 @@ var visitEachChildTable = {
nodeVisitor(node.assertClause, visitor, isAssertClause)
);
},
- [302 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [305 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateAssertClause(
node,
nodesVisitor(node.elements, visitor, isAssertEntry),
node.multiLine
);
},
- [303 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [306 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAssertEntry(
node,
nodeVisitor(node.name, visitor, isAssertionKey),
nodeVisitor(node.value, visitor, isExpression)
);
},
- [276 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [279 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportClause(
node,
node.isTypeOnly,
@@ -80622,25 +80816,25 @@ var visitEachChildTable = {
nodeVisitor(node.namedBindings, visitor, isNamedImportBindings)
);
},
- [277 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [280 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceImport(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [283 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [286 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceExport(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [278 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [281 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateNamedImports(
node,
nodesVisitor(node.elements, visitor, isImportSpecifier)
);
},
- [279 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [282 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportSpecifier(
node,
node.isTypeOnly,
@@ -80648,14 +80842,14 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [280 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [283 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportAssignment(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [281 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [284 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -80665,13 +80859,13 @@ var visitEachChildTable = {
nodeVisitor(node.assertClause, visitor, isAssertClause)
);
},
- [282 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [285 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateNamedExports(
node,
nodesVisitor(node.elements, visitor, isExportSpecifier)
);
},
- [284 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [287 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportSpecifier(
node,
node.isTypeOnly,
@@ -80679,13 +80873,13 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [286 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [289 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExternalModuleReference(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [287 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [290 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxElement(
node,
nodeVisitor(node.openingElement, visitor, isJsxOpeningElement),
@@ -80693,7 +80887,7 @@ var visitEachChildTable = {
nodeVisitor(node.closingElement, visitor, isJsxClosingElement)
);
},
- [288 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [291 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxSelfClosingElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression),
@@ -80701,7 +80895,7 @@ var visitEachChildTable = {
nodeVisitor(node.attributes, visitor, isJsxAttributes)
);
},
- [289 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [292 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxOpeningElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression),
@@ -80709,13 +80903,13 @@ var visitEachChildTable = {
nodeVisitor(node.attributes, visitor, isJsxAttributes)
);
},
- [290 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [293 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxClosingElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)
);
},
- [291 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [294 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxFragment(
node,
nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment),
@@ -80723,97 +80917,97 @@ var visitEachChildTable = {
nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)
);
},
- [294 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [297 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxAttribute(
node,
nodeVisitor(node.name, visitor, isIdentifier),
nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression)
);
},
- [295 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [298 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxAttributes(
node,
nodesVisitor(node.properties, visitor, isJsxAttributeLike)
);
},
- [296 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [299 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxSpreadAttribute(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [297 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [300 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [298 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [301 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCaseClause(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [299 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [302 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateDefaultClause(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [300 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [303 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateHeritageClause(
node,
nodesVisitor(node.types, visitor, isExpressionWithTypeArguments)
);
},
- [301 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [304 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCatchClause(
node,
nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration),
nodeVisitor(node.block, visitor, isBlock)
);
},
- [305 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [308 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePropertyAssignment(
node,
nodeVisitor(node.name, visitor, isPropertyName),
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [306 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [309 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateShorthandPropertyAssignment(
node,
nodeVisitor(node.name, visitor, isIdentifier),
nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression)
);
},
- [307 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [310 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSpreadAssignment(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [308 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [311 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateEnumMember(
node,
nodeVisitor(node.name, visitor, isPropertyName),
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [314 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [317 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateSourceFile(
node,
visitLexicalEnvironment(node.statements, visitor, context)
);
},
- [359 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [362 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePartiallyEmittedExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [360 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [363 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateCommaListExpression(
node,
nodesVisitor(node.elements, visitor, isExpression)
@@ -81387,7 +81581,7 @@ function isNamedDefaultReference(e) {
function chainBundle(context, transformSourceFile) {
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- return node.kind === 314 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
+ return node.kind === 317 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
}
function transformBundle(node) {
return context.factory.createBundle(map(node.sourceFiles, transformSourceFile), node.prepends);
@@ -81430,7 +81624,7 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
let hasImportDefault = false;
for (const node of sourceFile.statements) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
externalImports.push(node);
if (!hasImportStar && getImportNeedsImportStarHelper(node)) {
hasImportStar = true;
@@ -81439,12 +81633,12 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
hasImportDefault = true;
}
break;
- case 274 /* ImportEqualsDeclaration */:
- if (node.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ case 277 /* ImportEqualsDeclaration */:
+ if (node.moduleReference.kind === 289 /* ExternalModuleReference */) {
externalImports.push(node);
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
if (node.moduleSpecifier) {
if (!node.exportClause) {
externalImports.push(node);
@@ -81467,19 +81661,19 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
addExportedNamesForExportDeclaration(node);
}
break;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
if (node.isExportEquals && !exportEquals) {
exportEquals = node;
}
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (hasSyntacticModifier(node, 1 /* Export */)) {
for (const decl of node.declarationList.declarations) {
exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames);
}
}
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (hasSyntacticModifier(node, 1 /* Export */)) {
if (hasSyntacticModifier(node, 1024 /* Default */)) {
if (!hasExportDefault) {
@@ -81496,7 +81690,7 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
}
}
break;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
if (hasSyntacticModifier(node, 1 /* Export */)) {
if (hasSyntacticModifier(node, 1024 /* Default */)) {
if (!hasExportDefault) {
@@ -81640,7 +81834,7 @@ function isStaticPropertyDeclaration(member) {
return isPropertyDeclaration(member) && hasStaticModifier(member);
}
function isInitializedProperty(member) {
- return member.kind === 171 /* PropertyDeclaration */ && member.initializer !== void 0;
+ return member.kind === 172 /* PropertyDeclaration */ && member.initializer !== void 0;
}
function isNonStaticMethodOrAccessorWithPrivateName(member) {
return !isStatic(member) && (isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member)) && isPrivateIdentifier(member.name);
@@ -81677,12 +81871,12 @@ function getAllDecoratorsOfClass(node) {
}
function getAllDecoratorsOfClassElement(member, parent) {
switch (member.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return getAllDecoratorsOfAccessors(member, parent);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return getAllDecoratorsOfMethod(member);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return getAllDecoratorsOfProperty(member);
default:
return void 0;
@@ -82175,8 +82369,8 @@ function transformTypeScript(context) {
const previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(212 /* ElementAccessExpression */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(214 /* ElementAccessExpression */);
let currentSourceFile;
let currentNamespace;
let currentNamespaceContainerName;
@@ -82187,14 +82381,14 @@ function transformTypeScript(context) {
let applicableSubstitutions;
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- if (node.kind === 315 /* Bundle */) {
+ if (node.kind === 318 /* Bundle */) {
return transformBundle(node);
}
return transformSourceFile(node);
}
function transformBundle(node) {
return factory2.createBundle(node.sourceFiles.map(transformSourceFile), mapDefined(node.prepends, (prepend) => {
- if (prepend.kind === 317 /* InputFiles */) {
+ if (prepend.kind === 320 /* InputFiles */) {
return createUnparsedSourceFile(prepend, "js");
}
return prepend;
@@ -82225,22 +82419,22 @@ function transformTypeScript(context) {
}
function onBeforeVisitNode(node) {
switch (node.kind) {
- case 314 /* SourceFile */:
- case 272 /* CaseBlock */:
- case 271 /* ModuleBlock */:
- case 242 /* Block */:
+ case 317 /* SourceFile */:
+ case 275 /* CaseBlock */:
+ case 274 /* ModuleBlock */:
+ case 244 /* Block */:
currentLexicalScope = node;
currentScopeFirstDeclarationsOfName = void 0;
break;
- case 264 /* ClassDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (hasSyntacticModifier(node, 2 /* Ambient */)) {
break;
}
if (node.name) {
recordEmittedDeclarationInScope(node);
} else {
- Debug.assert(node.kind === 264 /* ClassDeclaration */ || hasSyntacticModifier(node, 1024 /* Default */));
+ Debug.assert(node.kind === 266 /* ClassDeclaration */ || hasSyntacticModifier(node, 1024 /* Default */));
}
break;
}
@@ -82259,10 +82453,10 @@ function transformTypeScript(context) {
}
function sourceElementVisitorWorker(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 280 /* ExportAssignment */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 284 /* ExportDeclaration */:
return visitElidableStatement(node);
default:
return visitorWorker(node);
@@ -82280,13 +82474,13 @@ function transformTypeScript(context) {
return node;
}
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
default:
Debug.fail("Unhandled ellided statement");
@@ -82296,7 +82490,7 @@ function transformTypeScript(context) {
return saveStateAndInvoke(node, namespaceElementVisitorWorker);
}
function namespaceElementVisitorWorker(node) {
- if (node.kind === 281 /* ExportDeclaration */ || node.kind === 275 /* ImportDeclaration */ || node.kind === 276 /* ImportClause */ || node.kind === 274 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ if (node.kind === 284 /* ExportDeclaration */ || node.kind === 278 /* ImportDeclaration */ || node.kind === 279 /* ImportClause */ || node.kind === 277 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 289 /* ExternalModuleReference */) {
return void 0;
} else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 1 /* Export */)) {
return visitTypeScript(node);
@@ -82308,21 +82502,21 @@ function transformTypeScript(context) {
}
function classElementVisitorWorker(node, parent) {
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return visitConstructor(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return visitPropertyDeclaration(node, parent);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return visitGetAccessor(node, parent);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return visitSetAccessor(node, parent);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node, parent);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return visitEachChild(node, visitor, context);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return node;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return;
default:
return Debug.failBadSyntaxKind(node);
@@ -82333,15 +82527,15 @@ function transformTypeScript(context) {
}
function objectLiteralElementVisitorWorker(node, parent) {
switch (node.kind) {
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return visitor(node);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return visitGetAccessor(node, parent);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return visitSetAccessor(node, parent);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node, parent);
default:
return Debug.failBadSyntaxKind(node);
@@ -82376,13 +82570,13 @@ function transformTypeScript(context) {
case 147 /* ReadonlyKeyword */:
case 102 /* InKeyword */:
case 146 /* OutKeyword */:
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
- case 190 /* OptionalType */:
- case 191 /* RestType */:
- case 187 /* TypeLiteral */:
- case 182 /* TypePredicate */:
- case 167 /* TypeParameter */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
+ case 192 /* OptionalType */:
+ case 193 /* RestType */:
+ case 189 /* TypeLiteral */:
+ case 184 /* TypePredicate */:
+ case 168 /* TypeParameter */:
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
case 135 /* BooleanKeyword */:
@@ -82391,83 +82585,86 @@ function transformTypeScript(context) {
case 145 /* NeverKeyword */:
case 115 /* VoidKeyword */:
case 154 /* SymbolKeyword */:
- case 185 /* ConstructorType */:
- case 184 /* FunctionType */:
- case 186 /* TypeQuery */:
- case 183 /* TypeReference */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 194 /* ConditionalType */:
- case 196 /* ParenthesizedType */:
- case 197 /* ThisType */:
- case 198 /* TypeOperator */:
- case 199 /* IndexedAccessType */:
- case 200 /* MappedType */:
- case 201 /* LiteralType */:
- case 181 /* IndexSignature */:
+ case 187 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 188 /* TypeQuery */:
+ case 185 /* TypeReference */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 196 /* ConditionalType */:
+ case 198 /* ParenthesizedType */:
+ case 199 /* ThisType */:
+ case 200 /* TypeOperator */:
+ case 201 /* IndexedAccessType */:
+ case 202 /* MappedType */:
+ case 203 /* LiteralType */:
+ case 183 /* IndexSignature */:
return void 0;
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return factory2.createNotEmittedStatement(node);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return void 0;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return factory2.createNotEmittedStatement(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ return factory2.createNotEmittedStatement(node);
+ case 269 /* OverloadDeclaration */:
return factory2.createNotEmittedStatement(node);
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return visitHeritageClause(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return visitExpressionWithTypeArguments(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
return Debug.fail("Class and object literal elements must be visited with their respective visitors");
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return visitArrowFunction(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameter(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node);
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return visitAssertionExpression(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return visitSatisfiesExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return visitNewExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return visitNonNullExpression(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return visitEnumDeclaration(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return visitVariableDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return visitModuleDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return visitJsxSelfClosingElement(node);
- case 289 /* JsxOpeningElement */:
+ case 292 /* JsxOpeningElement */:
return visitJsxJsxOpeningElement(node);
default:
return visitEachChild(node, visitor, context);
@@ -82699,19 +82896,19 @@ function transformTypeScript(context) {
}
function shouldAddTypeMetadata(node) {
const kind = node.kind;
- return kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 171 /* PropertyDeclaration */;
+ return kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 172 /* PropertyDeclaration */;
}
function shouldAddReturnTypeMetadata(node) {
- return node.kind === 174 /* MethodDeclaration */;
+ return node.kind === 176 /* MethodDeclaration */;
}
function shouldAddParamTypesMetadata(node) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return getFirstConstructorWithBody(node) !== void 0;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
}
return false;
@@ -83244,12 +83441,12 @@ function transformTypeScript(context) {
factory2.createVariableDeclaration(
factory2.getLocalName(node, false, true)
)
- ], currentLexicalScope.kind === 314 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)
+ ], currentLexicalScope.kind === 317 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)
);
setOriginalNode(statement, node);
recordEmittedDeclarationInScope(node);
if (isFirstEmittedDeclarationInScope(node)) {
- if (node.kind === 269 /* EnumDeclaration */) {
+ if (node.kind === 272 /* EnumDeclaration */) {
setSourceMapRange(statement.declarationList, node);
} else {
setSourceMapRange(statement, node);
@@ -83331,7 +83528,7 @@ function transformTypeScript(context) {
let statementsLocation;
let blockLocation;
if (node.body) {
- if (node.body.kind === 271 /* ModuleBlock */) {
+ if (node.body.kind === 274 /* ModuleBlock */) {
saveStateAndInvoke(node.body, (body) => addRange(statements, visitNodes2(body.statements, namespaceElementVisitor, isStatement)));
statementsLocation = node.body.statements;
blockLocation = node.body;
@@ -83360,13 +83557,13 @@ function transformTypeScript(context) {
true
);
setTextRange(block, blockLocation);
- if (!node.body || node.body.kind !== 271 /* ModuleBlock */) {
+ if (!node.body || node.body.kind !== 274 /* ModuleBlock */) {
setEmitFlags(block, getEmitFlags(block) | 1536 /* NoComments */);
}
return block;
}
function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) {
- if (moduleDeclaration.body.kind === 270 /* ModuleDeclaration */) {
+ if (moduleDeclaration.body.kind === 273 /* ModuleDeclaration */) {
const recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body);
return recursiveInnerModule || moduleDeclaration.body;
}
@@ -83394,7 +83591,7 @@ function transformTypeScript(context) {
return name || namedBindings ? factory2.updateImportClause(node, false, name, namedBindings) : void 0;
}
function visitNamedImportBindings(node) {
- if (node.kind === 277 /* NamespaceImport */) {
+ if (node.kind === 280 /* NamespaceImport */) {
return shouldEmitAliasDeclaration(node) ? node : void 0;
} else {
const allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */);
@@ -83564,15 +83761,15 @@ function transformTypeScript(context) {
if ((enabledSubstitutions & 2 /* NamespaceExports */) === 0) {
enabledSubstitutions |= 2 /* NamespaceExports */;
context.enableSubstitution(79 /* Identifier */);
- context.enableSubstitution(306 /* ShorthandPropertyAssignment */);
- context.enableEmitNotification(270 /* ModuleDeclaration */);
+ context.enableSubstitution(309 /* ShorthandPropertyAssignment */);
+ context.enableEmitNotification(273 /* ModuleDeclaration */);
}
}
function isTransformedModuleDeclaration(node) {
- return getOriginalNode(node).kind === 270 /* ModuleDeclaration */;
+ return getOriginalNode(node).kind === 273 /* ModuleDeclaration */;
}
function isTransformedEnumDeclaration(node) {
- return getOriginalNode(node).kind === 269 /* EnumDeclaration */;
+ return getOriginalNode(node).kind === 272 /* EnumDeclaration */;
}
function onEmitNode(hint, node, emitCallback) {
const savedApplicableSubstitutions = applicableSubstitutions;
@@ -83617,9 +83814,9 @@ function transformTypeScript(context) {
switch (node.kind) {
case 79 /* Identifier */:
return substituteExpressionIdentifier(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return substitutePropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return substituteElementAccessExpression(node);
}
return node;
@@ -83630,8 +83827,8 @@ function transformTypeScript(context) {
function trySubstituteNamespaceExportedName(node) {
if (enabledSubstitutions & applicableSubstitutions && !isGeneratedIdentifier(node) && !isLocalName(node)) {
const container = resolver.getReferencedExportContainer(node, false);
- if (container && container.kind !== 314 /* SourceFile */) {
- const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 270 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 269 /* EnumDeclaration */;
+ if (container && container.kind !== 317 /* SourceFile */) {
+ const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 273 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 272 /* EnumDeclaration */;
if (substitute) {
return setTextRange(
factory2.createPropertyAccessExpression(factory2.getGeneratedNameForNode(container), node),
@@ -83746,45 +83943,49 @@ function transformClassFields(context) {
switch (node.kind) {
case 128 /* AccessorKeyword */:
return shouldTransformAutoAccessors ? void 0 : node;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return void 0;
- case 232 /* ClassExpression */:
+ case 269 /* OverloadDeclaration */:
+ return void 0;
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return visitClassStaticBlockDeclaration(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return visitPropertyDeclaration(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ return void 0;
+ case 174 /* OverloadPropertyDeclaration */:
return void 0;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
case 80 /* PrivateIdentifier */:
return visitPrivateIdentifier(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return visitPropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitElementAccessExpression(node);
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPreOrPostfixUnaryExpression(node, false);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, false);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */: {
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */: {
return setCurrentStaticPropertyDeclarationOrStaticBlockAnd(
void 0,
fallbackVisitor,
@@ -83800,10 +84001,10 @@ function transformClassFields(context) {
}
function discardedValueVisitor(node) {
switch (node.kind) {
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPreOrPostfixUnaryExpression(node, true);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, true);
default:
return visitor(node);
@@ -83811,9 +84012,9 @@ function transformClassFields(context) {
}
function heritageClauseVisitor(node) {
switch (node.kind) {
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return visitEachChild(node, heritageClauseVisitor, context);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return visitExpressionWithTypeArgumentsInHeritageClause(node);
default:
return visitor(node);
@@ -83821,8 +84022,8 @@ function transformClassFields(context) {
}
function assignmentTargetVisitor(node) {
switch (node.kind) {
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return visitAssignmentPattern(node);
default:
return visitor(node);
@@ -83830,25 +84031,25 @@ function transformClassFields(context) {
}
function classElementVisitor(node) {
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return visitConstructorDeclaration(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
return setCurrentStaticPropertyDeclarationOrStaticBlockAnd(
void 0,
visitMethodOrAccessorDeclaration,
node
);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return setCurrentStaticPropertyDeclarationOrStaticBlockAnd(
void 0,
visitPropertyDeclaration,
node
);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return visitComputedPropertyName(node);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return node;
default:
return visitor(node);
@@ -83856,10 +84057,10 @@ function transformClassFields(context) {
}
function accessorFieldResultVisitor(node) {
switch (node.kind) {
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return transformFieldInitializer(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return classElementVisitor(node);
default:
Debug.assertMissingNode(node, "Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration");
@@ -84943,14 +85144,14 @@ function transformClassFields(context) {
if ((enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */) === 0) {
enabledSubstitutions |= 2 /* ClassStaticThisOrSuperReference */;
context.enableSubstitution(109 /* ThisKeyword */);
- context.enableEmitNotification(263 /* FunctionDeclaration */);
- context.enableEmitNotification(218 /* FunctionExpression */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(171 /* PropertyDeclaration */);
- context.enableEmitNotification(166 /* ComputedPropertyName */);
+ context.enableEmitNotification(265 /* FunctionDeclaration */);
+ context.enableEmitNotification(220 /* FunctionExpression */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(172 /* PropertyDeclaration */);
+ context.enableEmitNotification(167 /* ComputedPropertyName */);
}
}
function addMethodStatements(statements, methods, receiver) {
@@ -84992,12 +85193,12 @@ function transformClassFields(context) {
}
}
switch (node.kind) {
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
if (isArrowFunction(original) || getEmitFlags(node) & 262144 /* AsyncFunctionBody */) {
break;
}
- case 263 /* FunctionDeclaration */:
- case 176 /* Constructor */: {
+ case 265 /* FunctionDeclaration */:
+ case 178 /* Constructor */: {
const savedClassLexicalEnvironment = currentClassLexicalEnvironment;
const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
currentClassLexicalEnvironment = void 0;
@@ -85007,10 +85208,10 @@ function transformClassFields(context) {
currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment;
return;
}
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- case 171 /* PropertyDeclaration */: {
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 172 /* PropertyDeclaration */: {
const savedClassLexicalEnvironment = currentClassLexicalEnvironment;
const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
currentComputedPropertyNameClassLexicalEnvironment = currentClassLexicalEnvironment;
@@ -85020,7 +85221,7 @@ function transformClassFields(context) {
currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment;
return;
}
- case 166 /* ComputedPropertyName */: {
+ case 167 /* ComputedPropertyName */: {
const savedClassLexicalEnvironment = currentClassLexicalEnvironment;
const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
currentClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
@@ -85494,15 +85695,15 @@ function createRuntimeTypeSerializer(context) {
}
function serializeTypeOfNode(node) {
switch (node.kind) {
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
return serializeTypeNode(node.type);
- case 178 /* SetAccessor */:
- case 177 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 179 /* GetAccessor */:
return serializeTypeNode(getAccessorTypeNode(node));
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 174 /* MethodDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 176 /* MethodDeclaration */:
return factory.createIdentifier("Function");
default:
return factory.createVoidZero();
@@ -85529,7 +85730,7 @@ function createRuntimeTypeSerializer(context) {
return factory.createArrayLiteralExpression(expressions);
}
function getParametersOfDecoratedDeclaration(node, container) {
- if (container && node.kind === 177 /* GetAccessor */) {
+ if (container && node.kind === 179 /* GetAccessor */) {
const { setAccessor } = getAllAccessorDeclarations(container.members, node);
if (setAccessor) {
return setAccessor.parameters;
@@ -85555,22 +85756,22 @@ function createRuntimeTypeSerializer(context) {
case 157 /* UndefinedKeyword */:
case 145 /* NeverKeyword */:
return factory.createVoidZero();
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return factory.createIdentifier("Function");
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
return factory.createIdentifier("Array");
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return node.assertsModifier ? factory.createVoidZero() : factory.createIdentifier("Boolean");
case 135 /* BooleanKeyword */:
return factory.createIdentifier("Boolean");
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
case 153 /* StringKeyword */:
return factory.createIdentifier("String");
case 150 /* ObjectKeyword */:
return factory.createIdentifier("Object");
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return serializeLiteralOfLiteralTypeNode(node.literal);
case 149 /* NumberKeyword */:
return factory.createIdentifier("Number");
@@ -85578,37 +85779,37 @@ function createRuntimeTypeSerializer(context) {
return getGlobalConstructor("BigInt", 7 /* ES2020 */);
case 154 /* SymbolKeyword */:
return getGlobalConstructor("Symbol", 2 /* ES2015 */);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return serializeTypeReferenceNode(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return serializeUnionOrIntersectionConstituents(node.types, true);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return serializeUnionOrIntersectionConstituents(node.types, false);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return serializeUnionOrIntersectionConstituents([node.trueType, node.falseType], false);
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
if (node.operator === 147 /* ReadonlyKeyword */) {
return serializeTypeNode(node.type);
}
break;
- case 186 /* TypeQuery */:
- case 199 /* IndexedAccessType */:
- case 200 /* MappedType */:
- case 187 /* TypeLiteral */:
+ case 188 /* TypeQuery */:
+ case 201 /* IndexedAccessType */:
+ case 202 /* MappedType */:
+ case 189 /* TypeLiteral */:
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
- case 197 /* ThisType */:
- case 205 /* ImportType */:
+ case 199 /* ThisType */:
+ case 207 /* ImportType */:
break;
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
- case 326 /* JSDocFunctionType */:
- case 327 /* JSDocVariadicType */:
- case 328 /* JSDocNamepathType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
+ case 329 /* JSDocFunctionType */:
+ case 330 /* JSDocVariadicType */:
+ case 331 /* JSDocNamepathType */:
break;
- case 323 /* JSDocNullableType */:
- case 324 /* JSDocNonNullableType */:
- case 325 /* JSDocOptionalType */:
+ case 326 /* JSDocNullableType */:
+ case 327 /* JSDocNonNullableType */:
+ case 328 /* JSDocOptionalType */:
return serializeTypeNode(node.type);
default:
return Debug.failBadSyntaxKind(node);
@@ -85620,7 +85821,7 @@ function createRuntimeTypeSerializer(context) {
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return factory.createIdentifier("String");
- case 225 /* PrefixUnaryExpression */: {
+ case 227 /* PrefixUnaryExpression */: {
const operand = node.operand;
switch (operand.kind) {
case 8 /* NumericLiteral */:
@@ -85753,7 +85954,7 @@ function createRuntimeTypeSerializer(context) {
name.original = void 0;
setParent(name, getParseTreeNode(currentLexicalScope));
return name;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return serializeQualifiedNameAsExpression(node);
}
}
@@ -85801,23 +86002,23 @@ function transformLegacyDecorators(context) {
return node;
}
switch (node.kind) {
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return void 0;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return visitConstructorDeclaration(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return visitSetAccessorDeclaration(node);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return visitGetAccessorDeclaration(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return visitPropertyDeclaration(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameterDeclaration(node);
default:
return visitEachChild(node, visitor, context);
@@ -86235,34 +86436,34 @@ function transformES2017(context) {
switch (node.kind) {
case 133 /* AsyncKeyword */:
return void 0;
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return visitAwaitExpression(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 107 /* SuperKeyword */) {
capturedSuperProperties.add(node.name.escapedText);
}
return visitEachChild(node, visitor, context);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (capturedSuperProperties && node.expression.kind === 107 /* SuperKeyword */) {
hasSuperElementAccess = true;
}
return visitEachChild(node, visitor, context);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitGetAccessorDeclaration, node);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitSetAccessorDeclaration, node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitConstructorDeclaration, node);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node);
default:
return visitEachChild(node, visitor, context);
@@ -86271,27 +86472,27 @@ function transformES2017(context) {
function asyncBodyVisitor(node) {
if (isNodeWithPossibleHoistedDeclaration(node)) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatementInAsyncBody(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatementInAsyncBody(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatementInAsyncBody(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatementInAsyncBody(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClauseInAsyncBody(node);
- case 242 /* Block */:
- case 256 /* SwitchStatement */:
- case 272 /* CaseBlock */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 259 /* TryStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 246 /* IfStatement */:
- case 255 /* WithStatement */:
- case 257 /* LabeledStatement */:
+ case 244 /* Block */:
+ case 258 /* SwitchStatement */:
+ case 275 /* CaseBlock */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 261 /* TryStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 248 /* IfStatement */:
+ case 257 /* WithStatement */:
+ case 259 /* LabeledStatement */:
return visitEachChild(node, asyncBodyVisitor, context);
default:
return Debug.assertNever(node, "Unhandled node.");
@@ -86541,7 +86742,7 @@ function transformES2017(context) {
const original = getOriginalNode(node, isFunctionLike);
const nodeType = original.type;
const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
- const isArrowFunction2 = node.kind === 219 /* ArrowFunction */;
+ const isArrowFunction2 = node.kind === 221 /* ArrowFunction */;
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0;
const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
enclosingFunctionParameterNames = new Set2();
@@ -86630,15 +86831,15 @@ function transformES2017(context) {
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) {
enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */;
- context.enableSubstitution(213 /* CallExpression */);
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(212 /* ElementAccessExpression */);
- context.enableEmitNotification(264 /* ClassDeclaration */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(244 /* VariableStatement */);
+ context.enableSubstitution(215 /* CallExpression */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(214 /* ElementAccessExpression */);
+ context.enableEmitNotification(266 /* ClassDeclaration */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(246 /* VariableStatement */);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -86669,11 +86870,11 @@ function transformES2017(context) {
}
function substituteExpression(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return substitutePropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return substituteElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return substituteCallExpression(node);
}
return node;
@@ -86716,7 +86917,7 @@ function transformES2017(context) {
}
function isSuperContainer(node) {
const kind = node.kind;
- return kind === 264 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 266 /* ClassDeclaration */ || kind === 178 /* Constructor */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
if (enclosingSuperContainerFlags & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
@@ -86943,115 +87144,115 @@ function transformES2018(context) {
return node;
}
switch (node.kind) {
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return visitAwaitExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return visitYieldExpression(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitReturnStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, expressionResultIsUnused2);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return visitCommaListExpression(node, expressionResultIsUnused2);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return visitVariableDeclaration(node);
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 250 /* ForInStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 252 /* ForInStatement */:
return doWithHierarchyFacts(
visitDefault,
node,
0 /* IterationStatementExcludes */,
2 /* IterationStatementIncludes */
);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node, void 0);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return doWithHierarchyFacts(
visitForStatement,
node,
0 /* IterationStatementExcludes */,
2 /* IterationStatementIncludes */
);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return visitVoidExpression(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return doWithHierarchyFacts(
visitConstructorDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return doWithHierarchyFacts(
visitMethodDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return doWithHierarchyFacts(
visitGetAccessorDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return doWithHierarchyFacts(
visitSetAccessorDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return doWithHierarchyFacts(
visitFunctionDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return doWithHierarchyFacts(
visitFunctionExpression,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return doWithHierarchyFacts(
visitArrowFunction,
node,
2 /* ArrowFunctionExcludes */,
0 /* ArrowFunctionIncludes */
);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameter(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, expressionResultIsUnused2);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 107 /* SuperKeyword */) {
capturedSuperProperties.add(node.name.escapedText);
}
return visitEachChild(node, visitor, context);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (capturedSuperProperties && node.expression.kind === 107 /* SuperKeyword */) {
hasSuperElementAccess = true;
}
return visitEachChild(node, visitor, context);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return doWithHierarchyFacts(
visitDefault,
node,
@@ -87129,7 +87330,7 @@ function transformES2018(context) {
function visitLabeledStatement(node) {
if (enclosingFunctionFlags & 2 /* Async */) {
const statement = unwrapInnermostStatementOfLabel(node);
- if (statement.kind === 251 /* ForOfStatement */ && statement.awaitModifier) {
+ if (statement.kind === 253 /* ForOfStatement */ && statement.awaitModifier) {
return visitForOfStatement(statement, node);
}
return factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node);
@@ -87140,7 +87341,7 @@ function transformES2018(context) {
let chunkObject;
const objects = [];
for (const e of elements) {
- if (e.kind === 307 /* SpreadAssignment */) {
+ if (e.kind === 310 /* SpreadAssignment */) {
if (chunkObject) {
objects.push(factory2.createObjectLiteralExpression(chunkObject));
chunkObject = void 0;
@@ -87148,7 +87349,7 @@ function transformES2018(context) {
const target = e.expression;
objects.push(visitNode(target, visitor, isExpression));
} else {
- chunkObject = append(chunkObject, e.kind === 305 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike));
+ chunkObject = append(chunkObject, e.kind === 308 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike));
}
}
if (chunkObject) {
@@ -87159,7 +87360,7 @@ function transformES2018(context) {
function visitObjectLiteralExpression(node) {
if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) {
const objects = chunkObjectLiteralElements(node.properties);
- if (objects.length && objects[0].kind !== 210 /* ObjectLiteralExpression */) {
+ if (objects.length && objects[0].kind !== 212 /* ObjectLiteralExpression */) {
objects.unshift(factory2.createObjectLiteralExpression());
}
let expression = objects[0];
@@ -87812,15 +88013,15 @@ function transformES2018(context) {
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) {
enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */;
- context.enableSubstitution(213 /* CallExpression */);
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(212 /* ElementAccessExpression */);
- context.enableEmitNotification(264 /* ClassDeclaration */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(244 /* VariableStatement */);
+ context.enableSubstitution(215 /* CallExpression */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(214 /* ElementAccessExpression */);
+ context.enableEmitNotification(266 /* ClassDeclaration */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(246 /* VariableStatement */);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -87851,11 +88052,11 @@ function transformES2018(context) {
}
function substituteExpression(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return substitutePropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return substituteElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return substituteCallExpression(node);
}
return node;
@@ -87898,7 +88099,7 @@ function transformES2018(context) {
}
function isSuperContainer(node) {
const kind = node.kind;
- return kind === 264 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 266 /* ClassDeclaration */ || kind === 178 /* Constructor */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
if (enclosingSuperContainerFlags & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
@@ -87941,7 +88142,7 @@ function transformES2019(context) {
return node;
}
switch (node.kind) {
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
default:
return visitEachChild(node, visitor, context);
@@ -87977,25 +88178,25 @@ function transformES2020(context) {
return node;
}
switch (node.kind) {
- case 213 /* CallExpression */: {
+ case 215 /* CallExpression */: {
const updated = visitNonOptionalCallExpression(node, false);
Debug.assertNotNode(updated, isSyntheticReference);
return updated;
}
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (isOptionalChain(node)) {
const updated = visitOptionalExpression(node, false, false);
Debug.assertNotNode(updated, isSyntheticReference);
return updated;
}
return visitEachChild(node, visitor, context);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) {
return transformNullishCoalescingExpression(node);
}
return visitEachChild(node, visitor, context);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return visitDeleteExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -88033,7 +88234,7 @@ function transformES2020(context) {
thisArg = expression;
}
}
- expression = node.kind === 211 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression));
+ expression = node.kind === 213 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression));
return thisArg ? factory2.createSyntheticReferenceExpression(expression, thisArg) : expression;
}
function visitNonOptionalCallExpression(node, captureThisArg) {
@@ -88052,12 +88253,12 @@ function transformES2020(context) {
}
function visitNonOptionalExpression(node, captureThisArg, isDelete) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitNonOptionalCallExpression(node, captureThisArg);
default:
return visitNode(node, visitor, isExpression);
@@ -88078,8 +88279,8 @@ function transformES2020(context) {
for (let i = 0; i < chain.length; i++) {
const segment = chain[i];
switch (segment.kind) {
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (i === chain.length - 1 && captureThisArg) {
if (!isSimpleCopiableExpression(rightExpression)) {
thisArg = factory2.createTempVariable(hoistVariableDeclaration);
@@ -88088,9 +88289,9 @@ function transformES2020(context) {
thisArg = rightExpression;
}
}
- rightExpression = segment.kind === 211 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression));
+ rightExpression = segment.kind === 213 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression));
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (i === 0 && leftThisArg) {
if (!isGeneratedIdentifier(leftThisArg)) {
leftThisArg = factory2.cloneNode(leftThisArg);
@@ -88169,7 +88370,7 @@ function transformES2021(context) {
return node;
}
switch (node.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const binaryExpression = node;
if (isLogicalOrCoalescingAssignmentExpression(binaryExpression)) {
return transformLogicalAssignment(binaryExpression);
@@ -88347,13 +88548,13 @@ function transformJsx(context) {
}
function visitorWorker(node) {
switch (node.kind) {
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return visitJsxElement(node, false);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return visitJsxSelfClosingElement(node, false);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return visitJsxFragment(node, false);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return visitJsxExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -88363,13 +88564,13 @@ function transformJsx(context) {
switch (node.kind) {
case 11 /* JsxText */:
return visitJsxText(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return visitJsxExpression(node);
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return visitJsxElement(node, true);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return visitJsxSelfClosingElement(node, true);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return visitJsxFragment(node, true);
default:
return Debug.failBadSyntaxKind(node);
@@ -88564,7 +88765,7 @@ function transformJsx(context) {
const literal = factory2.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote);
return setTextRange(literal, node);
}
- if (node.kind === 297 /* JsxExpression */) {
+ if (node.kind === 300 /* JsxExpression */) {
if (node.expression === void 0) {
return factory2.createTrue();
}
@@ -88626,7 +88827,7 @@ function transformJsx(context) {
return decoded === text ? void 0 : decoded;
}
function getTagName(node) {
- if (node.kind === 287 /* JsxElement */) {
+ if (node.kind === 290 /* JsxElement */) {
return getTagName(node.openingElement);
} else {
const name = node.tagName;
@@ -88925,7 +89126,7 @@ function transformES2016(context) {
return node;
}
switch (node.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -89129,7 +89330,7 @@ function transformES2015(context) {
hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -32768 /* SubtreeFactsMask */ | ancestorFacts;
}
function isReturnVoidStatementInConstructorWithCapturedSuper(node) {
- return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 && node.kind === 254 /* ReturnStatement */ && !node.expression;
+ return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 && node.kind === 256 /* ReturnStatement */ && !node.expression;
}
function isOrMayContainReturnCompletion(node) {
return node.transformFlags & 4194304 /* ContainsHoistedDeclarationOrCompletion */ && (isReturnStatement(node) || isIfStatement(node) || isWithStatement(node) || isSwitchStatement(node) || isCaseBlock(node) || isCaseClause(node) || isDefaultClause(node) || isTryStatement(node) || isCatchClause(node) || isLabeledStatement(node) || isIterationStatement(node, false) || isBlock(node));
@@ -89169,65 +89370,65 @@ function transformES2015(context) {
switch (node.kind) {
case 125 /* StaticKeyword */:
return void 0;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameter(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return visitArrowFunction(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return visitVariableDeclaration(node);
case 79 /* Identifier */:
return visitIdentifier(node);
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return visitVariableDeclarationList(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return visitSwitchStatement(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return visitCaseBlock(node);
- case 242 /* Block */:
+ case 244 /* Block */:
return visitBlock(node, false);
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
return visitBreakOrContinueStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return visitDoOrWhileStatement(node, void 0);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, void 0);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node, void 0);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node, void 0);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return visitShorthandPropertyAssignment(node);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return visitComputedPropertyName(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return visitArrayLiteralExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return visitNewExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, expressionResultIsUnused2);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, expressionResultIsUnused2);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return visitCommaListExpression(node, expressionResultIsUnused2);
case 14 /* NoSubstitutionTemplateLiteral */:
case 15 /* TemplateHead */:
@@ -89238,30 +89439,30 @@ function transformES2015(context) {
return visitStringLiteral(node);
case 8 /* NumericLiteral */:
return visitNumericLiteral(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return visitTemplateExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return visitYieldExpression(node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return visitSpreadElement(node);
case 107 /* SuperKeyword */:
return visitSuperKeyword(false);
case 109 /* ThisKeyword */:
return visitThisKeyword(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return visitMetaProperty(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return visitAccessorDeclaration(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitReturnStatement(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return visitVoidExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -89362,13 +89563,13 @@ function transformES2015(context) {
}
function visitBreakOrContinueStatement(node) {
if (convertedLoopState) {
- const jump = node.kind === 253 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */;
+ const jump = node.kind === 255 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */;
const canUseBreakOrContinue = node.label && convertedLoopState.labels && convertedLoopState.labels.get(idText(node.label)) || !node.label && convertedLoopState.allowedNonLabeledJumps & jump;
if (!canUseBreakOrContinue) {
let labelMarker;
const label = node.label;
if (!label) {
- if (node.kind === 253 /* BreakStatement */) {
+ if (node.kind === 255 /* BreakStatement */) {
convertedLoopState.nonLocalJumps |= 2 /* Break */;
labelMarker = "break";
} else {
@@ -89376,7 +89577,7 @@ function transformES2015(context) {
labelMarker = "continue";
}
} else {
- if (node.kind === 253 /* BreakStatement */) {
+ if (node.kind === 255 /* BreakStatement */) {
labelMarker = `break-${label.escapedText}`;
setLabeledJump(convertedLoopState, true, idText(label), labelMarker);
} else {
@@ -89620,14 +89821,14 @@ function transformES2015(context) {
};
}
function isSufficientlyCoveredByReturnStatements(statement) {
- if (statement.kind === 254 /* ReturnStatement */) {
+ if (statement.kind === 256 /* ReturnStatement */) {
return true;
- } else if (statement.kind === 246 /* IfStatement */) {
+ } else if (statement.kind === 248 /* IfStatement */) {
const ifStatement = statement;
if (ifStatement.elseStatement) {
return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement);
}
- } else if (statement.kind === 242 /* Block */) {
+ } else if (statement.kind === 244 /* Block */) {
const lastStatement = lastOrUndefined(statement.statements);
if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {
return true;
@@ -89869,7 +90070,7 @@ function transformES2015(context) {
return true;
}
function insertCaptureThisForNodeIfNeeded(statements, node) {
- if (hierarchyFacts & 65536 /* CapturedLexicalThis */ && node.kind !== 219 /* ArrowFunction */) {
+ if (hierarchyFacts & 65536 /* CapturedLexicalThis */ && node.kind !== 221 /* ArrowFunction */) {
insertCaptureThisForNode(statements, node, factory2.createThis());
return true;
}
@@ -89908,21 +90109,21 @@ function transformES2015(context) {
if (hierarchyFacts & 32768 /* NewTarget */) {
let newTarget;
switch (node.kind) {
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return statements;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
newTarget = factory2.createVoidZero();
break;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
newTarget = factory2.createPropertyAccessExpression(
setEmitFlags(factory2.createThis(), 4 /* NoSubstitution */),
"constructor"
);
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
newTarget = factory2.createConditionalExpression(
factory2.createLogicalAnd(
setEmitFlags(factory2.createThis(), 4 /* NoSubstitution */),
@@ -89966,21 +90167,21 @@ function transformES2015(context) {
function addClassMembers(statements, node) {
for (const member of node.members) {
switch (member.kind) {
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
statements.push(transformSemicolonClassElementToStatement(member));
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node));
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
const accessors = getAllAccessorDeclarations(node.members, member);
if (member === accessors.firstAccessor) {
statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node));
}
break;
- case 176 /* Constructor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 177 /* ClassStaticBlockDeclaration */:
break;
default:
Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName);
@@ -90133,7 +90334,7 @@ function transformES2015(context) {
const ancestorFacts = container && isClassLike(container) && !isStatic(node) ? enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */) : enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */);
const parameters = visitParameterList(node.parameters, visitor, context);
const body = transformFunctionBody(node);
- if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) {
+ if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */)) {
name = factory2.getGeneratedNameForNode(node);
}
exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */);
@@ -90179,7 +90380,7 @@ function transformES2015(context) {
multiLine = true;
}
} else {
- Debug.assert(node.kind === 219 /* ArrowFunction */);
+ Debug.assert(node.kind === 221 /* ArrowFunction */);
statementsLocation = moveRangeEnd(body, -1);
const equalsGreaterThanToken = node.equalsGreaterThanToken;
if (!nodeIsSynthesized(equalsGreaterThanToken) && !nodeIsSynthesized(body)) {
@@ -90382,14 +90583,14 @@ function transformES2015(context) {
}
function visitIterationStatement(node, outermostLabeledStatement) {
switch (node.kind) {
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return visitDoOrWhileStatement(node, outermostLabeledStatement);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, outermostLabeledStatement);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node, outermostLabeledStatement);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node, outermostLabeledStatement);
}
}
@@ -90666,7 +90867,7 @@ function transformES2015(context) {
let numInitialProperties = -1, hasComputed = false;
for (let i = 0; i < properties.length; i++) {
const property = properties[i];
- if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 166 /* ComputedPropertyName */)) {
+ if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 167 /* ComputedPropertyName */)) {
numInitialProperties = i;
break;
}
@@ -90778,15 +90979,15 @@ function transformES2015(context) {
}
function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) {
switch (node.kind) {
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return convertForStatement(node, initializerFunction, convertedLoopBody);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return convertForInStatement(node, convertedLoopBody);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return convertForOfStatement(node, convertedLoopBody);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return convertDoStatement(node, convertedLoopBody);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return convertWhileStatement(node, convertedLoopBody);
default:
return Debug.failBadSyntaxKind(node, "IterationStatement expected");
@@ -90837,11 +91038,11 @@ function transformES2015(context) {
function createConvertedLoopState(node) {
let loopInitializer;
switch (node.kind) {
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
const initializer = node.initializer;
- if (initializer && initializer.kind === 262 /* VariableDeclarationList */) {
+ if (initializer && initializer.kind === 264 /* VariableDeclarationList */) {
loopInitializer = initializer;
}
break;
@@ -91195,20 +91396,20 @@ function transformES2015(context) {
for (let i = start; i < numProperties; i++) {
const property = properties[i];
switch (property.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
const accessors = getAllAccessorDeclarations(node.properties, property);
if (property === accessors.firstAccessor) {
expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine));
}
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine));
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
default:
@@ -91311,7 +91512,7 @@ function transformES2015(context) {
let updated;
const parameters = visitParameterList(node.parameters, visitor, context);
const body = transformFunctionBody(node);
- if (node.kind === 177 /* GetAccessor */) {
+ if (node.kind === 179 /* GetAccessor */) {
updated = factory2.updateGetAccessorDeclaration(node, node.modifiers, node.name, parameters, node.type, body);
} else {
updated = factory2.updateSetAccessorDeclaration(node, node.modifiers, node.name, parameters, body);
@@ -91613,13 +91814,13 @@ function transformES2015(context) {
if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) {
enabledSubstitutions |= 1 /* CapturedThis */;
context.enableSubstitution(109 /* ThisKeyword */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(219 /* ArrowFunction */);
- context.enableEmitNotification(218 /* FunctionExpression */);
- context.enableEmitNotification(263 /* FunctionDeclaration */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(221 /* ArrowFunction */);
+ context.enableEmitNotification(220 /* FunctionExpression */);
+ context.enableEmitNotification(265 /* FunctionDeclaration */);
}
}
function onSubstituteNode(hint, node) {
@@ -91643,10 +91844,10 @@ function transformES2015(context) {
}
function isNameOfDeclarationWithCollidingName(node) {
switch (node.parent.kind) {
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
- case 269 /* EnumDeclaration */:
- case 261 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 263 /* VariableDeclaration */:
return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent);
}
return false;
@@ -91703,11 +91904,11 @@ function transformES2015(context) {
return false;
}
const statement = firstOrUndefined(constructor.body.statements);
- if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 245 /* ExpressionStatement */) {
+ if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 247 /* ExpressionStatement */) {
return false;
}
const statementExpression = statement.expression;
- if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 213 /* CallExpression */) {
+ if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 215 /* CallExpression */) {
return false;
}
const callTarget = statementExpression.expression;
@@ -91715,7 +91916,7 @@ function transformES2015(context) {
return false;
}
const callArgument = singleOrUndefined(statementExpression.arguments);
- if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 231 /* SpreadElement */) {
+ if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 233 /* SpreadElement */) {
return false;
}
const expression = callArgument.expression;
@@ -91732,24 +91933,24 @@ function transformES5(context) {
if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) {
previousOnEmitNode = context.onEmitNode;
context.onEmitNode = onEmitNode;
- context.enableEmitNotification(289 /* JsxOpeningElement */);
- context.enableEmitNotification(290 /* JsxClosingElement */);
- context.enableEmitNotification(288 /* JsxSelfClosingElement */);
+ context.enableEmitNotification(292 /* JsxOpeningElement */);
+ context.enableEmitNotification(293 /* JsxClosingElement */);
+ context.enableEmitNotification(291 /* JsxSelfClosingElement */);
noSubstitution = [];
}
const previousOnSubstituteNode = context.onSubstituteNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(305 /* PropertyAssignment */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(308 /* PropertyAssignment */);
return chainBundle(context, transformSourceFile);
function transformSourceFile(node) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
switch (node.kind) {
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
const tagName = node.tagName;
noSubstitution[getOriginalNodeId(tagName)] = true;
break;
@@ -91920,13 +92121,13 @@ function transformGenerators(context) {
}
function visitJavaScriptInStatementContainingYield(node) {
switch (node.kind) {
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return visitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return visitWhileStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return visitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
default:
return visitJavaScriptInGeneratorFunctionBody(node);
@@ -91934,24 +92135,24 @@ function transformGenerators(context) {
}
function visitJavaScriptInGeneratorFunctionBody(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return visitAccessorDeclaration(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return visitBreakStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return visitContinueStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitReturnStatement(node);
default:
if (node.transformFlags & 1048576 /* ContainsYield */) {
@@ -91965,23 +92166,23 @@ function transformGenerators(context) {
}
function visitJavaScriptContainingYield(node) {
switch (node.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return visitCommaListExpression(node);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return visitConditionalExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return visitYieldExpression(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return visitArrayLiteralExpression(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return visitNewExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -91989,9 +92190,9 @@ function transformGenerators(context) {
}
function visitGenerator(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
default:
return Debug.failBadSyntaxKind(node);
@@ -92158,14 +92359,14 @@ function transformGenerators(context) {
if (containsYield(right)) {
let target;
switch (left.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
target = factory2.updatePropertyAccessExpression(
left,
cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)),
left.name
);
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
target = factory2.updateElementAccessExpression(
left,
cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)),
@@ -92437,35 +92638,35 @@ function transformGenerators(context) {
}
function transformAndEmitStatementWorker(node) {
switch (node.kind) {
- case 242 /* Block */:
+ case 244 /* Block */:
return transformAndEmitBlock(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return transformAndEmitExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return transformAndEmitIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return transformAndEmitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return transformAndEmitWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return transformAndEmitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return transformAndEmitForInStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return transformAndEmitContinueStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return transformAndEmitBreakStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return transformAndEmitReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return transformAndEmitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return transformAndEmitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return transformAndEmitLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return transformAndEmitThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return transformAndEmitTryStatement(node);
default:
return emitStatement(visitNode(node, visitor, isStatement));
@@ -92790,7 +92991,7 @@ function transformGenerators(context) {
for (let i = 0; i < numClauses; i++) {
const clause = caseBlock.clauses[i];
clauseLabels.push(defineLabel());
- if (clause.kind === 299 /* DefaultClause */ && defaultClauseIndex === -1) {
+ if (clause.kind === 302 /* DefaultClause */ && defaultClauseIndex === -1) {
defaultClauseIndex = i;
}
}
@@ -92800,7 +93001,7 @@ function transformGenerators(context) {
let defaultClausesSkipped = 0;
for (let i = clausesWritten; i < numClauses; i++) {
const clause = caseBlock.clauses[i];
- if (clause.kind === 298 /* CaseClause */) {
+ if (clause.kind === 301 /* CaseClause */) {
if (containsYield(clause.expression) && pendingClauses.length > 0) {
break;
}
@@ -93725,12 +93926,12 @@ function transformModule(context) {
const previousOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(213 /* CallExpression */);
- context.enableSubstitution(215 /* TaggedTemplateExpression */);
+ context.enableSubstitution(215 /* CallExpression */);
+ context.enableSubstitution(217 /* TaggedTemplateExpression */);
context.enableSubstitution(79 /* Identifier */);
- context.enableSubstitution(227 /* BinaryExpression */);
- context.enableSubstitution(306 /* ShorthandPropertyAssignment */);
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableSubstitution(229 /* BinaryExpression */);
+ context.enableSubstitution(309 /* ShorthandPropertyAssignment */);
+ context.enableEmitNotification(317 /* SourceFile */);
const moduleInfoMap = [];
const deferredExports = [];
let currentSourceFile;
@@ -94038,23 +94239,23 @@ function transformModule(context) {
}
function topLevelVisitor(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 361 /* MergeDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return visitMergeDeclarationMarker(node);
- case 362 /* EndOfDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return visitEndOfDeclarationMarker(node);
default:
return visitor(node);
@@ -94065,26 +94266,26 @@ function transformModule(context) {
return node;
}
switch (node.kind) {
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, valueIsDiscarded);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
return visitImportCallExpression(node);
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
return visitDestructuringAssignment(node, valueIsDiscarded);
}
break;
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPreOrPostfixUnaryExpression(node, valueIsDiscarded);
}
return visitEachChild(node, visitor, context);
@@ -94099,24 +94300,24 @@ function transformModule(context) {
if (isObjectLiteralExpression(node)) {
for (const elem of node.properties) {
switch (elem.kind) {
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (destructuringNeedsFlattening(elem.initializer)) {
return true;
}
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
if (destructuringNeedsFlattening(elem.name)) {
return true;
}
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
if (destructuringNeedsFlattening(elem.expression)) {
return true;
}
break;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return false;
default:
Debug.assertNever(elem, "Unhandled object member kind");
@@ -94773,7 +94974,7 @@ function transformModule(context) {
}
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 244 /* VariableStatement */) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 246 /* VariableStatement */) {
const id = getOriginalNodeId(node);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original);
}
@@ -94805,10 +95006,10 @@ function transformModule(context) {
const namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
for (const importBinding of namedBindings.elements) {
statements = appendExportsOfDeclaration(statements, importBinding, true);
}
@@ -94952,7 +95153,7 @@ function transformModule(context) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
currentSourceFile = node;
currentModuleInfo = moduleInfoMap[getOriginalNodeId(currentSourceFile)];
previousOnEmitNode(hint, node, emitCallback);
@@ -94990,11 +95191,11 @@ function transformModule(context) {
switch (node.kind) {
case 79 /* Identifier */:
return substituteExpressionIdentifier(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return substituteCallExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return substituteTaggedTemplateExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return substituteBinaryExpression(node);
}
return node;
@@ -95045,7 +95246,7 @@ function transformModule(context) {
return node;
} else if (!(isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node));
- if (exportContainer && exportContainer.kind === 314 /* SourceFile */) {
+ if (exportContainer && exportContainer.kind === 317 /* SourceFile */) {
return setTextRange(
factory2.createPropertyAccessExpression(
factory2.createIdentifier("exports"),
@@ -95124,10 +95325,10 @@ function transformSystemModule(context) {
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
context.enableSubstitution(79 /* Identifier */);
- context.enableSubstitution(306 /* ShorthandPropertyAssignment */);
- context.enableSubstitution(227 /* BinaryExpression */);
- context.enableSubstitution(237 /* MetaProperty */);
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableSubstitution(309 /* ShorthandPropertyAssignment */);
+ context.enableSubstitution(229 /* BinaryExpression */);
+ context.enableSubstitution(239 /* MetaProperty */);
+ context.enableEmitNotification(317 /* SourceFile */);
const moduleInfoMap = [];
const deferredExports = [];
const exportFunctionsMap = [];
@@ -95277,7 +95478,7 @@ function transformSystemModule(context) {
if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) {
let hasExportDeclarationWithExportClause = false;
for (const externalImport of moduleInfo.externalImports) {
- if (externalImport.kind === 281 /* ExportDeclaration */ && externalImport.exportClause) {
+ if (externalImport.kind === 284 /* ExportDeclaration */ && externalImport.exportClause) {
hasExportDeclarationWithExportClause = true;
break;
}
@@ -95396,11 +95597,11 @@ function transformSystemModule(context) {
for (const entry of group2.externalImports) {
const importVariableName = getLocalNameForExternalImport(factory2, entry, currentSourceFile);
switch (entry.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
if (!entry.importClause) {
break;
}
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
Debug.assert(importVariableName !== void 0);
statements.push(
factory2.createExpressionStatement(
@@ -95422,7 +95623,7 @@ function transformSystemModule(context) {
);
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
Debug.assert(importVariableName !== void 0);
if (entry.exportClause) {
if (isNamedExports(entry.exportClause)) {
@@ -95491,13 +95692,13 @@ function transformSystemModule(context) {
}
function topLevelVisitor(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
default:
return topLevelNestedVisitor(node);
@@ -95642,7 +95843,7 @@ function transformSystemModule(context) {
}
}
function shouldHoistVariableDeclarationList(node) {
- return (getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 314 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);
+ return (getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 317 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);
}
function transformInitializedVariable(node, isExportedDeclaration) {
const createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment;
@@ -95666,7 +95867,7 @@ function transformSystemModule(context) {
return isExportedDeclaration ? createExportExpression(name, preventSubstitution(setTextRange(factory2.createAssignment(name, value), location))) : preventSubstitution(setTextRange(factory2.createAssignment(name, value), location));
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 244 /* VariableStatement */) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 246 /* VariableStatement */) {
const id = getOriginalNodeId(node);
const isExportedDeclaration = hasSyntacticModifier(node.original, 1 /* Export */);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration);
@@ -95704,10 +95905,10 @@ function transformSystemModule(context) {
const namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
for (const importBinding of namedBindings.elements) {
statements = appendExportsOfDeclaration(statements, importBinding);
}
@@ -95802,43 +96003,43 @@ function transformSystemModule(context) {
}
function topLevelNestedVisitor(node) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, true);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return visitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return visitWhileStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return visitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return visitSwitchStatement(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return visitCaseBlock(node);
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
return visitCaseClause(node);
- case 299 /* DefaultClause */:
+ case 302 /* DefaultClause */:
return visitDefaultClause(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return visitTryStatement(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
- case 242 /* Block */:
+ case 244 /* Block */:
return visitBlock(node);
- case 361 /* MergeDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return visitMergeDeclarationMarker(node);
- case 362 /* EndOfDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return visitEndOfDeclarationMarker(node);
default:
return visitor(node);
@@ -95980,26 +96181,26 @@ function transformSystemModule(context) {
return node;
}
switch (node.kind) {
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, false);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, valueIsDiscarded);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
return visitDestructuringAssignment(node, valueIsDiscarded);
}
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isImportCall(node)) {
return visitImportCallExpression(node);
}
break;
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded);
}
return visitEachChild(node, visitor, context);
@@ -96059,7 +96260,7 @@ function transformSystemModule(context) {
return hasExportedReferenceInDestructuringTarget(node.initializer);
} else if (isIdentifier(node)) {
const container = resolver.getReferencedExportContainer(node);
- return container !== void 0 && container.kind === 314 /* SourceFile */;
+ return container !== void 0 && container.kind === 317 /* SourceFile */;
} else {
return false;
}
@@ -96103,7 +96304,7 @@ function transformSystemModule(context) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
const id = getOriginalNodeId(node);
currentSourceFile = node;
moduleInfo = moduleInfoMap[id];
@@ -96137,7 +96338,7 @@ function transformSystemModule(context) {
}
function substituteUnspecified(node) {
switch (node.kind) {
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return substituteShorthandPropertyAssignment(node);
}
return node;
@@ -96179,9 +96380,9 @@ function transformSystemModule(context) {
switch (node.kind) {
case 79 /* Identifier */:
return substituteExpressionIdentifier(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return substituteBinaryExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return substituteMetaProperty(node);
}
return node;
@@ -96244,7 +96445,7 @@ function transformSystemModule(context) {
const valueDeclaration = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name);
if (valueDeclaration) {
const exportContainer = resolver.getReferencedExportContainer(name, false);
- if (exportContainer && exportContainer.kind === 314 /* SourceFile */) {
+ if (exportContainer && exportContainer.kind === 317 /* SourceFile */) {
exportedNames = append(exportedNames, factory2.getDeclarationName(valueDeclaration));
}
exportedNames = addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[getOriginalNodeId(valueDeclaration)]);
@@ -96277,7 +96478,7 @@ function transformECMAScriptModule(context) {
const previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableEmitNotification(317 /* SourceFile */);
context.enableSubstitution(79 /* Identifier */);
let helperNameSubstitutions;
let currentSourceFile;
@@ -96328,11 +96529,11 @@ function transformECMAScriptModule(context) {
}
function visitor(node) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return getEmitModuleKind(compilerOptions) >= 100 /* Node16 */ ? visitImportEqualsDeclaration(node) : void 0;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportDecl = node;
return visitExportDeclaration(exportDecl);
}
@@ -96494,8 +96695,8 @@ function transformNodeModule(context) {
const cjsOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(314 /* SourceFile */);
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableSubstitution(317 /* SourceFile */);
+ context.enableEmitNotification(317 /* SourceFile */);
let currentSourceFile;
return transformSourceFileOrBundle;
function onSubstituteNode(hint, node) {
@@ -96538,7 +96739,7 @@ function transformNodeModule(context) {
return result;
}
function transformSourceFileOrBundle(node) {
- return node.kind === 314 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
+ return node.kind === 317 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
}
function transformBundle(node) {
return context.factory.createBundle(map(node.sourceFiles, transformSourceFile), node.prepends);
@@ -96568,7 +96769,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
function getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (isStatic(node)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1;
@@ -96585,7 +96786,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
function getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (isStatic(node)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1;
@@ -96593,7 +96794,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
}
}
function createGetSymbolAccessibilityDiagnosticForNode(node) {
- if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isAnnotationPropertyDeclaration(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
+ if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isAnnotationPropertyDeclaration(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node) || isOverloadPropertyDeclaration(node)) {
return getVariableDeclarationTypeVisibilityError;
} else if (isSetAccessor(node) || isGetAccessor(node)) {
return getAccessorDeclarationTypeVisibilityError;
@@ -96616,12 +96817,12 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
return Debug.assertNever(node, `Attempted to set a declaration diagnostic context for unhandled node kind: ${Debug.formatSyntaxKind(node.kind)}`);
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
- if (node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
+ if (node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
- } else if (node.kind === 171 /* PropertyDeclaration */ || node.kind === 211 /* PropertyAccessExpression */ || node.kind === 170 /* PropertySignature */ || node.kind === 168 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
+ } else if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 213 /* PropertyAccessExpression */ || node.kind === 171 /* PropertySignature */ || node.kind === 169 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
if (isStatic(node)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.kind === 264 /* ClassDeclaration */ || node.kind === 168 /* Parameter */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */ || node.kind === 169 /* Parameter */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1;
@@ -96638,7 +96839,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
}
function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) {
let diagnosticMessage;
- if (node.kind === 178 /* SetAccessor */) {
+ if (node.kind === 180 /* SetAccessor */) {
if (isStatic(node)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1;
} else {
@@ -96660,26 +96861,26 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
function getReturnTypeVisibilityError(symbolAccessibilityResult) {
let diagnosticMessage;
switch (node.kind) {
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isStatic(node)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0;
- } else if (node.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0;
} else {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;
}
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;
break;
default:
@@ -96700,29 +96901,29 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
}
function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
switch (node.parent.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;
- case 180 /* ConstructSignature */:
- case 185 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isStatic(node.parent)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.parent.kind === 266 /* ClassDeclaration */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
- case 263 /* FunctionDeclaration */:
- case 184 /* FunctionType */:
+ case 265 /* FunctionDeclaration */:
+ case 186 /* FunctionType */:
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1;
- case 178 /* SetAccessor */:
- case 177 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 179 /* GetAccessor */:
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
default:
return Debug.fail(`Unknown parent for parameter: ${Debug.formatSyntaxKind(node.parent.kind)}`);
@@ -96731,37 +96932,37 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
function getTypeParameterConstraintVisibilityError() {
let diagnosticMessage;
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;
break;
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;
break;
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isStatic(node.parent)) {
diagnosticMessage = Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.parent.kind === 266 /* ClassDeclaration */) {
diagnosticMessage = Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
} else {
diagnosticMessage = Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
break;
- case 184 /* FunctionType */:
- case 263 /* FunctionDeclaration */:
+ case 186 /* FunctionType */:
+ case 265 /* FunctionDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
break;
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
break;
default:
@@ -96814,7 +97015,7 @@ function hasInternalAnnotation(range, currentSourceFile) {
}
function isInternalDeclaration(node, currentSourceFile) {
const parseTreeNode = getParseTreeNode(node);
- if (parseTreeNode && parseTreeNode.kind === 168 /* Parameter */) {
+ if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
const text = currentSourceFile.text;
@@ -97023,10 +97224,10 @@ function transformDeclarations(context) {
return result;
}
function transformRoot(node) {
- if (node.kind === 314 /* SourceFile */ && node.isDeclarationFile) {
+ if (node.kind === 317 /* SourceFile */ && node.isDeclarationFile) {
return node;
}
- if (node.kind === 315 /* Bundle */) {
+ if (node.kind === 318 /* Bundle */) {
isBundledEmit = true;
refs = new Map2();
libs2 = new Map2();
@@ -97063,7 +97264,7 @@ function transformDeclarations(context) {
return factory2.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated2), true, [], [], false, []);
}
), mapDefined(node.prepends, (prepend) => {
- if (prepend.kind === 317 /* InputFiles */) {
+ if (prepend.kind === 320 /* InputFiles */) {
const sourceFile = createUnparsedSourceFile(prepend, "dts", stripInternal);
hasNoDefaultLib = hasNoDefaultLib || !!sourceFile.hasNoDefaultLib;
collectReferences(sourceFile, refs);
@@ -97205,14 +97406,14 @@ function transformDeclarations(context) {
if (name.kind === 79 /* Identifier */) {
return name;
} else {
- if (name.kind === 207 /* ArrayBindingPattern */) {
+ if (name.kind === 209 /* ArrayBindingPattern */) {
return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement));
} else {
return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement));
}
}
function visitBindingElement(elem) {
- if (elem.kind === 233 /* OmittedExpression */) {
+ if (elem.kind === 235 /* OmittedExpression */) {
return elem;
}
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced) {
@@ -97272,14 +97473,14 @@ function transformDeclarations(context) {
if (type !== void 0 && isTypeReferenceNode(type) && type.typeName.virtual) {
return;
}
- const shouldUseResolverType = node.kind === 168 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node));
+ const shouldUseResolverType = node.kind === 169 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node));
if (type && !shouldUseResolverType) {
return visitNode(type, visitDeclarationSubtree);
}
if (!getParseTreeNode(node)) {
return type ? visitNode(type, visitDeclarationSubtree) : factory2.createKeywordTypeNode(132 /* AnyKeyword */);
}
- if (node.kind === 178 /* SetAccessor */) {
+ if (node.kind === 180 /* SetAccessor */) {
return factory2.createKeywordTypeNode(132 /* AnyKeyword */);
}
errorNameNode = node.name;
@@ -97288,10 +97489,10 @@ function transformDeclarations(context) {
oldDiag = getSymbolAccessibilityDiagnostic;
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(node);
}
- if (node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
+ if (node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */) {
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
}
- if (node.kind === 168 /* Parameter */ || node.kind === 171 /* PropertyDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 172 /* AnnotationPropertyDeclaration */) {
+ if (node.kind === 169 /* Parameter */ || node.kind === 172 /* PropertyDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 173 /* AnnotationPropertyDeclaration */ || node.kind === 174 /* OverloadPropertyDeclaration */) {
if (isPropertySignature(node) || !node.initializer)
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType));
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
@@ -97308,23 +97509,23 @@ function transformDeclarations(context) {
function isDeclarationAndNotVisible(node) {
node = getParseTreeNode(node);
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return !resolver.isDeclarationVisible(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return !getBindingNameVisible(node);
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
return false;
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return true;
}
return false;
@@ -97389,7 +97590,7 @@ function transformDeclarations(context) {
return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree);
}
function isEnclosingDeclaration(node) {
- return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isStructDeclaration(node) || isAnnotationDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node);
+ return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isStructDeclaration(node) || isAnnotationDeclaration(node) || isOverloadDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node);
}
function checkEntityNameVisibility(entityName, enclosingDeclaration2) {
const visibilityResult = resolver.isEntityNameVisible(entityName, enclosingDeclaration2);
@@ -97405,7 +97606,7 @@ function transformDeclarations(context) {
function rewriteModuleSpecifier(parent, input) {
if (!input)
return void 0;
- resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 270 /* ModuleDeclaration */ && parent.kind !== 205 /* ImportType */;
+ resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 273 /* ModuleDeclaration */ && parent.kind !== 207 /* ImportType */;
if (isStringLiteralLike(input)) {
if (isBundledEmit) {
const newName = getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent);
@@ -97424,7 +97625,7 @@ function transformDeclarations(context) {
function transformImportEqualsDeclaration(decl) {
if (!resolver.isDeclarationVisible(decl))
return;
- if (decl.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ if (decl.moduleReference.kind === 289 /* ExternalModuleReference */) {
const specifier = getExternalModuleImportEqualsDeclarationExpression(decl);
return factory2.updateImportEqualsDeclaration(
decl,
@@ -97460,7 +97661,7 @@ function transformDeclarations(context) {
void 0
), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
}
- if (decl.importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (decl.importClause.namedBindings.kind === 280 /* NamespaceImport */) {
const namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : void 0;
return visibleDefaultBinding || namedBindings ? factory2.updateImportDeclaration(decl, decl.modifiers, factory2.updateImportClause(
decl.importClause,
@@ -97571,7 +97772,7 @@ function transformDeclarations(context) {
const oldDiag = getSymbolAccessibilityDiagnostic;
const canProduceDiagnostic = canProduceDiagnostics(input);
const oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
- let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 187 /* TypeLiteral */ || input.kind === 200 /* MappedType */) && input.parent.kind !== 268 /* TypeAliasDeclaration */;
+ let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 189 /* TypeLiteral */ || input.kind === 202 /* MappedType */) && input.parent.kind !== 271 /* TypeAliasDeclaration */;
if (isMethodDeclaration(input) || isMethodSignature(input)) {
if (hasEffectiveModifier(input, 8 /* Private */)) {
if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input)
@@ -97590,26 +97791,26 @@ function transformDeclarations(context) {
}
if (isProcessedComponent(input)) {
switch (input.kind) {
- case 234 /* ExpressionWithTypeArguments */: {
+ case 236 /* ExpressionWithTypeArguments */: {
if (isEntityName(input.expression) || isEntityNameExpression(input.expression)) {
checkEntityNameVisibility(input.expression, enclosingDeclaration);
}
const node = visitEachChild(input, visitDeclarationSubtree, context);
return cleanup(factory2.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments));
}
- case 183 /* TypeReference */: {
+ case 185 /* TypeReference */: {
checkEntityNameVisibility(input.typeName, enclosingDeclaration);
const node = visitEachChild(input, visitDeclarationSubtree, context);
return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments));
}
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return cleanup(factory2.updateConstructSignature(
input,
ensureTypeParams(input, input.typeParameters),
updateParamsList(input, input.parameters),
ensureType(input, input.type)
));
- case 176 /* Constructor */: {
+ case 178 /* Constructor */: {
const ctor = factory2.createConstructorDeclaration(
ensureModifiers(input),
updateParamsList(input, input.parameters, 0 /* None */),
@@ -97617,7 +97818,7 @@ function transformDeclarations(context) {
);
return cleanup(ctor);
}
- case 174 /* MethodDeclaration */: {
+ case 176 /* MethodDeclaration */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -97635,7 +97836,7 @@ function transformDeclarations(context) {
);
return cleanup(sig);
}
- case 177 /* GetAccessor */: {
+ case 179 /* GetAccessor */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -97649,7 +97850,7 @@ function transformDeclarations(context) {
void 0
));
}
- case 178 /* SetAccessor */: {
+ case 180 /* SetAccessor */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -97661,7 +97862,7 @@ function transformDeclarations(context) {
void 0
));
}
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -97674,14 +97875,14 @@ function transformDeclarations(context) {
ensureType(input, input.type),
ensureNoInitializer(input)
));
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return cleanup(factory2.updateAnnotationPropertyDeclaration(
input,
input.name,
ensureType(input, input.type),
input.initializer
));
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -97692,7 +97893,18 @@ function transformDeclarations(context) {
input.questionToken,
ensureType(input, input.type)
));
- case 173 /* MethodSignature */: {
+ case 174 /* OverloadPropertyDeclaration */:
+ if (isPrivateIdentifier(input.name)) {
+ return cleanup(void 0);
+ }
+ return cleanup(factory2.updateOverloadPropertyDeclaration(
+ input,
+ ensureModifiers(input),
+ input.name,
+ input.questionToken,
+ ensureType(input, input.type)
+ ));
+ case 175 /* MethodSignature */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -97706,7 +97918,7 @@ function transformDeclarations(context) {
ensureType(input, input.type)
));
}
- case 179 /* CallSignature */: {
+ case 181 /* CallSignature */: {
return cleanup(factory2.updateCallSignature(
input,
ensureTypeParams(input, input.typeParameters),
@@ -97714,7 +97926,7 @@ function transformDeclarations(context) {
ensureType(input, input.type)
));
}
- case 181 /* IndexSignature */: {
+ case 183 /* IndexSignature */: {
return cleanup(factory2.updateIndexSignature(
input,
ensureModifiers(input),
@@ -97722,7 +97934,7 @@ function transformDeclarations(context) {
visitNode(input.type, visitDeclarationSubtree) || factory2.createKeywordTypeNode(132 /* AnyKeyword */)
));
}
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
if (isBindingPattern(input.name)) {
return recreateBindingPattern(input.name);
}
@@ -97730,13 +97942,13 @@ function transformDeclarations(context) {
suppressNewDiagnosticContexts = true;
return cleanup(factory2.updateVariableDeclaration(input, input.name, void 0, ensureType(input, input.type), ensureNoInitializer(input)));
}
- case 167 /* TypeParameter */: {
+ case 168 /* TypeParameter */: {
if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) {
return cleanup(factory2.updateTypeParameterDeclaration(input, input.modifiers, input.name, void 0, void 0));
}
return cleanup(visitEachChild(input, visitDeclarationSubtree, context));
}
- case 194 /* ConditionalType */: {
+ case 196 /* ConditionalType */: {
const checkType = visitNode(input.checkType, visitDeclarationSubtree);
const extendsType = visitNode(input.extendsType, visitDeclarationSubtree);
const oldEnclosingDecl = enclosingDeclaration;
@@ -97746,13 +97958,13 @@ function transformDeclarations(context) {
const falseType = visitNode(input.falseType, visitDeclarationSubtree);
return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
}
- case 184 /* FunctionType */: {
+ case 186 /* FunctionType */: {
return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
- case 185 /* ConstructorType */: {
+ case 187 /* ConstructorType */: {
return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
- case 205 /* ImportType */: {
+ case 207 /* ImportType */: {
if (!isLiteralImportTypeNode(input))
return cleanup(input);
return cleanup(factory2.updateImportTypeNode(
@@ -97792,7 +98004,7 @@ function transformDeclarations(context) {
}
}
function isPrivateMethodTypeParameter(node) {
- return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 8 /* Private */);
+ return node.parent.kind === 176 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 8 /* Private */);
}
function visitDeclarationStatements(input) {
if (!isPreservedDeclarationStatement(input)) {
@@ -97801,7 +98013,7 @@ function transformDeclarations(context) {
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 281 /* ExportDeclaration */: {
+ case 284 /* ExportDeclaration */: {
if (isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
}
@@ -97815,7 +98027,7 @@ function transformDeclarations(context) {
getResolutionModeOverrideForClause(input.assertClause) ? input.assertClause : void 0
);
}
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
if (isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
}
@@ -97857,10 +98069,10 @@ function transformDeclarations(context) {
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 274 /* ImportEqualsDeclaration */: {
+ case 277 /* ImportEqualsDeclaration */: {
return transformImportEqualsDeclaration(input);
}
- case 275 /* ImportDeclaration */: {
+ case 278 /* ImportDeclaration */: {
return transformImportDeclaration(input);
}
}
@@ -97880,7 +98092,7 @@ function transformDeclarations(context) {
}
const previousNeedsDeclare = needsDeclare;
switch (input.kind) {
- case 268 /* TypeAliasDeclaration */: {
+ case 271 /* TypeAliasDeclaration */: {
needsDeclare = false;
const clean2 = cleanup(factory2.updateTypeAliasDeclaration(
input,
@@ -97895,7 +98107,7 @@ function transformDeclarations(context) {
needsDeclare = previousNeedsDeclare;
return clean2;
}
- case 267 /* InterfaceDeclaration */: {
+ case 270 /* InterfaceDeclaration */: {
return cleanup(factory2.updateInterfaceDeclaration(
input,
ensureModifiers(input),
@@ -97905,7 +98117,7 @@ function transformDeclarations(context) {
visitNodes2(input.members, visitDeclarationSubtree)
));
}
- case 263 /* FunctionDeclaration */: {
+ case 265 /* FunctionDeclaration */: {
const clean2 = cleanup(factory2.updateFunctionDeclaration(
input,
ensureModifiers(input),
@@ -97995,10 +98207,10 @@ function transformDeclarations(context) {
return clean2;
}
}
- case 270 /* ModuleDeclaration */: {
+ case 273 /* ModuleDeclaration */: {
needsDeclare = false;
const inner = input.body;
- if (inner && inner.kind === 271 /* ModuleBlock */) {
+ if (inner && inner.kind === 274 /* ModuleBlock */) {
const oldNeedsScopeFix = needsScopeFixMarker;
const oldHasScopeFix = resultHasScopeMarker;
resultHasScopeMarker = false;
@@ -98042,7 +98254,7 @@ function transformDeclarations(context) {
));
}
}
- case 265 /* StructDeclaration */: {
+ case 267 /* StructDeclaration */: {
errorNameNode = input.name;
errorFallbackNode = input;
const decorators = ensureEtsDecorators(input, host);
@@ -98059,7 +98271,7 @@ function transformDeclarations(context) {
members
));
}
- case 266 /* AnnotationDeclaration */: {
+ case 268 /* AnnotationDeclaration */: {
errorNameNode = input.name;
errorFallbackNode = input;
const modifiers = factory2.createNodeArray(ensureModifiers(input));
@@ -98072,7 +98284,20 @@ function transformDeclarations(context) {
members
));
}
- case 264 /* ClassDeclaration */: {
+ case 269 /* OverloadDeclaration */: {
+ errorNameNode = input.name;
+ errorFallbackNode = input;
+ const modifiers = factory2.createNodeArray(ensureModifiers(input));
+ const memberNodes = visitNodes2(input.members, visitDeclarationSubtree);
+ const members = factory2.createNodeArray(memberNodes);
+ return cleanup(factory2.updateOverloadDeclaration(
+ input,
+ modifiers,
+ input.name,
+ members
+ ));
+ }
+ case 266 /* ClassDeclaration */: {
errorNameNode = input.name;
errorFallbackNode = input;
const modifiers = factory2.createNodeArray(ensureModifiers(input));
@@ -98175,10 +98400,10 @@ function transformDeclarations(context) {
));
}
}
- case 244 /* VariableStatement */: {
+ case 246 /* VariableStatement */: {
return cleanup(transformVariableStatement(input));
}
- case 269 /* EnumDeclaration */: {
+ case 272 /* EnumDeclaration */: {
return cleanup(factory2.updateEnumDeclaration(input, factory2.createNodeArray(ensureModifiers(input)), input.name, factory2.createNodeArray(mapDefined(input.members, (m) => {
if (shouldStripInternal(m))
return;
@@ -98194,7 +98419,7 @@ function transformDeclarations(context) {
if (canProdiceDiagnostic) {
getSymbolAccessibilityDiagnostic = oldDiag;
}
- if (input.kind === 270 /* ModuleDeclaration */) {
+ if (input.kind === 273 /* ModuleDeclaration */) {
needsDeclare = previousNeedsDeclare;
}
if (node === input) {
@@ -98217,7 +98442,7 @@ function transformDeclarations(context) {
return flatten(mapDefined(d.elements, (e) => recreateBindingElement(e)));
}
function recreateBindingElement(e) {
- if (e.kind === 233 /* OmittedExpression */) {
+ if (e.kind === 235 /* OmittedExpression */) {
return;
}
if (e.name) {
@@ -98266,7 +98491,7 @@ function transformDeclarations(context) {
function ensureModifierFlags(node) {
let mask = 258047 /* All */ ^ (4 /* Public */ | 512 /* Async */ | 16384 /* Override */);
let additions = needsDeclare && !isAlwaysType(node) ? 2 /* Ambient */ : 0 /* None */;
- const parentIsFile = node.parent.kind === 314 /* SourceFile */;
+ const parentIsFile = node.parent.kind === 317 /* SourceFile */;
if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) {
mask ^= 2 /* Ambient */;
additions = 0 /* None */;
@@ -98292,7 +98517,7 @@ function transformDeclarations(context) {
}
}
function isAlwaysType(node) {
- if (node.kind === 267 /* InterfaceDeclaration */) {
+ if (node.kind === 270 /* InterfaceDeclaration */) {
return true;
}
return false;
@@ -98312,60 +98537,62 @@ function maskModifierFlags(node, modifierMask = 258047 /* All */ ^ 4 /* Public *
}
function getTypeAnnotationFromAccessor(accessor) {
if (accessor) {
- return accessor.kind === 177 /* GetAccessor */ ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : void 0;
+ return accessor.kind === 179 /* GetAccessor */ ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : void 0;
}
}
function canHaveLiteralInitializer(node) {
switch (node.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return !hasEffectiveModifier(node, 8 /* Private */);
- case 168 /* Parameter */:
- case 261 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 263 /* VariableDeclaration */:
return true;
}
return false;
}
function isPreservedDeclarationStatement(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 244 /* VariableStatement */:
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
+ case 265 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 246 /* VariableStatement */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
return true;
}
return false;
}
function isProcessedComponent(node) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 181 /* IndexSignature */:
- case 261 /* VariableDeclaration */:
- case 167 /* TypeParameter */:
- case 234 /* ExpressionWithTypeArguments */:
- case 183 /* TypeReference */:
- case 194 /* ConditionalType */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 205 /* ImportType */:
+ case 182 /* ConstructSignature */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 183 /* IndexSignature */:
+ case 263 /* VariableDeclaration */:
+ case 168 /* TypeParameter */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 185 /* TypeReference */:
+ case 196 /* ConditionalType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 207 /* ImportType */:
return true;
}
return false;
@@ -98481,7 +98708,7 @@ function noEmitNotification(hint, node, callback) {
}
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
var _a2, _b;
- const enabledSyntaxKindFeatures = new Array(364 /* Count */);
+ const enabledSyntaxKindFeatures = new Array(367 /* Count */);
let lexicalEnvironmentVariableDeclarations;
let lexicalEnvironmentFunctionDeclarations;
let lexicalEnvironmentStatements;
@@ -98560,7 +98787,7 @@ function transformNodes(resolver, host, factory2, options, nodes, transformers,
state = 1 /* Initialized */;
const transformed = [];
for (const node of nodes) {
- (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Emit, "transformNodes", node.kind === 314 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
+ (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Emit, "transformNodes", node.kind === 317 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
PerformanceDotting.start("transformRoot");
transformed.push((allowDtsFiles ? transformation : transformRoot)(node));
PerformanceDotting.stop("transformRoot");
@@ -98877,7 +99104,7 @@ function getOutputPathsForBundle(options, forceDtsPaths) {
}
function getOutputPathsFor(sourceFile, host, forceDtsPaths) {
const options = host.getCompilerOptions();
- if (sourceFile.kind === 315 /* Bundle */) {
+ if (sourceFile.kind === 318 /* Bundle */) {
return getOutputPathsForBundle(options, forceDtsPaths);
} else {
const ownOutputFilePath = getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile.fileName, options));
@@ -99250,8 +99477,8 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
}
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform, printer, mapOptions) {
const sourceFileOrBundle = transform.transformed[0];
- const bundle = sourceFileOrBundle.kind === 315 /* Bundle */ ? sourceFileOrBundle : void 0;
- const sourceFile = sourceFileOrBundle.kind === 314 /* SourceFile */ ? sourceFileOrBundle : void 0;
+ const bundle = sourceFileOrBundle.kind === 318 /* Bundle */ ? sourceFileOrBundle : void 0;
+ const sourceFile = sourceFileOrBundle.kind === 317 /* SourceFile */ ? sourceFileOrBundle : void 0;
const sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];
let sourceMapGenerator;
if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) {
@@ -99305,7 +99532,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
writer.clear();
}
function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
- return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 314 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
+ return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 317 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
}
function getSourceRoot(mapOptions) {
const sourceRoot = normalizeSlashes(mapOptions.sourceRoot || "");
@@ -99664,11 +99891,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
break;
}
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return printFile(node);
- case 315 /* Bundle */:
+ case 318 /* Bundle */:
return printBundle(node);
- case 316 /* UnparsedSource */:
+ case 319 /* UnparsedSource */:
return printUnparsedSource(node);
}
writeNode(hint, node, sourceFile, beginPrint());
@@ -99982,300 +100209,304 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return emitIdentifier(node);
case 80 /* PrivateIdentifier */:
return emitPrivateIdentifier(node);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return emitQualifiedName(node);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return emitComputedPropertyName(node);
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return emitTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return emitParameter(node);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return emitDecorator(node);
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
return emitPropertySignature(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return emitPropertyDeclaration(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return emitAnnotationPropertyDeclaration(node);
- case 173 /* MethodSignature */:
+ case 174 /* OverloadPropertyDeclaration */:
+ return emitOverloadPropertyDeclaration(node);
+ case 175 /* MethodSignature */:
return emitMethodSignature(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return emitMethodDeclaration(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return emitClassStaticBlockDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return emitConstructor(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return emitAccessorDeclaration(node);
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return emitCallSignature(node);
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return emitConstructSignature(node);
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return emitIndexSignature(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return emitTypePredicate(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return emitTypeReference(node);
- case 184 /* FunctionType */:
+ case 186 /* FunctionType */:
return emitFunctionType(node);
- case 185 /* ConstructorType */:
+ case 187 /* ConstructorType */:
return emitConstructorType(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return emitTypeQuery(node);
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return emitTypeLiteral(node);
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return emitArrayType(node);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
return emitTupleType(node);
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return emitOptionalType(node);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return emitUnionType(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return emitIntersectionType(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return emitConditionalType(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return emitInferType(node);
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return emitParenthesizedType(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return emitExpressionWithTypeArguments(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return emitThisType();
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return emitTypeOperator(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return emitIndexedAccessType(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return emitMappedType(node);
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return emitLiteralType(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return emitNamedTupleMember(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return emitTemplateType(node);
- case 204 /* TemplateLiteralTypeSpan */:
+ case 206 /* TemplateLiteralTypeSpan */:
return emitTemplateTypeSpan(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return emitImportTypeNode(node);
- case 206 /* ObjectBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
return emitObjectBindingPattern(node);
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return emitArrayBindingPattern(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return emitBindingElement(node);
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return emitTemplateSpan(node);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return emitSemicolonClassElement();
- case 242 /* Block */:
+ case 244 /* Block */:
return emitBlock(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return emitVariableStatement(node);
- case 243 /* EmptyStatement */:
+ case 245 /* EmptyStatement */:
return emitEmptyStatement(false);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return emitExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return emitIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return emitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return emitWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return emitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return emitForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return emitForOfStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return emitContinueStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return emitBreakStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return emitReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return emitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return emitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return emitLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return emitThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return emitTryStatement(node);
- case 260 /* DebuggerStatement */:
+ case 262 /* DebuggerStatement */:
return emitDebuggerStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return emitVariableDeclaration(node);
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return emitVariableDeclarationList(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return emitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return emitClassOrStructDeclaration(node);
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return emitClassOrStructDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return emitAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return emitOverloadDeclaration(node);
+ case 270 /* InterfaceDeclaration */:
return emitInterfaceDeclaration(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return emitTypeAliasDeclaration(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return emitEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return emitModuleDeclaration(node);
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return emitModuleBlock(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return emitCaseBlock(node);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return emitNamespaceExportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return emitImportEqualsDeclaration(node);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return emitImportDeclaration(node);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return emitImportClause(node);
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return emitNamespaceImport(node);
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
return emitNamespaceExport(node);
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
return emitNamedImports(node);
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return emitImportSpecifier(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return emitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return emitExportDeclaration(node);
- case 282 /* NamedExports */:
+ case 285 /* NamedExports */:
return emitNamedExports(node);
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return emitExportSpecifier(node);
- case 302 /* AssertClause */:
+ case 305 /* AssertClause */:
return emitAssertClause(node);
- case 303 /* AssertEntry */:
+ case 306 /* AssertEntry */:
return emitAssertEntry(node);
- case 285 /* MissingDeclaration */:
+ case 288 /* MissingDeclaration */:
return;
- case 286 /* ExternalModuleReference */:
+ case 289 /* ExternalModuleReference */:
return emitExternalModuleReference(node);
case 11 /* JsxText */:
return emitJsxText(node);
- case 289 /* JsxOpeningElement */:
- case 292 /* JsxOpeningFragment */:
+ case 292 /* JsxOpeningElement */:
+ case 295 /* JsxOpeningFragment */:
return emitJsxOpeningElementOrFragment(node);
- case 290 /* JsxClosingElement */:
- case 293 /* JsxClosingFragment */:
+ case 293 /* JsxClosingElement */:
+ case 296 /* JsxClosingFragment */:
return emitJsxClosingElementOrFragment(node);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return emitJsxAttribute(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return emitJsxAttributes(node);
- case 296 /* JsxSpreadAttribute */:
+ case 299 /* JsxSpreadAttribute */:
return emitJsxSpreadAttribute(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return emitJsxExpression(node);
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
return emitCaseClause(node);
- case 299 /* DefaultClause */:
+ case 302 /* DefaultClause */:
return emitDefaultClause(node);
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return emitHeritageClause(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return emitCatchClause(node);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return emitPropertyAssignment(node);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return emitShorthandPropertyAssignment(node);
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return emitSpreadAssignment(node);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return emitEnumMember(node);
- case 309 /* UnparsedPrologue */:
+ case 312 /* UnparsedPrologue */:
return writeUnparsedNode(node);
- case 316 /* UnparsedSource */:
- case 310 /* UnparsedPrepend */:
+ case 319 /* UnparsedSource */:
+ case 313 /* UnparsedPrepend */:
return emitUnparsedSourceOrPrepend(node);
- case 311 /* UnparsedText */:
- case 312 /* UnparsedInternalText */:
+ case 314 /* UnparsedText */:
+ case 315 /* UnparsedInternalText */:
return emitUnparsedTextLike(node);
- case 313 /* UnparsedSyntheticReference */:
+ case 316 /* UnparsedSyntheticReference */:
return emitUnparsedSyntheticReference(node);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return emitSourceFile(node);
- case 315 /* Bundle */:
+ case 318 /* Bundle */:
return Debug.fail("Bundles should be printed using printBundle");
- case 317 /* InputFiles */:
+ case 320 /* InputFiles */:
return Debug.fail("InputFiles should not be printed");
- case 318 /* JSDocTypeExpression */:
+ case 321 /* JSDocTypeExpression */:
return emitJSDocTypeExpression(node);
- case 319 /* JSDocNameReference */:
+ case 322 /* JSDocNameReference */:
return emitJSDocNameReference(node);
- case 321 /* JSDocAllType */:
+ case 324 /* JSDocAllType */:
return writePunctuation("*");
- case 322 /* JSDocUnknownType */:
+ case 325 /* JSDocUnknownType */:
return writePunctuation("?");
- case 323 /* JSDocNullableType */:
+ case 326 /* JSDocNullableType */:
return emitJSDocNullableType(node);
- case 324 /* JSDocNonNullableType */:
+ case 327 /* JSDocNonNullableType */:
return emitJSDocNonNullableType(node);
- case 325 /* JSDocOptionalType */:
+ case 328 /* JSDocOptionalType */:
return emitJSDocOptionalType(node);
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return emitJSDocFunctionType(node);
- case 191 /* RestType */:
- case 327 /* JSDocVariadicType */:
+ case 193 /* RestType */:
+ case 330 /* JSDocVariadicType */:
return emitRestOrJSDocVariadicType(node);
- case 328 /* JSDocNamepathType */:
+ case 331 /* JSDocNamepathType */:
return;
- case 329 /* JSDoc */:
+ case 332 /* JSDoc */:
return emitJSDoc(node);
- case 331 /* JSDocTypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
return emitJSDocTypeLiteral(node);
- case 332 /* JSDocSignature */:
+ case 335 /* JSDocSignature */:
return emitJSDocSignature(node);
- case 336 /* JSDocTag */:
- case 341 /* JSDocClassTag */:
- case 346 /* JSDocOverrideTag */:
+ case 339 /* JSDocTag */:
+ case 344 /* JSDocClassTag */:
+ case 349 /* JSDocOverrideTag */:
return emitJSDocSimpleTag(node);
- case 337 /* JSDocAugmentsTag */:
- case 338 /* JSDocImplementsTag */:
+ case 340 /* JSDocAugmentsTag */:
+ case 341 /* JSDocImplementsTag */:
return emitJSDocHeritageTag(node);
- case 339 /* JSDocAuthorTag */:
- case 340 /* JSDocDeprecatedTag */:
+ case 342 /* JSDocAuthorTag */:
+ case 343 /* JSDocDeprecatedTag */:
return;
- case 342 /* JSDocPublicTag */:
- case 343 /* JSDocPrivateTag */:
- case 344 /* JSDocProtectedTag */:
- case 345 /* JSDocReadonlyTag */:
+ case 345 /* JSDocPublicTag */:
+ case 346 /* JSDocPrivateTag */:
+ case 347 /* JSDocProtectedTag */:
+ case 348 /* JSDocReadonlyTag */:
return;
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
return emitJSDocCallbackTag(node);
- case 349 /* JSDocParameterTag */:
- case 356 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
+ case 359 /* JSDocPropertyTag */:
return emitJSDocPropertyLikeTag(node);
- case 348 /* JSDocEnumTag */:
- case 350 /* JSDocReturnTag */:
- case 351 /* JSDocThisTag */:
- case 352 /* JSDocTypeTag */:
+ case 351 /* JSDocEnumTag */:
+ case 353 /* JSDocReturnTag */:
+ case 354 /* JSDocThisTag */:
+ case 355 /* JSDocTypeTag */:
return emitJSDocSimpleTypedTag(node);
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return emitJSDocTemplateTag(node);
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return emitJSDocTypedefTag(node);
- case 355 /* JSDocSeeTag */:
+ case 358 /* JSDocSeeTag */:
return emitJSDocSeeTag(node);
- case 358 /* NotEmittedStatement */:
- case 362 /* EndOfDeclarationMarker */:
- case 361 /* MergeDeclarationMarker */:
+ case 361 /* NotEmittedStatement */:
+ case 365 /* EndOfDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return;
}
if (isExpression(node)) {
@@ -100304,84 +100535,84 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return emitIdentifier(node);
case 80 /* PrivateIdentifier */:
return emitPrivateIdentifier(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return emitArrayLiteralExpression(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return emitObjectLiteralExpression(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return emitPropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return emitElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return emitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return emitNewExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return emitTaggedTemplateExpression(node);
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return emitTypeAssertionExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return emitParenthesizedExpression(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return emitFunctionExpression(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return emitArrowFunction(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return emitDeleteExpression(node);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return emitTypeOfExpression(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return emitVoidExpression(node);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return emitAwaitExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return emitPrefixUnaryExpression(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return emitPostfixUnaryExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return emitBinaryExpression(node);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return emitConditionalExpression(node);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return emitTemplateExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return emitYieldExpression(node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return emitSpreadElement(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return emitClassExpression(node);
- case 233 /* OmittedExpression */:
+ case 235 /* OmittedExpression */:
return;
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return emitAsExpression(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return emitNonNullExpression(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return emitExpressionWithTypeArguments(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return emitSatisfiesExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return emitMetaProperty(node);
- case 238 /* SyntheticExpression */:
+ case 240 /* SyntheticExpression */:
return Debug.fail("SyntheticExpression should never be printed.");
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return emitJsxElement(node);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return emitJsxSelfClosingElement(node);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return emitJsxFragment(node);
- case 357 /* SyntaxList */:
+ case 360 /* SyntaxList */:
return Debug.fail("SyntaxList should not be printed");
- case 358 /* NotEmittedStatement */:
+ case 361 /* NotEmittedStatement */:
return;
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return emitPartiallyEmittedExpression(node);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return emitCommaList(node);
- case 361 /* MergeDeclarationMarker */:
- case 362 /* EndOfDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return;
- case 363 /* SyntheticReferenceExpression */:
+ case 366 /* SyntheticReferenceExpression */:
return Debug.fail("SyntheticReferenceExpression should not be printed");
}
}
@@ -100432,7 +100663,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitHelpers(node) {
let helpersEmitted = false;
- const bundle = node.kind === 315 /* Bundle */ ? node : void 0;
+ const bundle = node.kind === 318 /* Bundle */ ? node : void 0;
if (bundle && moduleKind === 0 /* None */) {
return;
}
@@ -100503,7 +100734,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
updateOrPushBundleFileTextLike(
pos,
writer.getTextPos(),
- unparsed.kind === 311 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */
+ unparsed.kind === 314 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */
);
}
}
@@ -100534,7 +100765,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitTabStop(hint, node, snippet) {
Debug.assert(
- node.kind === 243 /* EmptyStatement */,
+ node.kind === 245 /* EmptyStatement */,
`A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`
);
Debug.assert(
@@ -100590,7 +100821,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(node.dotDotDotToken);
emitNodeWithWriter(node.name, writeParameter);
emit(node.questionToken);
- if (node.parent && node.parent.kind === 326 /* JSDocFunctionType */ && !node.name) {
+ if (node.parent && node.parent.kind === 329 /* JSDocFunctionType */ && !node.name) {
emit(node.type);
} else {
emitTypeAnnotation(node.type);
@@ -100608,6 +100839,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitTypeAnnotation(node.type);
writeTrailingSemicolon();
}
+ function emitOverloadPropertyDeclaration(node) {
+ emitModifiers(node, node.modifiers);
+ emitNodeWithWriter(node.name, writeProperty);
+ emit(node.questionToken);
+ }
function emitPropertyDeclaration(node) {
emitDecoratorsAndModifiers(node, node.modifiers);
emit(node.name);
@@ -100652,7 +100888,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitAccessorDeclaration(node) {
emitDecoratorsAndModifiers(node, node.modifiers);
- writeKeyword(node.kind === 177 /* GetAccessor */ ? "get" : "set");
+ writeKeyword(node.kind === 179 /* GetAccessor */ ? "get" : "set");
writeSpace();
emit(node.name);
emitSignatureAndBody(node, emitSignatureHead);
@@ -101081,7 +101317,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function shouldEmitWhitespaceBeforeOperand(node) {
const operand = node.operand;
- return operand.kind === 225 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */));
+ return operand.kind === 227 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */));
}
function emitPostfixUnaryExpression(node) {
emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary);
@@ -101277,7 +101513,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (node.elseStatement) {
writeLineOrSpace(node, node.thenStatement, node.elseStatement);
emitTokenWithComment(92 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node);
- if (node.elseStatement.kind === 246 /* IfStatement */) {
+ if (node.elseStatement.kind === 248 /* IfStatement */) {
writeSpace();
emit(node.elseStatement);
} else {
@@ -101338,7 +101574,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);
emitForBinding(node.initializer);
writeSpace();
- emitTokenWithComment(164 /* OfKeyword */, node.initializer.end, writeKeyword, node);
+ emitTokenWithComment(165 /* OfKeyword */, node.initializer.end, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);
@@ -101346,7 +101582,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitForBinding(node) {
if (node !== void 0) {
- if (node.kind === 262 /* VariableDeclarationList */) {
+ if (node.kind === 264 /* VariableDeclarationList */) {
emit(node);
} else {
emitExpression(node);
@@ -101382,7 +101618,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
pos = writeTokenText(token, writer2, pos);
if (isSimilarNode && contextNode.end !== pos) {
- const isJsxExprContext = contextNode.kind === 297 /* JsxExpression */;
+ const isJsxExprContext = contextNode.kind === 300 /* JsxExpression */;
emitTrailingCommentsOfPosition(pos, !isJsxExprContext, isJsxExprContext);
}
return pos;
@@ -101641,6 +101877,25 @@ function createPrinter(printerOptions = {}, handlers = {}) {
decreaseIndent();
}
}
+ function emitOverloadDeclaration(node) {
+ emitDecoratorsAndModifiers(node, node.modifiers);
+ writeKeyword("overload");
+ if (node.name) {
+ writeSpace();
+ emitIdentifierName(node.name);
+ }
+ const indentedFlag = getEmitFlags(node) & 65536 /* Indented */;
+ if (indentedFlag) {
+ increaseIndent();
+ }
+ writeSpace();
+ writePunctuation("{");
+ emitList(node, node.members, 145 /* EnumMembers */);
+ writePunctuation("}");
+ if (indentedFlag) {
+ decreaseIndent();
+ }
+ }
function emitTypeAliasDeclaration(node) {
if (isSendableFunctionOrType(node, true)) {
emitDecorators(node, node.illegalDecorators);
@@ -102038,7 +102293,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
}
if (node.tags) {
- if (node.tags.length === 1 && node.tags[0].kind === 352 /* JSDocTypeTag */ && !node.comment) {
+ if (node.tags.length === 1 && node.tags[0].kind === 355 /* JSDocTypeTag */ && !node.comment) {
writeSpace();
emit(node.tags[0]);
} else {
@@ -102082,7 +102337,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitJSDocTypedefTag(tag) {
emitJSDocTagName(tag.tagName);
if (tag.typeExpression) {
- if (tag.typeExpression.kind === 318 /* JSDocTypeExpression */) {
+ if (tag.typeExpression.kind === 321 /* JSDocTypeExpression */) {
emitJSDocTypeExpression(tag.typeExpression);
} else {
writeSpace();
@@ -102100,7 +102355,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(tag.fullName);
}
emitJSDocComment(tag.comment);
- if (tag.typeExpression && tag.typeExpression.kind === 331 /* JSDocTypeLiteral */) {
+ if (tag.typeExpression && tag.typeExpression.kind === 334 /* JSDocTypeLiteral */) {
emitJSDocTypeLiteral(tag.typeExpression);
}
}
@@ -102916,7 +103171,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile));
}
function skipSynthesizedParentheses(node) {
- while (node.kind === 217 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) {
+ while (node.kind === 219 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) {
node = node.expression;
}
return node;
@@ -102986,84 +103241,84 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (!node)
return;
switch (node.kind) {
- case 242 /* Block */:
+ case 244 /* Block */:
forEach(node.statements, generateNames);
break;
- case 257 /* LabeledStatement */:
- case 255 /* WithStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 259 /* LabeledStatement */:
+ case 257 /* WithStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
generateNames(node.statement);
break;
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
generateNames(node.thenStatement);
generateNames(node.elseStatement);
break;
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
generateNames(node.initializer);
generateNames(node.statement);
break;
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
generateNames(node.caseBlock);
break;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
forEach(node.clauses, generateNames);
break;
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
forEach(node.statements, generateNames);
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
generateNames(node.tryBlock);
generateNames(node.catchClause);
generateNames(node.finallyBlock);
break;
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
generateNames(node.variableDeclaration);
generateNames(node.block);
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
generateNames(node.declarationList);
break;
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
forEach(node.declarations, generateNames);
break;
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
generateNameIfNeeded(node.name);
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
generateNameIfNeeded(node.name);
if (getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) {
forEach(node.parameters, generateNames);
generateNames(node.body);
}
break;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
forEach(node.elements, generateNames);
break;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
generateNames(node.importClause);
break;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
generateNameIfNeeded(node.name);
generateNames(node.namedBindings);
break;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
generateNameIfNeeded(node.name);
break;
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
generateNameIfNeeded(node.name);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
forEach(node.elements, generateNames);
break;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
generateNameIfNeeded(node.propertyName || node.name);
break;
}
@@ -103072,13 +103327,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (!node)
return;
switch (node.kind) {
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
generateNameIfNeeded(node.name);
break;
}
@@ -103252,27 +103507,27 @@ function createPrinter(printerOptions = {}, handlers = {}) {
prefix,
suffix
);
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForModuleOrEnum(node);
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForImportOrExportDeclaration(node);
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 280 /* ExportAssignment */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 283 /* ExportAssignment */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForExportDefault();
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForClassExpression();
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return generateNameForMethodOrAccessor(node, privateName, prefix, suffix);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return makeTempVariableName(TempFlags.Auto, true, privateName, prefix, suffix);
default:
return makeTempVariableName(TempFlags.Auto, false, privateName, prefix, suffix);
@@ -103363,14 +103618,14 @@ function createPrinter(printerOptions = {}, handlers = {}) {
const skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;
if ((pos > 0 || end > 0) && pos !== end) {
if (!skipLeadingComments) {
- emitLeadingComments(pos, node.kind !== 358 /* NotEmittedStatement */);
+ emitLeadingComments(pos, node.kind !== 361 /* NotEmittedStatement */);
}
if (!skipLeadingComments || pos >= 0 && (emitFlags & 512 /* NoLeadingComments */) !== 0) {
containerPos = pos;
}
if (!skipTrailingComments || end >= 0 && (emitFlags & 1024 /* NoTrailingComments */) !== 0) {
containerEnd = end;
- if (node.kind === 262 /* VariableDeclarationList */) {
+ if (node.kind === 264 /* VariableDeclarationList */) {
declarationListContainerEnd = end;
}
}
@@ -103386,7 +103641,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
containerPos = savedContainerPos;
containerEnd = savedContainerEnd;
declarationListContainerEnd = savedDeclarationListContainerEnd;
- if (!skipTrailingComments && node.kind !== 358 /* NotEmittedStatement */) {
+ if (!skipTrailingComments && node.kind !== 361 /* NotEmittedStatement */) {
emitTrailingComments(end);
}
}
@@ -103638,7 +103893,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
} else {
const source = sourceMapRange.source || sourceMapSource;
- if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
+ if (node.kind !== 361 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
}
if (emitFlags & 64 /* NoNestedSourceMaps */) {
@@ -103653,7 +103908,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (emitFlags & 64 /* NoNestedSourceMaps */) {
sourceMapsDisabled = false;
}
- if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
+ if (node.kind !== 361 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
}
}
@@ -106056,89 +106311,89 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
return diagnostics;
function walk(node, parent) {
switch (parent.kind) {
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
if (parent.questionToken === node) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?"));
return "skip";
}
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
- case 261 /* VariableDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 263 /* VariableDeclaration */:
if (parent.type === node) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files));
return "skip";
}
}
switch (node.kind) {
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
if (node.isTypeOnly) {
diagnostics.push(createDiagnosticForNode2(parent, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type"));
return "skip";
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
if (node.isTypeOnly) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type"));
return "skip";
}
break;
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
if (node.isTypeOnly) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, isImportSpecifier(node) ? "import...type" : "export...type"));
return "skip";
}
break;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.import_can_only_be_used_in_TypeScript_files));
return "skip";
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
if (node.isExportEquals) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.export_can_only_be_used_in_TypeScript_files));
return "skip";
}
break;
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
const heritageClause = node;
if (heritageClause.token === 118 /* ImplementsKeyword */) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files));
return "skip";
}
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
const interfaceKeyword = tokenToString(119 /* InterfaceKeyword */);
Debug.assertIsDefined(interfaceKeyword);
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword));
return "skip";
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const moduleKeyword = node.flags & 16 /* Namespace */ ? tokenToString(144 /* NamespaceKeyword */) : tokenToString(143 /* ModuleKeyword */);
Debug.assertIsDefined(moduleKeyword);
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword));
return "skip";
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files));
return "skip";
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
const enumKeyword = Debug.checkDefined(tokenToString(93 /* EnumKeyword */));
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword));
return "skip";
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files));
return "skip";
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files));
return "skip";
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files));
return "skip";
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
Debug.fail();
}
}
@@ -106147,27 +106402,27 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
diagnostics.push(createDiagnosticForNode2(parent, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning));
}
switch (parent.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
if (nodes === parent.typeParameters) {
diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files));
return "skip";
}
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (nodes === parent.modifiers) {
- checkModifiers(parent.modifiers, parent.kind === 244 /* VariableStatement */);
+ checkModifiers(parent.modifiers, parent.kind === 246 /* VariableStatement */);
return "skip";
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (nodes === parent.modifiers) {
for (const modifier of nodes) {
if (isModifier(modifier) && modifier.kind !== 125 /* StaticKeyword */ && modifier.kind !== 128 /* AccessorKeyword */) {
@@ -106177,18 +106432,18 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
return "skip";
}
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (nodes === parent.modifiers && some(nodes, isModifier)) {
diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files));
return "skip";
}
break;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 234 /* ExpressionWithTypeArguments */:
- case 288 /* JsxSelfClosingElement */:
- case 289 /* JsxOpeningElement */:
- case 215 /* TaggedTemplateExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 291 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 217 /* TaggedTemplateExpression */:
if (nodes === parent.typeArguments) {
diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files));
return "skip";
diff --git a/lib/tsserver.js b/lib/tsserver.js
index abe33f3d80..c6a316a606 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -1828,6 +1828,9 @@ __export(server_exports, {
isOptionalTypeNode: () => isOptionalTypeNode,
isOuterExpression: () => isOuterExpression,
isOutermostOptionalChain: () => isOutermostOptionalChain,
+ isOverloadDeclaration: () => isOverloadDeclaration,
+ isOverloadElement: () => isOverloadElement,
+ isOverloadPropertyDeclaration: () => isOverloadPropertyDeclaration,
isOverrideModifier: () => isOverrideModifier,
isPackedArrayLiteral: () => isPackedArrayLiteral,
isParameter: () => isParameter,
@@ -6562,208 +6565,211 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
SyntaxKind5[SyntaxKind5["GlobalKeyword"] = 161] = "GlobalKeyword";
SyntaxKind5[SyntaxKind5["BigIntKeyword"] = 162] = "BigIntKeyword";
SyntaxKind5[SyntaxKind5["OverrideKeyword"] = 163] = "OverrideKeyword";
- SyntaxKind5[SyntaxKind5["OfKeyword"] = 164] = "OfKeyword";
- SyntaxKind5[SyntaxKind5["QualifiedName"] = 165] = "QualifiedName";
- SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 166] = "ComputedPropertyName";
- SyntaxKind5[SyntaxKind5["TypeParameter"] = 167] = "TypeParameter";
- SyntaxKind5[SyntaxKind5["Parameter"] = 168] = "Parameter";
- SyntaxKind5[SyntaxKind5["Decorator"] = 169] = "Decorator";
- SyntaxKind5[SyntaxKind5["PropertySignature"] = 170] = "PropertySignature";
- SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 171] = "PropertyDeclaration";
- SyntaxKind5[SyntaxKind5["AnnotationPropertyDeclaration"] = 172] = "AnnotationPropertyDeclaration";
- SyntaxKind5[SyntaxKind5["MethodSignature"] = 173] = "MethodSignature";
- SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 174] = "MethodDeclaration";
- SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 175] = "ClassStaticBlockDeclaration";
- SyntaxKind5[SyntaxKind5["Constructor"] = 176] = "Constructor";
- SyntaxKind5[SyntaxKind5["GetAccessor"] = 177] = "GetAccessor";
- SyntaxKind5[SyntaxKind5["SetAccessor"] = 178] = "SetAccessor";
- SyntaxKind5[SyntaxKind5["CallSignature"] = 179] = "CallSignature";
- SyntaxKind5[SyntaxKind5["ConstructSignature"] = 180] = "ConstructSignature";
- SyntaxKind5[SyntaxKind5["IndexSignature"] = 181] = "IndexSignature";
- SyntaxKind5[SyntaxKind5["TypePredicate"] = 182] = "TypePredicate";
- SyntaxKind5[SyntaxKind5["TypeReference"] = 183] = "TypeReference";
- SyntaxKind5[SyntaxKind5["FunctionType"] = 184] = "FunctionType";
- SyntaxKind5[SyntaxKind5["ConstructorType"] = 185] = "ConstructorType";
- SyntaxKind5[SyntaxKind5["TypeQuery"] = 186] = "TypeQuery";
- SyntaxKind5[SyntaxKind5["TypeLiteral"] = 187] = "TypeLiteral";
- SyntaxKind5[SyntaxKind5["ArrayType"] = 188] = "ArrayType";
- SyntaxKind5[SyntaxKind5["TupleType"] = 189] = "TupleType";
- SyntaxKind5[SyntaxKind5["OptionalType"] = 190] = "OptionalType";
- SyntaxKind5[SyntaxKind5["RestType"] = 191] = "RestType";
- SyntaxKind5[SyntaxKind5["UnionType"] = 192] = "UnionType";
- SyntaxKind5[SyntaxKind5["IntersectionType"] = 193] = "IntersectionType";
- SyntaxKind5[SyntaxKind5["ConditionalType"] = 194] = "ConditionalType";
- SyntaxKind5[SyntaxKind5["InferType"] = 195] = "InferType";
- SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 196] = "ParenthesizedType";
- SyntaxKind5[SyntaxKind5["ThisType"] = 197] = "ThisType";
- SyntaxKind5[SyntaxKind5["TypeOperator"] = 198] = "TypeOperator";
- SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 199] = "IndexedAccessType";
- SyntaxKind5[SyntaxKind5["MappedType"] = 200] = "MappedType";
- SyntaxKind5[SyntaxKind5["LiteralType"] = 201] = "LiteralType";
- SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 202] = "NamedTupleMember";
- SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 203] = "TemplateLiteralType";
- SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 204] = "TemplateLiteralTypeSpan";
- SyntaxKind5[SyntaxKind5["ImportType"] = 205] = "ImportType";
- SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 206] = "ObjectBindingPattern";
- SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 207] = "ArrayBindingPattern";
- SyntaxKind5[SyntaxKind5["BindingElement"] = 208] = "BindingElement";
- SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 209] = "ArrayLiteralExpression";
- SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 210] = "ObjectLiteralExpression";
- SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 211] = "PropertyAccessExpression";
- SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 212] = "ElementAccessExpression";
- SyntaxKind5[SyntaxKind5["CallExpression"] = 213] = "CallExpression";
- SyntaxKind5[SyntaxKind5["NewExpression"] = 214] = "NewExpression";
- SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 215] = "TaggedTemplateExpression";
- SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 216] = "TypeAssertionExpression";
- SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 217] = "ParenthesizedExpression";
- SyntaxKind5[SyntaxKind5["FunctionExpression"] = 218] = "FunctionExpression";
- SyntaxKind5[SyntaxKind5["ArrowFunction"] = 219] = "ArrowFunction";
- SyntaxKind5[SyntaxKind5["EtsComponentExpression"] = 220] = "EtsComponentExpression";
- SyntaxKind5[SyntaxKind5["DeleteExpression"] = 221] = "DeleteExpression";
- SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 222] = "TypeOfExpression";
- SyntaxKind5[SyntaxKind5["VoidExpression"] = 223] = "VoidExpression";
- SyntaxKind5[SyntaxKind5["AwaitExpression"] = 224] = "AwaitExpression";
- SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 225] = "PrefixUnaryExpression";
- SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 226] = "PostfixUnaryExpression";
- SyntaxKind5[SyntaxKind5["BinaryExpression"] = 227] = "BinaryExpression";
- SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 228] = "ConditionalExpression";
- SyntaxKind5[SyntaxKind5["TemplateExpression"] = 229] = "TemplateExpression";
- SyntaxKind5[SyntaxKind5["YieldExpression"] = 230] = "YieldExpression";
- SyntaxKind5[SyntaxKind5["SpreadElement"] = 231] = "SpreadElement";
- SyntaxKind5[SyntaxKind5["ClassExpression"] = 232] = "ClassExpression";
- SyntaxKind5[SyntaxKind5["OmittedExpression"] = 233] = "OmittedExpression";
- SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 234] = "ExpressionWithTypeArguments";
- SyntaxKind5[SyntaxKind5["AsExpression"] = 235] = "AsExpression";
- SyntaxKind5[SyntaxKind5["NonNullExpression"] = 236] = "NonNullExpression";
- SyntaxKind5[SyntaxKind5["MetaProperty"] = 237] = "MetaProperty";
- SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 238] = "SyntheticExpression";
- SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 239] = "SatisfiesExpression";
- SyntaxKind5[SyntaxKind5["TemplateSpan"] = 240] = "TemplateSpan";
- SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 241] = "SemicolonClassElement";
- SyntaxKind5[SyntaxKind5["Block"] = 242] = "Block";
- SyntaxKind5[SyntaxKind5["EmptyStatement"] = 243] = "EmptyStatement";
- SyntaxKind5[SyntaxKind5["VariableStatement"] = 244] = "VariableStatement";
- SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 245] = "ExpressionStatement";
- SyntaxKind5[SyntaxKind5["IfStatement"] = 246] = "IfStatement";
- SyntaxKind5[SyntaxKind5["DoStatement"] = 247] = "DoStatement";
- SyntaxKind5[SyntaxKind5["WhileStatement"] = 248] = "WhileStatement";
- SyntaxKind5[SyntaxKind5["ForStatement"] = 249] = "ForStatement";
- SyntaxKind5[SyntaxKind5["ForInStatement"] = 250] = "ForInStatement";
- SyntaxKind5[SyntaxKind5["ForOfStatement"] = 251] = "ForOfStatement";
- SyntaxKind5[SyntaxKind5["ContinueStatement"] = 252] = "ContinueStatement";
- SyntaxKind5[SyntaxKind5["BreakStatement"] = 253] = "BreakStatement";
- SyntaxKind5[SyntaxKind5["ReturnStatement"] = 254] = "ReturnStatement";
- SyntaxKind5[SyntaxKind5["WithStatement"] = 255] = "WithStatement";
- SyntaxKind5[SyntaxKind5["SwitchStatement"] = 256] = "SwitchStatement";
- SyntaxKind5[SyntaxKind5["LabeledStatement"] = 257] = "LabeledStatement";
- SyntaxKind5[SyntaxKind5["ThrowStatement"] = 258] = "ThrowStatement";
- SyntaxKind5[SyntaxKind5["TryStatement"] = 259] = "TryStatement";
- SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 260] = "DebuggerStatement";
- SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 261] = "VariableDeclaration";
- SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 262] = "VariableDeclarationList";
- SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 263] = "FunctionDeclaration";
- SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 264] = "ClassDeclaration";
- SyntaxKind5[SyntaxKind5["StructDeclaration"] = 265] = "StructDeclaration";
- SyntaxKind5[SyntaxKind5["AnnotationDeclaration"] = 266] = "AnnotationDeclaration";
- SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 267] = "InterfaceDeclaration";
- SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 268] = "TypeAliasDeclaration";
- SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 269] = "EnumDeclaration";
- SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 270] = "ModuleDeclaration";
- SyntaxKind5[SyntaxKind5["ModuleBlock"] = 271] = "ModuleBlock";
- SyntaxKind5[SyntaxKind5["CaseBlock"] = 272] = "CaseBlock";
- SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 273] = "NamespaceExportDeclaration";
- SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 274] = "ImportEqualsDeclaration";
- SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 275] = "ImportDeclaration";
- SyntaxKind5[SyntaxKind5["ImportClause"] = 276] = "ImportClause";
- SyntaxKind5[SyntaxKind5["NamespaceImport"] = 277] = "NamespaceImport";
- SyntaxKind5[SyntaxKind5["NamedImports"] = 278] = "NamedImports";
- SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 279] = "ImportSpecifier";
- SyntaxKind5[SyntaxKind5["ExportAssignment"] = 280] = "ExportAssignment";
- SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 281] = "ExportDeclaration";
- SyntaxKind5[SyntaxKind5["NamedExports"] = 282] = "NamedExports";
- SyntaxKind5[SyntaxKind5["NamespaceExport"] = 283] = "NamespaceExport";
- SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 284] = "ExportSpecifier";
- SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 285] = "MissingDeclaration";
- SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 286] = "ExternalModuleReference";
- SyntaxKind5[SyntaxKind5["JsxElement"] = 287] = "JsxElement";
- SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 288] = "JsxSelfClosingElement";
- SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 289] = "JsxOpeningElement";
- SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 290] = "JsxClosingElement";
- SyntaxKind5[SyntaxKind5["JsxFragment"] = 291] = "JsxFragment";
- SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 292] = "JsxOpeningFragment";
- SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 293] = "JsxClosingFragment";
- SyntaxKind5[SyntaxKind5["JsxAttribute"] = 294] = "JsxAttribute";
- SyntaxKind5[SyntaxKind5["JsxAttributes"] = 295] = "JsxAttributes";
- SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 296] = "JsxSpreadAttribute";
- SyntaxKind5[SyntaxKind5["JsxExpression"] = 297] = "JsxExpression";
- SyntaxKind5[SyntaxKind5["CaseClause"] = 298] = "CaseClause";
- SyntaxKind5[SyntaxKind5["DefaultClause"] = 299] = "DefaultClause";
- SyntaxKind5[SyntaxKind5["HeritageClause"] = 300] = "HeritageClause";
- SyntaxKind5[SyntaxKind5["CatchClause"] = 301] = "CatchClause";
- SyntaxKind5[SyntaxKind5["AssertClause"] = 302] = "AssertClause";
- SyntaxKind5[SyntaxKind5["AssertEntry"] = 303] = "AssertEntry";
- SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 304] = "ImportTypeAssertionContainer";
- SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 305] = "PropertyAssignment";
- SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 306] = "ShorthandPropertyAssignment";
- SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 307] = "SpreadAssignment";
- SyntaxKind5[SyntaxKind5["EnumMember"] = 308] = "EnumMember";
- SyntaxKind5[SyntaxKind5["UnparsedPrologue"] = 309] = "UnparsedPrologue";
- SyntaxKind5[SyntaxKind5["UnparsedPrepend"] = 310] = "UnparsedPrepend";
- SyntaxKind5[SyntaxKind5["UnparsedText"] = 311] = "UnparsedText";
- SyntaxKind5[SyntaxKind5["UnparsedInternalText"] = 312] = "UnparsedInternalText";
- SyntaxKind5[SyntaxKind5["UnparsedSyntheticReference"] = 313] = "UnparsedSyntheticReference";
- SyntaxKind5[SyntaxKind5["SourceFile"] = 314] = "SourceFile";
- SyntaxKind5[SyntaxKind5["Bundle"] = 315] = "Bundle";
- SyntaxKind5[SyntaxKind5["UnparsedSource"] = 316] = "UnparsedSource";
- SyntaxKind5[SyntaxKind5["InputFiles"] = 317] = "InputFiles";
- SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 318] = "JSDocTypeExpression";
- SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 319] = "JSDocNameReference";
- SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 320] = "JSDocMemberName";
- SyntaxKind5[SyntaxKind5["JSDocAllType"] = 321] = "JSDocAllType";
- SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 322] = "JSDocUnknownType";
- SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 323] = "JSDocNullableType";
- SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 324] = "JSDocNonNullableType";
- SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 325] = "JSDocOptionalType";
- SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 326] = "JSDocFunctionType";
- SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 327] = "JSDocVariadicType";
- SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 328] = "JSDocNamepathType";
- SyntaxKind5[SyntaxKind5["JSDoc"] = 329] = "JSDoc";
- SyntaxKind5[SyntaxKind5["JSDocComment"] = 329 /* JSDoc */] = "JSDocComment";
- SyntaxKind5[SyntaxKind5["JSDocText"] = 330] = "JSDocText";
- SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 331] = "JSDocTypeLiteral";
- SyntaxKind5[SyntaxKind5["JSDocSignature"] = 332] = "JSDocSignature";
- SyntaxKind5[SyntaxKind5["JSDocLink"] = 333] = "JSDocLink";
- SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 334] = "JSDocLinkCode";
- SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 335] = "JSDocLinkPlain";
- SyntaxKind5[SyntaxKind5["JSDocTag"] = 336] = "JSDocTag";
- SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 337] = "JSDocAugmentsTag";
- SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 338] = "JSDocImplementsTag";
- SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 339] = "JSDocAuthorTag";
- SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 340] = "JSDocDeprecatedTag";
- SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 341] = "JSDocClassTag";
- SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 342] = "JSDocPublicTag";
- SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 343] = "JSDocPrivateTag";
- SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 344] = "JSDocProtectedTag";
- SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 345] = "JSDocReadonlyTag";
- SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 346] = "JSDocOverrideTag";
- SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 347] = "JSDocCallbackTag";
- SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 348] = "JSDocEnumTag";
- SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 349] = "JSDocParameterTag";
- SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 350] = "JSDocReturnTag";
- SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 351] = "JSDocThisTag";
- SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 352] = "JSDocTypeTag";
- SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 353] = "JSDocTemplateTag";
- SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 354] = "JSDocTypedefTag";
- SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 355] = "JSDocSeeTag";
- SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 356] = "JSDocPropertyTag";
- SyntaxKind5[SyntaxKind5["SyntaxList"] = 357] = "SyntaxList";
- SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 358] = "NotEmittedStatement";
- SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 359] = "PartiallyEmittedExpression";
- SyntaxKind5[SyntaxKind5["CommaListExpression"] = 360] = "CommaListExpression";
- SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 361] = "MergeDeclarationMarker";
- SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 362] = "EndOfDeclarationMarker";
- SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 363] = "SyntheticReferenceExpression";
- SyntaxKind5[SyntaxKind5["Count"] = 364] = "Count";
+ SyntaxKind5[SyntaxKind5["OverloadKeyword"] = 164] = "OverloadKeyword";
+ SyntaxKind5[SyntaxKind5["OfKeyword"] = 165] = "OfKeyword";
+ SyntaxKind5[SyntaxKind5["QualifiedName"] = 166] = "QualifiedName";
+ SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 167] = "ComputedPropertyName";
+ SyntaxKind5[SyntaxKind5["TypeParameter"] = 168] = "TypeParameter";
+ SyntaxKind5[SyntaxKind5["Parameter"] = 169] = "Parameter";
+ SyntaxKind5[SyntaxKind5["Decorator"] = 170] = "Decorator";
+ SyntaxKind5[SyntaxKind5["PropertySignature"] = 171] = "PropertySignature";
+ SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 172] = "PropertyDeclaration";
+ SyntaxKind5[SyntaxKind5["AnnotationPropertyDeclaration"] = 173] = "AnnotationPropertyDeclaration";
+ SyntaxKind5[SyntaxKind5["OverloadPropertyDeclaration"] = 174] = "OverloadPropertyDeclaration";
+ SyntaxKind5[SyntaxKind5["MethodSignature"] = 175] = "MethodSignature";
+ SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 176] = "MethodDeclaration";
+ SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 177] = "ClassStaticBlockDeclaration";
+ SyntaxKind5[SyntaxKind5["Constructor"] = 178] = "Constructor";
+ SyntaxKind5[SyntaxKind5["GetAccessor"] = 179] = "GetAccessor";
+ SyntaxKind5[SyntaxKind5["SetAccessor"] = 180] = "SetAccessor";
+ SyntaxKind5[SyntaxKind5["CallSignature"] = 181] = "CallSignature";
+ SyntaxKind5[SyntaxKind5["ConstructSignature"] = 182] = "ConstructSignature";
+ SyntaxKind5[SyntaxKind5["IndexSignature"] = 183] = "IndexSignature";
+ SyntaxKind5[SyntaxKind5["TypePredicate"] = 184] = "TypePredicate";
+ SyntaxKind5[SyntaxKind5["TypeReference"] = 185] = "TypeReference";
+ SyntaxKind5[SyntaxKind5["FunctionType"] = 186] = "FunctionType";
+ SyntaxKind5[SyntaxKind5["ConstructorType"] = 187] = "ConstructorType";
+ SyntaxKind5[SyntaxKind5["TypeQuery"] = 188] = "TypeQuery";
+ SyntaxKind5[SyntaxKind5["TypeLiteral"] = 189] = "TypeLiteral";
+ SyntaxKind5[SyntaxKind5["ArrayType"] = 190] = "ArrayType";
+ SyntaxKind5[SyntaxKind5["TupleType"] = 191] = "TupleType";
+ SyntaxKind5[SyntaxKind5["OptionalType"] = 192] = "OptionalType";
+ SyntaxKind5[SyntaxKind5["RestType"] = 193] = "RestType";
+ SyntaxKind5[SyntaxKind5["UnionType"] = 194] = "UnionType";
+ SyntaxKind5[SyntaxKind5["IntersectionType"] = 195] = "IntersectionType";
+ SyntaxKind5[SyntaxKind5["ConditionalType"] = 196] = "ConditionalType";
+ SyntaxKind5[SyntaxKind5["InferType"] = 197] = "InferType";
+ SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 198] = "ParenthesizedType";
+ SyntaxKind5[SyntaxKind5["ThisType"] = 199] = "ThisType";
+ SyntaxKind5[SyntaxKind5["TypeOperator"] = 200] = "TypeOperator";
+ SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 201] = "IndexedAccessType";
+ SyntaxKind5[SyntaxKind5["MappedType"] = 202] = "MappedType";
+ SyntaxKind5[SyntaxKind5["LiteralType"] = 203] = "LiteralType";
+ SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 204] = "NamedTupleMember";
+ SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 205] = "TemplateLiteralType";
+ SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 206] = "TemplateLiteralTypeSpan";
+ SyntaxKind5[SyntaxKind5["ImportType"] = 207] = "ImportType";
+ SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 208] = "ObjectBindingPattern";
+ SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 209] = "ArrayBindingPattern";
+ SyntaxKind5[SyntaxKind5["BindingElement"] = 210] = "BindingElement";
+ SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 211] = "ArrayLiteralExpression";
+ SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 212] = "ObjectLiteralExpression";
+ SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 213] = "PropertyAccessExpression";
+ SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 214] = "ElementAccessExpression";
+ SyntaxKind5[SyntaxKind5["CallExpression"] = 215] = "CallExpression";
+ SyntaxKind5[SyntaxKind5["NewExpression"] = 216] = "NewExpression";
+ SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 217] = "TaggedTemplateExpression";
+ SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 218] = "TypeAssertionExpression";
+ SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 219] = "ParenthesizedExpression";
+ SyntaxKind5[SyntaxKind5["FunctionExpression"] = 220] = "FunctionExpression";
+ SyntaxKind5[SyntaxKind5["ArrowFunction"] = 221] = "ArrowFunction";
+ SyntaxKind5[SyntaxKind5["EtsComponentExpression"] = 222] = "EtsComponentExpression";
+ SyntaxKind5[SyntaxKind5["DeleteExpression"] = 223] = "DeleteExpression";
+ SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 224] = "TypeOfExpression";
+ SyntaxKind5[SyntaxKind5["VoidExpression"] = 225] = "VoidExpression";
+ SyntaxKind5[SyntaxKind5["AwaitExpression"] = 226] = "AwaitExpression";
+ SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 227] = "PrefixUnaryExpression";
+ SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 228] = "PostfixUnaryExpression";
+ SyntaxKind5[SyntaxKind5["BinaryExpression"] = 229] = "BinaryExpression";
+ SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 230] = "ConditionalExpression";
+ SyntaxKind5[SyntaxKind5["TemplateExpression"] = 231] = "TemplateExpression";
+ SyntaxKind5[SyntaxKind5["YieldExpression"] = 232] = "YieldExpression";
+ SyntaxKind5[SyntaxKind5["SpreadElement"] = 233] = "SpreadElement";
+ SyntaxKind5[SyntaxKind5["ClassExpression"] = 234] = "ClassExpression";
+ SyntaxKind5[SyntaxKind5["OmittedExpression"] = 235] = "OmittedExpression";
+ SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 236] = "ExpressionWithTypeArguments";
+ SyntaxKind5[SyntaxKind5["AsExpression"] = 237] = "AsExpression";
+ SyntaxKind5[SyntaxKind5["NonNullExpression"] = 238] = "NonNullExpression";
+ SyntaxKind5[SyntaxKind5["MetaProperty"] = 239] = "MetaProperty";
+ SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 240] = "SyntheticExpression";
+ SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 241] = "SatisfiesExpression";
+ SyntaxKind5[SyntaxKind5["TemplateSpan"] = 242] = "TemplateSpan";
+ SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 243] = "SemicolonClassElement";
+ SyntaxKind5[SyntaxKind5["Block"] = 244] = "Block";
+ SyntaxKind5[SyntaxKind5["EmptyStatement"] = 245] = "EmptyStatement";
+ SyntaxKind5[SyntaxKind5["VariableStatement"] = 246] = "VariableStatement";
+ SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 247] = "ExpressionStatement";
+ SyntaxKind5[SyntaxKind5["IfStatement"] = 248] = "IfStatement";
+ SyntaxKind5[SyntaxKind5["DoStatement"] = 249] = "DoStatement";
+ SyntaxKind5[SyntaxKind5["WhileStatement"] = 250] = "WhileStatement";
+ SyntaxKind5[SyntaxKind5["ForStatement"] = 251] = "ForStatement";
+ SyntaxKind5[SyntaxKind5["ForInStatement"] = 252] = "ForInStatement";
+ SyntaxKind5[SyntaxKind5["ForOfStatement"] = 253] = "ForOfStatement";
+ SyntaxKind5[SyntaxKind5["ContinueStatement"] = 254] = "ContinueStatement";
+ SyntaxKind5[SyntaxKind5["BreakStatement"] = 255] = "BreakStatement";
+ SyntaxKind5[SyntaxKind5["ReturnStatement"] = 256] = "ReturnStatement";
+ SyntaxKind5[SyntaxKind5["WithStatement"] = 257] = "WithStatement";
+ SyntaxKind5[SyntaxKind5["SwitchStatement"] = 258] = "SwitchStatement";
+ SyntaxKind5[SyntaxKind5["LabeledStatement"] = 259] = "LabeledStatement";
+ SyntaxKind5[SyntaxKind5["ThrowStatement"] = 260] = "ThrowStatement";
+ SyntaxKind5[SyntaxKind5["TryStatement"] = 261] = "TryStatement";
+ SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 262] = "DebuggerStatement";
+ SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 263] = "VariableDeclaration";
+ SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 264] = "VariableDeclarationList";
+ SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 265] = "FunctionDeclaration";
+ SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 266] = "ClassDeclaration";
+ SyntaxKind5[SyntaxKind5["StructDeclaration"] = 267] = "StructDeclaration";
+ SyntaxKind5[SyntaxKind5["AnnotationDeclaration"] = 268] = "AnnotationDeclaration";
+ SyntaxKind5[SyntaxKind5["OverloadDeclaration"] = 269] = "OverloadDeclaration";
+ SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 270] = "InterfaceDeclaration";
+ SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 271] = "TypeAliasDeclaration";
+ SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 272] = "EnumDeclaration";
+ SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 273] = "ModuleDeclaration";
+ SyntaxKind5[SyntaxKind5["ModuleBlock"] = 274] = "ModuleBlock";
+ SyntaxKind5[SyntaxKind5["CaseBlock"] = 275] = "CaseBlock";
+ SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 276] = "NamespaceExportDeclaration";
+ SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 277] = "ImportEqualsDeclaration";
+ SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 278] = "ImportDeclaration";
+ SyntaxKind5[SyntaxKind5["ImportClause"] = 279] = "ImportClause";
+ SyntaxKind5[SyntaxKind5["NamespaceImport"] = 280] = "NamespaceImport";
+ SyntaxKind5[SyntaxKind5["NamedImports"] = 281] = "NamedImports";
+ SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 282] = "ImportSpecifier";
+ SyntaxKind5[SyntaxKind5["ExportAssignment"] = 283] = "ExportAssignment";
+ SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 284] = "ExportDeclaration";
+ SyntaxKind5[SyntaxKind5["NamedExports"] = 285] = "NamedExports";
+ SyntaxKind5[SyntaxKind5["NamespaceExport"] = 286] = "NamespaceExport";
+ SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 287] = "ExportSpecifier";
+ SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 288] = "MissingDeclaration";
+ SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 289] = "ExternalModuleReference";
+ SyntaxKind5[SyntaxKind5["JsxElement"] = 290] = "JsxElement";
+ SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 291] = "JsxSelfClosingElement";
+ SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 292] = "JsxOpeningElement";
+ SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 293] = "JsxClosingElement";
+ SyntaxKind5[SyntaxKind5["JsxFragment"] = 294] = "JsxFragment";
+ SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 295] = "JsxOpeningFragment";
+ SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 296] = "JsxClosingFragment";
+ SyntaxKind5[SyntaxKind5["JsxAttribute"] = 297] = "JsxAttribute";
+ SyntaxKind5[SyntaxKind5["JsxAttributes"] = 298] = "JsxAttributes";
+ SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 299] = "JsxSpreadAttribute";
+ SyntaxKind5[SyntaxKind5["JsxExpression"] = 300] = "JsxExpression";
+ SyntaxKind5[SyntaxKind5["CaseClause"] = 301] = "CaseClause";
+ SyntaxKind5[SyntaxKind5["DefaultClause"] = 302] = "DefaultClause";
+ SyntaxKind5[SyntaxKind5["HeritageClause"] = 303] = "HeritageClause";
+ SyntaxKind5[SyntaxKind5["CatchClause"] = 304] = "CatchClause";
+ SyntaxKind5[SyntaxKind5["AssertClause"] = 305] = "AssertClause";
+ SyntaxKind5[SyntaxKind5["AssertEntry"] = 306] = "AssertEntry";
+ SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 307] = "ImportTypeAssertionContainer";
+ SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 308] = "PropertyAssignment";
+ SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 309] = "ShorthandPropertyAssignment";
+ SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 310] = "SpreadAssignment";
+ SyntaxKind5[SyntaxKind5["EnumMember"] = 311] = "EnumMember";
+ SyntaxKind5[SyntaxKind5["UnparsedPrologue"] = 312] = "UnparsedPrologue";
+ SyntaxKind5[SyntaxKind5["UnparsedPrepend"] = 313] = "UnparsedPrepend";
+ SyntaxKind5[SyntaxKind5["UnparsedText"] = 314] = "UnparsedText";
+ SyntaxKind5[SyntaxKind5["UnparsedInternalText"] = 315] = "UnparsedInternalText";
+ SyntaxKind5[SyntaxKind5["UnparsedSyntheticReference"] = 316] = "UnparsedSyntheticReference";
+ SyntaxKind5[SyntaxKind5["SourceFile"] = 317] = "SourceFile";
+ SyntaxKind5[SyntaxKind5["Bundle"] = 318] = "Bundle";
+ SyntaxKind5[SyntaxKind5["UnparsedSource"] = 319] = "UnparsedSource";
+ SyntaxKind5[SyntaxKind5["InputFiles"] = 320] = "InputFiles";
+ SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 321] = "JSDocTypeExpression";
+ SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 322] = "JSDocNameReference";
+ SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 323] = "JSDocMemberName";
+ SyntaxKind5[SyntaxKind5["JSDocAllType"] = 324] = "JSDocAllType";
+ SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 325] = "JSDocUnknownType";
+ SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 326] = "JSDocNullableType";
+ SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 327] = "JSDocNonNullableType";
+ SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 328] = "JSDocOptionalType";
+ SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 329] = "JSDocFunctionType";
+ SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 330] = "JSDocVariadicType";
+ SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 331] = "JSDocNamepathType";
+ SyntaxKind5[SyntaxKind5["JSDoc"] = 332] = "JSDoc";
+ SyntaxKind5[SyntaxKind5["JSDocComment"] = 332 /* JSDoc */] = "JSDocComment";
+ SyntaxKind5[SyntaxKind5["JSDocText"] = 333] = "JSDocText";
+ SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 334] = "JSDocTypeLiteral";
+ SyntaxKind5[SyntaxKind5["JSDocSignature"] = 335] = "JSDocSignature";
+ SyntaxKind5[SyntaxKind5["JSDocLink"] = 336] = "JSDocLink";
+ SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 337] = "JSDocLinkCode";
+ SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 338] = "JSDocLinkPlain";
+ SyntaxKind5[SyntaxKind5["JSDocTag"] = 339] = "JSDocTag";
+ SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 340] = "JSDocAugmentsTag";
+ SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 341] = "JSDocImplementsTag";
+ SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 342] = "JSDocAuthorTag";
+ SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 343] = "JSDocDeprecatedTag";
+ SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 344] = "JSDocClassTag";
+ SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 345] = "JSDocPublicTag";
+ SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 346] = "JSDocPrivateTag";
+ SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 347] = "JSDocProtectedTag";
+ SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 348] = "JSDocReadonlyTag";
+ SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 349] = "JSDocOverrideTag";
+ SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 350] = "JSDocCallbackTag";
+ SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 351] = "JSDocEnumTag";
+ SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 352] = "JSDocParameterTag";
+ SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 353] = "JSDocReturnTag";
+ SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 354] = "JSDocThisTag";
+ SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 355] = "JSDocTypeTag";
+ SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 356] = "JSDocTemplateTag";
+ SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 357] = "JSDocTypedefTag";
+ SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 358] = "JSDocSeeTag";
+ SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 359] = "JSDocPropertyTag";
+ SyntaxKind5[SyntaxKind5["SyntaxList"] = 360] = "SyntaxList";
+ SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 361] = "NotEmittedStatement";
+ SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 362] = "PartiallyEmittedExpression";
+ SyntaxKind5[SyntaxKind5["CommaListExpression"] = 363] = "CommaListExpression";
+ SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 364] = "MergeDeclarationMarker";
+ SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 365] = "EndOfDeclarationMarker";
+ SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 366] = "SyntheticReferenceExpression";
+ SyntaxKind5[SyntaxKind5["Count"] = 367] = "Count";
SyntaxKind5[SyntaxKind5["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
SyntaxKind5[SyntaxKind5["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -6771,15 +6777,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
SyntaxKind5[SyntaxKind5["FirstReservedWord"] = 81 /* BreakKeyword */] = "FirstReservedWord";
SyntaxKind5[SyntaxKind5["LastReservedWord"] = 117 /* WithKeyword */] = "LastReservedWord";
SyntaxKind5[SyntaxKind5["FirstKeyword"] = 81 /* BreakKeyword */] = "FirstKeyword";
- SyntaxKind5[SyntaxKind5["LastKeyword"] = 164 /* OfKeyword */] = "LastKeyword";
+ SyntaxKind5[SyntaxKind5["LastKeyword"] = 165 /* OfKeyword */] = "LastKeyword";
SyntaxKind5[SyntaxKind5["FirstFutureReservedWord"] = 118 /* ImplementsKeyword */] = "FirstFutureReservedWord";
SyntaxKind5[SyntaxKind5["LastFutureReservedWord"] = 126 /* YieldKeyword */] = "LastFutureReservedWord";
- SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 182 /* TypePredicate */] = "FirstTypeNode";
- SyntaxKind5[SyntaxKind5["LastTypeNode"] = 205 /* ImportType */] = "LastTypeNode";
+ SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 184 /* TypePredicate */] = "FirstTypeNode";
+ SyntaxKind5[SyntaxKind5["LastTypeNode"] = 207 /* ImportType */] = "LastTypeNode";
SyntaxKind5[SyntaxKind5["FirstPunctuation"] = 18 /* OpenBraceToken */] = "FirstPunctuation";
SyntaxKind5[SyntaxKind5["LastPunctuation"] = 78 /* CaretEqualsToken */] = "LastPunctuation";
SyntaxKind5[SyntaxKind5["FirstToken"] = 0 /* Unknown */] = "FirstToken";
- SyntaxKind5[SyntaxKind5["LastToken"] = 164 /* LastKeyword */] = "LastToken";
+ SyntaxKind5[SyntaxKind5["LastToken"] = 165 /* LastKeyword */] = "LastToken";
SyntaxKind5[SyntaxKind5["FirstTriviaToken"] = 2 /* SingleLineCommentTrivia */] = "FirstTriviaToken";
SyntaxKind5[SyntaxKind5["LastTriviaToken"] = 7 /* ConflictMarkerTrivia */] = "LastTriviaToken";
SyntaxKind5[SyntaxKind5["FirstLiteralToken"] = 8 /* NumericLiteral */] = "FirstLiteralToken";
@@ -6788,15 +6794,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
SyntaxKind5[SyntaxKind5["LastTemplateToken"] = 17 /* TemplateTail */] = "LastTemplateToken";
SyntaxKind5[SyntaxKind5["FirstBinaryOperator"] = 29 /* LessThanToken */] = "FirstBinaryOperator";
SyntaxKind5[SyntaxKind5["LastBinaryOperator"] = 78 /* CaretEqualsToken */] = "LastBinaryOperator";
- SyntaxKind5[SyntaxKind5["FirstStatement"] = 244 /* VariableStatement */] = "FirstStatement";
- SyntaxKind5[SyntaxKind5["LastStatement"] = 260 /* DebuggerStatement */] = "LastStatement";
- SyntaxKind5[SyntaxKind5["FirstNode"] = 165 /* QualifiedName */] = "FirstNode";
- SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 318 /* JSDocTypeExpression */] = "FirstJSDocNode";
- SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 356 /* JSDocPropertyTag */] = "LastJSDocNode";
- SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 336 /* JSDocTag */] = "FirstJSDocTagNode";
- SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 356 /* JSDocPropertyTag */] = "LastJSDocTagNode";
+ SyntaxKind5[SyntaxKind5["FirstStatement"] = 246 /* VariableStatement */] = "FirstStatement";
+ SyntaxKind5[SyntaxKind5["LastStatement"] = 262 /* DebuggerStatement */] = "LastStatement";
+ SyntaxKind5[SyntaxKind5["FirstNode"] = 166 /* QualifiedName */] = "FirstNode";
+ SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 321 /* JSDocTypeExpression */] = "FirstJSDocNode";
+ SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 359 /* JSDocPropertyTag */] = "LastJSDocNode";
+ SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 339 /* JSDocTag */] = "FirstJSDocTagNode";
+ SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 359 /* JSDocPropertyTag */] = "LastJSDocTagNode";
SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 127 /* AbstractKeyword */] = "FirstContextualKeyword";
- SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 164 /* OfKeyword */] = "LastContextualKeyword";
+ SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword";
return SyntaxKind5;
})(SyntaxKind || {});
var NodeFlags = /* @__PURE__ */ ((NodeFlags4) => {
@@ -11813,6 +11819,7 @@ var textToKeywordObj = {
protected: 123 /* ProtectedKeyword */,
public: 124 /* PublicKeyword */,
override: 163 /* OverrideKeyword */,
+ overload: 164 /* OverloadKeyword */,
out: 146 /* OutKeyword */,
readonly: 147 /* ReadonlyKeyword */,
require: 148 /* RequireKeyword */,
@@ -11843,7 +11850,7 @@ var textToKeywordObj = {
yield: 126 /* YieldKeyword */,
async: 133 /* AsyncKeyword */,
await: 134 /* AwaitKeyword */,
- of: 164 /* OfKeyword */
+ of: 165 /* OfKeyword */
};
var textToKeyword = new Map2(getEntries(textToKeywordObj));
var textToToken = new Map2(getEntries({
@@ -13918,16 +13925,16 @@ function collapseTextChangeRangesAcrossMultipleVersions(changes) {
return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
}
function getTypeParameterOwner(d) {
- if (d && d.kind === 167 /* TypeParameter */) {
+ if (d && d.kind === 168 /* TypeParameter */) {
for (let current = d; current; current = current.parent) {
- if (isFunctionLike(current) || isClassLike(current) || current.kind === 267 /* InterfaceDeclaration */) {
+ if (isFunctionLike(current) || isClassLike(current) || current.kind === 270 /* InterfaceDeclaration */) {
return current;
}
}
}
}
function isParameterPropertyDeclaration(node, parent2) {
- return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 176 /* Constructor */;
+ return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 178 /* Constructor */;
}
function isEmptyBindingPattern(node) {
if (isBindingPattern(node)) {
@@ -13953,14 +13960,14 @@ function getCombinedFlags(node, getFlags) {
node = walkUpBindingElementsAndPatterns(node);
}
let flags = getFlags(node);
- if (node.kind === 261 /* VariableDeclaration */) {
+ if (node.kind === 263 /* VariableDeclaration */) {
node = node.parent;
}
- if (node && node.kind === 262 /* VariableDeclarationList */) {
+ if (node && node.kind === 264 /* VariableDeclarationList */) {
flags |= getFlags(node);
node = node.parent;
}
- if (node && node.kind === 244 /* VariableStatement */) {
+ if (node && node.kind === 246 /* VariableStatement */) {
flags |= getFlags(node);
}
return flags;
@@ -14081,30 +14088,30 @@ function nameForNamelessJSDocTypedef(declaration) {
return getDeclarationIdentifier(hostNode);
}
switch (hostNode.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (hostNode.declarationList && hostNode.declarationList.declarations[0]) {
return getDeclarationIdentifier(hostNode.declarationList.declarations[0]);
}
break;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
let expr = hostNode.expression;
- if (expr.kind === 227 /* BinaryExpression */ && expr.operatorToken.kind === 63 /* EqualsToken */) {
+ if (expr.kind === 229 /* BinaryExpression */ && expr.operatorToken.kind === 63 /* EqualsToken */) {
expr = expr.left;
}
switch (expr.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return expr.name;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const arg = expr.argumentExpression;
if (isIdentifier(arg)) {
return arg;
}
}
break;
- case 217 /* ParenthesizedExpression */: {
+ case 219 /* ParenthesizedExpression */: {
return getDeclarationIdentifier(hostNode.expression);
}
- case 257 /* LabeledStatement */: {
+ case 259 /* LabeledStatement */: {
if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) {
return getDeclarationIdentifier(hostNode.statement);
}
@@ -14135,16 +14142,16 @@ function getNonAssignedNameOfDeclaration(declaration) {
switch (declaration.kind) {
case 79 /* Identifier */:
return declaration;
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */: {
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */: {
const { name } = declaration;
- if (name.kind === 165 /* QualifiedName */) {
+ if (name.kind === 166 /* QualifiedName */) {
return name.right;
}
break;
}
- case 213 /* CallExpression */:
- case 227 /* BinaryExpression */: {
+ case 215 /* CallExpression */:
+ case 229 /* BinaryExpression */: {
const expr2 = declaration;
switch (getAssignmentDeclarationKind(expr2)) {
case 1 /* ExportsProperty */:
@@ -14160,15 +14167,15 @@ function getNonAssignedNameOfDeclaration(declaration) {
return void 0;
}
}
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return getNameOfJSDocTypedef(declaration);
- case 348 /* JSDocEnumTag */:
+ case 351 /* JSDocEnumTag */:
return nameForNamelessJSDocTypedef(declaration);
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
const { expression } = declaration;
return isIdentifier(expression) ? expression : void 0;
}
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = declaration;
if (isBindableStaticElementAccessExpression(expr)) {
return expr.argumentExpression;
@@ -14382,10 +14389,10 @@ function getAllJSDocTagsOfKind(node, kind) {
return getJSDocTags(node).filter((doc) => doc.kind === kind);
}
function getTextOfJSDocComment(comment) {
- return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 330 /* JSDocText */ ? c.text : formatJSDocLink(c)).join("");
+ return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 333 /* JSDocText */ ? c.text : formatJSDocLink(c)).join("");
}
function formatJSDocLink(link) {
- const kind = link.kind === 333 /* JSDocLink */ ? "link" : link.kind === 334 /* JSDocLinkCode */ ? "linkcode" : "linkplain";
+ const kind = link.kind === 336 /* JSDocLink */ ? "link" : link.kind === 337 /* JSDocLinkCode */ ? "linkcode" : "linkplain";
const name = link.name ? entityNameToString(link.name) : "";
const space = link.name && link.text.startsWith("://") ? "" : " ";
return `{@${kind} ${name}${space}${link.text}}`;
@@ -14395,7 +14402,7 @@ function getEffectiveTypeParameterDeclarations(node) {
return emptyArray;
}
if (isJSDocTypeAlias(node)) {
- Debug.assert(node.parent.kind === 329 /* JSDoc */);
+ Debug.assert(node.parent.kind === 332 /* JSDoc */);
return flatMap(node.parent.tags, (tag) => isJSDocTemplateTag(tag) ? tag.typeParameters : void 0);
}
if (node.typeParameters) {
@@ -14423,7 +14430,7 @@ function isMemberName(node) {
return node.kind === 79 /* Identifier */ || node.kind === 80 /* PrivateIdentifier */;
}
function isGetOrSetAccessorDeclaration(node) {
- return node.kind === 178 /* SetAccessor */ || node.kind === 177 /* GetAccessor */;
+ return node.kind === 180 /* SetAccessor */ || node.kind === 179 /* GetAccessor */;
}
function isPropertyAccessChain(node) {
return isPropertyAccessExpression(node) && !!(node.flags & 32 /* OptionalChain */);
@@ -14436,7 +14443,7 @@ function isCallChain(node) {
}
function isOptionalChain(node) {
const kind = node.kind;
- return !!(node.flags & 32 /* OptionalChain */) && (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */ || kind === 213 /* CallExpression */ || kind === 236 /* NonNullExpression */);
+ return !!(node.flags & 32 /* OptionalChain */) && (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */ || kind === 215 /* CallExpression */ || kind === 238 /* NonNullExpression */);
}
function isOptionalChainRoot(node) {
return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken;
@@ -14448,7 +14455,7 @@ function isOutermostOptionalChain(node) {
return !isOptionalChain(node.parent) || isOptionalChainRoot(node.parent) || node !== node.parent.expression;
}
function isNullishCoalesce(node) {
- return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
+ return node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
}
function isConstTypeReference(node) {
return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "const" && !node.typeArguments;
@@ -14460,34 +14467,34 @@ function isNonNullChain(node) {
return isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */);
}
function isBreakOrContinueStatement(node) {
- return node.kind === 253 /* BreakStatement */ || node.kind === 252 /* ContinueStatement */;
+ return node.kind === 255 /* BreakStatement */ || node.kind === 254 /* ContinueStatement */;
}
function isNamedExportBindings(node) {
- return node.kind === 283 /* NamespaceExport */ || node.kind === 282 /* NamedExports */;
+ return node.kind === 286 /* NamespaceExport */ || node.kind === 285 /* NamedExports */;
}
function isUnparsedTextLike(node) {
switch (node.kind) {
- case 311 /* UnparsedText */:
- case 312 /* UnparsedInternalText */:
+ case 314 /* UnparsedText */:
+ case 315 /* UnparsedInternalText */:
return true;
default:
return false;
}
}
function isUnparsedNode(node) {
- return isUnparsedTextLike(node) || node.kind === 309 /* UnparsedPrologue */ || node.kind === 313 /* UnparsedSyntheticReference */;
+ return isUnparsedTextLike(node) || node.kind === 312 /* UnparsedPrologue */ || node.kind === 316 /* UnparsedSyntheticReference */;
}
function isJSDocPropertyLikeTag(node) {
- return node.kind === 356 /* JSDocPropertyTag */ || node.kind === 349 /* JSDocParameterTag */;
+ return node.kind === 359 /* JSDocPropertyTag */ || node.kind === 352 /* JSDocParameterTag */;
}
function isNode(node) {
return isNodeKind(node.kind);
}
function isNodeKind(kind) {
- return kind >= 165 /* FirstNode */;
+ return kind >= 166 /* FirstNode */;
}
function isTokenKind(kind) {
- return kind >= 0 /* FirstToken */ && kind <= 164 /* LastToken */;
+ return kind >= 0 /* FirstToken */ && kind <= 165 /* LastToken */;
}
function isToken(n) {
return isTokenKind(n.kind);
@@ -14503,11 +14510,11 @@ function isLiteralExpression(node) {
}
function isLiteralExpressionOfObject(node) {
switch (node.kind) {
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
case 13 /* RegularExpressionLiteral */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
return true;
}
return false;
@@ -14527,13 +14534,13 @@ function isImportOrExportSpecifier(node) {
}
function isTypeOnlyImportOrExportDeclaration(node) {
switch (node.kind) {
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return node.isTypeOnly || node.parent.parent.isTypeOnly;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return node.parent.isTypeOnly;
- case 276 /* ImportClause */:
- case 274 /* ImportEqualsDeclaration */:
+ case 279 /* ImportClause */:
+ case 277 /* ImportEqualsDeclaration */:
return node.isTypeOnly;
default:
return false;
@@ -14589,15 +14596,15 @@ function isModifier(node) {
}
function isEntityName(node) {
const kind = node.kind;
- return kind === 165 /* QualifiedName */ || kind === 79 /* Identifier */;
+ return kind === 166 /* QualifiedName */ || kind === 79 /* Identifier */;
}
function isPropertyName(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 80 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ || kind === 166 /* ComputedPropertyName */;
+ return kind === 79 /* Identifier */ || kind === 80 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ || kind === 167 /* ComputedPropertyName */;
}
function isBindingName(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 206 /* ObjectBindingPattern */ || kind === 207 /* ArrayBindingPattern */;
+ return kind === 79 /* Identifier */ || kind === 208 /* ObjectBindingPattern */ || kind === 209 /* ArrayBindingPattern */;
}
function isFunctionLike(node) {
return !!node && isFunctionLikeKind(node.kind);
@@ -14613,13 +14620,13 @@ function isBooleanLiteral(node) {
}
function isFunctionLikeDeclarationKind(kind) {
switch (kind) {
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
default:
return false;
@@ -14627,14 +14634,14 @@ function isFunctionLikeDeclarationKind(kind) {
}
function isFunctionLikeKind(kind) {
switch (kind) {
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 184 /* FunctionType */:
- case 326 /* JSDocFunctionType */:
- case 185 /* ConstructorType */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 186 /* FunctionType */:
+ case 329 /* JSDocFunctionType */:
+ case 187 /* ConstructorType */:
return true;
default:
return isFunctionLikeDeclarationKind(kind);
@@ -14645,29 +14652,33 @@ function isFunctionOrModuleBlock(node) {
}
function isAnnotationElement(node) {
const kind = node.kind;
- return kind === 172 /* AnnotationPropertyDeclaration */;
+ return kind === 173 /* AnnotationPropertyDeclaration */;
+}
+function isOverloadElement(node) {
+ const kind = node.kind;
+ return kind === 174 /* OverloadPropertyDeclaration */;
}
function isClassElement(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 171 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 241 /* SemicolonClassElement */;
+ return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */;
}
function isClassLike(node) {
- return node && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || node.kind === 265 /* StructDeclaration */);
+ return node && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 267 /* StructDeclaration */);
}
function isStruct(node) {
- return node && node.kind === 265 /* StructDeclaration */;
+ return node && node.kind === 267 /* StructDeclaration */;
}
function isAccessor(node) {
- return node && (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */);
+ return node && (node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */);
}
function isAutoAccessorPropertyDeclaration(node) {
return isPropertyDeclaration(node) && hasAccessorModifier(node);
}
function isMethodOrAccessor(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -14675,10 +14686,10 @@ function isMethodOrAccessor(node) {
}
function isNamedClassElement(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
return true;
default:
return false;
@@ -14689,22 +14700,22 @@ function isModifierLike(node) {
}
function isTypeElement(node) {
const kind = node.kind;
- return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 170 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function isClassOrTypeElement(node) {
return isTypeElement(node) || isClassElement(node);
}
function isObjectLiteralElementLike(node) {
const kind = node.kind;
- return kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 307 /* SpreadAssignment */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 310 /* SpreadAssignment */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function isTypeNode(node) {
return isTypeNodeKind(node.kind);
}
function isFunctionOrConstructorTypeNode(node) {
switch (node.kind) {
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return true;
}
return false;
@@ -14712,23 +14723,23 @@ function isFunctionOrConstructorTypeNode(node) {
function isBindingPattern(node) {
if (node) {
const kind = node.kind;
- return kind === 207 /* ArrayBindingPattern */ || kind === 206 /* ObjectBindingPattern */;
+ return kind === 209 /* ArrayBindingPattern */ || kind === 208 /* ObjectBindingPattern */;
}
return false;
}
function isAssignmentPattern(node) {
const kind = node.kind;
- return kind === 209 /* ArrayLiteralExpression */ || kind === 210 /* ObjectLiteralExpression */;
+ return kind === 211 /* ArrayLiteralExpression */ || kind === 212 /* ObjectLiteralExpression */;
}
function isArrayBindingElement(node) {
const kind = node.kind;
- return kind === 208 /* BindingElement */ || kind === 233 /* OmittedExpression */;
+ return kind === 210 /* BindingElement */ || kind === 235 /* OmittedExpression */;
}
function isDeclarationBindingElement(bindingElement) {
switch (bindingElement.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
return true;
}
return false;
@@ -14738,78 +14749,78 @@ function isBindingOrAssignmentPattern(node) {
}
function isObjectBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 206 /* ObjectBindingPattern */:
- case 210 /* ObjectLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 212 /* ObjectLiteralExpression */:
return true;
}
return false;
}
function isObjectBindingOrAssignmentElement(node) {
switch (node.kind) {
- case 208 /* BindingElement */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 210 /* BindingElement */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return true;
}
return false;
}
function isArrayBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return true;
}
return false;
}
function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
const kind = node.kind;
- return kind === 211 /* PropertyAccessExpression */ || kind === 165 /* QualifiedName */ || kind === 205 /* ImportType */;
+ return kind === 213 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */ || kind === 207 /* ImportType */;
}
function isPropertyAccessOrQualifiedName(node) {
const kind = node.kind;
- return kind === 211 /* PropertyAccessExpression */ || kind === 165 /* QualifiedName */;
+ return kind === 213 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
}
function isCallLikeExpression(node) {
switch (node.kind) {
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 215 /* TaggedTemplateExpression */:
- case 169 /* Decorator */:
- case 220 /* EtsComponentExpression */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 170 /* Decorator */:
+ case 222 /* EtsComponentExpression */:
return true;
default:
return false;
}
}
function isCallOrNewExpression(node) {
- return node.kind === 213 /* CallExpression */ || node.kind === 214 /* NewExpression */;
+ return node.kind === 215 /* CallExpression */ || node.kind === 216 /* NewExpression */;
}
function isTemplateLiteral(node) {
const kind = node.kind;
- return kind === 229 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */;
+ return kind === 231 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */;
}
function isLeftHandSideExpression(node) {
return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind);
}
function isLeftHandSideExpressionKind(kind) {
switch (kind) {
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
- case 214 /* NewExpression */:
- case 213 /* CallExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
- case 215 /* TaggedTemplateExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 217 /* ParenthesizedExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 220 /* EtsComponentExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 216 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
+ case 217 /* TaggedTemplateExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 222 /* EtsComponentExpression */:
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
case 13 /* RegularExpressionLiteral */:
@@ -14817,15 +14828,15 @@ function isLeftHandSideExpressionKind(kind) {
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
case 96 /* FalseKeyword */:
case 105 /* NullKeyword */:
case 109 /* ThisKeyword */:
case 111 /* TrueKeyword */:
case 107 /* SuperKeyword */:
- case 236 /* NonNullExpression */:
- case 234 /* ExpressionWithTypeArguments */:
- case 237 /* MetaProperty */:
+ case 238 /* NonNullExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 239 /* MetaProperty */:
case 101 /* ImportKeyword */:
return true;
default:
@@ -14837,13 +14848,13 @@ function isUnaryExpression(node) {
}
function isUnaryExpressionKind(kind) {
switch (kind) {
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
- case 221 /* DeleteExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 224 /* AwaitExpression */:
- case 216 /* TypeAssertionExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 223 /* DeleteExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 226 /* AwaitExpression */:
+ case 218 /* TypeAssertionExpression */:
return true;
default:
return isLeftHandSideExpressionKind(kind);
@@ -14851,9 +14862,9 @@ function isUnaryExpressionKind(kind) {
}
function isUnaryExpressionWithWrite(expr) {
switch (expr.kind) {
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return true;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */;
default:
return false;
@@ -14864,16 +14875,16 @@ function isExpression(node) {
}
function isExpressionKind(kind) {
switch (kind) {
- case 228 /* ConditionalExpression */:
- case 230 /* YieldExpression */:
- case 219 /* ArrowFunction */:
- case 227 /* BinaryExpression */:
- case 231 /* SpreadElement */:
- case 235 /* AsExpression */:
- case 233 /* OmittedExpression */:
- case 360 /* CommaListExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 239 /* SatisfiesExpression */:
+ case 230 /* ConditionalExpression */:
+ case 232 /* YieldExpression */:
+ case 221 /* ArrowFunction */:
+ case 229 /* BinaryExpression */:
+ case 233 /* SpreadElement */:
+ case 237 /* AsExpression */:
+ case 235 /* OmittedExpression */:
+ case 363 /* CommaListExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 241 /* SatisfiesExpression */:
return true;
default:
return isUnaryExpressionKind(kind);
@@ -14881,20 +14892,20 @@ function isExpressionKind(kind) {
}
function isAssertionExpression(node) {
const kind = node.kind;
- return kind === 216 /* TypeAssertionExpression */ || kind === 235 /* AsExpression */;
+ return kind === 218 /* TypeAssertionExpression */ || kind === 237 /* AsExpression */;
}
function isNotEmittedOrPartiallyEmittedNode(node) {
return isNotEmittedStatement(node) || isPartiallyEmittedExpression(node);
}
function isIterationStatement(node, lookInLabeledStatements) {
switch (node.kind) {
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return true;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
}
return false;
@@ -14953,7 +14964,7 @@ function allImportsAreAnnotations(imports, resolver) {
});
}
function isForInOrOfStatement(node) {
- return node.kind === 250 /* ForInStatement */ || node.kind === 251 /* ForOfStatement */;
+ return node.kind === 252 /* ForInStatement */ || node.kind === 253 /* ForOfStatement */;
}
function isConciseBody(node) {
return isBlock(node) || isExpression(node);
@@ -14966,35 +14977,35 @@ function isForInitializer(node) {
}
function isModuleBody(node) {
const kind = node.kind;
- return kind === 271 /* ModuleBlock */ || kind === 270 /* ModuleDeclaration */ || kind === 79 /* Identifier */;
+ return kind === 274 /* ModuleBlock */ || kind === 273 /* ModuleDeclaration */ || kind === 79 /* Identifier */;
}
function isNamespaceBody(node) {
const kind = node.kind;
- return kind === 271 /* ModuleBlock */ || kind === 270 /* ModuleDeclaration */;
+ return kind === 274 /* ModuleBlock */ || kind === 273 /* ModuleDeclaration */;
}
function isJSDocNamespaceBody(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 270 /* ModuleDeclaration */;
+ return kind === 79 /* Identifier */ || kind === 273 /* ModuleDeclaration */;
}
function isNamedImportBindings(node) {
const kind = node.kind;
- return kind === 278 /* NamedImports */ || kind === 277 /* NamespaceImport */;
+ return kind === 281 /* NamedImports */ || kind === 280 /* NamespaceImport */;
}
function isModuleOrEnumDeclaration(node) {
- return node.kind === 270 /* ModuleDeclaration */ || node.kind === 269 /* EnumDeclaration */;
+ return node.kind === 273 /* ModuleDeclaration */ || node.kind === 272 /* EnumDeclaration */;
}
function isDeclarationKind(kind) {
- return kind === 219 /* ArrowFunction */ || kind === 208 /* BindingElement */ || kind === 264 /* ClassDeclaration */ || kind === 232 /* ClassExpression */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 176 /* Constructor */ || kind === 269 /* EnumDeclaration */ || kind === 308 /* EnumMember */ || kind === 284 /* ExportSpecifier */ || kind === 263 /* FunctionDeclaration */ || kind === 218 /* FunctionExpression */ || kind === 177 /* GetAccessor */ || kind === 276 /* ImportClause */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 279 /* ImportSpecifier */ || kind === 267 /* InterfaceDeclaration */ || kind === 294 /* JsxAttribute */ || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 270 /* ModuleDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 277 /* NamespaceImport */ || kind === 283 /* NamespaceExport */ || kind === 168 /* Parameter */ || kind === 305 /* PropertyAssignment */ || kind === 171 /* PropertyDeclaration */ || kind === 172 /* AnnotationPropertyDeclaration */ || kind === 170 /* PropertySignature */ || kind === 178 /* SetAccessor */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 268 /* TypeAliasDeclaration */ || kind === 167 /* TypeParameter */ || kind === 261 /* VariableDeclaration */ || kind === 354 /* JSDocTypedefTag */ || kind === 347 /* JSDocCallbackTag */ || kind === 356 /* JSDocPropertyTag */;
+ return kind === 221 /* ArrowFunction */ || kind === 210 /* BindingElement */ || kind === 266 /* ClassDeclaration */ || kind === 234 /* ClassExpression */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 174 /* OverloadPropertyDeclaration */ || kind === 178 /* Constructor */ || kind === 272 /* EnumDeclaration */ || kind === 311 /* EnumMember */ || kind === 287 /* ExportSpecifier */ || kind === 265 /* FunctionDeclaration */ || kind === 220 /* FunctionExpression */ || kind === 179 /* GetAccessor */ || kind === 279 /* ImportClause */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 282 /* ImportSpecifier */ || kind === 270 /* InterfaceDeclaration */ || kind === 297 /* JsxAttribute */ || kind === 176 /* MethodDeclaration */ || kind === 175 /* MethodSignature */ || kind === 273 /* ModuleDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 280 /* NamespaceImport */ || kind === 286 /* NamespaceExport */ || kind === 169 /* Parameter */ || kind === 308 /* PropertyAssignment */ || kind === 172 /* PropertyDeclaration */ || kind === 173 /* AnnotationPropertyDeclaration */ || kind === 171 /* PropertySignature */ || kind === 180 /* SetAccessor */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 271 /* TypeAliasDeclaration */ || kind === 168 /* TypeParameter */ || kind === 263 /* VariableDeclaration */ || kind === 357 /* JSDocTypedefTag */ || kind === 350 /* JSDocCallbackTag */ || kind === 359 /* JSDocPropertyTag */;
}
function isDeclarationStatementKind(kind) {
- return kind === 263 /* FunctionDeclaration */ || kind === 285 /* MissingDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 280 /* ExportAssignment */ || kind === 273 /* NamespaceExportDeclaration */;
+ return kind === 265 /* FunctionDeclaration */ || kind === 288 /* MissingDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 269 /* OverloadDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 276 /* NamespaceExportDeclaration */;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 253 /* BreakStatement */ || kind === 252 /* ContinueStatement */ || kind === 260 /* DebuggerStatement */ || kind === 247 /* DoStatement */ || kind === 245 /* ExpressionStatement */ || kind === 243 /* EmptyStatement */ || kind === 250 /* ForInStatement */ || kind === 251 /* ForOfStatement */ || kind === 249 /* ForStatement */ || kind === 246 /* IfStatement */ || kind === 257 /* LabeledStatement */ || kind === 254 /* ReturnStatement */ || kind === 256 /* SwitchStatement */ || kind === 258 /* ThrowStatement */ || kind === 259 /* TryStatement */ || kind === 244 /* VariableStatement */ || kind === 248 /* WhileStatement */ || kind === 255 /* WithStatement */ || kind === 358 /* NotEmittedStatement */ || kind === 362 /* EndOfDeclarationMarker */ || kind === 361 /* MergeDeclarationMarker */;
+ return kind === 255 /* BreakStatement */ || kind === 254 /* ContinueStatement */ || kind === 262 /* DebuggerStatement */ || kind === 249 /* DoStatement */ || kind === 247 /* ExpressionStatement */ || kind === 245 /* EmptyStatement */ || kind === 252 /* ForInStatement */ || kind === 253 /* ForOfStatement */ || kind === 251 /* ForStatement */ || kind === 248 /* IfStatement */ || kind === 259 /* LabeledStatement */ || kind === 256 /* ReturnStatement */ || kind === 258 /* SwitchStatement */ || kind === 260 /* ThrowStatement */ || kind === 261 /* TryStatement */ || kind === 246 /* VariableStatement */ || kind === 250 /* WhileStatement */ || kind === 257 /* WithStatement */ || kind === 361 /* NotEmittedStatement */ || kind === 365 /* EndOfDeclarationMarker */ || kind === 364 /* MergeDeclarationMarker */;
}
function isDeclaration(node) {
- if (node.kind === 167 /* TypeParameter */) {
- return node.parent && node.parent.kind !== 353 /* JSDocTemplateTag */ || isInJSFile(node);
+ if (node.kind === 168 /* TypeParameter */) {
+ return node.parent && node.parent.kind !== 356 /* JSDocTemplateTag */ || isInJSFile(node);
}
return isDeclarationKind(node.kind);
}
@@ -15009,10 +15020,10 @@ function isStatement(node) {
return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || isBlockStatement(node);
}
function isBlockStatement(node) {
- if (node.kind !== 242 /* Block */)
+ if (node.kind !== 244 /* Block */)
return false;
if (node.parent !== void 0) {
- if (node.parent.kind === 259 /* TryStatement */ || node.parent.kind === 301 /* CatchClause */) {
+ if (node.parent.kind === 261 /* TryStatement */ || node.parent.kind === 304 /* CatchClause */) {
return false;
}
}
@@ -15020,50 +15031,50 @@ function isBlockStatement(node) {
}
function isStatementOrBlock(node) {
const kind = node.kind;
- return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 242 /* Block */;
+ return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 244 /* Block */;
}
function isModuleReference(node) {
const kind = node.kind;
- return kind === 286 /* ExternalModuleReference */ || kind === 165 /* QualifiedName */ || kind === 79 /* Identifier */;
+ return kind === 289 /* ExternalModuleReference */ || kind === 166 /* QualifiedName */ || kind === 79 /* Identifier */;
}
function isJsxTagNameExpression(node) {
const kind = node.kind;
- return kind === 109 /* ThisKeyword */ || kind === 79 /* Identifier */ || kind === 211 /* PropertyAccessExpression */;
+ return kind === 109 /* ThisKeyword */ || kind === 79 /* Identifier */ || kind === 213 /* PropertyAccessExpression */;
}
function isJsxChild(node) {
const kind = node.kind;
- return kind === 287 /* JsxElement */ || kind === 297 /* JsxExpression */ || kind === 288 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ || kind === 291 /* JsxFragment */;
+ return kind === 290 /* JsxElement */ || kind === 300 /* JsxExpression */ || kind === 291 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ || kind === 294 /* JsxFragment */;
}
function isJsxAttributeLike(node) {
const kind = node.kind;
- return kind === 294 /* JsxAttribute */ || kind === 296 /* JsxSpreadAttribute */;
+ return kind === 297 /* JsxAttribute */ || kind === 299 /* JsxSpreadAttribute */;
}
function isStringLiteralOrJsxExpression(node) {
const kind = node.kind;
- return kind === 10 /* StringLiteral */ || kind === 297 /* JsxExpression */;
+ return kind === 10 /* StringLiteral */ || kind === 300 /* JsxExpression */;
}
function isJsxOpeningLikeElement(node) {
const kind = node.kind;
- return kind === 289 /* JsxOpeningElement */ || kind === 288 /* JsxSelfClosingElement */;
+ return kind === 292 /* JsxOpeningElement */ || kind === 291 /* JsxSelfClosingElement */;
}
function isCaseOrDefaultClause(node) {
const kind = node.kind;
- return kind === 298 /* CaseClause */ || kind === 299 /* DefaultClause */;
+ return kind === 301 /* CaseClause */ || kind === 302 /* DefaultClause */;
}
function isJSDocNode(node) {
- return node.kind >= 318 /* FirstJSDocNode */ && node.kind <= 356 /* LastJSDocNode */;
+ return node.kind >= 321 /* FirstJSDocNode */ && node.kind <= 359 /* LastJSDocNode */;
}
function isJSDocCommentContainingNode(node) {
- return node.kind === 329 /* JSDoc */ || node.kind === 328 /* JSDocNamepathType */ || node.kind === 330 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node);
+ return node.kind === 332 /* JSDoc */ || node.kind === 331 /* JSDocNamepathType */ || node.kind === 333 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node);
}
function isJSDocTag(node) {
- return node.kind >= 336 /* FirstJSDocTagNode */ && node.kind <= 356 /* LastJSDocTagNode */;
+ return node.kind >= 339 /* FirstJSDocTagNode */ && node.kind <= 359 /* LastJSDocTagNode */;
}
function isSetAccessor(node) {
- return node.kind === 178 /* SetAccessor */;
+ return node.kind === 180 /* SetAccessor */;
}
function isGetAccessor(node) {
- return node.kind === 177 /* GetAccessor */;
+ return node.kind === 179 /* GetAccessor */;
}
function hasJSDocNodes(node) {
const { jsDoc } = node;
@@ -15077,23 +15088,23 @@ function hasInitializer(node) {
}
function hasOnlyExpressionInitializer(node) {
switch (node.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 305 /* PropertyAssignment */:
- case 308 /* EnumMember */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 308 /* PropertyAssignment */:
+ case 311 /* EnumMember */:
return true;
default:
return false;
}
}
function isObjectLiteralElement(node) {
- return node.kind === 294 /* JsxAttribute */ || node.kind === 296 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);
+ return node.kind === 297 /* JsxAttribute */ || node.kind === 299 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);
}
function isTypeReferenceType(node) {
- return node.kind === 183 /* TypeReference */ || node.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.kind === 185 /* TypeReference */ || node.kind === 236 /* ExpressionWithTypeArguments */;
}
var MAX_SMI_X86 = 1073741823;
function guessIndentation(lines) {
@@ -15121,7 +15132,7 @@ function isStringLiteralLike(node) {
return node.kind === 10 /* StringLiteral */ || node.kind === 14 /* NoSubstitutionTemplateLiteral */;
}
function isJSDocLinkLike(node) {
- return node.kind === 333 /* JSDocLink */ || node.kind === 334 /* JSDocLinkCode */ || node.kind === 335 /* JSDocLinkPlain */;
+ return node.kind === 336 /* JSDocLink */ || node.kind === 337 /* JSDocLinkCode */ || node.kind === 338 /* JSDocLinkPlain */;
}
function hasRestParameter(s) {
const last2 = lastOrUndefined(s.parameters);
@@ -15129,7 +15140,7 @@ function hasRestParameter(s) {
}
function isRestParameter(node) {
const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
- return node.dotDotDotToken !== void 0 || !!type && type.kind === 327 /* JSDocVariadicType */;
+ return node.dotDotDotToken !== void 0 || !!type && type.kind === 330 /* JSDocVariadicType */;
}
var _MemoryUtils = class {
static tryGC() {
@@ -15353,7 +15364,7 @@ function aggregateChildData(node) {
}
}
function getSourceFileOfNode(node) {
- while (node && node.kind !== 314 /* SourceFile */) {
+ while (node && node.kind !== 317 /* SourceFile */) {
node = node.parent;
}
return node;
@@ -15366,11 +15377,11 @@ function isPlainJsFile(file, checkJs) {
}
function isStatementWithLocals(node) {
switch (node.kind) {
- case 242 /* Block */:
- case 272 /* CaseBlock */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 244 /* Block */:
+ case 275 /* CaseBlock */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
return true;
}
return false;
@@ -15527,7 +15538,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
if (includeJsDoc && hasJSDocNodes(node)) {
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
}
- if (node.kind === 357 /* SyntaxList */ && node._children.length > 0) {
+ if (node.kind === 360 /* SyntaxList */ && node._children.length > 0) {
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
}
return node.virtual ? node.pos : skipTrivia(
@@ -15730,7 +15741,7 @@ function isBlockOrCatchScoped(declaration) {
}
function isCatchClauseVariableDeclarationOrBindingElement(declaration) {
const node = getRootDeclaration(declaration);
- return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 301 /* CatchClause */;
+ return node.kind === 263 /* VariableDeclaration */ && node.parent.kind === 304 /* CatchClause */;
}
function isAmbientModule(node) {
return isModuleDeclaration(node) && (node.name.kind === 10 /* StringLiteral */ || isGlobalScopeAugmentation(node));
@@ -15748,10 +15759,10 @@ function isShorthandAmbientModuleSymbol(moduleSymbol) {
return isShorthandAmbientModule(moduleSymbol.valueDeclaration);
}
function isShorthandAmbientModule(node) {
- return !!node && node.kind === 270 /* ModuleDeclaration */ && !node.body;
+ return !!node && node.kind === 273 /* ModuleDeclaration */ && !node.body;
}
function isBlockScopedContainerTopLevel(node) {
- return node.kind === 314 /* SourceFile */ || node.kind === 270 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node);
+ return node.kind === 317 /* SourceFile */ || node.kind === 273 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node);
}
function isGlobalScopeAugmentation(module2) {
return !!(module2.flags & 1024 /* GlobalAugmentation */);
@@ -15761,9 +15772,9 @@ function isExternalModuleAugmentation(node) {
}
function isModuleAugmentationExternal(node) {
switch (node.parent.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return isExternalModule(node.parent);
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return isAmbientModule(node.parent.parent) && isSourceFile(node.parent.parent.parent) && !isExternalModule(node.parent.parent.parent);
}
return false;
@@ -15811,34 +15822,34 @@ function isAmbientPropertyDeclaration(node) {
}
function isBlockScope(node, parentNode) {
switch (node.kind) {
- case 314 /* SourceFile */:
- case 272 /* CaseBlock */:
- case 301 /* CatchClause */:
- case 270 /* ModuleDeclaration */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 317 /* SourceFile */:
+ case 275 /* CaseBlock */:
+ case 304 /* CatchClause */:
+ case 273 /* ModuleDeclaration */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return true;
- case 242 /* Block */:
+ case 244 /* Block */:
return !isFunctionLikeOrClassStaticBlockDeclaration(parentNode);
}
return false;
}
function isDeclarationWithTypeParameters(node) {
switch (node.kind) {
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
- case 332 /* JSDocSignature */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 335 /* JSDocSignature */:
return true;
default:
assertType(node);
@@ -15847,26 +15858,26 @@ function isDeclarationWithTypeParameters(node) {
}
function isDeclarationWithTypeParameterChildren(node) {
switch (node.kind) {
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 326 /* JSDocFunctionType */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 353 /* JSDocTemplateTag */:
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 329 /* JSDocFunctionType */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 356 /* JSDocTemplateTag */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
default:
assertType(node);
@@ -15875,8 +15886,8 @@ function isDeclarationWithTypeParameterChildren(node) {
}
function isAnyImportSyntax(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return true;
default:
return false;
@@ -15887,17 +15898,18 @@ function isAnyImportOrBareOrAccessedRequire(node) {
}
function isLateVisibilityPaintedStatement(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 244 /* VariableStatement */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 246 /* VariableStatement */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
return true;
default:
return false;
@@ -15930,7 +15942,7 @@ function getNameFromIndexInfo(info) {
return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : void 0;
}
function isComputedNonLiteralName(name) {
- return name.kind === 166 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
+ return name.kind === 167 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
}
function tryGetTextOfPropertyName(name) {
switch (name.kind) {
@@ -15941,7 +15953,7 @@ function tryGetTextOfPropertyName(name) {
case 8 /* NumericLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return escapeLeadingUnderscores(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
if (isStringOrNumericLiteralLike(name.expression))
return escapeLeadingUnderscores(name.expression.text);
return void 0;
@@ -15959,15 +15971,15 @@ function entityNameToString(name) {
case 80 /* PrivateIdentifier */:
case 79 /* Identifier */:
return getFullWidth(name) === 0 ? idText(name) : getTextOfNode(name);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return entityNameToString(name.left) + "." + entityNameToString(name.right);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isIdentifier(name.name) || isPrivateIdentifier(name.name)) {
return entityNameToString(name.expression) + "." + entityNameToString(name.name);
} else {
return Debug.assertNever(name.name);
}
- case 320 /* JSDocMemberName */:
+ case 323 /* JSDocMemberName */:
return entityNameToString(name.left) + entityNameToString(name.right);
default:
return Debug.assertNever(name);
@@ -16047,7 +16059,7 @@ function getSpanOfTokenAtPosition(sourceFile, pos) {
}
function getErrorSpanForArrowFunction(sourceFile, node) {
const pos = skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 242 /* Block */) {
+ if (node.body && node.body.kind === 244 /* Block */) {
const { line: startLine } = getLineAndCharacterOfPosition(sourceFile, node.body.pos);
const { line: endLine } = getLineAndCharacterOfPosition(sourceFile, node.body.end);
if (startLine < endLine) {
@@ -16059,37 +16071,37 @@ function getErrorSpanForArrowFunction(sourceFile, node) {
function getErrorSpanForNode(sourceFile, node) {
let errorNode = node;
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
const pos2 = skipTrivia(sourceFile.text, 0, false);
if (pos2 === sourceFile.text.length) {
return createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos2);
- case 261 /* VariableDeclaration */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 268 /* TypeAliasDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 277 /* NamespaceImport */:
+ case 263 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 271 /* TypeAliasDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 280 /* NamespaceImport */:
errorNode = node.name;
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return getErrorSpanForArrowFunction(sourceFile, node);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
const start2 = skipTrivia(sourceFile.text, node.pos);
const end = node.statements.length > 0 ? node.statements[0].pos : node.end;
return createTextSpanFromBounds(start2, end);
@@ -16131,10 +16143,10 @@ function isLet(node) {
return !!(getCombinedNodeFlags(node) & 1 /* Let */);
}
function isSuperCall(n) {
- return n.kind === 213 /* CallExpression */ && n.expression.kind === 107 /* SuperKeyword */;
+ return n.kind === 215 /* CallExpression */ && n.expression.kind === 107 /* SuperKeyword */;
}
function isImportCall(n) {
- return n.kind === 213 /* CallExpression */ && n.expression.kind === 101 /* ImportKeyword */;
+ return n.kind === 215 /* CallExpression */ && n.expression.kind === 101 /* ImportKeyword */;
}
function isImportMeta(n) {
return isMetaProperty(n) && n.keywordToken === 101 /* ImportKeyword */ && n.name.escapedText === "meta";
@@ -16143,7 +16155,7 @@ function isLiteralImportTypeNode(n) {
return isImportTypeNode(n) && isLiteralTypeNode(n.argument) && isStringLiteral(n.argument.literal);
}
function isPrologueDirective(node) {
- return node.kind === 245 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */;
+ return node.kind === 247 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */;
}
function isCustomPrologue(node) {
return !!(getEmitFlags(node) & 1048576 /* CustomPrologue */);
@@ -16158,7 +16170,7 @@ function isHoistedVariableStatement(node) {
return isCustomPrologue(node) && isVariableStatement(node) && every(node.declarationList.declarations, isHoistedVariable);
}
function getJSDocCommentRanges(node, text) {
- const commentRanges = node.kind === 168 /* Parameter */ || node.kind === 167 /* TypeParameter */ || node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */ || node.kind === 217 /* ParenthesizedExpression */ || node.kind === 261 /* VariableDeclaration */ || node.kind === 284 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos);
+ const commentRanges = node.kind === 169 /* Parameter */ || node.kind === 168 /* TypeParameter */ || node.kind === 220 /* FunctionExpression */ || node.kind === 221 /* ArrowFunction */ || node.kind === 219 /* ParenthesizedExpression */ || node.kind === 263 /* VariableDeclaration */ || node.kind === 287 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos);
return filter(commentRanges, (comment) => text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */);
}
var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/;
@@ -16166,7 +16178,7 @@ var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/;
var defaultLibReferenceRegEx = /^(\/\/\/\s*/;
function isPartOfTypeNode(node) {
- if (182 /* FirstTypeNode */ <= node.kind && node.kind <= 205 /* LastTypeNode */) {
+ if (184 /* FirstTypeNode */ <= node.kind && node.kind <= 207 /* LastTypeNode */) {
return true;
}
switch (node.kind) {
@@ -16182,65 +16194,65 @@ function isPartOfTypeNode(node) {
case 145 /* NeverKeyword */:
return true;
case 115 /* VoidKeyword */:
- return node.parent.kind !== 223 /* VoidExpression */;
- case 234 /* ExpressionWithTypeArguments */:
+ return node.parent.kind !== 225 /* VoidExpression */;
+ case 236 /* ExpressionWithTypeArguments */:
return isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node);
- case 167 /* TypeParameter */:
- return node.parent.kind === 200 /* MappedType */ || node.parent.kind === 195 /* InferType */;
+ case 168 /* TypeParameter */:
+ return node.parent.kind === 202 /* MappedType */ || node.parent.kind === 197 /* InferType */;
case 79 /* Identifier */:
- if (node.parent.kind === 165 /* QualifiedName */ && node.parent.right === node) {
+ if (node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node) {
node = node.parent;
- } else if (node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node) {
+ } else if (node.parent.kind === 213 /* PropertyAccessExpression */ && node.parent.name === node) {
node = node.parent;
}
Debug.assert(
- node.kind === 79 /* Identifier */ || node.kind === 165 /* QualifiedName */ || node.kind === 211 /* PropertyAccessExpression */,
+ node.kind === 79 /* Identifier */ || node.kind === 166 /* QualifiedName */ || node.kind === 213 /* PropertyAccessExpression */,
"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."
);
- case 165 /* QualifiedName */:
- case 211 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
case 109 /* ThisKeyword */: {
const { parent: parent2 } = node;
- if (parent2.kind === 186 /* TypeQuery */) {
+ if (parent2.kind === 188 /* TypeQuery */) {
return false;
}
- if (parent2.kind === 205 /* ImportType */) {
+ if (parent2.kind === 207 /* ImportType */) {
return !parent2.isTypeOf;
}
- if (182 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 205 /* LastTypeNode */) {
+ if (184 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 207 /* LastTypeNode */) {
return true;
}
switch (parent2.kind) {
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return isHeritageClause(parent2.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent2);
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return node === parent2.constraint;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return node === parent2.constraint;
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 168 /* Parameter */:
- case 261 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 169 /* Parameter */:
+ case 263 /* VariableDeclaration */:
return node === parent2.type;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return node === parent2.type;
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return node === parent2.type;
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return node === parent2.type;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
return contains(parent2.typeArguments, node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return false;
}
}
@@ -16260,23 +16272,23 @@ function forEachReturnStatement(body, visitor) {
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitor(node);
- case 272 /* CaseBlock */:
- case 242 /* Block */:
- case 246 /* IfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 255 /* WithStatement */:
- case 256 /* SwitchStatement */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 257 /* LabeledStatement */:
- case 259 /* TryStatement */:
- case 301 /* CatchClause */:
+ case 275 /* CaseBlock */:
+ case 244 /* Block */:
+ case 248 /* IfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 257 /* WithStatement */:
+ case 258 /* SwitchStatement */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 259 /* LabeledStatement */:
+ case 261 /* TryStatement */:
+ case 304 /* CatchClause */:
return forEachChild(node, traverse);
}
}
@@ -16285,21 +16297,21 @@ function forEachYieldExpression(body, visitor) {
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
visitor(node);
const operand = node.expression;
if (operand) {
traverse(operand);
}
return;
- case 269 /* EnumDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return;
default:
if (isFunctionLike(node)) {
- if (node.name && node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name && node.name.kind === 167 /* ComputedPropertyName */) {
traverse(node.name.expression);
return;
}
@@ -16310,9 +16322,9 @@ function forEachYieldExpression(body, visitor) {
}
}
function getRestParameterElementType(node) {
- if (node && node.kind === 188 /* ArrayType */) {
+ if (node && node.kind === 190 /* ArrayType */) {
return node.elementType;
- } else if (node && node.kind === 183 /* TypeReference */) {
+ } else if (node && node.kind === 185 /* TypeReference */) {
return singleOrUndefined(node.typeArguments);
} else {
return void 0;
@@ -16320,27 +16332,27 @@ function getRestParameterElementType(node) {
}
function getMembersOfDeclaration(node) {
switch (node.kind) {
- case 267 /* InterfaceDeclaration */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 187 /* TypeLiteral */:
+ case 270 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 189 /* TypeLiteral */:
return node.members;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return node.properties;
}
}
function isVariableLike(node) {
if (node) {
switch (node.kind) {
- case 208 /* BindingElement */:
- case 308 /* EnumMember */:
- case 168 /* Parameter */:
- case 305 /* PropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 306 /* ShorthandPropertyAssignment */:
- case 261 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 311 /* EnumMember */:
+ case 169 /* Parameter */:
+ case 308 /* PropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 263 /* VariableDeclaration */:
return true;
}
}
@@ -16350,7 +16362,7 @@ function isVariableLikeOrAccessor(node) {
return isVariableLike(node) || isAccessor(node);
}
function isVariableDeclarationInVariableStatement(node) {
- return node.parent.kind === 262 /* VariableDeclarationList */ && node.parent.parent.kind === 244 /* VariableStatement */;
+ return node.parent.kind === 264 /* VariableDeclarationList */ && node.parent.parent.kind === 246 /* VariableStatement */;
}
function isCommonJsExportedExpression(node) {
if (!isInJSFile(node))
@@ -16367,13 +16379,13 @@ function isValidESSymbolDeclaration(node) {
}
function introducesArgumentsExoticObject(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return true;
}
return false;
@@ -16383,20 +16395,20 @@ function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) {
if (beforeUnwrapLabelCallback) {
beforeUnwrapLabelCallback(node);
}
- if (node.statement.kind !== 257 /* LabeledStatement */) {
+ if (node.statement.kind !== 259 /* LabeledStatement */) {
return node.statement;
}
node = node.statement;
}
}
function isFunctionBlock(node) {
- return node && node.kind === 242 /* Block */ && isFunctionLike(node.parent);
+ return node && node.kind === 244 /* Block */ && isFunctionLike(node.parent);
}
function isObjectLiteralMethod(node) {
- return node && node.kind === 174 /* MethodDeclaration */ && node.parent.kind === 210 /* ObjectLiteralExpression */;
+ return node && node.kind === 176 /* MethodDeclaration */ && node.parent.kind === 212 /* ObjectLiteralExpression */;
}
function isObjectLiteralOrClassExpressionMethodOrAccessor(node) {
- return (node.kind === 174 /* MethodDeclaration */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */) && (node.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.kind === 232 /* ClassExpression */);
+ return (node.kind === 176 /* MethodDeclaration */ || node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */) && (node.parent.kind === 212 /* ObjectLiteralExpression */ || node.parent.kind === 234 /* ClassExpression */);
}
function isIdentifierTypePredicate(predicate) {
return predicate && predicate.kind === 1 /* Identifier */;
@@ -16406,7 +16418,7 @@ function isThisTypePredicate(predicate) {
}
function getPropertyAssignment(objectLiteral, key, key2) {
return objectLiteral.properties.filter((property) => {
- if (property.kind === 305 /* PropertyAssignment */) {
+ if (property.kind === 308 /* PropertyAssignment */) {
const propName = tryGetTextOfPropertyName(property.name);
return key === propName || !!key2 && key2 === propName;
}
@@ -16456,63 +16468,63 @@ function getContainingStruct(node) {
return findAncestor(node.parent, isStruct);
}
function getThisContainer(node, includeArrowFunctions) {
- Debug.assert(node.kind !== 314 /* SourceFile */);
+ Debug.assert(node.kind !== 317 /* SourceFile */);
while (true) {
node = node.parent;
if (!node) {
return Debug.fail();
}
switch (node.kind) {
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
if (isClassLike(node.parent.parent)) {
return node;
}
node = node.parent;
break;
- case 169 /* Decorator */:
- if (node.parent.kind === 168 /* Parameter */ && isClassElement(node.parent.parent)) {
+ case 170 /* Decorator */:
+ if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) {
node = node.parent.parent;
} else if (isClassElement(node.parent)) {
node = node.parent;
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (!includeArrowFunctions) {
continue;
}
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 270 /* ModuleDeclaration */:
- case 175 /* ClassStaticBlockDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 269 /* EnumDeclaration */:
- case 314 /* SourceFile */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 273 /* ModuleDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 272 /* EnumDeclaration */:
+ case 317 /* SourceFile */:
return node;
}
}
}
function isThisContainerOrFunctionBlock(node) {
switch (node.kind) {
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 171 /* PropertyDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 172 /* PropertyDeclaration */:
return true;
- case 242 /* Block */:
+ case 244 /* Block */:
switch (node.parent.kind) {
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -16532,9 +16544,9 @@ function getNewTargetContainer(node) {
const container = getThisContainer(node, false);
if (container) {
switch (container.kind) {
- case 176 /* Constructor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return container;
}
}
@@ -16547,26 +16559,26 @@ function getSuperContainer(node, stopOnFunctions) {
return node;
}
switch (node.kind) {
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
node = node.parent;
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
if (!stopOnFunctions) {
continue;
}
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
return node;
- case 169 /* Decorator */:
- if (node.parent.kind === 168 /* Parameter */ && isClassElement(node.parent.parent)) {
+ case 170 /* Decorator */:
+ if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) {
node = node.parent.parent;
} else if (isClassElement(node.parent)) {
node = node.parent;
@@ -16576,14 +16588,14 @@ function getSuperContainer(node, stopOnFunctions) {
}
}
function getImmediatelyInvokedFunctionExpression(func) {
- if (func.kind === 218 /* FunctionExpression */ || func.kind === 219 /* ArrowFunction */) {
+ if (func.kind === 220 /* FunctionExpression */ || func.kind === 221 /* ArrowFunction */) {
let prev = func;
let parent2 = func.parent;
- while (parent2.kind === 217 /* ParenthesizedExpression */) {
+ while (parent2.kind === 219 /* ParenthesizedExpression */) {
prev = parent2;
parent2 = parent2.parent;
}
- if (parent2.kind === 213 /* CallExpression */ && parent2.expression === prev) {
+ if (parent2.kind === 215 /* CallExpression */ && parent2.expression === prev) {
return parent2;
}
}
@@ -16593,11 +16605,11 @@ function isSuperOrSuperProperty(node) {
}
function isSuperProperty(node) {
const kind = node.kind;
- return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 107 /* SuperKeyword */;
+ return (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */) && node.expression.kind === 107 /* SuperKeyword */;
}
function isThisProperty(node) {
const kind = node.kind;
- return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 109 /* ThisKeyword */;
+ return (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */) && node.expression.kind === 109 /* ThisKeyword */;
}
function isThisInitializedDeclaration(node) {
var _a2;
@@ -16608,22 +16620,22 @@ function isThisInitializedObjectBindingExpression(node) {
}
function getEntityNameFromTypeNode(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return node.typeName;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return isEntityNameExpression(node.expression) ? node.expression : void 0;
case 79 /* Identifier */:
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return node;
}
return void 0;
}
function getInvokedExpression(node) {
switch (node.kind) {
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return node.tag;
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return node.tagName;
default:
return node.expression;
@@ -16634,20 +16646,20 @@ function nodeCanBeDecorated(node, parent2, grandparent, compilerOptions) {
return false;
}
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
return true;
- case 171 /* PropertyDeclaration */:
- return parent2.kind === 264 /* ClassDeclaration */ || parent2.kind === 265 /* StructDeclaration */;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- return node.body !== void 0 && (parent2.kind === 264 /* ClassDeclaration */ || parent2.kind === 265 /* StructDeclaration */);
- case 168 /* Parameter */:
- return parent2.body !== void 0 && (parent2.kind === 176 /* Constructor */ || parent2.kind === 174 /* MethodDeclaration */ || parent2.kind === 178 /* SetAccessor */) && (grandparent.kind === 264 /* ClassDeclaration */ || grandparent.kind === 265 /* StructDeclaration */);
- case 263 /* FunctionDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ return parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */;
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ return node.body !== void 0 && (parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */);
+ case 169 /* Parameter */:
+ return parent2.body !== void 0 && (parent2.kind === 178 /* Constructor */ || parent2.kind === 176 /* MethodDeclaration */ || parent2.kind === 180 /* SetAccessor */) && (grandparent.kind === 266 /* ClassDeclaration */ || grandparent.kind === 267 /* StructDeclaration */);
+ case 265 /* FunctionDeclaration */:
return isArkTsDecorator(node, compilerOptions) || isSendableFunctionOrType(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return isSendableFunctionOrType(node);
}
return false;
@@ -16660,13 +16672,13 @@ function nodeOrChildIsDecorated(node, parent2, grandparent) {
}
function childIsDecorated(node, parent2) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return some(node.members, (m) => nodeOrChildIsDecorated(m, node, parent2));
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return some(node.members, (m) => nodeOrChildIsDecorated(m, node, parent2));
- case 174 /* MethodDeclaration */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
return some(node.parameters, (p) => nodeIsDecorated(p, node, parent2));
default:
return false;
@@ -16680,7 +16692,7 @@ function classOrConstructorParameterIsDecorated(node) {
}
function isJSXTagName(node) {
const { parent: parent2 } = node;
- if (parent2.kind === 289 /* JsxOpeningElement */ || parent2.kind === 288 /* JsxSelfClosingElement */ || parent2.kind === 290 /* JsxClosingElement */) {
+ if (parent2.kind === 292 /* JsxOpeningElement */ || parent2.kind === 291 /* JsxSelfClosingElement */ || parent2.kind === 293 /* JsxClosingElement */) {
return parent2.tagName === node;
}
return false;
@@ -16692,55 +16704,55 @@ function isExpressionNode(node) {
case 111 /* TrueKeyword */:
case 96 /* FalseKeyword */:
case 13 /* RegularExpressionLiteral */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 211 /* PropertyAccessExpression */:
- case 220 /* EtsComponentExpression */:
- case 212 /* ElementAccessExpression */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 215 /* TaggedTemplateExpression */:
- case 235 /* AsExpression */:
- case 216 /* TypeAssertionExpression */:
- case 239 /* SatisfiesExpression */:
- case 236 /* NonNullExpression */:
- case 217 /* ParenthesizedExpression */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
- case 219 /* ArrowFunction */:
- case 223 /* VoidExpression */:
- case 221 /* DeleteExpression */:
- case 222 /* TypeOfExpression */:
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
- case 227 /* BinaryExpression */:
- case 228 /* ConditionalExpression */:
- case 231 /* SpreadElement */:
- case 229 /* TemplateExpression */:
- case 233 /* OmittedExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
- case 230 /* YieldExpression */:
- case 224 /* AwaitExpression */:
- case 237 /* MetaProperty */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 222 /* EtsComponentExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 237 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 241 /* SatisfiesExpression */:
+ case 238 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 225 /* VoidExpression */:
+ case 223 /* DeleteExpression */:
+ case 224 /* TypeOfExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 229 /* BinaryExpression */:
+ case 230 /* ConditionalExpression */:
+ case 233 /* SpreadElement */:
+ case 231 /* TemplateExpression */:
+ case 235 /* OmittedExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
+ case 232 /* YieldExpression */:
+ case 226 /* AwaitExpression */:
+ case 239 /* MetaProperty */:
return true;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return !isHeritageClause(node.parent);
- case 165 /* QualifiedName */:
- while (node.parent.kind === 165 /* QualifiedName */) {
+ case 166 /* QualifiedName */:
+ while (node.parent.kind === 166 /* QualifiedName */) {
node = node.parent;
}
- return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
- case 320 /* JSDocMemberName */:
+ return node.parent.kind === 188 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
+ case 323 /* JSDocMemberName */:
while (isJSDocMemberName(node.parent)) {
node = node.parent;
}
- return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
+ return node.parent.kind === 188 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
case 80 /* PrivateIdentifier */:
return isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 102 /* InKeyword */;
case 79 /* Identifier */:
- if (node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) {
+ if (node.parent.kind === 188 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) {
return true;
}
case 8 /* NumericLiteral */:
@@ -16756,64 +16768,64 @@ function isExpressionNode(node) {
function isInExpressionContext(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 308 /* EnumMember */:
- case 305 /* PropertyAssignment */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 311 /* EnumMember */:
+ case 308 /* PropertyAssignment */:
+ case 210 /* BindingElement */:
return parent2.initializer === node;
- case 245 /* ExpressionStatement */:
- case 246 /* IfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 254 /* ReturnStatement */:
- case 255 /* WithStatement */:
- case 256 /* SwitchStatement */:
- case 298 /* CaseClause */:
- case 258 /* ThrowStatement */:
+ case 247 /* ExpressionStatement */:
+ case 248 /* IfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 256 /* ReturnStatement */:
+ case 257 /* WithStatement */:
+ case 258 /* SwitchStatement */:
+ case 301 /* CaseClause */:
+ case 260 /* ThrowStatement */:
return parent2.expression === node;
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
const forStatement = parent2;
- return forStatement.initializer === node && forStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ return forStatement.initializer === node && forStatement.initializer.kind !== 264 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
const forInStatement = parent2;
- return forInStatement.initializer === node && forInStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forInStatement.expression === node;
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ return forInStatement.initializer === node && forInStatement.initializer.kind !== 264 /* VariableDeclarationList */ || forInStatement.expression === node;
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return node === parent2.expression;
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return node === parent2.expression;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return node === parent2.expression;
- case 169 /* Decorator */:
- case 297 /* JsxExpression */:
- case 296 /* JsxSpreadAttribute */:
- case 307 /* SpreadAssignment */:
+ case 170 /* Decorator */:
+ case 300 /* JsxExpression */:
+ case 299 /* JsxSpreadAttribute */:
+ case 310 /* SpreadAssignment */:
return true;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return parent2.expression === node && !isPartOfTypeNode(parent2);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return parent2.objectAssignmentInitializer === node;
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return node === parent2.expression;
default:
return isExpressionNode(parent2);
}
}
function isPartOfTypeQuery(node) {
- while (node.kind === 165 /* QualifiedName */ || node.kind === 79 /* Identifier */) {
+ while (node.kind === 166 /* QualifiedName */ || node.kind === 79 /* Identifier */) {
node = node.parent;
}
- return node.kind === 186 /* TypeQuery */;
+ return node.kind === 188 /* TypeQuery */;
}
function isNamespaceReexportDeclaration(node) {
return isNamespaceExport(node) && !!node.parent.moduleSpecifier;
}
function isExternalModuleImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 286 /* ExternalModuleReference */;
+ return node.kind === 277 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 289 /* ExternalModuleReference */;
}
function getExternalModuleImportEqualsDeclarationExpression(node) {
Debug.assert(isExternalModuleImportEqualsDeclaration(node));
@@ -16823,7 +16835,7 @@ function getExternalModuleRequireArgument(node) {
return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
}
function isInternalModuleImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 286 /* ExternalModuleReference */;
+ return node.kind === 277 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 289 /* ExternalModuleReference */;
}
function isSourceFileJS(file) {
return isInJSFile(file);
@@ -16882,7 +16894,7 @@ function isInStruct(node) {
return !!container && isStruct(container);
}
function isRequireCall(callExpression, requireStringLiteralLikeArgument) {
- if (callExpression.kind !== 213 /* CallExpression */) {
+ if (callExpression.kind !== 215 /* CallExpression */) {
return false;
}
const { expression, arguments: args } = callExpression;
@@ -16944,9 +16956,9 @@ function getAssignedExpandoInitializer(node) {
function getExpandoInitializer(initializer, isPrototypeAssignment) {
if (isCallExpression(initializer)) {
const e = skipParentheses(initializer.expression);
- return e.kind === 218 /* FunctionExpression */ || e.kind === 219 /* ArrowFunction */ ? initializer : void 0;
+ return e.kind === 220 /* FunctionExpression */ || e.kind === 221 /* ArrowFunction */ ? initializer : void 0;
}
- if (initializer.kind === 218 /* FunctionExpression */ || initializer.kind === 232 /* ClassExpression */ || initializer.kind === 219 /* ArrowFunction */) {
+ if (initializer.kind === 220 /* FunctionExpression */ || initializer.kind === 234 /* ClassExpression */ || initializer.kind === 221 /* ArrowFunction */) {
return initializer;
}
if (isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) {
@@ -17108,7 +17120,7 @@ function isPrototypePropertyAssignment(node) {
return isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 3 /* PrototypeProperty */;
}
function isSpecialPropertyDeclaration(expr) {
- return isInJSFile(expr) && expr.parent && expr.parent.kind === 245 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent);
+ return isInJSFile(expr) && expr.parent && expr.parent.kind === 247 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent);
}
function setValueDeclaration(symbol, node) {
const { valueDeclaration } = symbol;
@@ -17121,16 +17133,16 @@ function isFunctionSymbol(symbol) {
return false;
}
const decl = symbol.valueDeclaration;
- return decl.kind === 263 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer);
+ return decl.kind === 265 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer);
}
function tryGetModuleSpecifierFromDeclaration(node) {
var _a2, _b;
switch (node.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return (_a2 = findAncestor(node.initializer, (node2) => isRequireCall(node2, true))) == null ? void 0 : _a2.arguments[0];
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return tryCast(node.moduleSpecifier, isStringLiteralLike);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
default:
Debug.assertNever(node);
@@ -17141,14 +17153,14 @@ function importFromModuleSpecifier(node) {
}
function tryGetImportFromModuleSpecifier(node) {
switch (node.parent.kind) {
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
return node.parent;
- case 286 /* ExternalModuleReference */:
+ case 289 /* ExternalModuleReference */:
return node.parent.parent;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return isImportCall(node.parent) || isRequireCall(node.parent, false) ? node.parent : void 0;
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
Debug.assert(isStringLiteral(node));
return tryCast(node.parent.parent, isImportTypeNode);
default:
@@ -17157,16 +17169,16 @@ function tryGetImportFromModuleSpecifier(node) {
}
function getExternalModuleName(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
return node.moduleSpecifier;
- case 274 /* ImportEqualsDeclaration */:
- return node.moduleReference.kind === 286 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
- case 205 /* ImportType */:
+ case 277 /* ImportEqualsDeclaration */:
+ return node.moduleReference.kind === 289 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
+ case 207 /* ImportType */:
return isLiteralImportTypeNode(node) ? node.argument.literal : void 0;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return node.arguments[0];
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return node.name.kind === 10 /* StringLiteral */ ? node.name : void 0;
default:
return Debug.assertNever(node);
@@ -17174,18 +17186,18 @@ function getExternalModuleName(node) {
}
function getNamespaceDeclarationNode(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return node.importClause && tryCast(node.importClause.namedBindings, isNamespaceImport);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return node;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return node.exportClause && tryCast(node.exportClause, isNamespaceExport);
default:
return Debug.assertNever(node);
}
}
function isDefaultImport(node) {
- return node.kind === 275 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
+ return node.kind === 278 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
}
function forEachImportClauseDeclaration(node, action) {
if (node.name) {
@@ -17202,13 +17214,13 @@ function forEachImportClauseDeclaration(node, action) {
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
- case 168 /* Parameter */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 306 /* ShorthandPropertyAssignment */:
- case 305 /* PropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 169 /* Parameter */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return node.questionToken !== void 0;
}
}
@@ -17220,7 +17232,7 @@ function isJSDocConstructSignature(node) {
return !!name && name.escapedText === "new";
}
function isJSDocTypeAlias(node) {
- return node.kind === 354 /* JSDocTypedefTag */ || node.kind === 347 /* JSDocCallbackTag */ || node.kind === 348 /* JSDocEnumTag */;
+ return node.kind === 357 /* JSDocTypedefTag */ || node.kind === 350 /* JSDocCallbackTag */ || node.kind === 351 /* JSDocEnumTag */;
}
function isTypeAlias(node) {
return isJSDocTypeAlias(node) || isTypeAliasDeclaration(node);
@@ -17233,14 +17245,14 @@ function getSourceOfDefaultedAssignment(node) {
}
function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
const v = getSingleVariableOfVariableStatement(node);
return v && v.initializer;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return node.initializer;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return node.initializer;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return node.initializer;
}
}
@@ -17248,7 +17260,7 @@ function getSingleVariableOfVariableStatement(node) {
return isVariableStatement(node) ? firstOrUndefined(node.declarationList.declarations) : void 0;
}
function getNestedModuleDeclaration(node) {
- return isModuleDeclaration(node) && node.body && node.body.kind === 270 /* ModuleDeclaration */ ? node.body : void 0;
+ return isModuleDeclaration(node) && node.body && node.body.kind === 273 /* ModuleDeclaration */ ? node.body : void 0;
}
function getJSDocCommentsAndTags(hostNode, noCache) {
let result;
@@ -17260,11 +17272,11 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
if (hasJSDocNodes(node)) {
result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
}
- if (node.kind === 168 /* Parameter */) {
+ if (node.kind === 169 /* Parameter */) {
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
break;
}
- if (node.kind === 167 /* TypeParameter */) {
+ if (node.kind === 168 /* TypeParameter */) {
result = addRange(result, (noCache ? getJSDocTypeParameterTagsNoCache : getJSDocTypeParameterTags)(node));
break;
}
@@ -17284,7 +17296,7 @@ function ownsJSDocTag(hostNode, tag) {
}
function getNextJSDocCommentLocation(node) {
const parent2 = node.parent;
- if (parent2.kind === 305 /* PropertyAssignment */ || parent2.kind === 280 /* ExportAssignment */ || parent2.kind === 171 /* PropertyDeclaration */ || parent2.kind === 245 /* ExpressionStatement */ && node.kind === 211 /* PropertyAccessExpression */ || parent2.kind === 254 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isBinaryExpression(node) && node.operatorToken.kind === 63 /* EqualsToken */) {
+ if (parent2.kind === 308 /* PropertyAssignment */ || parent2.kind === 283 /* ExportAssignment */ || parent2.kind === 172 /* PropertyDeclaration */ || parent2.kind === 247 /* ExpressionStatement */ && node.kind === 213 /* PropertyAccessExpression */ || parent2.kind === 256 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isBinaryExpression(node) && node.operatorToken.kind === 63 /* EqualsToken */) {
return parent2;
} else if (parent2.parent && (getSingleVariableOfVariableStatement(parent2.parent) === node || isBinaryExpression(parent2) && parent2.operatorToken.kind === 63 /* EqualsToken */)) {
return parent2.parent;
@@ -17360,32 +17372,32 @@ function getAssignmentTargetKind(node) {
let parent2 = node.parent;
while (true) {
switch (parent2.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const binaryOperator = parent2.operatorToken.kind;
return isAssignmentOperator(binaryOperator) && parent2.left === node ? binaryOperator === 63 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
const unaryOperator = parent2.operator;
return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
return parent2.initializer === node ? 1 /* Definite */ : 0 /* None */;
- case 217 /* ParenthesizedExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 231 /* SpreadElement */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 233 /* SpreadElement */:
+ case 238 /* NonNullExpression */:
node = parent2;
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
node = parent2.parent;
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
if (parent2.name !== node) {
return 0 /* None */;
}
node = parent2.parent;
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (parent2.name === node) {
return 0 /* None */;
}
@@ -17402,22 +17414,22 @@ function isAssignmentTarget(node) {
}
function isNodeWithPossibleHoistedDeclaration(node) {
switch (node.kind) {
- case 242 /* Block */:
- case 244 /* VariableStatement */:
- case 255 /* WithStatement */:
- case 246 /* IfStatement */:
- case 256 /* SwitchStatement */:
- case 272 /* CaseBlock */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 257 /* LabeledStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 259 /* TryStatement */:
- case 301 /* CatchClause */:
+ case 244 /* Block */:
+ case 246 /* VariableStatement */:
+ case 257 /* WithStatement */:
+ case 248 /* IfStatement */:
+ case 258 /* SwitchStatement */:
+ case 275 /* CaseBlock */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 259 /* LabeledStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 261 /* TryStatement */:
+ case 304 /* CatchClause */:
return true;
}
return false;
@@ -17432,14 +17444,14 @@ function walkUp(node, kind) {
return node;
}
function walkUpParenthesizedTypes(node) {
- return walkUp(node, 196 /* ParenthesizedType */);
+ return walkUp(node, 198 /* ParenthesizedType */);
}
function walkUpParenthesizedExpressions(node) {
- return walkUp(node, 217 /* ParenthesizedExpression */);
+ return walkUp(node, 219 /* ParenthesizedExpression */);
}
function walkUpParenthesizedTypesAndGetParentAndChild(node) {
let child;
- while (node && node.kind === 196 /* ParenthesizedType */) {
+ while (node && node.kind === 198 /* ParenthesizedType */) {
child = node;
node = node.parent;
}
@@ -17455,11 +17467,11 @@ function skipParentheses(node, excludeJSDocTypeAssertions) {
return skipOuterExpressions(node, flags);
}
function isDeleteTarget(node) {
- if (node.kind !== 211 /* PropertyAccessExpression */ && node.kind !== 212 /* ElementAccessExpression */) {
+ if (node.kind !== 213 /* PropertyAccessExpression */ && node.kind !== 214 /* ElementAccessExpression */) {
return false;
}
node = walkUpParenthesizedExpressions(node.parent);
- return node && node.kind === 221 /* DeleteExpression */;
+ return node && node.kind === 223 /* DeleteExpression */;
}
function isNodeDescendantOf(node, ancestor) {
while (node) {
@@ -17497,56 +17509,56 @@ function getDeclarationFromName(name) {
}
}
function isLiteralComputedPropertyDeclarationName(node) {
- return isStringOrNumericLiteralLike(node) && node.parent.kind === 166 /* ComputedPropertyName */ && isDeclaration(node.parent.parent);
+ return isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ && isDeclaration(node.parent.parent);
}
function isIdentifierName(node) {
const parent2 = node.parent;
switch (parent2.kind) {
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 308 /* EnumMember */:
- case 305 /* PropertyAssignment */:
- case 211 /* PropertyAccessExpression */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 311 /* EnumMember */:
+ case 308 /* PropertyAssignment */:
+ case 213 /* PropertyAccessExpression */:
return parent2.name === node;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return parent2.right === node;
- case 208 /* BindingElement */:
- case 279 /* ImportSpecifier */:
+ case 210 /* BindingElement */:
+ case 282 /* ImportSpecifier */:
return parent2.propertyName === node;
- case 284 /* ExportSpecifier */:
- case 294 /* JsxAttribute */:
- case 288 /* JsxSelfClosingElement */:
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
+ case 287 /* ExportSpecifier */:
+ case 297 /* JsxAttribute */:
+ case 291 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
return true;
}
return false;
}
function isAliasSymbolDeclaration(node) {
- if (node.kind === 274 /* ImportEqualsDeclaration */ || node.kind === 273 /* NamespaceExportDeclaration */ || node.kind === 276 /* ImportClause */ && !!node.name || node.kind === 277 /* NamespaceImport */ || node.kind === 283 /* NamespaceExport */ || node.kind === 279 /* ImportSpecifier */ || node.kind === 284 /* ExportSpecifier */ || node.kind === 280 /* ExportAssignment */ && exportAssignmentIsAlias(node)) {
+ if (node.kind === 277 /* ImportEqualsDeclaration */ || node.kind === 276 /* NamespaceExportDeclaration */ || node.kind === 279 /* ImportClause */ && !!node.name || node.kind === 280 /* NamespaceImport */ || node.kind === 286 /* NamespaceExport */ || node.kind === 282 /* ImportSpecifier */ || node.kind === 287 /* ExportSpecifier */ || node.kind === 283 /* ExportAssignment */ && exportAssignmentIsAlias(node)) {
return true;
}
return isInJSFile(node) && (isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isPropertyAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableExpression(node.parent.right));
}
function getAliasDeclarationFromName(node) {
switch (node.parent.kind) {
- case 276 /* ImportClause */:
- case 279 /* ImportSpecifier */:
- case 277 /* NamespaceImport */:
- case 284 /* ExportSpecifier */:
- case 280 /* ExportAssignment */:
- case 274 /* ImportEqualsDeclaration */:
- case 283 /* NamespaceExport */:
+ case 279 /* ImportClause */:
+ case 282 /* ImportSpecifier */:
+ case 280 /* NamespaceImport */:
+ case 287 /* ExportSpecifier */:
+ case 283 /* ExportAssignment */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 286 /* NamespaceExport */:
return node.parent;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
do {
node = node.parent;
- } while (node.parent.kind === 165 /* QualifiedName */);
+ } while (node.parent.kind === 166 /* QualifiedName */);
return getAliasDeclarationFromName(node);
}
}
@@ -17561,7 +17573,7 @@ function getExportAssignmentExpression(node) {
return isExportAssignment(node) ? node.expression : node.right;
}
function getPropertyAssignmentAliasLikeExpression(node) {
- return node.kind === 306 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 305 /* PropertyAssignment */ ? node.initializer : node.parent.right;
+ return node.kind === 309 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 308 /* PropertyAssignment */ ? node.initializer : node.parent.right;
}
function getEffectiveBaseTypeNode(node) {
const baseType = getClassExtendsHeritageElement(node);
@@ -17646,10 +17658,10 @@ function getVirtualEtsComponent(node) {
return void 0;
}
function isKeyword(token) {
- return 81 /* FirstKeyword */ <= token && token <= 164 /* LastKeyword */;
+ return 81 /* FirstKeyword */ <= token && token <= 165 /* LastKeyword */;
}
function isContextualKeyword(token) {
- return 127 /* FirstContextualKeyword */ <= token && token <= 164 /* LastContextualKeyword */;
+ return 127 /* FirstContextualKeyword */ <= token && token <= 165 /* LastContextualKeyword */;
}
function isNonContextualKeyword(token) {
return isKeyword(token) && !isContextualKeyword(token);
@@ -17685,13 +17697,13 @@ function getFunctionFlags(node) {
}
let flags = 0 /* Normal */;
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
if (node.asteriskToken) {
flags |= 1 /* Generator */;
}
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (hasSyntacticModifier(node, 512 /* Async */)) {
flags |= 2 /* Async */;
}
@@ -17704,10 +17716,10 @@ function getFunctionFlags(node) {
}
function isAsyncFunction(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 512 /* Async */);
}
return false;
@@ -17723,7 +17735,7 @@ function hasDynamicName(declaration) {
return !!name && isDynamicName(name);
}
function isDynamicName(name) {
- if (!(name.kind === 166 /* ComputedPropertyName */ || name.kind === 212 /* ElementAccessExpression */)) {
+ if (!(name.kind === 167 /* ComputedPropertyName */ || name.kind === 214 /* ElementAccessExpression */)) {
return false;
}
const expr = isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression;
@@ -17737,7 +17749,7 @@ function getPropertyNameForPropertyNameNode(name) {
case 10 /* StringLiteral */:
case 8 /* NumericLiteral */:
return escapeLeadingUnderscores(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
const nameExpression = name.expression;
if (isStringOrNumericLiteralLike(nameExpression)) {
return escapeLeadingUnderscores(nameExpression.text);
@@ -17789,17 +17801,17 @@ function isPushOrUnshiftIdentifier(node) {
}
function isParameterDeclaration(node) {
const root = getRootDeclaration(node);
- return root.kind === 168 /* Parameter */;
+ return root.kind === 169 /* Parameter */;
}
function getRootDeclaration(node) {
- while (node.kind === 208 /* BindingElement */) {
+ while (node.kind === 210 /* BindingElement */) {
node = node.parent.parent;
}
return node;
}
function nodeStartsNewLexicalEnvironment(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 218 /* FunctionExpression */ || kind === 263 /* FunctionDeclaration */ || kind === 219 /* ArrowFunction */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 270 /* ModuleDeclaration */ || kind === 314 /* SourceFile */;
+ return kind === 178 /* Constructor */ || kind === 220 /* FunctionExpression */ || kind === 265 /* FunctionDeclaration */ || kind === 221 /* ArrowFunction */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 273 /* ModuleDeclaration */ || kind === 317 /* SourceFile */;
}
function nodeIsSynthesized(range) {
return positionIsSynthesized(range.pos) || positionIsSynthesized(range.end);
@@ -17814,22 +17826,22 @@ var Associativity = /* @__PURE__ */ ((Associativity2) => {
})(Associativity || {});
function getExpressionAssociativity(expression) {
const operator = getOperator(expression);
- const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0;
+ const hasArguments = expression.kind === 216 /* NewExpression */ && expression.arguments !== void 0;
return getOperatorAssociativity(expression.kind, operator, hasArguments);
}
function getOperatorAssociativity(kind, operator, hasArguments) {
switch (kind) {
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return hasArguments ? 0 /* Left */ : 1 /* Right */;
- case 225 /* PrefixUnaryExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 221 /* DeleteExpression */:
- case 224 /* AwaitExpression */:
- case 228 /* ConditionalExpression */:
- case 230 /* YieldExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 223 /* DeleteExpression */:
+ case 226 /* AwaitExpression */:
+ case 230 /* ConditionalExpression */:
+ case 232 /* YieldExpression */:
return 1 /* Right */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (operator) {
case 42 /* AsteriskAsteriskToken */:
case 63 /* EqualsToken */:
@@ -17855,13 +17867,13 @@ function getOperatorAssociativity(kind, operator, hasArguments) {
}
function getExpressionPrecedence(expression) {
const operator = getOperator(expression);
- const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0;
+ const hasArguments = expression.kind === 216 /* NewExpression */ && expression.arguments !== void 0;
return getOperatorPrecedence(expression.kind, operator, hasArguments);
}
function getOperator(expression) {
- if (expression.kind === 227 /* BinaryExpression */) {
+ if (expression.kind === 229 /* BinaryExpression */) {
return expression.operatorToken.kind;
- } else if (expression.kind === 225 /* PrefixUnaryExpression */ || expression.kind === 226 /* PostfixUnaryExpression */) {
+ } else if (expression.kind === 227 /* PrefixUnaryExpression */ || expression.kind === 228 /* PostfixUnaryExpression */) {
return expression.operator;
} else {
return expression.kind;
@@ -17897,15 +17909,15 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => {
})(OperatorPrecedence || {});
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return 0 /* Comma */;
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return 1 /* Spread */;
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return 2 /* Yield */;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return 4 /* Conditional */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (operatorKind) {
case 27 /* CommaToken */:
return 0 /* Comma */;
@@ -17929,27 +17941,27 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
default:
return getBinaryOperatorPrecedence(operatorKind);
}
- case 216 /* TypeAssertionExpression */:
- case 236 /* NonNullExpression */:
- case 225 /* PrefixUnaryExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 221 /* DeleteExpression */:
- case 224 /* AwaitExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 238 /* NonNullExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 223 /* DeleteExpression */:
+ case 226 /* AwaitExpression */:
return 16 /* Unary */;
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return 17 /* Update */;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return 18 /* LeftHandSide */;
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */;
- case 215 /* TaggedTemplateExpression */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
- case 237 /* MetaProperty */:
+ case 217 /* TaggedTemplateExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 239 /* MetaProperty */:
return 19 /* Member */;
- case 235 /* AsExpression */:
- case 239 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 241 /* SatisfiesExpression */:
return 11 /* Relational */;
case 109 /* ThisKeyword */:
case 107 /* SuperKeyword */:
@@ -17961,19 +17973,19 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
case 8 /* NumericLiteral */:
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 232 /* ClassExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
case 13 /* RegularExpressionLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
- case 217 /* ParenthesizedExpression */:
- case 233 /* OmittedExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
+ case 231 /* TemplateExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 235 /* OmittedExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
return 20 /* Primary */;
default:
return -1 /* Invalid */;
@@ -18026,7 +18038,7 @@ function getBinaryOperatorPrecedence(kind) {
function getSemanticJsxChildren(children) {
return filter(children, (i) => {
switch (i.kind) {
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return !!i.expression;
case 11 /* JsxText */:
return !i.containsOnlyTriviaWhiteSpaces;
@@ -18417,7 +18429,7 @@ function isThisInTypeQuery(node) {
while (isQualifiedName(node.parent) && node.parent.left === node) {
node = node.parent;
}
- return node.parent.kind === 186 /* TypeQuery */;
+ return node.parent.kind === 188 /* TypeQuery */;
}
function identifierIsThisKeyword(id) {
return id.originalKeywordKind === 109 /* ThisKeyword */;
@@ -18429,9 +18441,9 @@ function getAllAccessorDeclarations(declarations, accessor) {
let setAccessor;
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
- if (accessor.kind === 177 /* GetAccessor */) {
+ if (accessor.kind === 179 /* GetAccessor */) {
getAccessor = accessor;
- } else if (accessor.kind === 178 /* SetAccessor */) {
+ } else if (accessor.kind === 180 /* SetAccessor */) {
setAccessor = accessor;
} else {
Debug.fail("Accessor has wrong kind");
@@ -18447,10 +18459,10 @@ function getAllAccessorDeclarations(declarations, accessor) {
} else if (!secondAccessor) {
secondAccessor = member;
}
- if (member.kind === 177 /* GetAccessor */ && !getAccessor) {
+ if (member.kind === 179 /* GetAccessor */ && !getAccessor) {
getAccessor = member;
}
- if (member.kind === 178 /* SetAccessor */ && !setAccessor) {
+ if (member.kind === 180 /* SetAccessor */ && !setAccessor) {
setAccessor = member;
}
}
@@ -18482,7 +18494,7 @@ function getJSDocTypeParameterDeclarations(node) {
return flatMap(getJSDocTags(node), (tag) => isNonTypeAliasTemplate(tag) ? tag.typeParameters : void 0);
}
function isNonTypeAliasTemplate(tag) {
- return isJSDocTemplateTag(tag) && !(tag.parent.kind === 329 /* JSDoc */ && tag.parent.tags.some(isJSDocTypeAlias));
+ return isJSDocTemplateTag(tag) && !(tag.parent.kind === 332 /* JSDoc */ && tag.parent.tags.some(isJSDocTypeAlias));
}
function getEffectiveSetAccessorTypeAnnotationNode(node) {
const parameter = getSetAccessorValueParameter(node);
@@ -18667,7 +18679,7 @@ function getSelectedSyntacticModifierFlags(node, flags) {
return getSyntacticModifierFlags(node) & flags;
}
function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) {
- if (node.kind >= 0 /* FirstToken */ && node.kind <= 164 /* LastToken */) {
+ if (node.kind >= 0 /* FirstToken */ && node.kind <= 165 /* LastToken */) {
return 0 /* None */;
}
if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) {
@@ -18758,7 +18770,7 @@ function modifierToFlag(token) {
return 32768 /* In */;
case 146 /* OutKeyword */:
return 65536 /* Out */;
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return 131072 /* Decorator */;
}
return 0 /* None */;
@@ -18791,7 +18803,7 @@ function isLeftHandSideOfAssignment(node) {
function isDestructuringAssignment(node) {
if (isAssignmentExpression(node, true)) {
const kind = node.left.kind;
- return kind === 210 /* ObjectLiteralExpression */ || kind === 209 /* ArrayLiteralExpression */;
+ return kind === 212 /* ObjectLiteralExpression */ || kind === 211 /* ArrayLiteralExpression */;
}
return false;
}
@@ -18805,12 +18817,12 @@ function getFirstIdentifier(node) {
switch (node.kind) {
case 79 /* Identifier */:
return node;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
do {
node = node.left;
} while (node.kind !== 79 /* Identifier */);
return node;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
do {
node = node.expression;
} while (node.kind !== 79 /* Identifier */);
@@ -18818,7 +18830,7 @@ function getFirstIdentifier(node) {
}
}
function isDottedName(node) {
- return node.kind === 79 /* Identifier */ || node.kind === 109 /* ThisKeyword */ || node.kind === 107 /* SuperKeyword */ || node.kind === 237 /* MetaProperty */ || node.kind === 211 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 217 /* ParenthesizedExpression */ && isDottedName(node.expression);
+ return node.kind === 79 /* Identifier */ || node.kind === 109 /* ThisKeyword */ || node.kind === 107 /* SuperKeyword */ || node.kind === 239 /* MetaProperty */ || node.kind === 213 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 219 /* ParenthesizedExpression */ && isDottedName(node.expression);
}
function isPropertyAccessEntityNameExpression(node) {
return isPropertyAccessExpression(node) && isIdentifier(node.name) && isEntityNameExpression(node.expression);
@@ -18843,7 +18855,7 @@ function isPrototypeAccess(node) {
return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype";
}
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
- return node.parent.kind === 165 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node;
+ return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 213 /* PropertyAccessExpression */ && node.parent.name === node;
}
function isRightSideOfAccessExpression(node) {
return isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node;
@@ -18852,10 +18864,10 @@ function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) {
return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node || isJSDocMemberName(node.parent) && node.parent.right === node;
}
function isEmptyObjectLiteral(expression) {
- return expression.kind === 210 /* ObjectLiteralExpression */ && expression.properties.length === 0;
+ return expression.kind === 212 /* ObjectLiteralExpression */ && expression.properties.length === 0;
}
function isEmptyArrayLiteral(expression) {
- return expression.kind === 209 /* ArrayLiteralExpression */ && expression.elements.length === 0;
+ return expression.kind === 211 /* ArrayLiteralExpression */ && expression.elements.length === 0;
}
function getLocalSymbolForExportDefault(symbol) {
if (!isExportDefaultSymbol(symbol) || !symbol.declarations)
@@ -19083,8 +19095,8 @@ function isDeclarationNameOfEnumOrNamespace(node) {
const parseNode = getParseTreeNode(node);
if (parseNode) {
switch (parseNode.parent.kind) {
- case 269 /* EnumDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
return parseNode === parseNode.parent.name;
}
}
@@ -19145,30 +19157,30 @@ function accessKind(node) {
if (!parent2)
return 0 /* Read */;
switch (parent2.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return accessKind(parent2);
- case 226 /* PostfixUnaryExpression */:
- case 225 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const { operator } = parent2;
return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const { left, operatorToken } = parent2;
return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 63 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return parent2.name !== node ? 0 /* Read */ : accessKind(parent2);
- case 305 /* PropertyAssignment */: {
+ case 308 /* PropertyAssignment */: {
const parentAccess = accessKind(parent2.parent);
return node === parent2.name ? reverseAccessKind(parentAccess) : parentAccess;
}
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return node === parent2.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent2.parent);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return accessKind(parent2);
default:
return 0 /* Read */;
}
function writeOrReadWrite() {
- return parent2.parent && walkUpParenthesizedExpressions(parent2.parent).kind === 245 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
+ return parent2.parent && walkUpParenthesizedExpressions(parent2.parent).kind === 247 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
}
}
function reverseAccessKind(a) {
@@ -19281,16 +19293,16 @@ function isObjectTypeDeclaration(node) {
return isClassLike(node) || isInterfaceDeclaration(node) || isTypeLiteralNode(node);
}
function isTypeNodeKind(kind) {
- return kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */ || kind === 132 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 149 /* NumberKeyword */ || kind === 162 /* BigIntKeyword */ || kind === 150 /* ObjectKeyword */ || kind === 135 /* BooleanKeyword */ || kind === 153 /* StringKeyword */ || kind === 154 /* SymbolKeyword */ || kind === 115 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 145 /* NeverKeyword */ || kind === 234 /* ExpressionWithTypeArguments */ || kind === 321 /* JSDocAllType */ || kind === 322 /* JSDocUnknownType */ || kind === 323 /* JSDocNullableType */ || kind === 324 /* JSDocNonNullableType */ || kind === 325 /* JSDocOptionalType */ || kind === 326 /* JSDocFunctionType */ || kind === 327 /* JSDocVariadicType */;
+ return kind >= 184 /* FirstTypeNode */ && kind <= 207 /* LastTypeNode */ || kind === 132 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 149 /* NumberKeyword */ || kind === 162 /* BigIntKeyword */ || kind === 150 /* ObjectKeyword */ || kind === 135 /* BooleanKeyword */ || kind === 153 /* StringKeyword */ || kind === 154 /* SymbolKeyword */ || kind === 115 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 145 /* NeverKeyword */ || kind === 236 /* ExpressionWithTypeArguments */ || kind === 324 /* JSDocAllType */ || kind === 325 /* JSDocUnknownType */ || kind === 326 /* JSDocNullableType */ || kind === 327 /* JSDocNonNullableType */ || kind === 328 /* JSDocOptionalType */ || kind === 329 /* JSDocFunctionType */ || kind === 330 /* JSDocVariadicType */;
}
function isAccessExpression(node) {
- return node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */;
+ return node.kind === 213 /* PropertyAccessExpression */ || node.kind === 214 /* ElementAccessExpression */;
}
function getNameOfAccessExpression(node) {
- if (node.kind === 211 /* PropertyAccessExpression */) {
+ if (node.kind === 213 /* PropertyAccessExpression */) {
return node.name;
}
- Debug.assert(node.kind === 212 /* ElementAccessExpression */);
+ Debug.assert(node.kind === 214 /* ElementAccessExpression */);
return node.argumentExpression;
}
function isBundleFileTextLike(section) {
@@ -19303,7 +19315,7 @@ function isBundleFileTextLike(section) {
}
}
function isNamedImportsOrExports(node) {
- return node.kind === 278 /* NamedImports */ || node.kind === 282 /* NamedExports */;
+ return node.kind === 281 /* NamedImports */ || node.kind === 285 /* NamedExports */;
}
function getLeftmostAccessExpression(expr) {
while (isAccessExpression(expr)) {
@@ -19316,12 +19328,12 @@ function forEachNameInAccessChainWalkingLeft(name, action) {
return walkAccessExpression(name.parent);
}
function walkAccessExpression(access) {
- if (access.kind === 211 /* PropertyAccessExpression */) {
+ if (access.kind === 213 /* PropertyAccessExpression */) {
const res = action(access.name);
if (res !== void 0) {
return res;
}
- } else if (access.kind === 212 /* ElementAccessExpression */) {
+ } else if (access.kind === 214 /* ElementAccessExpression */) {
if (isIdentifier(access.argumentExpression) || isStringLiteralLike(access.argumentExpression)) {
const res = action(access.argumentExpression);
if (res !== void 0) {
@@ -19343,28 +19355,28 @@ function forEachNameInAccessChainWalkingLeft(name, action) {
function getLeftmostExpression(node, stopAtCallExpressions) {
while (true) {
switch (node.kind) {
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
node = node.operand;
continue;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
node = node.left;
continue;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
node = node.condition;
continue;
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
node = node.tag;
continue;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (stopAtCallExpressions) {
return node;
}
- case 235 /* AsExpression */:
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
- case 236 /* NonNullExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 239 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 238 /* NonNullExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 241 /* SatisfiesExpression */:
node = node.expression;
continue;
}
@@ -20328,33 +20340,33 @@ function isShorthandPropertyNameUseSite(useSite) {
return isIdentifier(useSite) && isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite;
}
function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) {
- while (node.kind === 79 /* Identifier */ || node.kind === 211 /* PropertyAccessExpression */) {
+ while (node.kind === 79 /* Identifier */ || node.kind === 213 /* PropertyAccessExpression */) {
node = node.parent;
}
- if (node.kind !== 166 /* ComputedPropertyName */) {
+ if (node.kind !== 167 /* ComputedPropertyName */) {
return false;
}
if (hasSyntacticModifier(node.parent, 256 /* Abstract */)) {
return true;
}
const containerKind = node.parent.parent.kind;
- return containerKind === 267 /* InterfaceDeclaration */ || containerKind === 187 /* TypeLiteral */;
+ return containerKind === 270 /* InterfaceDeclaration */ || containerKind === 189 /* TypeLiteral */;
}
function isIdentifierInNonEmittingHeritageClause(node) {
if (node.kind !== 79 /* Identifier */)
return false;
const heritageClause = findAncestor(node.parent, (parent2) => {
switch (parent2.kind) {
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return true;
- case 211 /* PropertyAccessExpression */:
- case 234 /* ExpressionWithTypeArguments */:
+ case 213 /* PropertyAccessExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
return false;
default:
return "quit";
}
});
- return (heritageClause == null ? void 0 : heritageClause.token) === 118 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 267 /* InterfaceDeclaration */;
+ return (heritageClause == null ? void 0 : heritageClause.token) === 118 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 270 /* InterfaceDeclaration */;
}
function isIdentifierTypeReference(node) {
return isTypeReferenceNode(node) && isIdentifier(node.typeName);
@@ -20443,20 +20455,20 @@ function getContainingNodeArray(node) {
if (!node.parent)
return void 0;
switch (node.kind) {
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
const { parent: parent3 } = node;
- return parent3.kind === 195 /* InferType */ ? void 0 : parent3.typeParameters;
- case 168 /* Parameter */:
+ return parent3.kind === 197 /* InferType */ ? void 0 : parent3.typeParameters;
+ case 169 /* Parameter */:
return node.parent.parameters;
- case 204 /* TemplateLiteralTypeSpan */:
+ case 206 /* TemplateLiteralTypeSpan */:
return node.parent.templateSpans;
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return node.parent.templateSpans;
- case 169 /* Decorator */: {
+ case 170 /* Decorator */: {
const { parent: parent4 } = node;
return canHaveDecorators(parent4) ? parent4.modifiers : canHaveIllegalDecorators(parent4) ? parent4.illegalDecorators : void 0;
}
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return node.parent.heritageClauses;
}
const { parent: parent2 } = node;
@@ -20464,43 +20476,43 @@ function getContainingNodeArray(node) {
return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags;
}
switch (parent2.kind) {
- case 187 /* TypeLiteral */:
- case 267 /* InterfaceDeclaration */:
+ case 189 /* TypeLiteral */:
+ case 270 /* InterfaceDeclaration */:
return isTypeElement(node) ? parent2.members : void 0;
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return parent2.types;
- case 189 /* TupleType */:
- case 209 /* ArrayLiteralExpression */:
- case 360 /* CommaListExpression */:
- case 278 /* NamedImports */:
- case 282 /* NamedExports */:
+ case 191 /* TupleType */:
+ case 211 /* ArrayLiteralExpression */:
+ case 363 /* CommaListExpression */:
+ case 281 /* NamedImports */:
+ case 285 /* NamedExports */:
return parent2.elements;
- case 210 /* ObjectLiteralExpression */:
- case 295 /* JsxAttributes */:
+ case 212 /* ObjectLiteralExpression */:
+ case 298 /* JsxAttributes */:
return parent2.properties;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
return isTypeNode(node) ? parent2.typeArguments : parent2.expression === node ? void 0 : parent2.arguments;
- case 287 /* JsxElement */:
- case 291 /* JsxFragment */:
+ case 290 /* JsxElement */:
+ case 294 /* JsxFragment */:
return isJsxChild(node) ? parent2.children : void 0;
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return isTypeNode(node) ? parent2.typeArguments : void 0;
- case 242 /* Block */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 274 /* ModuleBlock */:
return parent2.statements;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return parent2.clauses;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return isClassElement(node) ? parent2.members : void 0;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return isEnumMember(node) ? parent2.members : void 0;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return parent2.statements;
}
}
@@ -20509,7 +20521,7 @@ function hasContextSensitiveParameters(node) {
if (some(node.parameters, (p) => !getEffectiveTypeAnnotationNode(p))) {
return true;
}
- if (node.kind !== 219 /* ArrowFunction */) {
+ if (node.kind !== 221 /* ArrowFunction */) {
const parameter = firstOrUndefined(node.parameters);
if (!(parameter && parameterIsThisKeyword(parameter))) {
return true;
@@ -20522,14 +20534,14 @@ function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "-Infinity" || name === "NaN";
}
function isCatchClauseVariableDeclaration(node) {
- return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 301 /* CatchClause */;
+ return node.kind === 263 /* VariableDeclaration */ && node.parent.kind === 304 /* CatchClause */;
}
function isParameterOrCatchClauseVariable(symbol) {
const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
return !!declaration && (isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
}
function isFunctionExpressionOrArrowFunction(node) {
- return node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */;
+ return node.kind === 220 /* FunctionExpression */ || node.kind === 221 /* ArrowFunction */;
}
function escapeSnippetText(text) {
return text.replace(/\$/gm, () => "\\$");
@@ -20592,23 +20604,23 @@ function getNodeModulePathParts(fullPath, modulePathPart) {
}
function getParameterTypeNode(parameter) {
var _a2;
- return parameter.kind === 349 /* JSDocParameterTag */ ? (_a2 = parameter.typeExpression) == null ? void 0 : _a2.type : parameter.type;
+ return parameter.kind === 352 /* JSDocParameterTag */ ? (_a2 = parameter.typeExpression) == null ? void 0 : _a2.type : parameter.type;
}
function isTypeDeclaration(node) {
switch (node.kind) {
- case 167 /* TypeParameter */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 168 /* TypeParameter */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return true;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return node.isTypeOnly;
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return node.parent.parent.isTypeOnly;
default:
return false;
@@ -20621,7 +20633,7 @@ function isCalledStructDeclaration(declarations) {
if (!declarations) {
return false;
}
- return declarations.some((declaration) => declaration.kind === 265 /* StructDeclaration */);
+ return declarations.some((declaration) => declaration.kind === 267 /* StructDeclaration */);
}
function getNameOfDecorator(node) {
const expression = node.expression;
@@ -20853,16 +20865,16 @@ function createParenthesizerRules(factory2) {
return parenthesizerRule;
}
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
- const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator);
- const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator);
+ const binaryOperatorPrecedence = getOperatorPrecedence(229 /* BinaryExpression */, binaryOperator);
+ const binaryOperatorAssociativity = getOperatorAssociativity(229 /* BinaryExpression */, binaryOperator);
const emittedOperand = skipPartiallyEmittedExpressions(operand);
- if (!isLeftSideOfBinary && operand.kind === 219 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
+ if (!isLeftSideOfBinary && operand.kind === 221 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
return true;
}
const operandPrecedence = getExpressionPrecedence(emittedOperand);
switch (compareValues(operandPrecedence, binaryOperatorPrecedence)) {
case -1 /* LessThan */:
- if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 230 /* YieldExpression */) {
+ if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 232 /* YieldExpression */) {
return false;
}
return true;
@@ -20896,7 +20908,7 @@ function createParenthesizerRules(factory2) {
if (isLiteralKind(node.kind)) {
return node.kind;
}
- if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {
+ if (node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {
if (node.cachedLiteralKind !== void 0) {
return node.cachedLiteralKind;
}
@@ -20909,7 +20921,7 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
const skipped = skipPartiallyEmittedExpressions(operand);
- if (skipped.kind === 217 /* ParenthesizedExpression */) {
+ if (skipped.kind === 219 /* ParenthesizedExpression */) {
return operand;
}
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory2.createParenthesizedExpression(operand) : operand;
@@ -20924,7 +20936,7 @@ function createParenthesizerRules(factory2) {
return isCommaSequence(expression) ? factory2.createParenthesizedExpression(expression) : expression;
}
function parenthesizeConditionOfConditionalExpression(condition) {
- const conditionalPrecedence = getOperatorPrecedence(228 /* ConditionalExpression */, 57 /* QuestionToken */);
+ const conditionalPrecedence = getOperatorPrecedence(230 /* ConditionalExpression */, 57 /* QuestionToken */);
const emittedCondition = skipPartiallyEmittedExpressions(condition);
const conditionPrecedence = getExpressionPrecedence(emittedCondition);
if (compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) {
@@ -20941,8 +20953,8 @@ function createParenthesizerRules(factory2) {
let needsParens = isCommaSequence(check);
if (!needsParens) {
switch (getLeftmostExpression(check, false).kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
needsParens = true;
}
}
@@ -20951,16 +20963,16 @@ function createParenthesizerRules(factory2) {
function parenthesizeExpressionOfNew(expression) {
const leftmostExpr = getLeftmostExpression(expression, true);
switch (leftmostExpr.kind) {
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return factory2.createParenthesizedExpression(expression);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return !leftmostExpr.arguments ? factory2.createParenthesizedExpression(expression) : expression;
}
return parenthesizeLeftSideOfAccess(expression);
}
function parenthesizeLeftSideOfAccess(expression, optionalChain) {
const emittedExpression = skipPartiallyEmittedExpressions(expression);
- if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 214 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) {
+ if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 216 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) {
return expression;
}
return setTextRange(factory2.createParenthesizedExpression(expression), expression);
@@ -20978,7 +20990,7 @@ function createParenthesizerRules(factory2) {
function parenthesizeExpressionForDisallowedComma(expression) {
const emittedExpression = skipPartiallyEmittedExpressions(expression);
const expressionPrecedence = getExpressionPrecedence(emittedExpression);
- const commaPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, 27 /* CommaToken */);
+ const commaPrecedence = getOperatorPrecedence(229 /* BinaryExpression */, 27 /* CommaToken */);
return expressionPrecedence > commaPrecedence ? expression : setTextRange(factory2.createParenthesizedExpression(expression), expression);
}
function parenthesizeExpressionOfExpressionStatement(expression) {
@@ -20986,7 +20998,7 @@ function createParenthesizerRules(factory2) {
if (isCallExpression(emittedExpression)) {
const callee = emittedExpression.expression;
const kind = skipPartiallyEmittedExpressions(callee).kind;
- if (kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */) {
+ if (kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */) {
const updated = factory2.updateCallExpression(
emittedExpression,
setTextRange(factory2.createParenthesizedExpression(callee), callee),
@@ -20997,37 +21009,37 @@ function createParenthesizerRules(factory2) {
}
}
const leftmostExpressionKind = getLeftmostExpression(emittedExpression, false).kind;
- if (leftmostExpressionKind === 210 /* ObjectLiteralExpression */ || leftmostExpressionKind === 218 /* FunctionExpression */) {
+ if (leftmostExpressionKind === 212 /* ObjectLiteralExpression */ || leftmostExpressionKind === 220 /* FunctionExpression */) {
return setTextRange(factory2.createParenthesizedExpression(expression), expression);
}
return expression;
}
function parenthesizeConciseBodyOfArrowFunction(body) {
- if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 210 /* ObjectLiteralExpression */)) {
+ if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 212 /* ObjectLiteralExpression */)) {
return setTextRange(factory2.createParenthesizedExpression(body), body);
}
return body;
}
function parenthesizeCheckTypeOfConditionalType(checkType) {
switch (checkType.kind) {
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 194 /* ConditionalType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 196 /* ConditionalType */:
return factory2.createParenthesizedType(checkType);
}
return checkType;
}
function parenthesizeExtendsTypeOfConditionalType(extendsType) {
switch (extendsType.kind) {
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return factory2.createParenthesizedType(extendsType);
}
return extendsType;
}
function parenthesizeConstituentTypeOfUnionType(type) {
switch (type.kind) {
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeCheckTypeOfConditionalType(type);
@@ -21037,8 +21049,8 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeConstituentTypeOfIntersectionType(type) {
switch (type.kind) {
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeConstituentTypeOfUnionType(type);
@@ -21048,23 +21060,23 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeOperandOfTypeOperator(type) {
switch (type.kind) {
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeConstituentTypeOfIntersectionType(type);
}
function parenthesizeOperandOfReadonlyTypeOperator(type) {
switch (type.kind) {
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return factory2.createParenthesizedType(type);
}
return parenthesizeOperandOfTypeOperator(type);
}
function parenthesizeNonArrayTypeOfPostfixType(type) {
switch (type.kind) {
- case 195 /* InferType */:
- case 198 /* TypeOperator */:
- case 186 /* TypeQuery */:
+ case 197 /* InferType */:
+ case 200 /* TypeOperator */:
+ case 188 /* TypeQuery */:
return factory2.createParenthesizedType(type);
}
return parenthesizeOperandOfTypeOperator(type);
@@ -21218,11 +21230,11 @@ function createNodeConverters(factory2) {
}
function convertToAssignmentPattern(node) {
switch (node.kind) {
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return convertToArrayAssignmentPattern(node);
- case 206 /* ObjectBindingPattern */:
- case 210 /* ObjectLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 212 /* ObjectLiteralExpression */:
return convertToObjectAssignmentPattern(node);
}
}
@@ -21347,6 +21359,8 @@ function createNodeFactory(flags, baseFactory2) {
updatePropertyDeclaration: updatePropertyDeclaration2,
createAnnotationPropertyDeclaration,
updateAnnotationPropertyDeclaration,
+ createOverloadPropertyDeclaration,
+ updateOverloadPropertyDeclaration,
createMethodSignature: createMethodSignature3,
updateMethodSignature: updateMethodSignature3,
createMethodDeclaration,
@@ -21542,6 +21556,8 @@ function createNodeFactory(flags, baseFactory2) {
updateStructDeclaration,
createAnnotationDeclaration,
updateAnnotationDeclaration,
+ createOverloadDeclaration,
+ updateOverloadDeclaration,
createInterfaceDeclaration: createInterfaceDeclaration2,
updateInterfaceDeclaration: updateInterfaceDeclaration2,
createTypeAliasDeclaration: createTypeAliasDeclaration2,
@@ -21588,40 +21604,40 @@ function createNodeFactory(flags, baseFactory2) {
createExternalModuleReference: createExternalModuleReference2,
updateExternalModuleReference: updateExternalModuleReference2,
get createJSDocAllType() {
- return getJSDocPrimaryTypeCreateFunction(321 /* JSDocAllType */);
+ return getJSDocPrimaryTypeCreateFunction(324 /* JSDocAllType */);
},
get createJSDocUnknownType() {
- return getJSDocPrimaryTypeCreateFunction(322 /* JSDocUnknownType */);
+ return getJSDocPrimaryTypeCreateFunction(325 /* JSDocUnknownType */);
},
get createJSDocNonNullableType() {
- return getJSDocPrePostfixUnaryTypeCreateFunction(324 /* JSDocNonNullableType */);
+ return getJSDocPrePostfixUnaryTypeCreateFunction(327 /* JSDocNonNullableType */);
},
get updateJSDocNonNullableType() {
- return getJSDocPrePostfixUnaryTypeUpdateFunction(324 /* JSDocNonNullableType */);
+ return getJSDocPrePostfixUnaryTypeUpdateFunction(327 /* JSDocNonNullableType */);
},
get createJSDocNullableType() {
- return getJSDocPrePostfixUnaryTypeCreateFunction(323 /* JSDocNullableType */);
+ return getJSDocPrePostfixUnaryTypeCreateFunction(326 /* JSDocNullableType */);
},
get updateJSDocNullableType() {
- return getJSDocPrePostfixUnaryTypeUpdateFunction(323 /* JSDocNullableType */);
+ return getJSDocPrePostfixUnaryTypeUpdateFunction(326 /* JSDocNullableType */);
},
get createJSDocOptionalType() {
- return getJSDocUnaryTypeCreateFunction(325 /* JSDocOptionalType */);
+ return getJSDocUnaryTypeCreateFunction(328 /* JSDocOptionalType */);
},
get updateJSDocOptionalType() {
- return getJSDocUnaryTypeUpdateFunction(325 /* JSDocOptionalType */);
+ return getJSDocUnaryTypeUpdateFunction(328 /* JSDocOptionalType */);
},
get createJSDocVariadicType() {
- return getJSDocUnaryTypeCreateFunction(327 /* JSDocVariadicType */);
+ return getJSDocUnaryTypeCreateFunction(330 /* JSDocVariadicType */);
},
get updateJSDocVariadicType() {
- return getJSDocUnaryTypeUpdateFunction(327 /* JSDocVariadicType */);
+ return getJSDocUnaryTypeUpdateFunction(330 /* JSDocVariadicType */);
},
get createJSDocNamepathType() {
- return getJSDocUnaryTypeCreateFunction(328 /* JSDocNamepathType */);
+ return getJSDocUnaryTypeCreateFunction(331 /* JSDocNamepathType */);
},
get updateJSDocNamepathType() {
- return getJSDocUnaryTypeUpdateFunction(328 /* JSDocNamepathType */);
+ return getJSDocUnaryTypeUpdateFunction(331 /* JSDocNamepathType */);
},
createJSDocFunctionType,
updateJSDocFunctionType,
@@ -21658,76 +21674,76 @@ function createNodeFactory(flags, baseFactory2) {
createJSDocLinkPlain,
updateJSDocLinkPlain,
get createJSDocTypeTag() {
- return getJSDocTypeLikeTagCreateFunction(352 /* JSDocTypeTag */);
+ return getJSDocTypeLikeTagCreateFunction(355 /* JSDocTypeTag */);
},
get updateJSDocTypeTag() {
- return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocTypeTag */);
+ return getJSDocTypeLikeTagUpdateFunction(355 /* JSDocTypeTag */);
},
get createJSDocReturnTag() {
- return getJSDocTypeLikeTagCreateFunction(350 /* JSDocReturnTag */);
+ return getJSDocTypeLikeTagCreateFunction(353 /* JSDocReturnTag */);
},
get updateJSDocReturnTag() {
- return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocReturnTag */);
+ return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocReturnTag */);
},
get createJSDocThisTag() {
- return getJSDocTypeLikeTagCreateFunction(351 /* JSDocThisTag */);
+ return getJSDocTypeLikeTagCreateFunction(354 /* JSDocThisTag */);
},
get updateJSDocThisTag() {
- return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocThisTag */);
+ return getJSDocTypeLikeTagUpdateFunction(354 /* JSDocThisTag */);
},
get createJSDocEnumTag() {
- return getJSDocTypeLikeTagCreateFunction(348 /* JSDocEnumTag */);
+ return getJSDocTypeLikeTagCreateFunction(351 /* JSDocEnumTag */);
},
get updateJSDocEnumTag() {
- return getJSDocTypeLikeTagUpdateFunction(348 /* JSDocEnumTag */);
+ return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocEnumTag */);
},
get createJSDocAuthorTag() {
- return getJSDocSimpleTagCreateFunction(339 /* JSDocAuthorTag */);
+ return getJSDocSimpleTagCreateFunction(342 /* JSDocAuthorTag */);
},
get updateJSDocAuthorTag() {
- return getJSDocSimpleTagUpdateFunction(339 /* JSDocAuthorTag */);
+ return getJSDocSimpleTagUpdateFunction(342 /* JSDocAuthorTag */);
},
get createJSDocClassTag() {
- return getJSDocSimpleTagCreateFunction(341 /* JSDocClassTag */);
+ return getJSDocSimpleTagCreateFunction(344 /* JSDocClassTag */);
},
get updateJSDocClassTag() {
- return getJSDocSimpleTagUpdateFunction(341 /* JSDocClassTag */);
+ return getJSDocSimpleTagUpdateFunction(344 /* JSDocClassTag */);
},
get createJSDocPublicTag() {
- return getJSDocSimpleTagCreateFunction(342 /* JSDocPublicTag */);
+ return getJSDocSimpleTagCreateFunction(345 /* JSDocPublicTag */);
},
get updateJSDocPublicTag() {
- return getJSDocSimpleTagUpdateFunction(342 /* JSDocPublicTag */);
+ return getJSDocSimpleTagUpdateFunction(345 /* JSDocPublicTag */);
},
get createJSDocPrivateTag() {
- return getJSDocSimpleTagCreateFunction(343 /* JSDocPrivateTag */);
+ return getJSDocSimpleTagCreateFunction(346 /* JSDocPrivateTag */);
},
get updateJSDocPrivateTag() {
- return getJSDocSimpleTagUpdateFunction(343 /* JSDocPrivateTag */);
+ return getJSDocSimpleTagUpdateFunction(346 /* JSDocPrivateTag */);
},
get createJSDocProtectedTag() {
- return getJSDocSimpleTagCreateFunction(344 /* JSDocProtectedTag */);
+ return getJSDocSimpleTagCreateFunction(347 /* JSDocProtectedTag */);
},
get updateJSDocProtectedTag() {
- return getJSDocSimpleTagUpdateFunction(344 /* JSDocProtectedTag */);
+ return getJSDocSimpleTagUpdateFunction(347 /* JSDocProtectedTag */);
},
get createJSDocReadonlyTag() {
- return getJSDocSimpleTagCreateFunction(345 /* JSDocReadonlyTag */);
+ return getJSDocSimpleTagCreateFunction(348 /* JSDocReadonlyTag */);
},
get updateJSDocReadonlyTag() {
- return getJSDocSimpleTagUpdateFunction(345 /* JSDocReadonlyTag */);
+ return getJSDocSimpleTagUpdateFunction(348 /* JSDocReadonlyTag */);
},
get createJSDocOverrideTag() {
- return getJSDocSimpleTagCreateFunction(346 /* JSDocOverrideTag */);
+ return getJSDocSimpleTagCreateFunction(349 /* JSDocOverrideTag */);
},
get updateJSDocOverrideTag() {
- return getJSDocSimpleTagUpdateFunction(346 /* JSDocOverrideTag */);
+ return getJSDocSimpleTagUpdateFunction(349 /* JSDocOverrideTag */);
},
get createJSDocDeprecatedTag() {
- return getJSDocSimpleTagCreateFunction(340 /* JSDocDeprecatedTag */);
+ return getJSDocSimpleTagCreateFunction(343 /* JSDocDeprecatedTag */);
},
get updateJSDocDeprecatedTag() {
- return getJSDocSimpleTagUpdateFunction(340 /* JSDocDeprecatedTag */);
+ return getJSDocSimpleTagUpdateFunction(343 /* JSDocDeprecatedTag */);
},
createJSDocUnknownTag,
updateJSDocUnknownTag,
@@ -21978,12 +21994,13 @@ function createNodeFactory(flags, baseFactory2) {
}
if (name) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 305 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 308 /* PropertyAssignment */:
if (isIdentifier(name)) {
node.transformFlags |= propagateIdentifierNameFlags(name);
break;
@@ -22250,7 +22267,7 @@ function createNodeFactory(flags, baseFactory2) {
return baseFactory2.createBaseTokenNode(kind);
}
function createToken3(token) {
- Debug.assert(token >= 0 /* FirstToken */ && token <= 164 /* LastToken */, "Invalid token");
+ Debug.assert(token >= 0 /* FirstToken */ && token <= 165 /* LastToken */, "Invalid token");
Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals.");
Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals.");
Debug.assert(token !== 79 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers");
@@ -22354,7 +22371,7 @@ function createNodeFactory(flags, baseFactory2) {
return result.length ? result : void 0;
}
function createQualifiedName2(left, right) {
- const node = createBaseNode(165 /* QualifiedName */);
+ const node = createBaseNode(166 /* QualifiedName */);
node.left = left;
node.right = asName(right);
node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right);
@@ -22364,7 +22381,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.right !== right ? update(createQualifiedName2(left, right), node) : node;
}
function createComputedPropertyName2(expression) {
- const node = createBaseNode(166 /* ComputedPropertyName */);
+ const node = createBaseNode(167 /* ComputedPropertyName */);
node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */;
return node;
@@ -22374,7 +22391,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createTypeParameterDeclaration2(modifiers, name, constraint, defaultType) {
const node = createBaseNamedDeclaration(
- 167 /* TypeParameter */,
+ 168 /* TypeParameter */,
modifiers,
name
);
@@ -22388,7 +22405,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 168 /* Parameter */,
+ 169 /* Parameter */,
modifiers,
name,
type,
@@ -22413,7 +22430,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? update(createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer), node) : node;
}
function createDecorator2(expression, annotationDeclaration) {
- const node = createBaseNode(169 /* Decorator */);
+ const node = createBaseNode(170 /* Decorator */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.annotationDeclaration = annotationDeclaration;
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */ | 8192 /* ContainsTypeScriptClassSyntax */ | 33554432 /* ContainsDecorators */;
@@ -22424,7 +22441,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertySignature3(modifiers, name, questionToken, type) {
const node = createBaseNamedDeclaration(
- 170 /* PropertySignature */,
+ 171 /* PropertySignature */,
modifiers,
name
);
@@ -22437,6 +22454,21 @@ function createNodeFactory(flags, baseFactory2) {
function updatePropertySignature3(node, modifiers, name, questionToken, type) {
return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature3(modifiers, name, questionToken, type), node) : node;
}
+ function createOverloadPropertyDeclaration(modifiers, name, questionToken, type) {
+ const node = createBaseNamedDeclaration(
+ 174 /* OverloadPropertyDeclaration */,
+ modifiers,
+ name
+ );
+ node.type = type;
+ node.questionToken = questionToken;
+ node.transformFlags = 1 /* ContainsTypeScript */;
+ node.initializer = void 0;
+ return node;
+ }
+ function updateOverloadPropertyDeclaration(node, modifiers, name, questionToken, type) {
+ return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createOverloadPropertyDeclaration(modifiers, name, questionToken, type), node) : node;
+ }
function finishUpdatePropertySignature(updated, original) {
if (updated !== original) {
updated.initializer = original.initializer;
@@ -22445,7 +22477,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 171 /* PropertyDeclaration */,
+ 172 /* PropertyDeclaration */,
modifiers,
name,
type,
@@ -22467,7 +22499,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createAnnotationPropertyDeclaration(name, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
void 0,
name,
type,
@@ -22481,7 +22513,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createMethodSignature3(modifiers, name, questionToken, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 173 /* MethodSignature */,
+ 175 /* MethodSignature */,
modifiers,
name,
typeParameters,
@@ -22497,7 +22529,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 174 /* MethodDeclaration */,
+ 176 /* MethodDeclaration */,
modifiers,
name,
typeParameters,
@@ -22534,7 +22566,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassStaticBlockDeclaration(body) {
const node = createBaseGenericNamedDeclaration(
- 175 /* ClassStaticBlockDeclaration */,
+ 177 /* ClassStaticBlockDeclaration */,
void 0,
void 0,
void 0
@@ -22557,7 +22589,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructorDeclaration(modifiers, parameters, body) {
const node = createBaseFunctionLikeDeclaration(
- 176 /* Constructor */,
+ 178 /* Constructor */,
modifiers,
void 0,
void 0,
@@ -22584,7 +22616,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createGetAccessorDeclaration(modifiers, name, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 177 /* GetAccessor */,
+ 179 /* GetAccessor */,
modifiers,
name,
void 0,
@@ -22606,7 +22638,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createSetAccessorDeclaration(modifiers, name, parameters, body) {
const node = createBaseFunctionLikeDeclaration(
- 178 /* SetAccessor */,
+ 180 /* SetAccessor */,
modifiers,
name,
void 0,
@@ -22630,7 +22662,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createCallSignature2(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 179 /* CallSignature */,
+ 181 /* CallSignature */,
void 0,
void 0,
typeParameters,
@@ -22645,7 +22677,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructSignature2(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 180 /* ConstructSignature */,
+ 182 /* ConstructSignature */,
void 0,
void 0,
typeParameters,
@@ -22660,7 +22692,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createIndexSignature3(modifiers, parameters, type) {
const node = createBaseSignatureDeclaration(
- 181 /* IndexSignature */,
+ 183 /* IndexSignature */,
modifiers,
void 0,
void 0,
@@ -22674,7 +22706,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature3(modifiers, parameters, type), node) : node;
}
function createTemplateLiteralTypeSpan(type, literal) {
- const node = createBaseNode(204 /* TemplateLiteralTypeSpan */);
+ const node = createBaseNode(206 /* TemplateLiteralTypeSpan */);
node.type = type;
node.literal = literal;
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22687,7 +22719,7 @@ function createNodeFactory(flags, baseFactory2) {
return createToken3(kind);
}
function createTypePredicateNode3(assertsModifier, parameterName, type) {
- const node = createBaseNode(182 /* TypePredicate */);
+ const node = createBaseNode(184 /* TypePredicate */);
node.assertsModifier = assertsModifier;
node.parameterName = asName(parameterName);
node.type = type;
@@ -22698,7 +22730,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode3(assertsModifier, parameterName, type), node) : node;
}
function createTypeReferenceNode2(typeName, typeArguments) {
- const node = createBaseNode(183 /* TypeReference */);
+ const node = createBaseNode(185 /* TypeReference */);
node.typeName = asName(typeName);
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray2(typeArguments));
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22709,7 +22741,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionTypeNode2(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 184 /* FunctionType */,
+ 186 /* FunctionType */,
void 0,
void 0,
typeParameters,
@@ -22734,7 +22766,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 185 /* ConstructorType */,
+ 187 /* ConstructorType */,
modifiers,
void 0,
typeParameters,
@@ -22757,7 +22789,7 @@ function createNodeFactory(flags, baseFactory2) {
return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);
}
function createTypeQueryNode2(exprName, typeArguments) {
- const node = createBaseNode(186 /* TypeQuery */);
+ const node = createBaseNode(188 /* TypeQuery */);
node.exprName = exprName;
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22767,7 +22799,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode2(exprName, typeArguments), node) : node;
}
function createTypeLiteralNode2(members) {
- const node = createBaseNode(187 /* TypeLiteral */);
+ const node = createBaseNode(189 /* TypeLiteral */);
node.members = createNodeArray2(members);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22776,7 +22808,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.members !== members ? update(createTypeLiteralNode2(members), node) : node;
}
function createArrayTypeNode2(elementType) {
- const node = createBaseNode(188 /* ArrayType */);
+ const node = createBaseNode(190 /* ArrayType */);
node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22785,7 +22817,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elementType !== elementType ? update(createArrayTypeNode2(elementType), node) : node;
}
function createTupleTypeNode2(elements) {
- const node = createBaseNode(189 /* TupleType */);
+ const node = createBaseNode(191 /* TupleType */);
node.elements = createNodeArray2(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements));
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22794,7 +22826,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createTupleTypeNode2(elements), node) : node;
}
function createNamedTupleMember(dotDotDotToken, name, questionToken, type) {
- const node = createBaseNode(202 /* NamedTupleMember */);
+ const node = createBaseNode(204 /* NamedTupleMember */);
node.dotDotDotToken = dotDotDotToken;
node.name = name;
node.questionToken = questionToken;
@@ -22806,7 +22838,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node) : node;
}
function createOptionalTypeNode2(type) {
- const node = createBaseNode(190 /* OptionalType */);
+ const node = createBaseNode(192 /* OptionalType */);
node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22815,7 +22847,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createOptionalTypeNode2(type), node) : node;
}
function createRestTypeNode2(type) {
- const node = createBaseNode(191 /* RestType */);
+ const node = createBaseNode(193 /* RestType */);
node.type = type;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22833,19 +22865,19 @@ function createNodeFactory(flags, baseFactory2) {
return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node;
}
function createUnionTypeNode2(types) {
- return createUnionOrIntersectionTypeNode(192 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
+ return createUnionOrIntersectionTypeNode(194 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
}
function updateUnionTypeNode2(node, types) {
return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
}
function createIntersectionTypeNode2(types) {
- return createUnionOrIntersectionTypeNode(193 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
+ return createUnionOrIntersectionTypeNode(195 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
}
function updateIntersectionTypeNode2(node, types) {
return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
}
function createConditionalTypeNode2(checkType, extendsType, trueType, falseType) {
- const node = createBaseNode(194 /* ConditionalType */);
+ const node = createBaseNode(196 /* ConditionalType */);
node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType);
node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType);
node.trueType = trueType;
@@ -22857,7 +22889,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode2(checkType, extendsType, trueType, falseType), node) : node;
}
function createInferTypeNode2(typeParameter) {
- const node = createBaseNode(195 /* InferType */);
+ const node = createBaseNode(197 /* InferType */);
node.typeParameter = typeParameter;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22866,7 +22898,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.typeParameter !== typeParameter ? update(createInferTypeNode2(typeParameter), node) : node;
}
function createTemplateLiteralType(head, templateSpans) {
- const node = createBaseNode(203 /* TemplateLiteralType */);
+ const node = createBaseNode(205 /* TemplateLiteralType */);
node.head = head;
node.templateSpans = createNodeArray2(templateSpans);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22876,7 +22908,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
}
function createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf = false) {
- const node = createBaseNode(205 /* ImportType */);
+ const node = createBaseNode(207 /* ImportType */);
node.argument = argument;
node.assertions = assertions;
node.qualifier = qualifier;
@@ -22889,7 +22921,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node;
}
function createParenthesizedType2(type) {
- const node = createBaseNode(196 /* ParenthesizedType */);
+ const node = createBaseNode(198 /* ParenthesizedType */);
node.type = type;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22898,12 +22930,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createParenthesizedType2(type), node) : node;
}
function createThisTypeNode2() {
- const node = createBaseNode(197 /* ThisType */);
+ const node = createBaseNode(199 /* ThisType */);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
}
function createTypeOperatorNode3(operator, type) {
- const node = createBaseNode(198 /* TypeOperator */);
+ const node = createBaseNode(200 /* TypeOperator */);
node.operator = operator;
node.type = operator === 147 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22913,7 +22945,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createTypeOperatorNode3(node.operator, type), node) : node;
}
function createIndexedAccessTypeNode2(objectType, indexType) {
- const node = createBaseNode(199 /* IndexedAccessType */);
+ const node = createBaseNode(201 /* IndexedAccessType */);
node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType);
node.indexType = indexType;
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22923,7 +22955,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode2(objectType, indexType), node) : node;
}
function createMappedTypeNode2(readonlyToken, typeParameter, nameType, questionToken, type, members) {
- const node = createBaseNode(200 /* MappedType */);
+ const node = createBaseNode(202 /* MappedType */);
node.readonlyToken = readonlyToken;
node.typeParameter = typeParameter;
node.nameType = nameType;
@@ -22937,7 +22969,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode2(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node;
}
function createLiteralTypeNode2(literal) {
- const node = createBaseNode(201 /* LiteralType */);
+ const node = createBaseNode(203 /* LiteralType */);
node.literal = literal;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22946,7 +22978,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.literal !== literal ? update(createLiteralTypeNode2(literal), node) : node;
}
function createObjectBindingPattern2(elements) {
- const node = createBaseNode(206 /* ObjectBindingPattern */);
+ const node = createBaseNode(208 /* ObjectBindingPattern */);
node.elements = createNodeArray2(elements);
node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */;
if (node.transformFlags & 32768 /* ContainsRestOrSpread */) {
@@ -22958,7 +22990,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createObjectBindingPattern2(elements), node) : node;
}
function createArrayBindingPattern2(elements) {
- const node = createBaseNode(207 /* ArrayBindingPattern */);
+ const node = createBaseNode(209 /* ArrayBindingPattern */);
node.elements = createNodeArray2(elements);
node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */;
return node;
@@ -22968,7 +23000,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createBindingElement2(dotDotDotToken, propertyName, name, initializer) {
const node = createBaseBindingLikeDeclaration(
- 208 /* BindingElement */,
+ 210 /* BindingElement */,
void 0,
name,
initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
@@ -22991,7 +23023,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createArrayLiteralExpression(elements, multiLine) {
- const node = createBaseExpression(209 /* ArrayLiteralExpression */);
+ const node = createBaseExpression(211 /* ArrayLiteralExpression */);
const lastElement = elements && lastOrUndefined(elements);
const elementsArray = createNodeArray2(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0);
node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray);
@@ -23003,7 +23035,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node;
}
function createObjectLiteralExpression(properties, multiLine) {
- const node = createBaseExpression(210 /* ObjectLiteralExpression */);
+ const node = createBaseExpression(212 /* ObjectLiteralExpression */);
node.properties = createNodeArray2(properties);
node.multiLine = multiLine;
node.transformFlags |= propagateChildrenFlags(node.properties);
@@ -23013,7 +23045,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node;
}
function createPropertyAccessExpression(expression, name) {
- const node = createBaseExpression(211 /* PropertyAccessExpression */);
+ const node = createBaseExpression(213 /* PropertyAccessExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.name = asName(name);
node.transformFlags = propagateChildFlags(node.expression) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
@@ -23029,7 +23061,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node;
}
function createPropertyAccessChain2(expression, questionDotToken, name) {
- const node = createBaseExpression(211 /* PropertyAccessExpression */);
+ const node = createBaseExpression(213 /* PropertyAccessExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -23042,7 +23074,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain2(expression, questionDotToken, name), node) : node;
}
function createElementAccessExpression(expression, index) {
- const node = createBaseExpression(212 /* ElementAccessExpression */);
+ const node = createBaseExpression(214 /* ElementAccessExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.argumentExpression = asExpression(index);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.argumentExpression);
@@ -23058,7 +23090,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node;
}
function createElementAccessChain2(expression, questionDotToken, index) {
- const node = createBaseExpression(212 /* ElementAccessExpression */);
+ const node = createBaseExpression(214 /* ElementAccessExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -23071,7 +23103,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain2(expression, questionDotToken, argumentExpression), node) : node;
}
function createCallExpression(expression, typeArguments, argumentsArray) {
- const node = createBaseExpression(213 /* CallExpression */);
+ const node = createBaseExpression(215 /* CallExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray2(argumentsArray));
@@ -23093,7 +23125,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node;
}
function createCallChain2(expression, questionDotToken, typeArguments, argumentsArray) {
- const node = createBaseExpression(213 /* CallExpression */);
+ const node = createBaseExpression(215 /* CallExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -23113,7 +23145,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain2(expression, questionDotToken, typeArguments, argumentsArray), node) : node;
}
function createNewExpression(expression, typeArguments, argumentsArray) {
- const node = createBaseExpression(214 /* NewExpression */);
+ const node = createBaseExpression(216 /* NewExpression */);
node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0;
@@ -23127,7 +23159,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createNewExpression(expression, typeArguments, argumentsArray), node) : node;
}
function createTaggedTemplateExpression(tag, typeArguments, template) {
- const node = createBaseExpression(215 /* TaggedTemplateExpression */);
+ const node = createBaseExpression(217 /* TaggedTemplateExpression */);
node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag, false);
node.typeArguments = asNodeArray(typeArguments);
node.template = template;
@@ -23144,7 +23176,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node;
}
function createTypeAssertion2(type, expression) {
- const node = createBaseExpression(216 /* TypeAssertionExpression */);
+ const node = createBaseExpression(218 /* TypeAssertionExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -23154,7 +23186,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type || node.expression !== expression ? update(createTypeAssertion2(type, expression), node) : node;
}
function createParenthesizedExpression(expression) {
- const node = createBaseExpression(217 /* ParenthesizedExpression */);
+ const node = createBaseExpression(219 /* ParenthesizedExpression */);
node.expression = expression;
node.transformFlags = propagateChildFlags(node.expression);
return node;
@@ -23164,7 +23196,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionExpression2(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 218 /* FunctionExpression */,
+ 220 /* FunctionExpression */,
modifiers,
name,
typeParameters,
@@ -23192,7 +23224,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression2(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node;
}
function createEtsComponentExpression(name, argumentsArray, body) {
- const node = createBaseExpression(220 /* EtsComponentExpression */);
+ const node = createBaseExpression(222 /* EtsComponentExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(name);
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray2(argumentsArray));
node.body = body;
@@ -23203,7 +23235,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createArrowFunction3(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
const node = createBaseFunctionLikeDeclaration(
- 219 /* ArrowFunction */,
+ 221 /* ArrowFunction */,
modifiers,
void 0,
typeParameters,
@@ -23222,7 +23254,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction3(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node;
}
function createDeleteExpression(expression) {
- const node = createBaseExpression(221 /* DeleteExpression */);
+ const node = createBaseExpression(223 /* DeleteExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23231,7 +23263,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createDeleteExpression(expression), node) : node;
}
function createTypeOfExpression(expression) {
- const node = createBaseExpression(222 /* TypeOfExpression */);
+ const node = createBaseExpression(224 /* TypeOfExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23240,7 +23272,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node;
}
function createVoidExpression(expression) {
- const node = createBaseExpression(223 /* VoidExpression */);
+ const node = createBaseExpression(225 /* VoidExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23249,7 +23281,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createVoidExpression(expression), node) : node;
}
function createAwaitExpression(expression) {
- const node = createBaseExpression(224 /* AwaitExpression */);
+ const node = createBaseExpression(226 /* AwaitExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */;
return node;
@@ -23258,7 +23290,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createAwaitExpression(expression), node) : node;
}
function createPrefixUnaryExpression(operator, operand) {
- const node = createBaseExpression(225 /* PrefixUnaryExpression */);
+ const node = createBaseExpression(227 /* PrefixUnaryExpression */);
node.operator = operator;
node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand);
node.transformFlags |= propagateChildFlags(node.operand);
@@ -23271,7 +23303,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node;
}
function createPostfixUnaryExpression(operand, operator) {
- const node = createBaseExpression(226 /* PostfixUnaryExpression */);
+ const node = createBaseExpression(228 /* PostfixUnaryExpression */);
node.operator = operator;
node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand);
node.transformFlags |= propagateChildFlags(node.operand);
@@ -23284,7 +23316,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node;
}
function createBinaryExpression(left, operator, right) {
- const node = createBaseExpression(227 /* BinaryExpression */);
+ const node = createBaseExpression(229 /* BinaryExpression */);
const operatorToken = asToken(operator);
const operatorKind = operatorToken.kind;
node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left);
@@ -23333,7 +23365,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node;
}
function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) {
- const node = createBaseExpression(228 /* ConditionalExpression */);
+ const node = createBaseExpression(230 /* ConditionalExpression */);
node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition);
node.questionToken = questionToken != null ? questionToken : createToken3(57 /* QuestionToken */);
node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue);
@@ -23346,7 +23378,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node;
}
function createTemplateExpression2(head, templateSpans) {
- const node = createBaseExpression(229 /* TemplateExpression */);
+ const node = createBaseExpression(231 /* TemplateExpression */);
node.head = head;
node.templateSpans = createNodeArray2(templateSpans);
node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */;
@@ -23399,7 +23431,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createYieldExpression(asteriskToken, expression) {
Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression.");
- const node = createBaseExpression(230 /* YieldExpression */);
+ const node = createBaseExpression(232 /* YieldExpression */);
node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.asteriskToken = asteriskToken;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */;
@@ -23409,7 +23441,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node;
}
function createSpreadElement(expression) {
- const node = createBaseExpression(231 /* SpreadElement */);
+ const node = createBaseExpression(233 /* SpreadElement */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */;
return node;
@@ -23419,7 +23451,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassExpression3(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 232 /* ClassExpression */,
+ 234 /* ClassExpression */,
modifiers,
name,
typeParameters,
@@ -23433,10 +23465,10 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression3(modifiers, name, typeParameters, heritageClauses, members), node) : node;
}
function createOmittedExpression2() {
- return createBaseExpression(233 /* OmittedExpression */);
+ return createBaseExpression(235 /* OmittedExpression */);
}
function createExpressionWithTypeArguments3(expression, typeArguments) {
- const node = createBaseNode(234 /* ExpressionWithTypeArguments */);
+ const node = createBaseNode(236 /* ExpressionWithTypeArguments */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | 1024 /* ContainsES2015 */;
@@ -23446,7 +23478,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments3(expression, typeArguments), node) : node;
}
function createAsExpression2(expression, type) {
- const node = createBaseExpression(235 /* AsExpression */);
+ const node = createBaseExpression(237 /* AsExpression */);
node.expression = expression;
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -23456,7 +23488,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.type !== type ? update(createAsExpression2(expression, type), node) : node;
}
function createNonNullExpression2(expression) {
- const node = createBaseExpression(236 /* NonNullExpression */);
+ const node = createBaseExpression(238 /* NonNullExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
return node;
@@ -23468,7 +23500,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createNonNullExpression2(expression), node) : node;
}
function createSatisfiesExpression(expression, type) {
- const node = createBaseExpression(239 /* SatisfiesExpression */);
+ const node = createBaseExpression(241 /* SatisfiesExpression */);
node.expression = expression;
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -23478,7 +23510,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node;
}
function createNonNullChain2(expression) {
- const node = createBaseExpression(236 /* NonNullExpression */);
+ const node = createBaseExpression(238 /* NonNullExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -23489,7 +23521,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createNonNullChain2(expression), node) : node;
}
function createMetaProperty2(keywordToken, name) {
- const node = createBaseExpression(237 /* MetaProperty */);
+ const node = createBaseExpression(239 /* MetaProperty */);
node.keywordToken = keywordToken;
node.name = name;
node.transformFlags |= propagateChildFlags(node.name);
@@ -23509,7 +23541,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createMetaProperty2(node.keywordToken, name), node) : node;
}
function createTemplateSpan2(expression, literal) {
- const node = createBaseNode(240 /* TemplateSpan */);
+ const node = createBaseNode(242 /* TemplateSpan */);
node.expression = expression;
node.literal = literal;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */;
@@ -23519,12 +23551,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan2(expression, literal), node) : node;
}
function createSemicolonClassElement2() {
- const node = createBaseNode(241 /* SemicolonClassElement */);
+ const node = createBaseNode(243 /* SemicolonClassElement */);
node.transformFlags |= 1024 /* ContainsES2015 */;
return node;
}
function createBlock2(statements, multiLine) {
- const node = createBaseNode(242 /* Block */);
+ const node = createBaseNode(244 /* Block */);
node.statements = createNodeArray2(statements);
node.multiLine = multiLine;
node.transformFlags |= propagateChildrenFlags(node.statements);
@@ -23534,7 +23566,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createBlock2(statements, node.multiLine), node) : node;
}
function createVariableStatement2(modifiers, declarationList) {
- const node = createBaseDeclaration(244 /* VariableStatement */);
+ const node = createBaseDeclaration(246 /* VariableStatement */);
node.modifiers = asNodeArray(modifiers);
node.declarationList = isArray(declarationList) ? createVariableDeclarationList2(declarationList) : declarationList;
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList);
@@ -23547,10 +23579,10 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement2(modifiers, declarationList), node) : node;
}
function createEmptyStatement2() {
- return createBaseNode(243 /* EmptyStatement */);
+ return createBaseNode(245 /* EmptyStatement */);
}
function createExpressionStatement2(expression) {
- const node = createBaseNode(245 /* ExpressionStatement */);
+ const node = createBaseNode(247 /* ExpressionStatement */);
node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23559,7 +23591,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createExpressionStatement2(expression), node) : node;
}
function createIfStatement(expression, thenStatement, elseStatement) {
- const node = createBaseNode(246 /* IfStatement */);
+ const node = createBaseNode(248 /* IfStatement */);
node.expression = expression;
node.thenStatement = asEmbeddedStatement(thenStatement);
node.elseStatement = asEmbeddedStatement(elseStatement);
@@ -23570,7 +23602,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? update(createIfStatement(expression, thenStatement, elseStatement), node) : node;
}
function createDoStatement(statement, expression) {
- const node = createBaseNode(247 /* DoStatement */);
+ const node = createBaseNode(249 /* DoStatement */);
node.statement = asEmbeddedStatement(statement);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression);
@@ -23580,7 +23612,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statement !== statement || node.expression !== expression ? update(createDoStatement(statement, expression), node) : node;
}
function createWhileStatement(expression, statement) {
- const node = createBaseNode(248 /* WhileStatement */);
+ const node = createBaseNode(250 /* WhileStatement */);
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
@@ -23590,7 +23622,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statement !== statement ? update(createWhileStatement(expression, statement), node) : node;
}
function createForStatement(initializer, condition, incrementor, statement) {
- const node = createBaseNode(249 /* ForStatement */);
+ const node = createBaseNode(251 /* ForStatement */);
node.initializer = initializer;
node.condition = condition;
node.incrementor = incrementor;
@@ -23602,7 +23634,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement ? update(createForStatement(initializer, condition, incrementor, statement), node) : node;
}
function createForInStatement(initializer, expression, statement) {
- const node = createBaseNode(250 /* ForInStatement */);
+ const node = createBaseNode(252 /* ForInStatement */);
node.initializer = initializer;
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
@@ -23613,7 +23645,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForInStatement(initializer, expression, statement), node) : node;
}
function createForOfStatement(awaitModifier, initializer, expression, statement) {
- const node = createBaseNode(251 /* ForOfStatement */);
+ const node = createBaseNode(253 /* ForOfStatement */);
node.awaitModifier = awaitModifier;
node.initializer = initializer;
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
@@ -23627,7 +23659,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForOfStatement(awaitModifier, initializer, expression, statement), node) : node;
}
function createContinueStatement(label) {
- const node = createBaseNode(252 /* ContinueStatement */);
+ const node = createBaseNode(254 /* ContinueStatement */);
node.label = asName(label);
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -23636,7 +23668,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label ? update(createContinueStatement(label), node) : node;
}
function createBreakStatement(label) {
- const node = createBaseNode(253 /* BreakStatement */);
+ const node = createBaseNode(255 /* BreakStatement */);
node.label = asName(label);
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -23645,7 +23677,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label ? update(createBreakStatement(label), node) : node;
}
function createReturnStatement(expression) {
- const node = createBaseNode(254 /* ReturnStatement */);
+ const node = createBaseNode(256 /* ReturnStatement */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -23654,7 +23686,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createReturnStatement(expression), node) : node;
}
function createWithStatement(expression, statement) {
- const node = createBaseNode(255 /* WithStatement */);
+ const node = createBaseNode(257 /* WithStatement */);
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
@@ -23664,7 +23696,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statement !== statement ? update(createWithStatement(expression, statement), node) : node;
}
function createSwitchStatement(expression, caseBlock) {
- const node = createBaseNode(256 /* SwitchStatement */);
+ const node = createBaseNode(258 /* SwitchStatement */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.caseBlock = caseBlock;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock);
@@ -23674,7 +23706,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.caseBlock !== caseBlock ? update(createSwitchStatement(expression, caseBlock), node) : node;
}
function createLabeledStatement(label, statement) {
- const node = createBaseNode(257 /* LabeledStatement */);
+ const node = createBaseNode(259 /* LabeledStatement */);
node.label = asName(label);
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement);
@@ -23684,7 +23716,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label || node.statement !== statement ? update(createLabeledStatement(label, statement), node) : node;
}
function createThrowStatement(expression) {
- const node = createBaseNode(258 /* ThrowStatement */);
+ const node = createBaseNode(260 /* ThrowStatement */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23693,7 +23725,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createThrowStatement(expression), node) : node;
}
function createTryStatement(tryBlock, catchClause, finallyBlock) {
- const node = createBaseNode(259 /* TryStatement */);
+ const node = createBaseNode(261 /* TryStatement */);
node.tryBlock = tryBlock;
node.catchClause = catchClause;
node.finallyBlock = finallyBlock;
@@ -23704,11 +23736,11 @@ function createNodeFactory(flags, baseFactory2) {
return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node;
}
function createDebuggerStatement2() {
- return createBaseNode(260 /* DebuggerStatement */);
+ return createBaseNode(262 /* DebuggerStatement */);
}
function createVariableDeclaration3(name, exclamationToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 261 /* VariableDeclaration */,
+ 263 /* VariableDeclaration */,
void 0,
name,
type,
@@ -23725,7 +23757,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration3(name, exclamationToken, type, initializer), node) : node;
}
function createVariableDeclarationList2(declarations, flags2 = 0 /* None */) {
- const node = createBaseNode(262 /* VariableDeclarationList */);
+ const node = createBaseNode(264 /* VariableDeclarationList */);
node.flags |= flags2 & 3 /* BlockScoped */;
node.declarations = createNodeArray2(declarations);
node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
@@ -23739,7 +23771,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 263 /* FunctionDeclaration */,
+ 265 /* FunctionDeclaration */,
modifiers,
name,
typeParameters,
@@ -23776,7 +23808,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassDeclaration2(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 264 /* ClassDeclaration */,
+ 266 /* ClassDeclaration */,
modifiers,
name,
typeParameters,
@@ -23798,7 +23830,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createStructDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 265 /* StructDeclaration */,
+ 267 /* StructDeclaration */,
modifiers,
name,
typeParameters,
@@ -23820,7 +23852,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createAnnotationDeclaration(modifiers, name, members) {
const node = createBaseNamedDeclaration(
- 266 /* AnnotationDeclaration */,
+ 268 /* AnnotationDeclaration */,
modifiers,
name
);
@@ -23837,9 +23869,28 @@ function createNodeFactory(flags, baseFactory2) {
function updateAnnotationDeclaration(node, modifiers, name, members) {
return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createAnnotationDeclaration(modifiers, name, members), node) : node;
}
+ function createOverloadDeclaration(modifiers, name, members) {
+ const node = createBaseNamedDeclaration(
+ 269 /* OverloadDeclaration */,
+ modifiers,
+ name
+ );
+ node.members = createNodeArray2(members);
+ node.transformFlags |= propagateChildrenFlags(node.members);
+ if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
+ node.transformFlags = 1 /* ContainsTypeScript */;
+ } else {
+ node.transformFlags |= 1024 /* ContainsES2015 */;
+ node.transformFlags |= 1 /* ContainsTypeScript */;
+ }
+ return node;
+ }
+ function updateOverloadDeclaration(node, modifiers, name, members) {
+ return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createOverloadDeclaration(modifiers, name, members), node) : node;
+ }
function createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseInterfaceOrClassLikeDeclaration(
- 267 /* InterfaceDeclaration */,
+ 270 /* InterfaceDeclaration */,
modifiers,
name,
typeParameters,
@@ -23861,7 +23912,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createTypeAliasDeclaration2(modifiers, name, typeParameters, type) {
const node = createBaseGenericNamedDeclaration(
- 268 /* TypeAliasDeclaration */,
+ 271 /* TypeAliasDeclaration */,
modifiers,
name,
typeParameters
@@ -23882,7 +23933,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createEnumDeclaration2(modifiers, name, members) {
const node = createBaseNamedDeclaration(
- 269 /* EnumDeclaration */,
+ 272 /* EnumDeclaration */,
modifiers,
name
);
@@ -23902,7 +23953,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createModuleDeclaration2(modifiers, name, body, flags2 = 0 /* None */) {
- const node = createBaseDeclaration(270 /* ModuleDeclaration */);
+ const node = createBaseDeclaration(273 /* ModuleDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.flags |= flags2 & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */);
node.name = name;
@@ -23926,7 +23977,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createModuleBlock2(statements) {
- const node = createBaseNode(271 /* ModuleBlock */);
+ const node = createBaseNode(274 /* ModuleBlock */);
node.statements = createNodeArray2(statements);
node.transformFlags |= propagateChildrenFlags(node.statements);
return node;
@@ -23935,7 +23986,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createModuleBlock2(statements), node) : node;
}
function createCaseBlock2(clauses) {
- const node = createBaseNode(272 /* CaseBlock */);
+ const node = createBaseNode(275 /* CaseBlock */);
node.clauses = createNodeArray2(clauses);
node.transformFlags |= propagateChildrenFlags(node.clauses);
return node;
@@ -23945,7 +23996,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createNamespaceExportDeclaration2(name) {
const node = createBaseNamedDeclaration(
- 273 /* NamespaceExportDeclaration */,
+ 276 /* NamespaceExportDeclaration */,
void 0,
name
);
@@ -23966,7 +24017,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference) {
const node = createBaseNamedDeclaration(
- 274 /* ImportEqualsDeclaration */,
+ 277 /* ImportEqualsDeclaration */,
modifiers,
name
);
@@ -23989,7 +24040,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause) {
- const node = createBaseDeclaration(275 /* ImportDeclaration */);
+ const node = createBaseDeclaration(278 /* ImportDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.importClause = importClause;
node.moduleSpecifier = moduleSpecifier;
@@ -24009,7 +24060,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createImportClause3(isTypeOnly, name, namedBindings) {
- const node = createBaseNode(276 /* ImportClause */);
+ const node = createBaseNode(279 /* ImportClause */);
node.isTypeOnly = isTypeOnly;
node.name = name;
node.namedBindings = namedBindings;
@@ -24031,7 +24082,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createAssertClause(elements, multiLine) {
- const node = createBaseNode(302 /* AssertClause */);
+ const node = createBaseNode(305 /* AssertClause */);
node.elements = createNodeArray2(elements);
node.multiLine = multiLine;
node.transformFlags |= 4 /* ContainsESNext */;
@@ -24041,7 +24092,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements || node.multiLine !== multiLine ? update(createAssertClause(elements, multiLine), node) : node;
}
function createAssertEntry(name, value) {
- const node = createBaseNode(303 /* AssertEntry */);
+ const node = createBaseNode(306 /* AssertEntry */);
node.name = name;
node.value = value;
node.transformFlags |= 4 /* ContainsESNext */;
@@ -24051,7 +24102,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.value !== value ? update(createAssertEntry(name, value), node) : node;
}
function createImportTypeAssertionContainer(clause, multiLine) {
- const node = createBaseNode(304 /* ImportTypeAssertionContainer */);
+ const node = createBaseNode(307 /* ImportTypeAssertionContainer */);
node.assertClause = clause;
node.multiLine = multiLine;
return node;
@@ -24060,7 +24111,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
}
function createNamespaceImport2(name) {
- const node = createBaseNode(277 /* NamespaceImport */);
+ const node = createBaseNode(280 /* NamespaceImport */);
node.name = name;
node.transformFlags |= propagateChildFlags(node.name);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -24070,7 +24121,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createNamespaceImport2(name), node) : node;
}
function createNamespaceExport2(name) {
- const node = createBaseNode(283 /* NamespaceExport */);
+ const node = createBaseNode(286 /* NamespaceExport */);
node.name = name;
node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */;
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -24080,7 +24131,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createNamespaceExport2(name), node) : node;
}
function createNamedImports2(elements) {
- const node = createBaseNode(278 /* NamedImports */);
+ const node = createBaseNode(281 /* NamedImports */);
node.elements = createNodeArray2(elements);
node.transformFlags |= propagateChildrenFlags(node.elements);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -24090,7 +24141,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createNamedImports2(elements), node) : node;
}
function createImportSpecifier2(isTypeOnly, propertyName, name) {
- const node = createBaseNode(279 /* ImportSpecifier */);
+ const node = createBaseNode(282 /* ImportSpecifier */);
node.isTypeOnly = isTypeOnly;
node.propertyName = propertyName;
node.name = name;
@@ -24102,7 +24153,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier2(isTypeOnly, propertyName, name), node) : node;
}
function createExportAssignment3(modifiers, isExportEquals, expression) {
- const node = createBaseDeclaration(280 /* ExportAssignment */);
+ const node = createBaseDeclaration(283 /* ExportAssignment */);
node.modifiers = asNodeArray(modifiers);
node.isExportEquals = isExportEquals;
node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary(63 /* EqualsToken */, void 0, expression) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression);
@@ -24121,7 +24172,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
- const node = createBaseDeclaration(281 /* ExportDeclaration */);
+ const node = createBaseDeclaration(284 /* ExportDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.isTypeOnly = isTypeOnly;
node.exportClause = exportClause;
@@ -24142,7 +24193,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createNamedExports2(elements) {
- const node = createBaseNode(282 /* NamedExports */);
+ const node = createBaseNode(285 /* NamedExports */);
node.elements = createNodeArray2(elements);
node.transformFlags |= propagateChildrenFlags(node.elements);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -24152,7 +24203,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createNamedExports2(elements), node) : node;
}
function createExportSpecifier2(isTypeOnly, propertyName, name) {
- const node = createBaseNode(284 /* ExportSpecifier */);
+ const node = createBaseNode(287 /* ExportSpecifier */);
node.isTypeOnly = isTypeOnly;
node.propertyName = asName(propertyName);
node.name = asName(name);
@@ -24164,11 +24215,11 @@ function createNodeFactory(flags, baseFactory2) {
return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier2(isTypeOnly, propertyName, name), node) : node;
}
function createMissingDeclaration() {
- const node = createBaseDeclaration(285 /* MissingDeclaration */);
+ const node = createBaseDeclaration(288 /* MissingDeclaration */);
return node;
}
function createExternalModuleReference2(expression) {
- const node = createBaseNode(286 /* ExternalModuleReference */);
+ const node = createBaseNode(289 /* ExternalModuleReference */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -24201,7 +24252,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createJSDocFunctionType(parameters, type) {
const node = createBaseSignatureDeclaration(
- 326 /* JSDocFunctionType */,
+ 329 /* JSDocFunctionType */,
void 0,
void 0,
void 0,
@@ -24214,7 +24265,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node;
}
function createJSDocTypeLiteral2(propertyTags, isArrayType = false) {
- const node = createBaseNode(331 /* JSDocTypeLiteral */);
+ const node = createBaseNode(334 /* JSDocTypeLiteral */);
node.jsDocPropertyTags = asNodeArray(propertyTags);
node.isArrayType = isArrayType;
return node;
@@ -24223,7 +24274,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral2(propertyTags, isArrayType), node) : node;
}
function createJSDocTypeExpression2(type) {
- const node = createBaseNode(318 /* JSDocTypeExpression */);
+ const node = createBaseNode(321 /* JSDocTypeExpression */);
node.type = type;
return node;
}
@@ -24231,7 +24282,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createJSDocTypeExpression2(type), node) : node;
}
function createJSDocSignature2(typeParameters, parameters, type) {
- const node = createBaseNode(332 /* JSDocSignature */);
+ const node = createBaseNode(335 /* JSDocSignature */);
node.typeParameters = asNodeArray(typeParameters);
node.parameters = createNodeArray2(parameters);
node.type = type;
@@ -24251,7 +24302,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createJSDocTemplateTag2(tagName, constraint, typeParameters, comment) {
- const node = createBaseJSDocTag(353 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier3("template"), comment);
+ const node = createBaseJSDocTag(356 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier3("template"), comment);
node.constraint = constraint;
node.typeParameters = createNodeArray2(typeParameters);
return node;
@@ -24260,7 +24311,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag2(tagName, constraint, typeParameters, comment), node) : node;
}
function createJSDocTypedefTag2(tagName, typeExpression, fullName, comment) {
- const node = createBaseJSDocTag(354 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier3("typedef"), comment);
+ const node = createBaseJSDocTag(357 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier3("typedef"), comment);
node.typeExpression = typeExpression;
node.fullName = fullName;
node.name = getJSDocTypeAliasName(fullName);
@@ -24270,7 +24321,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag2(tagName, typeExpression, fullName, comment), node) : node;
}
function createJSDocParameterTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
- const node = createBaseJSDocTag(349 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier3("param"), comment);
+ const node = createBaseJSDocTag(352 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier3("param"), comment);
node.typeExpression = typeExpression;
node.name = name;
node.isNameFirst = !!isNameFirst;
@@ -24281,7 +24332,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node;
}
function createJSDocPropertyTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
- const node = createBaseJSDocTag(356 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier3("prop"), comment);
+ const node = createBaseJSDocTag(359 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier3("prop"), comment);
node.typeExpression = typeExpression;
node.name = name;
node.isNameFirst = !!isNameFirst;
@@ -24292,7 +24343,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node;
}
function createJSDocCallbackTag2(tagName, typeExpression, fullName, comment) {
- const node = createBaseJSDocTag(347 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier3("callback"), comment);
+ const node = createBaseJSDocTag(350 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier3("callback"), comment);
node.typeExpression = typeExpression;
node.fullName = fullName;
node.name = getJSDocTypeAliasName(fullName);
@@ -24302,7 +24353,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag2(tagName, typeExpression, fullName, comment), node) : node;
}
function createJSDocAugmentsTag2(tagName, className, comment) {
- const node = createBaseJSDocTag(337 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier3("augments"), comment);
+ const node = createBaseJSDocTag(340 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier3("augments"), comment);
node.class = className;
return node;
}
@@ -24310,12 +24361,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag2(tagName, className, comment), node) : node;
}
function createJSDocImplementsTag2(tagName, className, comment) {
- const node = createBaseJSDocTag(338 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier3("implements"), comment);
+ const node = createBaseJSDocTag(341 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier3("implements"), comment);
node.class = className;
return node;
}
function createJSDocSeeTag(tagName, name, comment) {
- const node = createBaseJSDocTag(355 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier3("see"), comment);
+ const node = createBaseJSDocTag(358 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier3("see"), comment);
node.name = name;
return node;
}
@@ -24323,7 +24374,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.comment !== comment ? update(createJSDocSeeTag(tagName, name, comment), node) : node;
}
function createJSDocNameReference(name) {
- const node = createBaseNode(319 /* JSDocNameReference */);
+ const node = createBaseNode(322 /* JSDocNameReference */);
node.name = name;
return node;
}
@@ -24331,7 +24382,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocNameReference(name), node) : node;
}
function createJSDocMemberName(left, right) {
- const node = createBaseNode(320 /* JSDocMemberName */);
+ const node = createBaseNode(323 /* JSDocMemberName */);
node.left = left;
node.right = right;
node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.right);
@@ -24341,7 +24392,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.right !== right ? update(createJSDocMemberName(left, right), node) : node;
}
function createJSDocLink(name, text) {
- const node = createBaseNode(333 /* JSDocLink */);
+ const node = createBaseNode(336 /* JSDocLink */);
node.name = name;
node.text = text;
return node;
@@ -24350,7 +24401,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocLink(name, text), node) : node;
}
function createJSDocLinkCode(name, text) {
- const node = createBaseNode(334 /* JSDocLinkCode */);
+ const node = createBaseNode(337 /* JSDocLinkCode */);
node.name = name;
node.text = text;
return node;
@@ -24359,7 +24410,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocLinkCode(name, text), node) : node;
}
function createJSDocLinkPlain(name, text) {
- const node = createBaseNode(335 /* JSDocLinkPlain */);
+ const node = createBaseNode(338 /* JSDocLinkPlain */);
node.name = name;
node.text = text;
return node;
@@ -24386,14 +24437,14 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment), node) : node;
}
function createJSDocUnknownTag(tagName, comment) {
- const node = createBaseJSDocTag(336 /* JSDocTag */, tagName, comment);
+ const node = createBaseJSDocTag(339 /* JSDocTag */, tagName, comment);
return node;
}
function updateJSDocUnknownTag(node, tagName, comment) {
return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node;
}
function createJSDocText(text) {
- const node = createBaseNode(330 /* JSDocText */);
+ const node = createBaseNode(333 /* JSDocText */);
node.text = text;
return node;
}
@@ -24401,7 +24452,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.text !== text ? update(createJSDocText(text), node) : node;
}
function createJSDocComment2(comment, tags) {
- const node = createBaseNode(329 /* JSDoc */);
+ const node = createBaseNode(332 /* JSDoc */);
node.comment = comment;
node.tags = asNodeArray(tags);
return node;
@@ -24410,7 +24461,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.comment !== comment || node.tags !== tags ? update(createJSDocComment2(comment, tags), node) : node;
}
function createJsxElement2(openingElement, children, closingElement) {
- const node = createBaseNode(287 /* JsxElement */);
+ const node = createBaseNode(290 /* JsxElement */);
node.openingElement = openingElement;
node.children = createNodeArray2(children);
node.closingElement = closingElement;
@@ -24421,7 +24472,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement2(openingElement, children, closingElement), node) : node;
}
function createJsxSelfClosingElement2(tagName, typeArguments, attributes) {
- const node = createBaseNode(288 /* JsxSelfClosingElement */);
+ const node = createBaseNode(291 /* JsxSelfClosingElement */);
node.tagName = tagName;
node.typeArguments = asNodeArray(typeArguments);
node.attributes = attributes;
@@ -24435,7 +24486,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement2(tagName, typeArguments, attributes), node) : node;
}
function createJsxOpeningElement2(tagName, typeArguments, attributes) {
- const node = createBaseNode(289 /* JsxOpeningElement */);
+ const node = createBaseNode(292 /* JsxOpeningElement */);
node.tagName = tagName;
node.typeArguments = asNodeArray(typeArguments);
node.attributes = attributes;
@@ -24449,7 +24500,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement2(tagName, typeArguments, attributes), node) : node;
}
function createJsxClosingElement2(tagName) {
- const node = createBaseNode(290 /* JsxClosingElement */);
+ const node = createBaseNode(293 /* JsxClosingElement */);
node.tagName = tagName;
node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */;
return node;
@@ -24458,7 +24509,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName ? update(createJsxClosingElement2(tagName), node) : node;
}
function createJsxFragment2(openingFragment, children, closingFragment) {
- const node = createBaseNode(291 /* JsxFragment */);
+ const node = createBaseNode(294 /* JsxFragment */);
node.openingFragment = openingFragment;
node.children = createNodeArray2(children);
node.closingFragment = closingFragment;
@@ -24479,17 +24530,17 @@ function createNodeFactory(flags, baseFactory2) {
return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText2(text, containsOnlyTriviaWhiteSpaces), node) : node;
}
function createJsxOpeningFragment2() {
- const node = createBaseNode(292 /* JsxOpeningFragment */);
+ const node = createBaseNode(295 /* JsxOpeningFragment */);
node.transformFlags |= 2 /* ContainsJsx */;
return node;
}
function createJsxJsxClosingFragment2() {
- const node = createBaseNode(293 /* JsxClosingFragment */);
+ const node = createBaseNode(296 /* JsxClosingFragment */);
node.transformFlags |= 2 /* ContainsJsx */;
return node;
}
function createJsxAttribute2(name, initializer) {
- const node = createBaseNode(294 /* JsxAttribute */);
+ const node = createBaseNode(297 /* JsxAttribute */);
node.name = name;
node.initializer = initializer;
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */;
@@ -24499,7 +24550,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute2(name, initializer), node) : node;
}
function createJsxAttributes2(properties) {
- const node = createBaseNode(295 /* JsxAttributes */);
+ const node = createBaseNode(298 /* JsxAttributes */);
node.properties = createNodeArray2(properties);
node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */;
return node;
@@ -24508,7 +24559,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.properties !== properties ? update(createJsxAttributes2(properties), node) : node;
}
function createJsxSpreadAttribute2(expression) {
- const node = createBaseNode(296 /* JsxSpreadAttribute */);
+ const node = createBaseNode(299 /* JsxSpreadAttribute */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */;
return node;
@@ -24517,7 +24568,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createJsxSpreadAttribute2(expression), node) : node;
}
function createJsxExpression2(dotDotDotToken, expression) {
- const node = createBaseNode(297 /* JsxExpression */);
+ const node = createBaseNode(300 /* JsxExpression */);
node.dotDotDotToken = dotDotDotToken;
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */;
@@ -24527,7 +24578,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createJsxExpression2(node.dotDotDotToken, expression), node) : node;
}
function createCaseClause2(expression, statements) {
- const node = createBaseNode(298 /* CaseClause */);
+ const node = createBaseNode(301 /* CaseClause */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.statements = createNodeArray2(statements);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements);
@@ -24537,7 +24588,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statements !== statements ? update(createCaseClause2(expression, statements), node) : node;
}
function createDefaultClause2(statements) {
- const node = createBaseNode(299 /* DefaultClause */);
+ const node = createBaseNode(302 /* DefaultClause */);
node.statements = createNodeArray2(statements);
node.transformFlags = propagateChildrenFlags(node.statements);
return node;
@@ -24546,7 +24597,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createDefaultClause2(statements), node) : node;
}
function createHeritageClause2(token, types) {
- const node = createBaseNode(300 /* HeritageClause */);
+ const node = createBaseNode(303 /* HeritageClause */);
node.token = token;
node.types = createNodeArray2(types);
node.transformFlags |= propagateChildrenFlags(node.types);
@@ -24566,7 +24617,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.types !== types ? update(createHeritageClause2(node.token, types), node) : node;
}
function createCatchClause2(variableDeclaration, block) {
- const node = createBaseNode(301 /* CatchClause */);
+ const node = createBaseNode(304 /* CatchClause */);
if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
variableDeclaration = createVariableDeclaration3(
variableDeclaration,
@@ -24587,7 +24638,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertyAssignment2(name, initializer) {
const node = createBaseNamedDeclaration(
- 305 /* PropertyAssignment */,
+ 308 /* PropertyAssignment */,
void 0,
name
);
@@ -24613,7 +24664,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createShorthandPropertyAssignment2(name, objectAssignmentInitializer) {
const node = createBaseNamedDeclaration(
- 306 /* ShorthandPropertyAssignment */,
+ 309 /* ShorthandPropertyAssignment */,
void 0,
name
);
@@ -24640,7 +24691,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createSpreadAssignment2(expression) {
- const node = createBaseNode(307 /* SpreadAssignment */);
+ const node = createBaseNode(310 /* SpreadAssignment */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */;
return node;
@@ -24649,7 +24700,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createSpreadAssignment2(expression), node) : node;
}
function createEnumMember2(name, initializer) {
- const node = createBaseNode(308 /* EnumMember */);
+ const node = createBaseNode(311 /* EnumMember */);
node.name = asName(name);
node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */;
@@ -24659,7 +24710,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.initializer !== initializer ? update(createEnumMember2(name, initializer), node) : node;
}
function createSourceFile2(statements, endOfFileToken, flags2) {
- const node = baseFactory2.createBaseSourceFileNode(314 /* SourceFile */);
+ const node = baseFactory2.createBaseSourceFileNode(317 /* SourceFile */);
node.statements = createNodeArray2(statements);
node.endOfFileToken = endOfFileToken;
node.flags |= flags2;
@@ -24674,7 +24725,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
- const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(314 /* SourceFile */);
+ const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(317 /* SourceFile */);
for (const p in source) {
if (p === "emitNode" || hasProperty(node, p) || !hasProperty(source, p))
continue;
@@ -24696,7 +24747,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node;
}
function createBundle2(sourceFiles, prepends = emptyArray) {
- const node = createBaseNode(315 /* Bundle */);
+ const node = createBaseNode(318 /* Bundle */);
node.prepends = prepends;
node.sourceFiles = sourceFiles;
return node;
@@ -24705,7 +24756,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle2(sourceFiles, prepends), node) : node;
}
function createUnparsedSource(prologues, syntheticReferences, texts) {
- const node = createBaseNode(316 /* UnparsedSource */);
+ const node = createBaseNode(319 /* UnparsedSource */);
node.prologues = prologues;
node.syntheticReferences = syntheticReferences;
node.texts = texts;
@@ -24722,48 +24773,48 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createUnparsedPrologue(data) {
- return createBaseUnparsedNode(309 /* UnparsedPrologue */, data);
+ return createBaseUnparsedNode(312 /* UnparsedPrologue */, data);
}
function createUnparsedPrepend(data, texts) {
- const node = createBaseUnparsedNode(310 /* UnparsedPrepend */, data);
+ const node = createBaseUnparsedNode(313 /* UnparsedPrepend */, data);
node.texts = texts;
return node;
}
function createUnparsedTextLike(data, internal) {
- return createBaseUnparsedNode(internal ? 312 /* UnparsedInternalText */ : 311 /* UnparsedText */, data);
+ return createBaseUnparsedNode(internal ? 315 /* UnparsedInternalText */ : 314 /* UnparsedText */, data);
}
function createUnparsedSyntheticReference(section) {
- const node = createBaseNode(313 /* UnparsedSyntheticReference */);
+ const node = createBaseNode(316 /* UnparsedSyntheticReference */);
node.data = section.data;
node.section = section;
return node;
}
function createInputFiles2() {
- const node = createBaseNode(317 /* InputFiles */);
+ const node = createBaseNode(320 /* InputFiles */);
node.javascriptText = "";
node.declarationText = "";
return node;
}
function createSyntheticExpression(type, isSpread = false, tupleNameSource) {
- const node = createBaseNode(238 /* SyntheticExpression */);
+ const node = createBaseNode(240 /* SyntheticExpression */);
node.type = type;
node.isSpread = isSpread;
node.tupleNameSource = tupleNameSource;
return node;
}
function createSyntaxList3(children) {
- const node = createBaseNode(357 /* SyntaxList */);
+ const node = createBaseNode(360 /* SyntaxList */);
node._children = children;
return node;
}
function createNotEmittedStatement2(original) {
- const node = createBaseNode(358 /* NotEmittedStatement */);
+ const node = createBaseNode(361 /* NotEmittedStatement */);
node.original = original;
setTextRange(node, original);
return node;
}
function createPartiallyEmittedExpression2(expression, original) {
- const node = createBaseNode(359 /* PartiallyEmittedExpression */);
+ const node = createBaseNode(362 /* PartiallyEmittedExpression */);
node.expression = expression;
node.original = original;
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -24785,7 +24836,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createCommaListExpression(elements) {
- const node = createBaseNode(360 /* CommaListExpression */);
+ const node = createBaseNode(363 /* CommaListExpression */);
node.elements = createNodeArray2(sameFlatMap(elements, flattenCommaElements));
node.transformFlags |= propagateChildrenFlags(node.elements);
return node;
@@ -24794,19 +24845,19 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
}
function createEndOfDeclarationMarker(original) {
- const node = createBaseNode(362 /* EndOfDeclarationMarker */);
+ const node = createBaseNode(365 /* EndOfDeclarationMarker */);
node.emitNode = {};
node.original = original;
return node;
}
function createMergeDeclarationMarker(original) {
- const node = createBaseNode(361 /* MergeDeclarationMarker */);
+ const node = createBaseNode(364 /* MergeDeclarationMarker */);
node.emitNode = {};
node.original = original;
return node;
}
function createSyntheticReferenceExpression(expression, thisArg) {
- const node = createBaseNode(363 /* SyntheticReferenceExpression */);
+ const node = createBaseNode(366 /* SyntheticReferenceExpression */);
node.expression = expression;
node.thisArg = thisArg;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -24819,7 +24870,7 @@ function createNodeFactory(flags, baseFactory2) {
if (node === void 0) {
return node;
}
- const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(314 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
+ const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(317 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
clone2.flags |= node.flags & ~8 /* Synthesized */;
clone2.transformFlags = node.transformFlags;
setOriginalNode(clone2, node);
@@ -24944,17 +24995,17 @@ function createNodeFactory(flags, baseFactory2) {
}
function updateOuterExpression(outerExpression, expression) {
switch (outerExpression.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return updateParenthesizedExpression(outerExpression, expression);
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return updateTypeAssertion2(outerExpression, outerExpression.type, expression);
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return updateAsExpression2(outerExpression, expression, outerExpression.type);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return updateNonNullExpression2(outerExpression, expression);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return updatePartiallyEmittedExpression2(outerExpression, expression);
}
}
@@ -24994,13 +25045,13 @@ function createNodeFactory(flags, baseFactory2) {
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
return false;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
const elements = target.elements;
if (elements.length === 0) {
return false;
}
return true;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return target.properties.length > 0;
default:
return true;
@@ -25247,7 +25298,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray2(array) : void 0;
@@ -25280,41 +25331,41 @@ function updateWithOriginal(updated, original) {
}
function getDefaultTagNameForKind(kind) {
switch (kind) {
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return "type";
- case 350 /* JSDocReturnTag */:
+ case 353 /* JSDocReturnTag */:
return "returns";
- case 351 /* JSDocThisTag */:
+ case 354 /* JSDocThisTag */:
return "this";
- case 348 /* JSDocEnumTag */:
+ case 351 /* JSDocEnumTag */:
return "enum";
- case 339 /* JSDocAuthorTag */:
+ case 342 /* JSDocAuthorTag */:
return "author";
- case 341 /* JSDocClassTag */:
+ case 344 /* JSDocClassTag */:
return "class";
- case 342 /* JSDocPublicTag */:
+ case 345 /* JSDocPublicTag */:
return "public";
- case 343 /* JSDocPrivateTag */:
+ case 346 /* JSDocPrivateTag */:
return "private";
- case 344 /* JSDocProtectedTag */:
+ case 347 /* JSDocProtectedTag */:
return "protected";
- case 345 /* JSDocReadonlyTag */:
+ case 348 /* JSDocReadonlyTag */:
return "readonly";
- case 346 /* JSDocOverrideTag */:
+ case 349 /* JSDocOverrideTag */:
return "override";
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return "template";
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return "typedef";
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
return "param";
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
return "prop";
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
return "callback";
- case 337 /* JSDocAugmentsTag */:
+ case 340 /* JSDocAugmentsTag */:
return "augments";
- case 338 /* JSDocImplementsTag */:
+ case 341 /* JSDocImplementsTag */:
return "implements";
default:
return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`);
@@ -25387,35 +25438,35 @@ function aggregateChildrenFlags(children) {
children.transformFlags = subtreeFlags;
}
function getTransformFlagsSubtreeExclusions(kind) {
- if (kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */) {
+ if (kind >= 184 /* FirstTypeNode */ && kind <= 207 /* LastTypeNode */) {
return -2 /* TypeExcludes */;
}
switch (kind) {
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 211 /* ArrayLiteralExpression */:
return -2147450880 /* ArrayLiteralOrCallOrNewExcludes */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return -1941676032 /* ModuleExcludes */;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return -2147483648 /* ParameterExcludes */;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return -2072174592 /* ArrowFunctionExcludes */;
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
return -1937940480 /* FunctionExcludes */;
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return -2146893824 /* VariableDeclarationListExcludes */;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return -2147344384 /* ClassExcludes */;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return -1937948672 /* ConstructorExcludes */;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return -2013249536 /* PropertyExcludes */;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return -2005057536 /* MethodOrAccessorExcludes */;
case 132 /* AnyKeyword */:
case 149 /* NumberKeyword */:
@@ -25426,31 +25477,31 @@ function getTransformFlagsSubtreeExclusions(kind) {
case 135 /* BooleanKeyword */:
case 154 /* SymbolKeyword */:
case 115 /* VoidKeyword */:
- case 167 /* TypeParameter */:
- case 170 /* PropertySignature */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 168 /* TypeParameter */:
+ case 171 /* PropertySignature */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return -2 /* TypeExcludes */;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return -2147278848 /* ObjectLiteralExcludes */;
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return -2147418112 /* CatchClauseExcludes */;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return -2147450880 /* BindingPatternExcludes */;
- case 216 /* TypeAssertionExpression */:
- case 239 /* SatisfiesExpression */:
- case 235 /* AsExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 241 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 219 /* ParenthesizedExpression */:
case 107 /* SuperKeyword */:
return -2147483648 /* OuterExpressionExcludes */;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return -2147483648 /* PropertyAccessExcludes */;
default:
return -2147483648 /* NodeExcludes */;
@@ -25751,7 +25802,7 @@ function getOrCreateEmitNode(node) {
var _a2;
if (!node.emitNode) {
if (isParseTreeNode(node)) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return node.emitNode = { annotatedNodes: [node] };
}
const sourceFile = (_a2 = getSourceFileOfNode(getParseTreeNode(getSourceFileOfNode(node)))) != null ? _a2 : Debug.fail("Could not determine parsed source file.");
@@ -26750,589 +26801,595 @@ function isImportKeyword(node) {
return node.kind === 101 /* ImportKeyword */;
}
function isQualifiedName(node) {
- return node.kind === 165 /* QualifiedName */;
+ return node.kind === 166 /* QualifiedName */;
}
function isComputedPropertyName(node) {
- return node.kind === 166 /* ComputedPropertyName */;
+ return node.kind === 167 /* ComputedPropertyName */;
}
function isTypeParameterDeclaration(node) {
- return node.kind === 167 /* TypeParameter */;
+ return node.kind === 168 /* TypeParameter */;
}
function isParameter(node) {
- return node.kind === 168 /* Parameter */;
+ return node.kind === 169 /* Parameter */;
}
function isDecoratorOrAnnotation(node) {
- return node.kind === 169 /* Decorator */;
+ return node.kind === 170 /* Decorator */;
}
function isDecorator(node) {
- return node.kind === 169 /* Decorator */ && node.annotationDeclaration === void 0;
+ return node.kind === 170 /* Decorator */ && node.annotationDeclaration === void 0;
}
function isAnnotation(node) {
- return node.kind === 169 /* Decorator */ && node.annotationDeclaration !== void 0;
+ return node.kind === 170 /* Decorator */ && node.annotationDeclaration !== void 0;
}
function isPropertySignature(node) {
- return node.kind === 170 /* PropertySignature */;
+ return node.kind === 171 /* PropertySignature */;
+}
+function isOverloadPropertyDeclaration(node) {
+ return node.kind === 174 /* OverloadPropertyDeclaration */;
}
function isPropertyDeclaration(node) {
- return node.kind === 171 /* PropertyDeclaration */;
+ return node.kind === 172 /* PropertyDeclaration */;
}
function isAnnotationPropertyDeclaration(node) {
- return node.kind === 172 /* AnnotationPropertyDeclaration */;
+ return node.kind === 173 /* AnnotationPropertyDeclaration */;
}
function isMethodSignature(node) {
- return node.kind === 173 /* MethodSignature */;
+ return node.kind === 175 /* MethodSignature */;
}
function isMethodDeclaration(node) {
- return node.kind === 174 /* MethodDeclaration */;
+ return node.kind === 176 /* MethodDeclaration */;
}
function isClassStaticBlockDeclaration(node) {
- return node.kind === 175 /* ClassStaticBlockDeclaration */;
+ return node.kind === 177 /* ClassStaticBlockDeclaration */;
}
function isConstructorDeclaration(node) {
- return node.kind === 176 /* Constructor */;
+ return node.kind === 178 /* Constructor */;
}
function isGetAccessorDeclaration(node) {
- return node.kind === 177 /* GetAccessor */;
+ return node.kind === 179 /* GetAccessor */;
}
function isSetAccessorDeclaration(node) {
- return node.kind === 178 /* SetAccessor */;
+ return node.kind === 180 /* SetAccessor */;
}
function isCallSignatureDeclaration(node) {
- return node.kind === 179 /* CallSignature */;
+ return node.kind === 181 /* CallSignature */;
}
function isConstructSignatureDeclaration(node) {
- return node.kind === 180 /* ConstructSignature */;
+ return node.kind === 182 /* ConstructSignature */;
}
function isIndexSignatureDeclaration(node) {
- return node.kind === 181 /* IndexSignature */;
+ return node.kind === 183 /* IndexSignature */;
}
function isTypePredicateNode(node) {
- return node.kind === 182 /* TypePredicate */;
+ return node.kind === 184 /* TypePredicate */;
}
function isTypeReferenceNode(node) {
- return node.kind === 183 /* TypeReference */;
+ return node.kind === 185 /* TypeReference */;
}
function isFunctionTypeNode(node) {
- return node.kind === 184 /* FunctionType */;
+ return node.kind === 186 /* FunctionType */;
}
function isConstructorTypeNode(node) {
- return node.kind === 185 /* ConstructorType */;
+ return node.kind === 187 /* ConstructorType */;
}
function isTypeQueryNode(node) {
- return node.kind === 186 /* TypeQuery */;
+ return node.kind === 188 /* TypeQuery */;
}
function isTypeLiteralNode(node) {
- return node.kind === 187 /* TypeLiteral */;
+ return node.kind === 189 /* TypeLiteral */;
}
function isArrayTypeNode(node) {
- return node.kind === 188 /* ArrayType */;
+ return node.kind === 190 /* ArrayType */;
}
function isTupleTypeNode(node) {
- return node.kind === 189 /* TupleType */;
+ return node.kind === 191 /* TupleType */;
}
function isNamedTupleMember(node) {
- return node.kind === 202 /* NamedTupleMember */;
+ return node.kind === 204 /* NamedTupleMember */;
}
function isOptionalTypeNode(node) {
- return node.kind === 190 /* OptionalType */;
+ return node.kind === 192 /* OptionalType */;
}
function isRestTypeNode(node) {
- return node.kind === 191 /* RestType */;
+ return node.kind === 193 /* RestType */;
}
function isUnionTypeNode(node) {
- return node.kind === 192 /* UnionType */;
+ return node.kind === 194 /* UnionType */;
}
function isIntersectionTypeNode(node) {
- return node.kind === 193 /* IntersectionType */;
+ return node.kind === 195 /* IntersectionType */;
}
function isConditionalTypeNode(node) {
- return node.kind === 194 /* ConditionalType */;
+ return node.kind === 196 /* ConditionalType */;
}
function isInferTypeNode(node) {
- return node.kind === 195 /* InferType */;
+ return node.kind === 197 /* InferType */;
}
function isParenthesizedTypeNode(node) {
- return node.kind === 196 /* ParenthesizedType */;
+ return node.kind === 198 /* ParenthesizedType */;
}
function isThisTypeNode(node) {
- return node.kind === 197 /* ThisType */;
+ return node.kind === 199 /* ThisType */;
}
function isTypeOperatorNode(node) {
- return node.kind === 198 /* TypeOperator */;
+ return node.kind === 200 /* TypeOperator */;
}
function isIndexedAccessTypeNode(node) {
- return node.kind === 199 /* IndexedAccessType */;
+ return node.kind === 201 /* IndexedAccessType */;
}
function isMappedTypeNode(node) {
- return node.kind === 200 /* MappedType */;
+ return node.kind === 202 /* MappedType */;
}
function isLiteralTypeNode(node) {
- return node.kind === 201 /* LiteralType */;
+ return node.kind === 203 /* LiteralType */;
}
function isImportTypeNode(node) {
- return node.kind === 205 /* ImportType */;
+ return node.kind === 207 /* ImportType */;
}
function isTemplateLiteralTypeSpan(node) {
- return node.kind === 204 /* TemplateLiteralTypeSpan */;
+ return node.kind === 206 /* TemplateLiteralTypeSpan */;
}
function isTemplateLiteralTypeNode(node) {
- return node.kind === 203 /* TemplateLiteralType */;
+ return node.kind === 205 /* TemplateLiteralType */;
}
function isObjectBindingPattern(node) {
- return node.kind === 206 /* ObjectBindingPattern */;
+ return node.kind === 208 /* ObjectBindingPattern */;
}
function isArrayBindingPattern(node) {
- return node.kind === 207 /* ArrayBindingPattern */;
+ return node.kind === 209 /* ArrayBindingPattern */;
}
function isBindingElement(node) {
- return node.kind === 208 /* BindingElement */;
+ return node.kind === 210 /* BindingElement */;
}
function isArrayLiteralExpression(node) {
- return node.kind === 209 /* ArrayLiteralExpression */;
+ return node.kind === 211 /* ArrayLiteralExpression */;
}
function isObjectLiteralExpression(node) {
- return node.kind === 210 /* ObjectLiteralExpression */;
+ return node.kind === 212 /* ObjectLiteralExpression */;
}
function isPropertyAccessExpression(node) {
- return node.kind === 211 /* PropertyAccessExpression */;
+ return node.kind === 213 /* PropertyAccessExpression */;
}
function isElementAccessExpression(node) {
- return node.kind === 212 /* ElementAccessExpression */;
+ return node.kind === 214 /* ElementAccessExpression */;
}
function isCallExpression(node) {
- return node.kind === 213 /* CallExpression */;
+ return node.kind === 215 /* CallExpression */;
}
function isNewExpression(node) {
- return node.kind === 214 /* NewExpression */;
+ return node.kind === 216 /* NewExpression */;
}
function isTaggedTemplateExpression(node) {
- return node.kind === 215 /* TaggedTemplateExpression */;
+ return node.kind === 217 /* TaggedTemplateExpression */;
}
function isTypeAssertionExpression(node) {
- return node.kind === 216 /* TypeAssertionExpression */;
+ return node.kind === 218 /* TypeAssertionExpression */;
}
function isParenthesizedExpression(node) {
- return node.kind === 217 /* ParenthesizedExpression */;
+ return node.kind === 219 /* ParenthesizedExpression */;
}
function isFunctionExpression(node) {
- return node.kind === 218 /* FunctionExpression */;
+ return node.kind === 220 /* FunctionExpression */;
}
function isEtsComponentExpression(node) {
- return node.kind === 220 /* EtsComponentExpression */;
+ return node.kind === 222 /* EtsComponentExpression */;
}
function isArrowFunction(node) {
- return node.kind === 219 /* ArrowFunction */;
+ return node.kind === 221 /* ArrowFunction */;
}
function isDeleteExpression(node) {
- return node.kind === 221 /* DeleteExpression */;
+ return node.kind === 223 /* DeleteExpression */;
}
function isTypeOfExpression(node) {
- return node.kind === 222 /* TypeOfExpression */;
+ return node.kind === 224 /* TypeOfExpression */;
}
function isVoidExpression(node) {
- return node.kind === 223 /* VoidExpression */;
+ return node.kind === 225 /* VoidExpression */;
}
function isAwaitExpression(node) {
- return node.kind === 224 /* AwaitExpression */;
+ return node.kind === 226 /* AwaitExpression */;
}
function isPrefixUnaryExpression(node) {
- return node.kind === 225 /* PrefixUnaryExpression */;
+ return node.kind === 227 /* PrefixUnaryExpression */;
}
function isPostfixUnaryExpression(node) {
- return node.kind === 226 /* PostfixUnaryExpression */;
+ return node.kind === 228 /* PostfixUnaryExpression */;
}
function isBinaryExpression(node) {
- return node.kind === 227 /* BinaryExpression */;
+ return node.kind === 229 /* BinaryExpression */;
}
function isConditionalExpression(node) {
- return node.kind === 228 /* ConditionalExpression */;
+ return node.kind === 230 /* ConditionalExpression */;
}
function isTemplateExpression(node) {
- return node.kind === 229 /* TemplateExpression */;
+ return node.kind === 231 /* TemplateExpression */;
}
function isYieldExpression(node) {
- return node.kind === 230 /* YieldExpression */;
+ return node.kind === 232 /* YieldExpression */;
}
function isSpreadElement(node) {
- return node.kind === 231 /* SpreadElement */;
+ return node.kind === 233 /* SpreadElement */;
}
function isClassExpression(node) {
- return node.kind === 232 /* ClassExpression */;
+ return node.kind === 234 /* ClassExpression */;
}
function isOmittedExpression(node) {
- return node.kind === 233 /* OmittedExpression */;
+ return node.kind === 235 /* OmittedExpression */;
}
function isExpressionWithTypeArguments(node) {
- return node.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.kind === 236 /* ExpressionWithTypeArguments */;
}
function isAsExpression(node) {
- return node.kind === 235 /* AsExpression */;
+ return node.kind === 237 /* AsExpression */;
}
function isSatisfiesExpression(node) {
- return node.kind === 239 /* SatisfiesExpression */;
+ return node.kind === 241 /* SatisfiesExpression */;
}
function isNonNullExpression(node) {
- return node.kind === 236 /* NonNullExpression */;
+ return node.kind === 238 /* NonNullExpression */;
}
function isMetaProperty(node) {
- return node.kind === 237 /* MetaProperty */;
+ return node.kind === 239 /* MetaProperty */;
}
function isSyntheticExpression(node) {
- return node.kind === 238 /* SyntheticExpression */;
+ return node.kind === 240 /* SyntheticExpression */;
}
function isPartiallyEmittedExpression(node) {
- return node.kind === 359 /* PartiallyEmittedExpression */;
+ return node.kind === 362 /* PartiallyEmittedExpression */;
}
function isCommaListExpression(node) {
- return node.kind === 360 /* CommaListExpression */;
+ return node.kind === 363 /* CommaListExpression */;
}
function isTemplateSpan(node) {
- return node.kind === 240 /* TemplateSpan */;
+ return node.kind === 242 /* TemplateSpan */;
}
function isSemicolonClassElement(node) {
- return node.kind === 241 /* SemicolonClassElement */;
+ return node.kind === 243 /* SemicolonClassElement */;
}
function isBlock(node) {
- return node.kind === 242 /* Block */;
+ return node.kind === 244 /* Block */;
}
function isVariableStatement(node) {
- return node.kind === 244 /* VariableStatement */;
+ return node.kind === 246 /* VariableStatement */;
}
function isEmptyStatement(node) {
- return node.kind === 243 /* EmptyStatement */;
+ return node.kind === 245 /* EmptyStatement */;
}
function isExpressionStatement(node) {
- return node.kind === 245 /* ExpressionStatement */;
+ return node.kind === 247 /* ExpressionStatement */;
}
function isIfStatement(node) {
- return node.kind === 246 /* IfStatement */;
+ return node.kind === 248 /* IfStatement */;
}
function isDoStatement(node) {
- return node.kind === 247 /* DoStatement */;
+ return node.kind === 249 /* DoStatement */;
}
function isWhileStatement(node) {
- return node.kind === 248 /* WhileStatement */;
+ return node.kind === 250 /* WhileStatement */;
}
function isForStatement(node) {
- return node.kind === 249 /* ForStatement */;
+ return node.kind === 251 /* ForStatement */;
}
function isForInStatement(node) {
- return node.kind === 250 /* ForInStatement */;
+ return node.kind === 252 /* ForInStatement */;
}
function isForOfStatement(node) {
- return node.kind === 251 /* ForOfStatement */;
+ return node.kind === 253 /* ForOfStatement */;
}
function isContinueStatement(node) {
- return node.kind === 252 /* ContinueStatement */;
+ return node.kind === 254 /* ContinueStatement */;
}
function isBreakStatement(node) {
- return node.kind === 253 /* BreakStatement */;
+ return node.kind === 255 /* BreakStatement */;
}
function isReturnStatement(node) {
- return node.kind === 254 /* ReturnStatement */;
+ return node.kind === 256 /* ReturnStatement */;
}
function isWithStatement(node) {
- return node.kind === 255 /* WithStatement */;
+ return node.kind === 257 /* WithStatement */;
}
function isSwitchStatement(node) {
- return node.kind === 256 /* SwitchStatement */;
+ return node.kind === 258 /* SwitchStatement */;
}
function isLabeledStatement(node) {
- return node.kind === 257 /* LabeledStatement */;
+ return node.kind === 259 /* LabeledStatement */;
}
function isThrowStatement(node) {
- return node.kind === 258 /* ThrowStatement */;
+ return node.kind === 260 /* ThrowStatement */;
}
function isTryStatement(node) {
- return node.kind === 259 /* TryStatement */;
+ return node.kind === 261 /* TryStatement */;
}
function isDebuggerStatement(node) {
- return node.kind === 260 /* DebuggerStatement */;
+ return node.kind === 262 /* DebuggerStatement */;
}
function isVariableDeclaration(node) {
- return node.kind === 261 /* VariableDeclaration */;
+ return node.kind === 263 /* VariableDeclaration */;
}
function isVariableDeclarationList(node) {
- return node.kind === 262 /* VariableDeclarationList */;
+ return node.kind === 264 /* VariableDeclarationList */;
}
function isFunctionDeclaration(node) {
- return node.kind === 263 /* FunctionDeclaration */;
+ return node.kind === 265 /* FunctionDeclaration */;
}
function isClassDeclaration(node) {
- return node.kind === 264 /* ClassDeclaration */;
+ return node.kind === 266 /* ClassDeclaration */;
}
function isStructDeclaration(node) {
- return node.kind === 265 /* StructDeclaration */;
+ return node.kind === 267 /* StructDeclaration */;
}
function isAnnotationDeclaration(node) {
- return node.kind === 266 /* AnnotationDeclaration */;
+ return node.kind === 268 /* AnnotationDeclaration */;
+}
+function isOverloadDeclaration(node) {
+ return node.kind === 269 /* OverloadDeclaration */;
}
function isInterfaceDeclaration(node) {
- return node.kind === 267 /* InterfaceDeclaration */;
+ return node.kind === 270 /* InterfaceDeclaration */;
}
function isTypeAliasDeclaration(node) {
- return node.kind === 268 /* TypeAliasDeclaration */;
+ return node.kind === 271 /* TypeAliasDeclaration */;
}
function isEnumDeclaration(node) {
- return node.kind === 269 /* EnumDeclaration */;
+ return node.kind === 272 /* EnumDeclaration */;
}
function isModuleDeclaration(node) {
- return node.kind === 270 /* ModuleDeclaration */;
+ return node.kind === 273 /* ModuleDeclaration */;
}
function isModuleBlock(node) {
- return node.kind === 271 /* ModuleBlock */;
+ return node.kind === 274 /* ModuleBlock */;
}
function isCaseBlock(node) {
- return node.kind === 272 /* CaseBlock */;
+ return node.kind === 275 /* CaseBlock */;
}
function isNamespaceExportDeclaration(node) {
- return node.kind === 273 /* NamespaceExportDeclaration */;
+ return node.kind === 276 /* NamespaceExportDeclaration */;
}
function isImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */;
+ return node.kind === 277 /* ImportEqualsDeclaration */;
}
function isImportDeclaration(node) {
- return node.kind === 275 /* ImportDeclaration */;
+ return node.kind === 278 /* ImportDeclaration */;
}
function isImportClause(node) {
- return node.kind === 276 /* ImportClause */;
+ return node.kind === 279 /* ImportClause */;
}
function isImportTypeAssertionContainer(node) {
- return node.kind === 304 /* ImportTypeAssertionContainer */;
+ return node.kind === 307 /* ImportTypeAssertionContainer */;
}
function isAssertClause(node) {
- return node.kind === 302 /* AssertClause */;
+ return node.kind === 305 /* AssertClause */;
}
function isAssertEntry(node) {
- return node.kind === 303 /* AssertEntry */;
+ return node.kind === 306 /* AssertEntry */;
}
function isNamespaceImport(node) {
- return node.kind === 277 /* NamespaceImport */;
+ return node.kind === 280 /* NamespaceImport */;
}
function isNamespaceExport(node) {
- return node.kind === 283 /* NamespaceExport */;
+ return node.kind === 286 /* NamespaceExport */;
}
function isNamedImports(node) {
- return node.kind === 278 /* NamedImports */;
+ return node.kind === 281 /* NamedImports */;
}
function isImportSpecifier(node) {
- return node.kind === 279 /* ImportSpecifier */;
+ return node.kind === 282 /* ImportSpecifier */;
}
function isExportAssignment(node) {
- return node.kind === 280 /* ExportAssignment */;
+ return node.kind === 283 /* ExportAssignment */;
}
function isExportDeclaration(node) {
- return node.kind === 281 /* ExportDeclaration */;
+ return node.kind === 284 /* ExportDeclaration */;
}
function isNamedExports(node) {
- return node.kind === 282 /* NamedExports */;
+ return node.kind === 285 /* NamedExports */;
}
function isExportSpecifier(node) {
- return node.kind === 284 /* ExportSpecifier */;
+ return node.kind === 287 /* ExportSpecifier */;
}
function isMissingDeclaration(node) {
- return node.kind === 285 /* MissingDeclaration */;
+ return node.kind === 288 /* MissingDeclaration */;
}
function isNotEmittedStatement(node) {
- return node.kind === 358 /* NotEmittedStatement */;
+ return node.kind === 361 /* NotEmittedStatement */;
}
function isSyntheticReference(node) {
- return node.kind === 363 /* SyntheticReferenceExpression */;
+ return node.kind === 366 /* SyntheticReferenceExpression */;
}
function isMergeDeclarationMarker(node) {
- return node.kind === 361 /* MergeDeclarationMarker */;
+ return node.kind === 364 /* MergeDeclarationMarker */;
}
function isEndOfDeclarationMarker(node) {
- return node.kind === 362 /* EndOfDeclarationMarker */;
+ return node.kind === 365 /* EndOfDeclarationMarker */;
}
function isExternalModuleReference(node) {
- return node.kind === 286 /* ExternalModuleReference */;
+ return node.kind === 289 /* ExternalModuleReference */;
}
function isJsxElement(node) {
- return node.kind === 287 /* JsxElement */;
+ return node.kind === 290 /* JsxElement */;
}
function isJsxSelfClosingElement(node) {
- return node.kind === 288 /* JsxSelfClosingElement */;
+ return node.kind === 291 /* JsxSelfClosingElement */;
}
function isJsxOpeningElement(node) {
- return node.kind === 289 /* JsxOpeningElement */;
+ return node.kind === 292 /* JsxOpeningElement */;
}
function isJsxClosingElement(node) {
- return node.kind === 290 /* JsxClosingElement */;
+ return node.kind === 293 /* JsxClosingElement */;
}
function isJsxFragment(node) {
- return node.kind === 291 /* JsxFragment */;
+ return node.kind === 294 /* JsxFragment */;
}
function isJsxOpeningFragment(node) {
- return node.kind === 292 /* JsxOpeningFragment */;
+ return node.kind === 295 /* JsxOpeningFragment */;
}
function isJsxClosingFragment(node) {
- return node.kind === 293 /* JsxClosingFragment */;
+ return node.kind === 296 /* JsxClosingFragment */;
}
function isJsxAttribute(node) {
- return node.kind === 294 /* JsxAttribute */;
+ return node.kind === 297 /* JsxAttribute */;
}
function isJsxAttributes(node) {
- return node.kind === 295 /* JsxAttributes */;
+ return node.kind === 298 /* JsxAttributes */;
}
function isJsxSpreadAttribute(node) {
- return node.kind === 296 /* JsxSpreadAttribute */;
+ return node.kind === 299 /* JsxSpreadAttribute */;
}
function isJsxExpression(node) {
- return node.kind === 297 /* JsxExpression */;
+ return node.kind === 300 /* JsxExpression */;
}
function isCaseClause(node) {
- return node.kind === 298 /* CaseClause */;
+ return node.kind === 301 /* CaseClause */;
}
function isDefaultClause(node) {
- return node.kind === 299 /* DefaultClause */;
+ return node.kind === 302 /* DefaultClause */;
}
function isHeritageClause(node) {
- return node.kind === 300 /* HeritageClause */;
+ return node.kind === 303 /* HeritageClause */;
}
function isCatchClause(node) {
- return node.kind === 301 /* CatchClause */;
+ return node.kind === 304 /* CatchClause */;
}
function isPropertyAssignment(node) {
- return node.kind === 305 /* PropertyAssignment */;
+ return node.kind === 308 /* PropertyAssignment */;
}
function isShorthandPropertyAssignment(node) {
- return node.kind === 306 /* ShorthandPropertyAssignment */;
+ return node.kind === 309 /* ShorthandPropertyAssignment */;
}
function isSpreadAssignment(node) {
- return node.kind === 307 /* SpreadAssignment */;
+ return node.kind === 310 /* SpreadAssignment */;
}
function isEnumMember(node) {
- return node.kind === 308 /* EnumMember */;
+ return node.kind === 311 /* EnumMember */;
}
function isUnparsedPrepend(node) {
- return node.kind === 310 /* UnparsedPrepend */;
+ return node.kind === 313 /* UnparsedPrepend */;
}
function isSourceFile(node) {
- return node.kind === 314 /* SourceFile */;
+ return node.kind === 317 /* SourceFile */;
}
function isBundle(node) {
- return node.kind === 315 /* Bundle */;
+ return node.kind === 318 /* Bundle */;
}
function isUnparsedSource(node) {
- return node.kind === 316 /* UnparsedSource */;
+ return node.kind === 319 /* UnparsedSource */;
}
function isJSDocTypeExpression(node) {
- return node.kind === 318 /* JSDocTypeExpression */;
+ return node.kind === 321 /* JSDocTypeExpression */;
}
function isJSDocNameReference(node) {
- return node.kind === 319 /* JSDocNameReference */;
+ return node.kind === 322 /* JSDocNameReference */;
}
function isJSDocMemberName(node) {
- return node.kind === 320 /* JSDocMemberName */;
+ return node.kind === 323 /* JSDocMemberName */;
}
function isJSDocLink(node) {
- return node.kind === 333 /* JSDocLink */;
+ return node.kind === 336 /* JSDocLink */;
}
function isJSDocLinkCode(node) {
- return node.kind === 334 /* JSDocLinkCode */;
+ return node.kind === 337 /* JSDocLinkCode */;
}
function isJSDocLinkPlain(node) {
- return node.kind === 335 /* JSDocLinkPlain */;
+ return node.kind === 338 /* JSDocLinkPlain */;
}
function isJSDocAllType(node) {
- return node.kind === 321 /* JSDocAllType */;
+ return node.kind === 324 /* JSDocAllType */;
}
function isJSDocUnknownType(node) {
- return node.kind === 322 /* JSDocUnknownType */;
+ return node.kind === 325 /* JSDocUnknownType */;
}
function isJSDocNullableType(node) {
- return node.kind === 323 /* JSDocNullableType */;
+ return node.kind === 326 /* JSDocNullableType */;
}
function isJSDocNonNullableType(node) {
- return node.kind === 324 /* JSDocNonNullableType */;
+ return node.kind === 327 /* JSDocNonNullableType */;
}
function isJSDocOptionalType(node) {
- return node.kind === 325 /* JSDocOptionalType */;
+ return node.kind === 328 /* JSDocOptionalType */;
}
function isJSDocFunctionType(node) {
- return node.kind === 326 /* JSDocFunctionType */;
+ return node.kind === 329 /* JSDocFunctionType */;
}
function isJSDocVariadicType(node) {
- return node.kind === 327 /* JSDocVariadicType */;
+ return node.kind === 330 /* JSDocVariadicType */;
}
function isJSDocNamepathType(node) {
- return node.kind === 328 /* JSDocNamepathType */;
+ return node.kind === 331 /* JSDocNamepathType */;
}
function isJSDoc(node) {
- return node.kind === 329 /* JSDoc */;
+ return node.kind === 332 /* JSDoc */;
}
function isJSDocTypeLiteral(node) {
- return node.kind === 331 /* JSDocTypeLiteral */;
+ return node.kind === 334 /* JSDocTypeLiteral */;
}
function isJSDocSignature(node) {
- return node.kind === 332 /* JSDocSignature */;
+ return node.kind === 335 /* JSDocSignature */;
}
function isJSDocAugmentsTag(node) {
- return node.kind === 337 /* JSDocAugmentsTag */;
+ return node.kind === 340 /* JSDocAugmentsTag */;
}
function isJSDocAuthorTag(node) {
- return node.kind === 339 /* JSDocAuthorTag */;
+ return node.kind === 342 /* JSDocAuthorTag */;
}
function isJSDocClassTag(node) {
- return node.kind === 341 /* JSDocClassTag */;
+ return node.kind === 344 /* JSDocClassTag */;
}
function isJSDocCallbackTag(node) {
- return node.kind === 347 /* JSDocCallbackTag */;
+ return node.kind === 350 /* JSDocCallbackTag */;
}
function isJSDocPublicTag(node) {
- return node.kind === 342 /* JSDocPublicTag */;
+ return node.kind === 345 /* JSDocPublicTag */;
}
function isJSDocPrivateTag(node) {
- return node.kind === 343 /* JSDocPrivateTag */;
+ return node.kind === 346 /* JSDocPrivateTag */;
}
function isJSDocProtectedTag(node) {
- return node.kind === 344 /* JSDocProtectedTag */;
+ return node.kind === 347 /* JSDocProtectedTag */;
}
function isJSDocReadonlyTag(node) {
- return node.kind === 345 /* JSDocReadonlyTag */;
+ return node.kind === 348 /* JSDocReadonlyTag */;
}
function isJSDocOverrideTag(node) {
- return node.kind === 346 /* JSDocOverrideTag */;
+ return node.kind === 349 /* JSDocOverrideTag */;
}
function isJSDocDeprecatedTag(node) {
- return node.kind === 340 /* JSDocDeprecatedTag */;
+ return node.kind === 343 /* JSDocDeprecatedTag */;
}
function isJSDocSeeTag(node) {
- return node.kind === 355 /* JSDocSeeTag */;
+ return node.kind === 358 /* JSDocSeeTag */;
}
function isJSDocEnumTag(node) {
- return node.kind === 348 /* JSDocEnumTag */;
+ return node.kind === 351 /* JSDocEnumTag */;
}
function isJSDocParameterTag(node) {
- return node.kind === 349 /* JSDocParameterTag */;
+ return node.kind === 352 /* JSDocParameterTag */;
}
function isJSDocReturnTag(node) {
- return node.kind === 350 /* JSDocReturnTag */;
+ return node.kind === 353 /* JSDocReturnTag */;
}
function isJSDocThisTag(node) {
- return node.kind === 351 /* JSDocThisTag */;
+ return node.kind === 354 /* JSDocThisTag */;
}
function isJSDocTypeTag(node) {
- return node.kind === 352 /* JSDocTypeTag */;
+ return node.kind === 355 /* JSDocTypeTag */;
}
function isJSDocTemplateTag(node) {
- return node.kind === 353 /* JSDocTemplateTag */;
+ return node.kind === 356 /* JSDocTemplateTag */;
}
function isJSDocTypedefTag(node) {
- return node.kind === 354 /* JSDocTypedefTag */;
+ return node.kind === 357 /* JSDocTypedefTag */;
}
function isJSDocUnknownTag(node) {
- return node.kind === 336 /* JSDocTag */;
+ return node.kind === 339 /* JSDocTag */;
}
function isJSDocPropertyTag(node) {
- return node.kind === 356 /* JSDocPropertyTag */;
+ return node.kind === 359 /* JSDocPropertyTag */;
}
function isJSDocImplementsTag(node) {
- return node.kind === 338 /* JSDocImplementsTag */;
+ return node.kind === 341 /* JSDocImplementsTag */;
}
function isSyntaxList(n) {
- return n.kind === 357 /* SyntaxList */;
+ return n.kind === 360 /* SyntaxList */;
}
// src/compiler/factory/utilities.ts
@@ -27576,14 +27633,14 @@ function createExpressionForObjectLiteralElementLike(factory2, node, property, r
Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals.");
}
switch (property.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return createExpressionForAccessorDeclaration(factory2, node.properties, property, receiver, !!node.multiLine);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return createExpressionForPropertyAssignment(factory2, property, receiver);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return createExpressionForShorthandPropertyAssignment(factory2, property, receiver);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return createExpressionForMethodDeclaration(factory2, property, receiver);
}
}
@@ -27636,7 +27693,7 @@ function startsWithUseStrict(statements) {
return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement);
}
function isCommaSequence(node) {
- return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 360 /* CommaListExpression */;
+ return node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 363 /* CommaListExpression */;
}
function isJSDocTypeAssertion(node) {
return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
@@ -27648,18 +27705,18 @@ function getJSDocTypeAssertionType(node) {
}
function isOuterExpression(node, kinds = 15 /* All */) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
if (kinds & 16 /* ExcludeJSDocTypeAssertion */ && isJSDocTypeAssertion(node)) {
return false;
}
return (kinds & 1 /* Parentheses */) !== 0;
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
- case 239 /* SatisfiesExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
+ case 241 /* SatisfiesExpression */:
return (kinds & 2 /* TypeAssertions */) !== 0;
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return (kinds & 4 /* NonNullAssertions */) !== 0;
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
}
return false;
@@ -27765,10 +27822,10 @@ function getLocalNameForExternalImport(factory2, node, sourceFile) {
const name = namespaceDeclaration.name;
return isGeneratedIdentifier(name) ? name : factory2.createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name) || idText(name));
}
- if (node.kind === 275 /* ImportDeclaration */ && node.importClause) {
+ if (node.kind === 278 /* ImportDeclaration */ && node.importClause) {
return factory2.getGeneratedNameForNode(node);
}
- if (node.kind === 281 /* ExportDeclaration */ && node.moduleSpecifier) {
+ if (node.kind === 284 /* ExportDeclaration */ && node.moduleSpecifier) {
return factory2.getGeneratedNameForNode(node);
}
return void 0;
@@ -27823,11 +27880,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) {
}
if (isObjectLiteralElementLike(bindingElement)) {
switch (bindingElement.kind) {
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return bindingElement.name;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return getTargetOfBindingOrAssignmentElement(bindingElement.expression);
}
}
@@ -27841,11 +27898,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) {
}
function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
return bindingElement.dotDotDotToken;
- case 231 /* SpreadElement */:
- case 307 /* SpreadAssignment */:
+ case 233 /* SpreadElement */:
+ case 310 /* SpreadAssignment */:
return bindingElement;
}
return void 0;
@@ -27857,7 +27914,7 @@ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) {
}
function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
if (bindingElement.propertyName) {
const propertyName = bindingElement.propertyName;
if (isPrivateIdentifier(propertyName)) {
@@ -27866,7 +27923,7 @@ function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName;
}
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (bindingElement.name) {
const propertyName = bindingElement.name;
if (isPrivateIdentifier(propertyName)) {
@@ -27875,7 +27932,7 @@ function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName;
}
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
if (bindingElement.name && isPrivateIdentifier(bindingElement.name)) {
return Debug.failBadSyntaxKind(bindingElement.name);
}
@@ -27892,11 +27949,11 @@ function isStringOrNumericLiteral(node) {
}
function getElementsOfBindingOrAssignmentPattern(name) {
switch (name.kind) {
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return name.elements;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return name.properties;
}
}
@@ -27913,19 +27970,19 @@ function getJSDocTypeAliasName(fullName) {
}
function canHaveIllegalType(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 178 /* SetAccessor */;
+ return kind === 178 /* Constructor */ || kind === 180 /* SetAccessor */;
}
function canHaveIllegalTypeParameters(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function canHaveIllegalDecorators(node) {
const kind = node.kind;
- return kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 263 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 285 /* MissingDeclaration */ || kind === 244 /* VariableStatement */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 280 /* ExportAssignment */;
+ return kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 265 /* FunctionDeclaration */ || kind === 178 /* Constructor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 288 /* MissingDeclaration */ || kind === 246 /* VariableStatement */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 283 /* ExportAssignment */;
}
function canHaveIllegalModifiers(node) {
const kind = node.kind;
- return kind === 175 /* ClassStaticBlockDeclaration */ || kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 184 /* FunctionType */ || kind === 285 /* MissingDeclaration */ || kind === 273 /* NamespaceExportDeclaration */;
+ return kind === 177 /* ClassStaticBlockDeclaration */ || kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 186 /* FunctionType */ || kind === 288 /* MissingDeclaration */ || kind === 276 /* NamespaceExportDeclaration */;
}
var isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration);
var isQuestionOrExclamationToken = or(isQuestionToken, isExclamationToken);
@@ -28211,11 +28268,11 @@ function setTextRange(range, location2) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 167 /* TypeParameter */ || kind === 168 /* Parameter */ || kind === 170 /* PropertySignature */ || kind === 171 /* PropertyDeclaration */ || kind === 173 /* MethodSignature */ || kind === 174 /* MethodDeclaration */ || kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 185 /* ConstructorType */ || kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || kind === 232 /* ClassExpression */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 244 /* VariableStatement */ || kind === 263 /* FunctionDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 280 /* ExportAssignment */ || kind === 281 /* ExportDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 168 /* Parameter */ || kind === 171 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 232 /* ClassExpression */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* StructDeclaration */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */;
}
// src/compiler/parser.ts
@@ -28270,430 +28327,434 @@ function isImportMeta2(node) {
return isMetaProperty(node) && node.keywordToken === 101 /* ImportKeyword */ && node.name.escapedText === "meta";
}
var forEachChildTable = {
- [165 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) {
+ [166 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right);
},
- [167 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) {
+ [168 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression);
},
- [306 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) {
+ [309 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer);
},
- [307 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) {
+ [310 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [168 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) {
+ [169 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [171 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) {
+ [172 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [172 /* AnnotationPropertyDeclaration */]: function forEachChildInAnnotationPropertyDeclaration(node, cbNode, _cbNodes) {
+ [173 /* AnnotationPropertyDeclaration */]: function forEachChildInAnnotationPropertyDeclaration(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [170 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) {
+ [171 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) {
+ return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
+ },
+ [174 /* OverloadPropertyDeclaration */]: function forEachChildInOverloadPropertyDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [305 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) {
+ [308 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer);
},
- [261 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) {
+ [263 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [208 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) {
+ [210 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [181 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) {
+ [183 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [185 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) {
+ [187 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [184 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) {
+ [186 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [179 /* CallSignature */]: forEachChildInCallOrConstructSignature,
- [180 /* ConstructSignature */]: forEachChildInCallOrConstructSignature,
- [220 /* EtsComponentExpression */]: function forEachChildInEtsComponentExpression(node, cbNode, cbNodes) {
+ [181 /* CallSignature */]: forEachChildInCallOrConstructSignature,
+ [182 /* ConstructSignature */]: forEachChildInCallOrConstructSignature,
+ [222 /* EtsComponentExpression */]: function forEachChildInEtsComponentExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.arguments) || visitNode2(cbNode, node.body);
},
- [174 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) {
+ [176 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [173 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) {
+ [175 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [176 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) {
+ [178 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [177 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) {
+ [179 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [178 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) {
+ [180 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [263 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) {
+ [265 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [218 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) {
+ [220 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [219 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) {
+ [221 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body);
},
- [175 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) {
+ [177 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body);
},
- [183 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) {
+ [185 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [182 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) {
+ [184 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.assertsModifier) || visitNode2(cbNode, node.parameterName) || visitNode2(cbNode, node.type);
},
- [186 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) {
+ [188 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.exprName) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [187 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) {
+ [189 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.members);
},
- [188 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) {
+ [190 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.elementType);
},
- [189 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) {
+ [191 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [192 /* UnionType */]: forEachChildInUnionOrIntersectionType,
- [193 /* IntersectionType */]: forEachChildInUnionOrIntersectionType,
- [194 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) {
+ [194 /* UnionType */]: forEachChildInUnionOrIntersectionType,
+ [195 /* IntersectionType */]: forEachChildInUnionOrIntersectionType,
+ [196 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.checkType) || visitNode2(cbNode, node.extendsType) || visitNode2(cbNode, node.trueType) || visitNode2(cbNode, node.falseType);
},
- [195 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) {
+ [197 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.typeParameter);
},
- [205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
+ [207 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.assertions) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [304 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
+ [307 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.assertClause);
},
- [196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
- [198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
- [199 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) {
+ [198 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
+ [200 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
+ [201 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.objectType) || visitNode2(cbNode, node.indexType);
},
- [200 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) {
+ [202 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.readonlyToken) || visitNode2(cbNode, node.typeParameter) || visitNode2(cbNode, node.nameType) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNodes(cbNode, cbNodes, node.members);
},
- [201 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) {
+ [203 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.literal);
},
- [202 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) {
+ [204 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type);
},
- [206 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
- [207 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
- [209 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) {
+ [208 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
+ [209 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
+ [211 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [210 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) {
+ [212 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.properties);
},
- [211 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) {
+ [213 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.name);
},
- [212 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) {
+ [214 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.argumentExpression);
},
- [213 /* CallExpression */]: forEachChildInCallOrNewExpression,
- [214 /* NewExpression */]: forEachChildInCallOrNewExpression,
- [215 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) {
+ [215 /* CallExpression */]: forEachChildInCallOrNewExpression,
+ [216 /* NewExpression */]: forEachChildInCallOrNewExpression,
+ [217 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tag) || visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.template);
},
- [216 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) {
+ [218 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.expression);
},
- [217 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) {
+ [219 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [221 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) {
+ [223 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [222 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) {
+ [224 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [223 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) {
+ [225 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [225 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) {
+ [227 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.operand);
},
- [230 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) {
+ [232 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.expression);
},
- [224 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) {
+ [226 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [226 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) {
+ [228 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.operand);
},
- [227 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) {
+ [229 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.operatorToken) || visitNode2(cbNode, node.right);
},
- [235 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) {
+ [237 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type);
},
- [236 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) {
+ [238 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [239 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) {
+ [241 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type);
},
- [237 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) {
+ [239 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [228 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) {
+ [230 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.whenTrue) || visitNode2(cbNode, node.colonToken) || visitNode2(cbNode, node.whenFalse);
},
- [231 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) {
+ [233 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [242 /* Block */]: forEachChildInBlock,
- [271 /* ModuleBlock */]: forEachChildInBlock,
- [314 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) {
+ [244 /* Block */]: forEachChildInBlock,
+ [274 /* ModuleBlock */]: forEachChildInBlock,
+ [317 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken);
},
- [244 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) {
+ [246 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList);
},
- [262 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) {
+ [264 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.declarations);
},
- [245 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) {
+ [247 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [246 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) {
+ [248 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.thenStatement) || visitNode2(cbNode, node.elseStatement);
},
- [247 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) {
+ [249 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.statement) || visitNode2(cbNode, node.expression);
},
- [248 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) {
+ [250 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [249 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) {
+ [251 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.incrementor) || visitNode2(cbNode, node.statement);
},
- [250 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) {
+ [252 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [251 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) {
+ [253 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.awaitModifier) || visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [252 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement,
- [253 /* BreakStatement */]: forEachChildInContinueOrBreakStatement,
- [254 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) {
+ [254 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement,
+ [255 /* BreakStatement */]: forEachChildInContinueOrBreakStatement,
+ [256 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [255 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) {
+ [257 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [256 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) {
+ [258 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.caseBlock);
},
- [272 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) {
+ [275 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.clauses);
},
- [298 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) {
+ [301 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements);
},
- [299 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) {
+ [302 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.statements);
},
- [257 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) {
+ [259 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.label) || visitNode2(cbNode, node.statement);
},
- [258 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) {
+ [260 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [259 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) {
+ [261 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.tryBlock) || visitNode2(cbNode, node.catchClause) || visitNode2(cbNode, node.finallyBlock);
},
- [301 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) {
+ [304 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.variableDeclaration) || visitNode2(cbNode, node.block);
},
- [169 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) {
+ [170 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [264 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression,
- [232 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression,
- [265 /* StructDeclaration */]: forEachChildInClassDeclarationOrExpression,
- [266 /* AnnotationDeclaration */]: forEachChildInAnnotationDeclaration,
- [267 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) {
+ [266 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression,
+ [234 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression,
+ [267 /* StructDeclaration */]: forEachChildInClassDeclarationOrExpression,
+ [268 /* AnnotationDeclaration */]: forEachChildInAnnotationDeclaration,
+ [269 /* OverloadDeclaration */]: forEachChildInOverloadDeclaration,
+ [270 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members);
},
- [268 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) {
+ [271 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type);
},
- [269 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) {
+ [272 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
},
- [308 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) {
+ [311 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [270 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) {
+ [273 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body);
},
- [274 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) {
+ [277 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
},
- [275 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
+ [278 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
},
- [276 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
+ [279 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
},
- [302 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) {
+ [305 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [303 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) {
+ [306 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
},
- [273 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
+ [276 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNode2(cbNode, node.name);
},
- [277 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) {
+ [280 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [283 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) {
+ [286 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [278 /* NamedImports */]: forEachChildInNamedImportsOrExports,
- [282 /* NamedExports */]: forEachChildInNamedImportsOrExports,
- [281 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
+ [281 /* NamedImports */]: forEachChildInNamedImportsOrExports,
+ [285 /* NamedExports */]: forEachChildInNamedImportsOrExports,
+ [284 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
},
- [279 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
- [284 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
- [280 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) {
+ [282 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
+ [287 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
+ [283 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression);
},
- [229 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) {
+ [231 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
},
- [240 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) {
+ [242 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.literal);
},
- [203 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) {
+ [205 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
},
- [204 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) {
+ [206 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.literal);
},
- [166 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) {
+ [167 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [300 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) {
+ [303 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.types);
},
- [234 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) {
+ [236 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [286 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) {
+ [289 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [285 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
+ [288 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
},
- [360 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
+ [363 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [287 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
+ [290 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingElement);
},
- [291 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) {
+ [294 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingFragment);
},
- [288 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
- [289 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
- [295 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) {
+ [291 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
+ [292 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
+ [298 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.properties);
},
- [294 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) {
+ [297 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [296 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) {
+ [299 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [297 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) {
+ [300 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.expression);
},
- [290 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) {
+ [293 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.tagName);
},
- [190 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [191 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [318 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [324 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [323 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [325 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [327 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [326 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) {
+ [192 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [193 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [321 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [327 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [326 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [328 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [330 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [329 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [329 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) {
+ [332 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) {
return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags);
},
- [355 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
+ [358 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [319 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) {
+ [322 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [320 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) {
+ [323 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right);
},
- [349 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
- [356 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
- [339 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) {
+ [352 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
+ [359 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
+ [342 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [338 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) {
+ [341 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [337 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) {
+ [340 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [353 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
+ [356 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [354 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
- return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 318 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)));
+ [357 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
+ return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 321 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)));
},
- [347 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
+ [350 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [350 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
- [352 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
- [351 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
- [348 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
- [332 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
+ [353 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
+ [355 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
+ [354 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
+ [351 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
+ [335 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type);
},
- [333 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain,
- [334 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain,
- [335 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain,
- [331 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) {
+ [336 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain,
+ [337 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain,
+ [338 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain,
+ [334 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) {
return forEach(node.jsDocPropertyTags, cbNode);
},
- [336 /* JSDocTag */]: forEachChildInJSDocTag,
- [341 /* JSDocClassTag */]: forEachChildInJSDocTag,
- [342 /* JSDocPublicTag */]: forEachChildInJSDocTag,
- [343 /* JSDocPrivateTag */]: forEachChildInJSDocTag,
- [344 /* JSDocProtectedTag */]: forEachChildInJSDocTag,
- [345 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
- [340 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
- [346 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
- [359 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
+ [339 /* JSDocTag */]: forEachChildInJSDocTag,
+ [344 /* JSDocClassTag */]: forEachChildInJSDocTag,
+ [345 /* JSDocPublicTag */]: forEachChildInJSDocTag,
+ [346 /* JSDocPrivateTag */]: forEachChildInJSDocTag,
+ [347 /* JSDocProtectedTag */]: forEachChildInJSDocTag,
+ [348 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
+ [343 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
+ [349 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
+ [362 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
};
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
@@ -28722,6 +28783,9 @@ function forEachChildInClassDeclarationOrExpression(node, cbNode, cbNodes) {
function forEachChildInAnnotationDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
}
+function forEachChildInOverloadDeclaration(node, cbNode, cbNodes) {
+ return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
+}
function forEachChildInNamedImportsOrExports(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
}
@@ -28750,7 +28814,7 @@ function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
}
function forEachChild(node, cbNode, cbNodes) {
- if (node === void 0 || node.kind <= 164 /* LastToken */) {
+ if (node === void 0 || node.kind <= 165 /* LastToken */) {
return;
}
const fn = forEachChildTable[node.kind];
@@ -28785,7 +28849,7 @@ function forEachChildRecursively(rootNode, cbNode, cbNodes) {
continue;
return res;
}
- if (current.kind >= 165 /* FirstNode */) {
+ if (current.kind >= 166 /* FirstNode */) {
for (const child of gatherPossibleChildren(current)) {
queue.push(child);
parents.push(current);
@@ -29761,7 +29825,7 @@ var Parser;
parseErrorAtCurrentToken(diagnosticMessage, arg0);
}
const pos = getNodePos();
- const result = kind === 79 /* Identifier */ ? factory2.createIdentifier("", void 0, void 0) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, "", "", void 0) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral("", void 0) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral("", void 0) : kind === 285 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind);
+ const result = kind === 79 /* Identifier */ ? factory2.createIdentifier("", void 0, void 0) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, "", "", void 0) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral("", void 0) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral("", void 0) : kind === 288 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind);
return finishNode(result, pos);
}
function internIdentifier(text) {
@@ -29886,6 +29950,9 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
+ if (token() === 164 /* OverloadKeyword */) {
+ return true;
+ }
return canFollowExportModifier();
case 89 /* DefaultKeyword */:
return nextTokenCanFollowDefaultKeyword();
@@ -29910,7 +29977,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -30185,15 +30252,15 @@ var Parser;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 181 /* IndexSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 241 /* SemicolonClassElement */:
+ case 178 /* Constructor */:
+ case 183 /* IndexSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 243 /* SemicolonClassElement */:
return true;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return !inStructContext();
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
const methodDeclaration = node;
const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 136 /* ConstructorKeyword */;
return !nameIsConstructor;
@@ -30204,8 +30271,8 @@ var Parser;
function isReusableSwitchClause(node) {
if (node) {
switch (node.kind) {
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return true;
}
}
@@ -30214,66 +30281,66 @@ var Parser;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 244 /* VariableStatement */:
- case 242 /* Block */:
- case 246 /* IfStatement */:
- case 245 /* ExpressionStatement */:
- case 258 /* ThrowStatement */:
- case 254 /* ReturnStatement */:
- case 256 /* SwitchStatement */:
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 249 /* ForStatement */:
- case 248 /* WhileStatement */:
- case 255 /* WithStatement */:
- case 243 /* EmptyStatement */:
- case 259 /* TryStatement */:
- case 257 /* LabeledStatement */:
- case 247 /* DoStatement */:
- case 260 /* DebuggerStatement */:
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 246 /* VariableStatement */:
+ case 244 /* Block */:
+ case 248 /* IfStatement */:
+ case 247 /* ExpressionStatement */:
+ case 260 /* ThrowStatement */:
+ case 256 /* ReturnStatement */:
+ case 258 /* SwitchStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 250 /* WhileStatement */:
+ case 257 /* WithStatement */:
+ case 245 /* EmptyStatement */:
+ case 261 /* TryStatement */:
+ case 259 /* LabeledStatement */:
+ case 249 /* DoStatement */:
+ case 262 /* DebuggerStatement */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
}
}
return false;
}
function isReusableEnumMember(node) {
- return node.kind === 308 /* EnumMember */;
+ return node.kind === 311 /* EnumMember */;
}
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 170 /* PropertySignature */:
- case 179 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 171 /* PropertySignature */:
+ case 181 /* CallSignature */:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 261 /* VariableDeclaration */) {
+ if (node.kind !== 263 /* VariableDeclaration */) {
return false;
}
const variableDeclarator = node;
return variableDeclarator.initializer === void 0;
}
function isReusableParameter(node) {
- if (node.kind !== 168 /* Parameter */) {
+ if (node.kind !== 169 /* Parameter */) {
return false;
}
const parameter = node;
@@ -30564,14 +30631,14 @@ var Parser;
}
function typeHasArrowFunctionBlockingParseError(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return nodeIsMissing(node.typeName);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */: {
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */: {
const { parameters, type } = node;
return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type);
}
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return typeHasArrowFunctionBlockingParseError(node.type);
default:
return false;
@@ -30812,14 +30879,14 @@ var Parser;
function parseSignatureMember(kind) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
- if (kind === 180 /* ConstructSignature */) {
+ if (kind === 182 /* ConstructSignature */) {
parseExpected(104 /* NewKeyword */);
}
const typeParameters = parseTypeParameters();
const parameters = parseParameters(4 /* Type */);
const type = parseReturnType(58 /* ColonToken */, true);
parseTypeMemberSemicolon();
- const node = kind === 179 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type);
+ const node = kind === 181 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function isIndexSignature() {
@@ -30857,6 +30924,17 @@ var Parser;
node.illegalDecorators = decorators;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+ function parseOverloadPropertyDeclaration(pos, hasJSDoc, modifiers) {
+ const name = parsePropertyName();
+ const questionToken = parseOptionalToken(57 /* QuestionToken */);
+ let node;
+ const type = parseTypeAnnotation();
+ node = factory2.createOverloadPropertyDeclaration(modifiers, name, questionToken, type);
+ if (token() === 63 /* EqualsToken */)
+ node.initializer = parseInitializer();
+ parseTypeMemberSemicolon();
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
+ }
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
@@ -30898,19 +30976,19 @@ var Parser;
}
function parseTypeMember() {
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) {
- return parseSignatureMember(179 /* CallSignature */);
+ return parseSignatureMember(181 /* CallSignature */);
}
if (token() === 104 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) {
- return parseSignatureMember(180 /* ConstructSignature */);
+ return parseSignatureMember(182 /* ConstructSignature */);
}
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 177 /* GetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 179 /* GetAccessor */, 4 /* Type */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 178 /* SetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 180 /* SetAccessor */, 4 /* Type */);
}
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
@@ -31786,7 +31864,7 @@ var Parser;
return void 0;
}
let unwrappedType = type;
- while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 196 /* ParenthesizedType */) {
+ while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 198 /* ParenthesizedType */) {
unwrappedType = unwrappedType.type;
}
const hasJSDocFunctionType = unwrappedType && isJSDocFunctionType(unwrappedType);
@@ -31849,7 +31927,7 @@ var Parser;
return parseBinaryExpressionRest(precedence, leftOperand, pos);
}
function isInOrOfKeyword(t) {
- return t === 102 /* InKeyword */ || t === 164 /* OfKeyword */;
+ return t === 102 /* InKeyword */ || t === 165 /* OfKeyword */;
}
function parseBinaryExpressionRest(precedence, leftOperand, pos) {
while (true) {
@@ -31931,7 +32009,7 @@ var Parser;
if (token() === 42 /* AsteriskAsteriskToken */) {
const pos = skipTrivia(sourceText, simpleUnaryExpression.pos);
const { end } = simpleUnaryExpression;
- if (simpleUnaryExpression.kind === 216 /* TypeAssertionExpression */) {
+ if (simpleUnaryExpression.kind === 218 /* TypeAssertionExpression */) {
parseErrorAt(pos, end, Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
} else {
parseErrorAt(pos, end, Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator));
@@ -32054,11 +32132,11 @@ var Parser;
const pos = getNodePos();
const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext);
let result;
- if (opening.kind === 289 /* JsxOpeningElement */) {
+ if (opening.kind === 292 /* JsxOpeningElement */) {
let children = parseJsxChildren(opening);
let closingElement;
const lastChild = children[children.length - 1];
- if ((lastChild == null ? void 0 : lastChild.kind) === 287 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) {
+ if ((lastChild == null ? void 0 : lastChild.kind) === 290 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) {
const end = lastChild.children.end;
const newLast = finishNode(
factory2.createJsxElement(
@@ -32082,10 +32160,10 @@ var Parser;
}
}
result = finishNode(factory2.createJsxElement(opening, children, closingElement), pos);
- } else if (opening.kind === 292 /* JsxOpeningFragment */) {
+ } else if (opening.kind === 295 /* JsxOpeningFragment */) {
result = finishNode(factory2.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos);
} else {
- Debug.assert(opening.kind === 288 /* JsxSelfClosingElement */);
+ Debug.assert(opening.kind === 291 /* JsxSelfClosingElement */);
result = opening;
}
if (inExpressionContext && token() === 29 /* LessThanToken */) {
@@ -32141,7 +32219,7 @@ var Parser;
if (!child)
break;
list.push(child);
- if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 287 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) {
+ if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 290 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) {
break;
}
}
@@ -32349,7 +32427,7 @@ var Parser;
continue;
}
if (isTemplateStartOfTaggedTemplate()) {
- expression = !questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest(pos, expression, questionDotToken, void 0);
+ expression = !questionDotToken && expression.kind === 236 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest(pos, expression, questionDotToken, void 0);
continue;
}
if (!questionDotToken) {
@@ -32397,7 +32475,7 @@ var Parser;
}
}
if (typeArguments || token() === 20 /* OpenParenToken */) {
- if (!questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (!questionDotToken && expression.kind === 236 /* ExpressionWithTypeArguments */) {
typeArguments = expression.typeArguments;
expression = expression.expression;
}
@@ -32624,10 +32702,10 @@ var Parser;
const decorators = parseDecorators();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 177 /* GetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 0 /* None */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 178 /* SetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 0 /* None */);
}
const asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
const tokenIsIdentifier = isIdentifier2();
@@ -32697,7 +32775,7 @@ var Parser;
const expressionPos = getNodePos();
let expression = parseMemberExpressionRest(expressionPos, parsePrimaryExpression(), false);
let typeArguments;
- if (expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (expression.kind === 236 /* ExpressionWithTypeArguments */) {
typeArguments = expression.typeArguments;
expression = expression.expression;
}
@@ -32805,7 +32883,7 @@ var Parser;
}
}
let node;
- if (awaitToken ? parseExpected(164 /* OfKeyword */) : parseOptional(164 /* OfKeyword */)) {
+ if (awaitToken ? parseExpected(165 /* OfKeyword */) : parseOptional(165 /* OfKeyword */)) {
const expression = allowInAnd(() => parseAssignmentExpressionOrHigher(true));
parseExpected(21 /* CloseParenToken */);
node = factory2.createForOfStatement(awaitToken, initializer, expression, parseStatement());
@@ -32826,10 +32904,10 @@ var Parser;
function parseBreakOrContinueStatement(kind) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
- parseExpected(kind === 253 /* BreakStatement */ ? 81 /* BreakKeyword */ : 87 /* ContinueKeyword */);
+ parseExpected(kind === 255 /* BreakStatement */ ? 81 /* BreakKeyword */ : 87 /* ContinueKeyword */);
const label = canParseSemicolon() ? void 0 : parseIdentifier();
parseSemicolon();
- const node = kind === 253 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label);
+ const node = kind === 255 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseReturnStatement() {
@@ -32983,6 +33061,8 @@ var Parser;
return inEtsContext();
case 59 /* AtToken */:
return inAllowAnnotationContext() && nextToken() === 119 /* InterfaceKeyword */;
+ case 164 /* OverloadKeyword */:
+ return nextTokenIsIdentifierOnSameLine();
case 119 /* InterfaceKeyword */:
case 155 /* TypeKeyword */:
return nextTokenIsIdentifierOnSameLine();
@@ -33117,9 +33197,9 @@ var Parser;
case 98 /* ForKeyword */:
return parseForOrForInOrForOfStatement();
case 87 /* ContinueKeyword */:
- return parseBreakOrContinueStatement(252 /* ContinueStatement */);
+ return parseBreakOrContinueStatement(254 /* ContinueStatement */);
case 81 /* BreakKeyword */:
- return parseBreakOrContinueStatement(253 /* BreakStatement */);
+ return parseBreakOrContinueStatement(255 /* BreakStatement */);
case 106 /* ReturnKeyword */:
return parseReturnStatement();
case 117 /* WithKeyword */:
@@ -33135,6 +33215,7 @@ var Parser;
case 88 /* DebuggerKeyword */:
return parseDebuggerStatement();
case 59 /* AtToken */:
+ case 164 /* OverloadKeyword */:
return parseDeclaration();
case 133 /* AsyncKeyword */:
case 119 /* InterfaceKeyword */:
@@ -33183,6 +33264,19 @@ var Parser;
const node = factory2.createAnnotationDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+ function parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers) {
+ parseExpected(164 /* OverloadKeyword */);
+ const name = createIdentifier3(isBindingIdentifier());
+ let members;
+ if (parseExpected(18 /* OpenBraceToken */)) {
+ members = parseOverloadMembers();
+ parseExpected(19 /* CloseBraceToken */);
+ } else {
+ members = createMissingList();
+ }
+ const node = factory2.createOverloadDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
+ }
function parseDeclaration() {
var _a2, _b;
const pos = getNodePos();
@@ -33252,6 +33346,8 @@ var Parser;
return parseAnnotationDeclaration(pos, hasJSDoc, decorators, modifiers);
}
return parseDeclarationDefault(pos, decorators, modifiers);
+ case 164 /* OverloadKeyword */:
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
case 119 /* InterfaceKeyword */:
return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
case 155 /* TypeKeyword */:
@@ -33281,7 +33377,7 @@ var Parser;
}
function parseDeclarationDefault(pos, decorators, modifiers) {
if (decorators || modifiers) {
- const missing = createMissingNode(285 /* MissingDeclaration */, true, Diagnostics.Declaration_expected);
+ const missing = createMissingNode(288 /* MissingDeclaration */, true, Diagnostics.Declaration_expected);
setTextRangePos(missing, pos);
missing.illegalDecorators = decorators;
missing.modifiers = modifiers;
@@ -33391,7 +33487,7 @@ var Parser;
}
nextToken();
let declarations;
- if (token() === 164 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {
+ if (token() === 165 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {
declarations = createMissingList();
} else {
const savedDisallowIn = inDisallowInContext();
@@ -33421,7 +33517,7 @@ var Parser;
const asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
const name = modifierFlags & 1024 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier();
if (name && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
- fileStylesComponents.set(name.escapedText.toString(), 263 /* FunctionDeclaration */);
+ fileStylesComponents.set(name.escapedText.toString(), 265 /* FunctionDeclaration */);
}
const originalUICallbackContext = inUICallbackContext();
setEtsBuilderContext(hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions));
@@ -33525,7 +33621,7 @@ var Parser;
setUICallbackContext(inBuildContext() || inBuilderContext());
if (inStructContext() && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
if (methodName && currentStructName) {
- structStylesComponents.set(methodName, { structName: currentStructName, kind: 174 /* MethodDeclaration */ });
+ structStylesComponents.set(methodName, { structName: currentStructName, kind: 176 /* MethodDeclaration */ });
}
const stylesEtsComponentDecoratorNames = getEtsStylesDecoratorComponentNames(decorators, sourceFileCompilerOptions);
if (stylesEtsComponentDecoratorNames.length > 0) {
@@ -33614,7 +33710,7 @@ var Parser;
const parameters = parseParameters(0 /* None */);
const type = parseReturnType(58 /* ColonToken */, false);
const body = parseFunctionBlockOrSemicolon(flags);
- const node = kind === 177 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body);
+ const node = kind === 179 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body);
node.typeParameters = typeParameters;
if (isSetAccessorDeclaration(node))
node.type = type;
@@ -33826,10 +33922,10 @@ var Parser;
return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 177 /* GetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 0 /* None */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 178 /* SetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 0 /* None */);
}
if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers);
@@ -33865,35 +33961,35 @@ var Parser;
const hasJSDoc = hasPrecedingJSDocComment();
if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (parseContextualModifier(138 /* GetKeyword */)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (isIndexSignature()) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
@@ -33904,11 +34000,66 @@ var Parser;
}
return Debug.fail("Should not have attempted to parse annotation member declaration.");
}
+ function parseOverloadElement() {
+ const pos = getNodePos();
+ if (token() === 26 /* SemicolonToken */) {
+ parseErrorAt(pos, pos, Diagnostics.Unexpected_keyword_or_identifier);
+ }
+ const hasJSDoc = hasPrecedingJSDocComment();
+ if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (parseContextualModifier(138 /* GetKeyword */)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (parseContextualModifier(152 /* SetKeyword */)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (isIndexSignature()) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (tokenIsIdentifierOrKeyword(token())) {
+ const modifiers = parseModifiers();
+ let overloadPropertyDeclaration = parseOverloadPropertyDeclaration(pos, hasJSDoc, modifiers);
+ if (overloadPropertyDeclaration.kind === 174 /* OverloadPropertyDeclaration */) {
+ return overloadPropertyDeclaration;
+ }
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ return Debug.fail("Should not have attempted to parse annotation member declaration.");
+ }
function parseClassExpression() {
- return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0, 232 /* ClassExpression */);
+ return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0, 234 /* ClassExpression */);
}
function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) {
- return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 264 /* ClassDeclaration */);
+ return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 266 /* ClassDeclaration */);
}
function parseStructDeclaration(pos, hasJSDoc, decorators, modifiers) {
return parseStructDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers);
@@ -33929,7 +34080,7 @@ var Parser;
members = createMissingList();
}
setAwaitContext(savedAwaitContext);
- const node = kind === 264 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
+ const node = kind === 266 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseStructDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers) {
@@ -33993,7 +34144,7 @@ var Parser;
function parseExpressionWithTypeArguments() {
const pos = getNodePos();
const expression = parseLeftHandSideExpressionOrHigher();
- if (expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (expression.kind === 236 /* ExpressionWithTypeArguments */) {
return expression;
}
const typeArguments = tryParseTypeArguments();
@@ -34011,13 +34162,16 @@ var Parser;
function parseAnnotationMembers() {
return parseList(ParsingContext.AnnotationMembers, parseAnnotationElement);
}
+ function parseOverloadMembers() {
+ return parseList(ParsingContext.TypeMembers, parseOverloadElement);
+ }
function parseStructMembers(pos) {
const structMembers = parseList(ParsingContext.ClassMembers, parseClassElement);
const virtualStructMembers = [];
const virtualParameterProperties = [];
structMembers.forEach((member) => {
virtualStructMembers.push(member);
- if (member.kind === 171 /* PropertyDeclaration */) {
+ if (member.kind === 172 /* PropertyDeclaration */) {
const property = member;
virtualParameterProperties.push(
finishVirtualNode(
@@ -34264,7 +34418,7 @@ var Parser;
function parseImportClause(identifier, pos, isTypeOnly) {
let namedBindings;
if (!identifier || parseOptional(27 /* CommaToken */)) {
- namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(278 /* NamedImports */);
+ namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(281 /* NamedImports */);
}
return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos);
}
@@ -34297,15 +34451,15 @@ var Parser;
}
function parseNamedImportsOrExports(kind) {
const pos = getNodePos();
- const node = kind === 278 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */));
+ const node = kind === 281 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */));
return finishNode(node, pos);
}
function parseExportSpecifier() {
const hasJSDoc = hasPrecedingJSDocComment();
- return withJSDoc(parseImportOrExportSpecifier(284 /* ExportSpecifier */), hasJSDoc);
+ return withJSDoc(parseImportOrExportSpecifier(287 /* ExportSpecifier */), hasJSDoc);
}
function parseImportSpecifier() {
- return parseImportOrExportSpecifier(279 /* ImportSpecifier */);
+ return parseImportOrExportSpecifier(282 /* ImportSpecifier */);
}
function parseImportOrExportSpecifier(kind) {
const pos = getNodePos();
@@ -34349,10 +34503,10 @@ var Parser;
parseExpected(129 /* AsKeyword */);
name = parseNameWithKeywordCheck();
}
- if (kind === 279 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
+ if (kind === 282 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected);
}
- const node = kind === 279 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
+ const node = kind === 282 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
return finishNode(node, pos);
function parseNameWithKeywordCheck() {
checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2();
@@ -34379,7 +34533,7 @@ var Parser;
parseExpected(160 /* FromKeyword */);
moduleSpecifier = parseModuleSpecifier();
} else {
- exportClause = parseNamedImportsOrExports(282 /* NamedExports */);
+ exportClause = parseNamedImportsOrExports(285 /* NamedExports */);
if (token() === 160 /* FromKeyword */ || token() === 10 /* StringLiteral */ && !scanner2.hasPrecedingLineBreak()) {
parseExpected(160 /* FromKeyword */);
moduleSpecifier = parseModuleSpecifier();
@@ -34953,7 +35107,7 @@ var Parser;
switch (node.kind) {
case 150 /* ObjectKeyword */:
return true;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return isObjectOrObjectArrayTypeReference(node.elementType);
default:
return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments;
@@ -34983,12 +35137,12 @@ var Parser;
let child;
let children;
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent3, name))) {
- if (child.kind === 349 /* JSDocParameterTag */ || child.kind === 356 /* JSDocPropertyTag */) {
+ if (child.kind === 352 /* JSDocParameterTag */ || child.kind === 359 /* JSDocPropertyTag */) {
children = append(children, child);
}
}
if (children) {
- const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 188 /* ArrayType */), pos);
+ const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 190 /* ArrayType */), pos);
return finishNode(factory2.createJSDocTypeExpression(literal), pos);
}
}
@@ -35101,7 +35255,7 @@ var Parser;
let hasChildren = false;
while (child = tryParse(() => parseChildPropertyTag(indent3))) {
hasChildren = true;
- if (child.kind === 352 /* JSDocTypeTag */) {
+ if (child.kind === 355 /* JSDocTypeTag */) {
if (childTypeTag) {
const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
if (lastError) {
@@ -35116,7 +35270,7 @@ var Parser;
}
}
if (hasChildren) {
- const isArrayType = typeExpression && typeExpression.type.kind === 188 /* ArrayType */;
+ const isArrayType = typeExpression && typeExpression.type.kind === 190 /* ArrayType */;
const jsdocTypeLiteral = factory2.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType);
typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral, start3);
end2 = typeExpression.end;
@@ -35167,7 +35321,7 @@ var Parser;
const returnTag = tryParse(() => {
if (parseOptionalJsdoc(59 /* AtToken */)) {
const tag = parseTag(indent3);
- if (tag && tag.kind === 350 /* JSDocReturnTag */) {
+ if (tag && tag.kind === 353 /* JSDocReturnTag */) {
return tag;
}
}
@@ -35201,7 +35355,7 @@ var Parser;
case 59 /* AtToken */:
if (canParseTag) {
const child = tryParseChildTag(target, indent3);
- if (child && (child.kind === 349 /* JSDocParameterTag */ || child.kind === 356 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
+ if (child && (child.kind === 352 /* JSDocParameterTag */ || child.kind === 359 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
return false;
}
return child;
@@ -37721,7 +37875,7 @@ function convertConfigFileToObject(sourceFile, errors, reportOptionsErrors, opti
var _a2;
const rootExpression = (_a2 = sourceFile.statements[0]) == null ? void 0 : _a2.expression;
const knownRootOptions = reportOptionsErrors ? getTsconfigRootOptionsMap() : void 0;
- if (rootExpression && rootExpression.kind !== 210 /* ObjectLiteralExpression */) {
+ if (rootExpression && rootExpression.kind !== 212 /* ObjectLiteralExpression */) {
errors.push(createDiagnosticForNodeInSourceFile(
sourceFile,
rootExpression,
@@ -37753,7 +37907,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) {
const result = returnValue ? {} : void 0;
for (const element of node.properties) {
- if (element.kind !== 305 /* PropertyAssignment */) {
+ if (element.kind !== 308 /* PropertyAssignment */) {
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element, Diagnostics.Property_assignment_expected));
continue;
}
@@ -37841,13 +37995,13 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
case 8 /* NumericLiteral */:
reportInvalidOptionValue(option && option.type !== "number");
return validateValue(Number(valueExpression.text));
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) {
break;
}
reportInvalidOptionValue(option && option.type !== "number");
return validateValue(-Number(valueExpression.operand.text));
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
reportInvalidOptionValue(option && option.type !== "object");
const objectLiteralExpression = valueExpression;
if (option) {
@@ -37866,7 +38020,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
void 0
));
}
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
reportInvalidOptionValue(option && option.type !== "list");
return validateValue(convertArrayLiteralExpressionToJson(
valueExpression.elements,
@@ -40911,7 +41065,7 @@ function getReservedDecoratorsOfEtsFile(node, host) {
}
function getReservedDecoratorsOfStructDeclaration(node, host) {
let reservedDecorators;
- if (node.parent.kind === 265 /* StructDeclaration */) {
+ if (node.parent.kind === 267 /* StructDeclaration */) {
reservedDecorators = ensureEtsDecorators(node, host);
}
return reservedDecorators;
@@ -41128,10 +41282,10 @@ function isTokenInsideBuilder(decorators, compilerOptions) {
return false;
}
function getEtsComponentExpressionInnerCallExpressionNode(node) {
- while (node && node.kind !== 220 /* EtsComponentExpression */) {
- if (node.kind === 213 /* CallExpression */) {
+ while (node && node.kind !== 222 /* EtsComponentExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
node = node.expression;
- } else if (node.kind === 211 /* PropertyAccessExpression */) {
+ } else if (node.kind === 213 /* PropertyAccessExpression */) {
node = node.expression;
} else {
node = void 0;
@@ -41144,7 +41298,7 @@ function getRootEtsComponentInnerCallExpressionNode(node) {
return node;
}
while (node) {
- const ancestor = getAncestor(isCallExpression(node) ? node.parent : node, 213 /* CallExpression */);
+ const ancestor = getAncestor(isCallExpression(node) ? node.parent : node, 215 /* CallExpression */);
const target = getRootEtsComponent(ancestor);
if (target && isInStateStylesObject(node)) {
return target;
@@ -41173,7 +41327,7 @@ function getEtsComponentExpressionInnerExpressionStatementNode(node) {
return void 0;
}
function isInStateStylesObject(node) {
- const ancestor = getAncestor(node, 210 /* ObjectLiteralExpression */);
+ const ancestor = getAncestor(node, 212 /* ObjectLiteralExpression */);
return ancestor !== void 0 && ancestor.parent !== void 0 && isPropertyAssignment(ancestor.parent);
}
function getEtsExtendDecoratorsComponentNames(decorators, compilerOptions) {
@@ -41181,7 +41335,7 @@ function getEtsExtendDecoratorsComponentNames(decorators, compilerOptions) {
const extendComponents = [];
const extendDecorator = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.extend) == null ? void 0 : _b.decorator) != null ? _c : "Extend";
decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (decorator.expression.kind === 213 /* CallExpression */) {
+ if (decorator.expression.kind === 215 /* CallExpression */) {
const identifier = decorator.expression.expression;
const args = decorator.expression.arguments;
if (identifier.kind === 79 /* Identifier */ && (extendDecorator == null ? void 0 : extendDecorator.includes(identifier.escapedText.toString())) && args.length) {
@@ -41198,7 +41352,7 @@ function getEtsStylesDecoratorComponentNames(decorators, compilerOptions) {
const stylesComponents = [];
const stylesDecorator = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.styles) == null ? void 0 : _b.decorator) != null ? _c : "Styles";
decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (decorator.kind === 169 /* Decorator */ && decorator.expression.kind === 79 /* Identifier */) {
+ if (decorator.kind === 170 /* Decorator */ && decorator.expression.kind === 79 /* Identifier */) {
const identifier = decorator.expression;
if (identifier.kind === 79 /* Identifier */ && identifier.escapedText === stylesDecorator) {
stylesComponents.push(identifier.escapedText);
@@ -41244,7 +41398,7 @@ function transformAnnotation(context) {
}
function visitAnnotationsDeclarations(node) {
switch (node.kind) {
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return visitAnnotationDeclaration(node);
default:
return visitEachChild(node, visitAnnotationsDeclarations, context);
@@ -41252,9 +41406,9 @@ function transformAnnotation(context) {
}
function visitAnnotations(node) {
switch (node.kind) {
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return visitImportSpecifier(node);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return visitAnnotation(node);
default:
return visitEachChild(node, visitAnnotations, context);
@@ -41294,14 +41448,14 @@ function transformAnnotation(context) {
return factory.createIdentifier(
annotationMagicNamePrefix + expr.escapedText
);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
const propAccessExpr = expr;
return factory.updatePropertyAccessExpression(
propAccessExpr,
propAccessExpr.expression,
addMagicPrefixToAnnotationNameIdentifier(propAccessExpr.name)
);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
const callExpr = expr;
return factory.updateCallExpression(
callExpr,
@@ -41382,16 +41536,16 @@ function transformTypeExportImportAndConstEnumInTypeScript(context) {
}
function visitImportExportAndConstEnumMember(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitConstEnum(node);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return visitEnumMember(node);
default:
return visitEachChild(node, visitImportExportAndConstEnumMember, context);
@@ -41437,7 +41591,7 @@ function transformTypeExportImportAndConstEnumInTypeScript(context) {
return name || namedBindings ? factory.updateImportClause(node, false, name, namedBindings) : void 0;
}
function visitNamedImportBindings(node) {
- if (node.kind === 277 /* NamespaceImport */) {
+ if (node.kind === 280 /* NamespaceImport */) {
if (resolver.isReferencedAliasDeclaration(node)) {
return node;
}
@@ -42037,23 +42191,23 @@ function getModuleInstanceStateCached(node, visited = new Map2()) {
}
function getModuleInstanceStateWorker(node, visited) {
switch (node.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return 0 /* NonInstantiated */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (isEnumConst(node)) {
return 2 /* ConstEnumOnly */;
}
break;
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
if (!hasSyntacticModifier(node, 1 /* Export */)) {
return 0 /* NonInstantiated */;
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportDeclaration = node;
- if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 282 /* NamedExports */) {
+ if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 285 /* NamedExports */) {
let state = 0 /* NonInstantiated */;
for (const specifier of exportDeclaration.exportClause.elements) {
const specifierState = getModuleInstanceStateForAliasTarget(specifier, visited);
@@ -42067,7 +42221,7 @@ function getModuleInstanceStateWorker(node, visited) {
return state;
}
break;
- case 271 /* ModuleBlock */: {
+ case 274 /* ModuleBlock */: {
let state = 0 /* NonInstantiated */;
forEachChild(node, (n) => {
const childState = getModuleInstanceStateCached(n, visited);
@@ -42086,7 +42240,7 @@ function getModuleInstanceStateWorker(node, visited) {
});
return state;
}
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return getModuleInstanceState(node, visited);
case 79 /* Identifier */:
if (node.isInJSDocNamespace) {
@@ -42246,7 +42400,7 @@ function createBinder() {
}
}
function getDeclarationName(node) {
- if (node.kind === 280 /* ExportAssignment */) {
+ if (node.kind === 283 /* ExportAssignment */) {
return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
}
const name = getNameOfDeclaration(node);
@@ -42255,7 +42409,7 @@ function createBinder() {
const moduleName = getTextOfIdentifierOrLiteral(name);
return isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName}"`;
}
- if (name.kind === 166 /* ComputedPropertyName */) {
+ if (name.kind === 167 /* ComputedPropertyName */) {
const nameExpression = name.expression;
if (isStringOrNumericLiteralLike(nameExpression)) {
return escapeLeadingUnderscores(nameExpression.text);
@@ -42277,30 +42431,30 @@ function createBinder() {
return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0;
}
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return "__constructor" /* Constructor */;
- case 184 /* FunctionType */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
+ case 186 /* FunctionType */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
return "__call" /* Call */;
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
return "__new" /* New */;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return "__index" /* Index */;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return "__export" /* ExportStar */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return "export=" /* ExportEquals */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) {
return "export=" /* ExportEquals */;
}
Debug.fail("Unknown binary declaration kind");
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */;
- case 168 /* Parameter */:
- Debug.assert(node.parent.kind === 326 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
+ case 169 /* Parameter */:
+ Debug.assert(node.parent.kind === 329 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
const functionType = node.parent;
const index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -42347,7 +42501,7 @@ function createBinder() {
messageNeedsName = false;
multipleDefaultExports = true;
} else {
- if (symbol.declarations && symbol.declarations.length && (node.kind === 280 /* ExportAssignment */ && !node.isExportEquals)) {
+ if (symbol.declarations && symbol.declarations.length && (node.kind === 283 /* ExportAssignment */ && !node.isExportEquals)) {
message = Diagnostics.A_module_cannot_have_multiple_default_exports;
messageNeedsName = false;
multipleDefaultExports = true;
@@ -42386,7 +42540,7 @@ function createBinder() {
function declareModuleMember(node, symbolFlags, symbolExcludes) {
const hasExportModifier = !!(getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node);
if (symbolFlags & 2097152 /* Alias */) {
- if (node.kind === 284 /* ExportSpecifier */ || node.kind === 274 /* ImportEqualsDeclaration */ && hasExportModifier) {
+ if (node.kind === 287 /* ExportSpecifier */ || node.kind === 277 /* ImportEqualsDeclaration */ && hasExportModifier) {
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
} else {
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
@@ -42430,7 +42584,7 @@ function createBinder() {
const saveThisParentContainer = thisParentContainer;
const savedBlockScopeContainer = blockScopeContainer;
if (containerFlags & 1 /* IsContainer */) {
- if (node.kind !== 219 /* ArrowFunction */) {
+ if (node.kind !== 221 /* ArrowFunction */) {
thisParentContainer = container;
}
container = blockScopeContainer = node;
@@ -42450,14 +42604,14 @@ function createBinder() {
const saveExceptionTarget = currentExceptionTarget;
const saveActiveLabelList = activeLabelList;
const saveHasExplicitReturn = hasExplicitReturn;
- const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 512 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */;
+ const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 512 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 177 /* ClassStaticBlockDeclaration */;
if (!isImmediatelyInvoked) {
currentFlow = initFlowNode({ flags: 2 /* Start */ });
if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) {
currentFlow.node = node;
}
}
- currentReturnTarget = isImmediatelyInvoked || node.kind === 176 /* Constructor */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */) ? createBranchLabel() : void 0;
+ currentReturnTarget = isImmediatelyInvoked || node.kind === 178 /* Constructor */ || isInJSFile(node) && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */) ? createBranchLabel() : void 0;
currentExceptionTarget = void 0;
currentBreakTarget = void 0;
currentContinueTarget = void 0;
@@ -42471,14 +42625,14 @@ function createBinder() {
node.flags |= 512 /* HasExplicitReturn */;
node.endFlowNode = currentFlow;
}
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
node.flags |= emitFlags;
node.endFlowNode = currentFlow;
}
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
currentFlow = finishFlowLabel(currentReturnTarget);
- if (node.kind === 176 /* Constructor */ || node.kind === 175 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) {
+ if (node.kind === 178 /* Constructor */ || node.kind === 177 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */)) {
node.returnFlowNode = currentFlow;
}
}
@@ -42503,8 +42657,8 @@ function createBinder() {
blockScopeContainer = savedBlockScopeContainer;
}
function bindEachFunctionsFirst(nodes) {
- bindEach(nodes, (n) => n.kind === 263 /* FunctionDeclaration */ ? bind(n) : void 0);
- bindEach(nodes, (n) => n.kind !== 263 /* FunctionDeclaration */ ? bind(n) : void 0);
+ bindEach(nodes, (n) => n.kind === 265 /* FunctionDeclaration */ ? bind(n) : void 0);
+ bindEach(nodes, (n) => n.kind !== 265 /* FunctionDeclaration */ ? bind(n) : void 0);
}
function bindEach(nodes, bindFunction = bind) {
if (nodes === void 0) {
@@ -42524,59 +42678,59 @@ function createBinder() {
inAssignmentPattern = saveInAssignmentPattern;
return;
}
- if (node.kind >= 244 /* FirstStatement */ && node.kind <= 260 /* LastStatement */ && !options.allowUnreachableCode) {
+ if (node.kind >= 246 /* FirstStatement */ && node.kind <= 262 /* LastStatement */ && !options.allowUnreachableCode) {
node.flowNode = currentFlow;
}
switch (node.kind) {
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
bindWhileStatement(node);
break;
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
bindDoStatement(node);
break;
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
bindForStatement(node);
break;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
bindForInOrForOfStatement(node);
break;
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
bindIfStatement(node);
break;
- case 254 /* ReturnStatement */:
- case 258 /* ThrowStatement */:
+ case 256 /* ReturnStatement */:
+ case 260 /* ThrowStatement */:
bindReturnOrThrow(node);
break;
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
bindBreakOrContinueStatement(node);
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
bindTryStatement(node);
break;
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
bindSwitchStatement(node);
break;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
bindCaseBlock(node);
break;
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
bindCaseClause(node);
break;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
bindExpressionStatement(node);
break;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
bindLabeledStatement(node);
break;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
bindPrefixUnaryExpressionFlow(node);
break;
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
bindPostfixUnaryExpressionFlow(node);
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
inAssignmentPattern = saveInAssignmentPattern;
bindDestructuringAssignmentFlow(node);
@@ -42584,49 +42738,49 @@ function createBinder() {
}
bindBinaryExpressionFlow(node);
break;
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
bindDeleteExpressionFlow(node);
break;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
bindConditionalExpressionFlow(node);
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
bindVariableDeclarationFlow(node);
break;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
bindAccessExpressionFlow(node);
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
bindCallExpressionFlow(node);
break;
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
bindNonNullExpressionFlow(node);
break;
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
bindJSDocTypeAlias(node);
break;
- case 314 /* SourceFile */: {
+ case 317 /* SourceFile */: {
bindEachFunctionsFirst(node.statements);
bind(node.endOfFileToken);
break;
}
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
bindEachFunctionsFirst(node.statements);
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
bindBindingElementFlow(node);
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
bindParameterFlow(node);
break;
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 305 /* PropertyAssignment */:
- case 231 /* SpreadElement */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 308 /* PropertyAssignment */:
+ case 233 /* SpreadElement */:
inAssignmentPattern = saveInAssignmentPattern;
default:
bindEachChild(node);
@@ -42640,19 +42794,19 @@ function createBinder() {
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
case 109 /* ThisKeyword */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return containsNarrowableReference(expr);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return hasNarrowableArgument(expr);
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return isNarrowingExpression(expr.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isNarrowingBinaryExpression(expr);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return isNarrowingExpression(expr.expression);
}
return false;
@@ -42671,7 +42825,7 @@ function createBinder() {
}
}
}
- if (expr.expression.kind === 211 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) {
+ if (expr.expression.kind === 213 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) {
return true;
}
return false;
@@ -42702,9 +42856,9 @@ function createBinder() {
}
function isNarrowableOperand(expr) {
switch (expr.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isNarrowableOperand(expr.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (expr.operatorToken.kind) {
case 63 /* EqualsToken */:
return isNarrowableOperand(expr.left);
@@ -42777,24 +42931,24 @@ function createBinder() {
function isStatementCondition(node) {
const parent3 = node.parent;
switch (parent3.kind) {
- case 246 /* IfStatement */:
- case 248 /* WhileStatement */:
- case 247 /* DoStatement */:
+ case 248 /* IfStatement */:
+ case 250 /* WhileStatement */:
+ case 249 /* DoStatement */:
return parent3.expression === node;
- case 249 /* ForStatement */:
- case 228 /* ConditionalExpression */:
+ case 251 /* ForStatement */:
+ case 230 /* ConditionalExpression */:
return parent3.condition === node;
}
return false;
}
function isLogicalExpression(node) {
while (true) {
- if (node.kind === 217 /* ParenthesizedExpression */) {
+ if (node.kind === 219 /* ParenthesizedExpression */) {
node = node.expression;
- } else if (node.kind === 225 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
+ } else if (node.kind === 227 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
node = node.operand;
} else {
- return node.kind === 227 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */);
+ return node.kind === 229 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */);
}
}
}
@@ -42835,7 +42989,7 @@ function createBinder() {
}
function setContinueTarget(node, target) {
let label = activeLabelList;
- while (label && node.parent.kind === 257 /* LabeledStatement */) {
+ while (label && node.parent.kind === 259 /* LabeledStatement */) {
label.continueTarget = target;
label = label.next;
node = node.parent;
@@ -42886,12 +43040,12 @@ function createBinder() {
bind(node.expression);
addAntecedent(preLoopLabel, currentFlow);
currentFlow = preLoopLabel;
- if (node.kind === 251 /* ForOfStatement */) {
+ if (node.kind === 253 /* ForOfStatement */) {
bind(node.awaitModifier);
}
addAntecedent(postLoopLabel, currentFlow);
bind(node.initializer);
- if (node.initializer.kind !== 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind !== 264 /* VariableDeclarationList */) {
bindAssignmentTargetFlow(node.initializer);
}
bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
@@ -42913,7 +43067,7 @@ function createBinder() {
}
function bindReturnOrThrow(node) {
bind(node.expression);
- if (node.kind === 254 /* ReturnStatement */) {
+ if (node.kind === 256 /* ReturnStatement */) {
hasExplicitReturn = true;
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
@@ -42930,7 +43084,7 @@ function createBinder() {
return void 0;
}
function bindBreakOrContinueFlow(node, breakTarget, continueTarget) {
- const flowLabel = node.kind === 253 /* BreakStatement */ ? breakTarget : continueTarget;
+ const flowLabel = node.kind === 255 /* BreakStatement */ ? breakTarget : continueTarget;
if (flowLabel) {
addAntecedent(flowLabel, currentFlow);
currentFlow = unreachableFlow;
@@ -43000,7 +43154,7 @@ function createBinder() {
preSwitchCaseFlow = currentFlow;
bind(node.caseBlock);
addAntecedent(postSwitchLabel, currentFlow);
- const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 299 /* DefaultClause */);
+ const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 302 /* DefaultClause */);
node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents;
if (!hasDefault) {
addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0));
@@ -43043,7 +43197,7 @@ function createBinder() {
maybeBindExpressionFlowIfCall(node.expression);
}
function maybeBindExpressionFlowIfCall(node) {
- if (node.kind === 213 /* CallExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
const call = node;
if (call.expression.kind !== 107 /* SuperKeyword */ && isDottedName(call.expression)) {
currentFlow = createFlowCall(currentFlow, call);
@@ -43069,7 +43223,7 @@ function createBinder() {
currentFlow = finishFlowLabel(postStatementLabel);
}
function bindDestructuringTargetFlow(node) {
- if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */) {
+ if (node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */) {
bindAssignmentTargetFlow(node.left);
} else {
bindAssignmentTargetFlow(node);
@@ -43078,21 +43232,21 @@ function createBinder() {
function bindAssignmentTargetFlow(node) {
if (isNarrowableReference(node)) {
currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node);
- } else if (node.kind === 209 /* ArrayLiteralExpression */) {
+ } else if (node.kind === 211 /* ArrayLiteralExpression */) {
for (const e of node.elements) {
- if (e.kind === 231 /* SpreadElement */) {
+ if (e.kind === 233 /* SpreadElement */) {
bindAssignmentTargetFlow(e.expression);
} else {
bindDestructuringTargetFlow(e);
}
}
- } else if (node.kind === 210 /* ObjectLiteralExpression */) {
+ } else if (node.kind === 212 /* ObjectLiteralExpression */) {
for (const p of node.properties) {
- if (p.kind === 305 /* PropertyAssignment */) {
+ if (p.kind === 308 /* PropertyAssignment */) {
bindDestructuringTargetFlow(p.initializer);
- } else if (p.kind === 306 /* ShorthandPropertyAssignment */) {
+ } else if (p.kind === 309 /* ShorthandPropertyAssignment */) {
bindAssignmentTargetFlow(p.name);
- } else if (p.kind === 307 /* SpreadAssignment */) {
+ } else if (p.kind === 310 /* SpreadAssignment */) {
bindAssignmentTargetFlow(p.expression);
}
}
@@ -43215,7 +43369,7 @@ function createBinder() {
const operator = node.operatorToken.kind;
if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
- if (operator === 63 /* EqualsToken */ && node.left.kind === 212 /* ElementAccessExpression */) {
+ if (operator === 63 /* EqualsToken */ && node.left.kind === 214 /* ElementAccessExpression */) {
const elementAccess = node.left;
if (isNarrowableOperand(elementAccess.expression)) {
currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
@@ -43243,7 +43397,7 @@ function createBinder() {
}
function bindDeleteExpressionFlow(node) {
bindEachChild(node);
- if (node.expression.kind === 211 /* PropertyAccessExpression */) {
+ if (node.expression.kind === 213 /* PropertyAccessExpression */) {
bindAssignmentTargetFlow(node.expression);
}
}
@@ -43308,7 +43462,7 @@ function createBinder() {
}
function bindJSDocTypeAlias(node) {
bind(node.tagName);
- if (node.kind !== 348 /* JSDocEnumTag */ && node.fullName) {
+ if (node.kind !== 351 /* JSDocEnumTag */ && node.fullName) {
setParent(node.fullName, node);
setParentRecursive(node.fullName, false);
}
@@ -43319,7 +43473,7 @@ function createBinder() {
function bindJSDocClassTag(node) {
bindEachChild(node);
const host = getHostSignatureFromJSDoc(node);
- if (host && host.kind !== 174 /* MethodDeclaration */) {
+ if (host && host.kind !== 176 /* MethodDeclaration */) {
addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
}
}
@@ -43332,15 +43486,15 @@ function createBinder() {
}
function bindOptionalChainRest(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
bind(node.questionDotToken);
bind(node.name);
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
bind(node.questionDotToken);
bind(node.argumentExpression);
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
bind(node.questionDotToken);
bindEach(node.typeArguments);
bindEach(node.arguments);
@@ -43387,7 +43541,7 @@ function createBinder() {
bindOptionalChainFlow(node);
} else {
const expr = skipParentheses(node.expression);
- if (expr.kind === 218 /* FunctionExpression */ || expr.kind === 219 /* ArrowFunction */) {
+ if (expr.kind === 220 /* FunctionExpression */ || expr.kind === 221 /* ArrowFunction */) {
bindEach(node.typeArguments);
bindEach(node.arguments);
bind(node.expression);
@@ -43398,7 +43552,7 @@ function createBinder() {
}
}
}
- if (node.expression.kind === 211 /* PropertyAccessExpression */) {
+ if (node.expression.kind === 213 /* PropertyAccessExpression */) {
const propertyAccess = node.expression;
if (isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && isPushOrUnshiftIdentifier(propertyAccess.name)) {
currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
@@ -43407,58 +43561,60 @@ function createBinder() {
}
function getContainerFlags(node) {
switch (node.kind) {
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 269 /* EnumDeclaration */:
- case 210 /* ObjectLiteralExpression */:
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 295 /* JsxAttributes */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 212 /* ObjectLiteralExpression */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 298 /* JsxAttributes */:
return 1 /* IsContainer */;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return 1 /* IsContainer */ | 64 /* IsInterface */;
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 200 /* MappedType */:
- case 181 /* IndexSignature */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 202 /* MappedType */:
+ case 183 /* IndexSignature */:
return 1 /* IsContainer */ | 32 /* HasLocals */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
}
- case 176 /* Constructor */:
- case 263 /* FunctionDeclaration */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
- case 326 /* JSDocFunctionType */:
- case 184 /* FunctionType */:
- case 180 /* ConstructSignature */:
- case 185 /* ConstructorType */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 265 /* FunctionDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
+ case 329 /* JSDocFunctionType */:
+ case 186 /* FunctionType */:
+ case 182 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 177 /* ClassStaticBlockDeclaration */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return 4 /* IsControlFlowContainer */;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
- case 301 /* CatchClause */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 272 /* CaseBlock */:
+ case 304 /* CatchClause */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 275 /* CaseBlock */:
return 2 /* IsBlockScopedContainer */;
- case 242 /* Block */:
+ case 244 /* Block */:
return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */;
}
return 0 /* None */;
@@ -43471,43 +43627,44 @@ function createBinder() {
}
function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) {
switch (container.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return declareModuleMember(node, symbolFlags, symbolExcludes);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
return declareClassMember(node, symbolFlags, symbolExcludes);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 210 /* ObjectLiteralExpression */:
- case 267 /* InterfaceDeclaration */:
- case 295 /* JsxAttributes */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 212 /* ObjectLiteralExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 298 /* JsxAttributes */:
return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 332 /* JSDocSignature */:
- case 181 /* IndexSignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 326 /* JSDocFunctionType */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 175 /* ClassStaticBlockDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 200 /* MappedType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 335 /* JSDocSignature */:
+ case 183 /* IndexSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 329 /* JSDocFunctionType */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 202 /* MappedType */:
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
}
}
@@ -43593,10 +43750,10 @@ function createBinder() {
}
function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {
switch (blockScopeContainer.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (isExternalOrCommonJsModule(container)) {
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
@@ -43786,7 +43943,7 @@ function createBinder() {
}
function checkStrictModeFunctionDeclaration(node) {
if (languageVersion < 2 /* ES2015 */) {
- if (blockScopeContainer.kind !== 314 /* SourceFile */ && blockScopeContainer.kind !== 270 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
+ if (blockScopeContainer.kind !== 317 /* SourceFile */ && blockScopeContainer.kind !== 273 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
const errorSpan = getErrorSpanForNode(file, node);
file.bindDiagnostics.push(createFileDiagnostic(
file,
@@ -43853,7 +44010,7 @@ function createBinder() {
node.tracingPath = file.path;
const saveInStrictMode = inStrictMode;
bindWorker(node);
- if (node.kind > 164 /* LastToken */) {
+ if (node.kind > 165 /* LastToken */) {
const saveParent = parent2;
parent2 = node;
const containerFlags = getContainerFlags(node);
@@ -43915,23 +44072,23 @@ function createBinder() {
break;
}
case 109 /* ThisKeyword */:
- if (currentFlow && (isExpression(node) || parent2.kind === 306 /* ShorthandPropertyAssignment */)) {
+ if (currentFlow && (isExpression(node) || parent2.kind === 309 /* ShorthandPropertyAssignment */)) {
node.flowNode = currentFlow;
}
return checkContextualIdentifier(node);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
if (currentFlow && isPartOfTypeQuery(node)) {
node.flowNode = currentFlow;
}
break;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
case 107 /* SuperKeyword */:
node.flowNode = currentFlow;
break;
case 80 /* PrivateIdentifier */:
return checkPrivateIdentifier(node);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = node;
if (currentFlow && isNarrowableReference(expr)) {
expr.flowNode = currentFlow;
@@ -43949,7 +44106,7 @@ function createBinder() {
);
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const specialKind = getAssignmentDeclarationKind(node);
switch (specialKind) {
case 1 /* ExportsProperty */:
@@ -43984,79 +44141,80 @@ function createBinder() {
Debug.fail("Unknown binary expression special property assignment kind");
}
return checkStrictModeBinaryExpression(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return checkStrictModeCatchClause(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return checkStrictModeDeleteExpression(node);
case 8 /* NumericLiteral */:
return checkStrictModeNumericLiteral(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return checkStrictModePostfixUnaryExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return checkStrictModePrefixUnaryExpression(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return checkStrictModeWithStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return checkStrictModeLabeledStatement(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
seenThisKeyword = true;
return;
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
break;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return bindTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return bindParameter(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return bindVariableDeclarationOrBindingElement(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
node.flowNode = currentFlow;
return bindVariableDeclarationOrBindingElement(node);
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 174 /* OverloadPropertyDeclaration */:
return bindPropertyWorker(node);
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */);
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return bindPropertyOrMethodOrAccessor(
node,
8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */),
isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */
);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return bindFunctionDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, 0 /* None */);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */);
- case 184 /* FunctionType */:
- case 326 /* JSDocFunctionType */:
- case 332 /* JSDocSignature */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 329 /* JSDocFunctionType */:
+ case 335 /* JSDocSignature */:
+ case 187 /* ConstructorType */:
return bindFunctionOrConstructorType(node);
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 200 /* MappedType */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 202 /* MappedType */:
return bindAnonymousTypeWorker(node);
- case 341 /* JSDocClassTag */:
+ case 344 /* JSDocClassTag */:
return bindJSDocClassTag(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return bindObjectLiteralExpression(node);
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return bindFunctionExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
const assignmentKind = getAssignmentDeclarationKind(node);
switch (assignmentKind) {
case 7 /* ObjectDefinePropertyValue */:
@@ -44074,61 +44232,63 @@ function createBinder() {
bindCallExpression(node);
}
break;
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
inStrictMode = true;
return bindClassLikeDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return bindAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return bindOverloadDeclaration(node);
+ case 270 /* InterfaceDeclaration */:
return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return bindEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return bindModuleDeclaration(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return bindJsxAttributes(node);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */);
- case 274 /* ImportEqualsDeclaration */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return bindNamespaceExportDeclaration(node);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return bindImportClause(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return bindExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return bindExportAssignment(node);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
updateStrictModeStatementList(node.statements);
return bindSourceFileIfExternalModule();
- case 242 /* Block */:
+ case 244 /* Block */:
if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) {
return;
}
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return updateStrictModeStatementList(node.statements);
- case 349 /* JSDocParameterTag */:
- if (node.parent.kind === 332 /* JSDocSignature */) {
+ case 352 /* JSDocParameterTag */:
+ if (node.parent.kind === 335 /* JSDocSignature */) {
return bindParameter(node);
}
- if (node.parent.kind !== 331 /* JSDocTypeLiteral */) {
+ if (node.parent.kind !== 334 /* JSDocTypeLiteral */) {
break;
}
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
const propTag = node;
- const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 325 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
+ const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 328 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */);
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
}
}
@@ -44266,8 +44426,8 @@ function createBinder() {
}
const thisContainer = getThisContainer(node, false);
switch (thisContainer.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
let constructorSymbol = thisContainer.symbol;
if (isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 63 /* EqualsToken */) {
const l = thisContainer.parent.left;
@@ -44285,13 +44445,14 @@ function createBinder() {
addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */);
}
break;
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
const containingClass = thisContainer.parent;
const symbolTable = isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members;
if (hasDynamicName(node)) {
@@ -44300,7 +44461,7 @@ function createBinder() {
declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, true);
}
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (hasDynamicName(node)) {
break;
} else if (thisContainer.commonJsModuleIndicator) {
@@ -44325,7 +44486,7 @@ function createBinder() {
function bindSpecialPropertyDeclaration(node) {
if (node.expression.kind === 109 /* ThisKeyword */) {
bindThisPropertyAssignment(node);
- } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 314 /* SourceFile */) {
+ } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 317 /* SourceFile */) {
if (isPrototypeAccess(node.expression)) {
bindPrototypePropertyAssignment(node, node.parent);
} else {
@@ -44355,7 +44516,7 @@ function createBinder() {
}
function bindObjectDefinePropertyAssignment(node) {
let namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]);
- const isToplevel = node.parent.parent.kind === 314 /* SourceFile */;
+ const isToplevel = node.parent.parent.kind === 317 /* SourceFile */;
namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, false, false);
bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, false);
}
@@ -44441,7 +44602,7 @@ function createBinder() {
declareSymbol(symbolTable, namespaceSymbol, declaration, includes | 67108864 /* Assignment */, excludes & ~67108864 /* Assignment */);
}
function isTopLevelNamespaceAssignment(propertyAccess) {
- return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 314 /* SourceFile */ : propertyAccess.parent.parent.kind === 314 /* SourceFile */;
+ return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 317 /* SourceFile */ : propertyAccess.parent.parent.kind === 317 /* SourceFile */;
}
function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) {
let namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer);
@@ -44499,7 +44660,7 @@ function createBinder() {
}
}
function bindClassLikeDeclaration(node) {
- if (node.kind === 264 /* ClassDeclaration */ || node.kind === 265 /* StructDeclaration */) {
+ if (node.kind === 266 /* ClassDeclaration */ || node.kind === 267 /* StructDeclaration */) {
bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */);
} else {
const bindingName = node.name ? node.name.escapedText : "__class" /* Class */;
@@ -44521,7 +44682,7 @@ function createBinder() {
prototypeSymbol.parent = symbol;
}
function bindAnnotationDeclaration(node) {
- Debug.assert(node.kind === 266 /* AnnotationDeclaration */);
+ Debug.assert(node.kind === 268 /* AnnotationDeclaration */);
bindBlockScopedDeclaration(node, 32 /* Class */ | 268435456 /* Annotation */, 899503 /* ClassExcludes */);
const { symbol } = node;
const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype");
@@ -44535,6 +44696,21 @@ function createBinder() {
symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);
prototypeSymbol.parent = symbol;
}
+ function bindOverloadDeclaration(node) {
+ Debug.assert(node.kind === 269 /* OverloadDeclaration */);
+ bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */);
+ const { symbol } = node;
+ const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype");
+ const symbolExport = symbol.exports.get(prototypeSymbol.escapedName);
+ if (symbolExport) {
+ if (node.name) {
+ setParent(node.name, node);
+ }
+ file.bindDiagnostics.push(createDiagnosticForNode2(symbolExport.declarations[0], Diagnostics.Duplicate_identifier_0, symbolName(prototypeSymbol)));
+ }
+ symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);
+ prototypeSymbol.parent = symbol;
+ }
function bindEnumDeclaration(node) {
return isEnumConst(node) ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */);
}
@@ -44543,7 +44719,7 @@ function createBinder() {
checkStrictModeEvalOrArguments(node, node.name);
}
if (!isBindingPattern(node.name)) {
- const possibleVariableDecl = node.kind === 261 /* VariableDeclaration */ ? node : node.parent.parent;
+ const possibleVariableDecl = node.kind === 263 /* VariableDeclaration */ ? node : node.parent.parent;
if (isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) {
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
} else if (isBlockOrCatchScoped(node)) {
@@ -44556,7 +44732,7 @@ function createBinder() {
}
}
function bindParameter(node) {
- if (node.kind === 349 /* JSDocParameterTag */ && container.kind !== 332 /* JSDocSignature */) {
+ if (node.kind === 352 /* JSDocParameterTag */ && container.kind !== 335 /* JSDocSignature */) {
return;
}
if (inStrictMode && !(node.flags & 16777216 /* Ambient */)) {
@@ -44623,7 +44799,7 @@ function createBinder() {
} else {
declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
}
- } else if (node.parent.kind === 195 /* InferType */) {
+ } else if (node.parent.kind === 197 /* InferType */) {
const container2 = getInferTypeContainer(node.parent);
if (container2) {
if (!container2.locals) {
@@ -44646,7 +44822,7 @@ function createBinder() {
return false;
}
if (currentFlow === unreachableFlow) {
- const reportError = isStatementButNotDeclaration(node) && node.kind !== 243 /* EmptyStatement */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 270 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
+ const reportError = isStatementButNotDeclaration(node) && node.kind !== 245 /* EmptyStatement */ || node.kind === 266 /* ClassDeclaration */ || node.kind === 273 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
if (reportError) {
currentFlow = reportedUnreachableFlow;
if (!options.allowUnreachableCode) {
@@ -44672,12 +44848,12 @@ function isExecutableStatement(s) {
}
function isPurelyTypeDeclaration(s) {
switch (s.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return getModuleInstanceState(s) !== 1 /* Instantiated */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return hasSyntacticModifier(s, 2048 /* Const */);
default:
return false;
@@ -44859,7 +45035,7 @@ function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignatu
symbol.exports.forEach(visitSymbol);
}
forEach(symbol.declarations, (d) => {
- if (d.type && d.type.kind === 186 /* TypeQuery */) {
+ if (d.type && d.type.kind === 188 /* TypeQuery */) {
const query = d.type;
const entity = getResolvedSymbol(getFirstIdentifier2(query.exprName));
visitSymbol(entity);
@@ -46794,7 +46970,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks());
}
function isGlobalSourceFile(node) {
- return node.kind === 314 /* SourceFile */ && !isExternalOrCommonJsModule(node);
+ return node.kind === 317 /* SourceFile */ && !isExternalOrCommonJsModule(node);
}
function isValidFromLibs(symbol, node) {
var _a2;
@@ -46871,13 +47047,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile);
}
if (declaration.pos <= usage.pos && !(isPropertyDeclaration(declaration) && isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) {
- if (declaration.kind === 208 /* BindingElement */) {
- const errorBindingElement = getAncestor(usage, 208 /* BindingElement */);
+ if (declaration.kind === 210 /* BindingElement */) {
+ const errorBindingElement = getAncestor(usage, 210 /* BindingElement */);
if (errorBindingElement) {
return findAncestor(errorBindingElement, isBindingElement) !== findAncestor(declaration, isBindingElement) || declaration.pos < errorBindingElement.pos;
}
- return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 261 /* VariableDeclaration */), usage);
- } else if (declaration.kind === 261 /* VariableDeclaration */) {
+ return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 263 /* VariableDeclaration */), usage);
+ } else if (declaration.kind === 263 /* VariableDeclaration */) {
return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
} else if (isClassDeclaration(declaration)) {
return !findAncestor(usage, (n) => isComputedPropertyName(n) && n.parent.parent === declaration);
@@ -46888,10 +47064,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return true;
}
- if (usage.parent.kind === 284 /* ExportSpecifier */ || usage.parent.kind === 280 /* ExportAssignment */ && usage.parent.isExportEquals) {
+ if (usage.parent.kind === 287 /* ExportSpecifier */ || usage.parent.kind === 283 /* ExportAssignment */ && usage.parent.isExportEquals) {
return true;
}
- if (usage.kind === 280 /* ExportAssignment */ && usage.isExportEquals) {
+ if (usage.kind === 283 /* ExportAssignment */ && usage.isExportEquals) {
return true;
}
if (!!(usage.flags & 8388608 /* JSDoc */) || isInTypeQuery(usage) || usageInTypeDeclaration()) {
@@ -46910,9 +47086,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration2, usage2) {
switch (declaration2.parent.parent.kind) {
- case 244 /* VariableStatement */:
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
+ case 246 /* VariableStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
if (isSameScopeDescendentOf(usage2, declaration2, declContainer)) {
return true;
}
@@ -46937,7 +47113,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const initializerOfProperty = propertyDeclaration.initializer === current;
if (initializerOfProperty) {
if (isStatic(current.parent)) {
- if (declaration2.kind === 174 /* MethodDeclaration */) {
+ if (declaration2.kind === 176 /* MethodDeclaration */) {
return true;
}
if (isPropertyDeclaration(declaration2) && getContainingClass(usage2) === getContainingClass(declaration2)) {
@@ -46951,7 +47127,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
} else {
- const isDeclarationInstanceProperty = declaration2.kind === 171 /* PropertyDeclaration */ && !isStatic(declaration2);
+ const isDeclarationInstanceProperty = declaration2.kind === 172 /* PropertyDeclaration */ && !isStatic(declaration2);
if (!isDeclarationInstanceProperty || getContainingClass(usage2) !== getContainingClass(declaration2)) {
return true;
}
@@ -46970,15 +47146,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return "quit";
}
switch (node.kind) {
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return true;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return stopAtAnyPropertyDeclaration && (isPropertyDeclaration(declaration2) && node.parent === declaration2.parent || isParameterPropertyDeclaration(declaration2, declaration2.parent) && node.parent === declaration2.parent.parent) ? "quit" : true;
- case 242 /* Block */:
+ case 244 /* Block */:
switch (node.parent.kind) {
- case 177 /* GetAccessor */:
- case 174 /* MethodDeclaration */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -47008,22 +47184,22 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function requiresScopeChangeWorker(node) {
switch (node.kind) {
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 176 /* Constructor */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 178 /* Constructor */:
return false;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 305 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 308 /* PropertyAssignment */:
return requiresScopeChangeWorker(node.name);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (hasStaticModifier(node)) {
return target < 99 /* ESNext */ || !useDefineForClassFields;
}
return requiresScopeChangeWorker(node.name);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return requiresScopeChangeWorker(node.name);
default:
if (isNullishCoalesce(node) || isOptionalChain(node)) {
@@ -47065,17 +47241,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (result = lookup(location2.locals, name, meaning)) {
let useResult = true;
if (isFunctionLike(location2) && lastLocation && lastLocation !== location2.body) {
- if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 329 /* JSDoc */) {
- useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location2.type || lastLocation.kind === 168 /* Parameter */ || lastLocation.kind === 349 /* JSDocParameterTag */ || lastLocation.kind === 350 /* JSDocReturnTag */ || lastLocation.kind === 167 /* TypeParameter */ : false;
+ if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 332 /* JSDoc */) {
+ useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location2.type || lastLocation.kind === 169 /* Parameter */ || lastLocation.kind === 352 /* JSDocParameterTag */ || lastLocation.kind === 353 /* JSDocReturnTag */ || lastLocation.kind === 168 /* TypeParameter */ : false;
}
if (meaning & result.flags & 3 /* Variable */) {
if (useOuterVariableScopeInParameter(result, location2, lastLocation)) {
useResult = false;
} else if (result.flags & 1 /* FunctionScopedVariable */) {
- useResult = lastLocation.kind === 168 /* Parameter */ || lastLocation === location2.type && !!findAncestor(result.valueDeclaration, isParameter);
+ useResult = lastLocation.kind === 169 /* Parameter */ || lastLocation === location2.type && !!findAncestor(result.valueDeclaration, isParameter);
}
}
- } else if (location2.kind === 194 /* ConditionalType */) {
+ } else if (location2.kind === 196 /* ConditionalType */) {
useResult = lastLocation === location2.trueType;
}
if (useResult) {
@@ -47087,13 +47263,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
withinDeferredContext = withinDeferredContext || getIsDeferredContext(location2, lastLocation);
switch (location2.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (!isExternalOrCommonJsModule(location2))
break;
isInExternalModule = true;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const moduleExports = getSymbolOfNode(location2) ? ((_a2 = getSymbolOfNode(location2)) == null ? void 0 : _a2.exports) || emptySymbols : emptySymbols;
- if (location2.kind === 314 /* SourceFile */ || isModuleDeclaration(location2) && location2.flags & 16777216 /* Ambient */ && !isGlobalScopeAugmentation(location2)) {
+ if (location2.kind === 317 /* SourceFile */ || isModuleDeclaration(location2) && location2.flags & 16777216 /* Ambient */ && !isGlobalScopeAugmentation(location2)) {
if (result = moduleExports.get("default" /* Default */)) {
const localSymbol = getLocalSymbolForExportDefault(result);
if (localSymbol && result.flags & meaning && localSymbol.escapedName === name) {
@@ -47102,7 +47278,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
result = void 0;
}
const moduleExport = moduleExports.get(name);
- if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 284 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 283 /* NamespaceExport */))) {
+ if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 287 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 286 /* NamespaceExport */))) {
break;
}
}
@@ -47114,12 +47290,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (result = lookup(((_c = getSymbolOfNode(location2)) == null ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) {
break loop;
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (!isStatic(location2)) {
const ctor = findConstructorDeclaration(location2.parent);
if (ctor && ctor.locals) {
@@ -47130,9 +47306,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
if (result = lookup(getSymbolOfNode(location2).members || emptySymbols, name, meaning & 788968 /* Type */)) {
if (!isTypeParameterSymbolDeclaredInContainer(result, location2)) {
result = void 0;
@@ -47146,7 +47322,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
break loop;
}
- if (location2.kind === 232 /* ClassExpression */ && meaning & 32 /* Class */) {
+ if (location2.kind === 234 /* ClassExpression */ && meaning & 32 /* Class */) {
const className = location2.name;
if (className && name === className.escapedText) {
result = location2.symbol;
@@ -47154,7 +47330,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
if (lastLocation === location2.expression && location2.parent.token === 95 /* ExtendsKeyword */) {
const container = location2.parent.parent;
if (isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 788968 /* Type */))) {
@@ -47165,9 +47341,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
grandparent = location2.parent.parent;
- if (isClassLike(grandparent) || grandparent.kind === 267 /* InterfaceDeclaration */) {
+ if (isClassLike(grandparent) || grandparent.kind === 270 /* InterfaceDeclaration */) {
if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) {
if (nameNotFoundMessage) {
error(errorLocation, Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
@@ -47176,21 +47352,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */) {
break;
}
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
if (meaning & 3 /* Variable */ && name === "arguments") {
result = argumentsSymbol;
break loop;
}
break;
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
if (meaning & 3 /* Variable */ && name === "arguments") {
result = argumentsSymbol;
break loop;
@@ -47203,37 +47379,37 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 169 /* Decorator */:
- if (location2.parent && location2.parent.kind === 168 /* Parameter */) {
+ case 170 /* Decorator */:
+ if (location2.parent && location2.parent.kind === 169 /* Parameter */) {
location2 = location2.parent;
}
- if (location2.parent && (isClassElement(location2.parent) || location2.parent.kind === 264 /* ClassDeclaration */)) {
+ if (location2.parent && (isClassElement(location2.parent) || location2.parent.kind === 266 /* ClassDeclaration */)) {
location2 = location2.parent;
}
break;
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
const root = getJSDocRoot(location2);
if (root) {
location2 = root.parent;
}
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (lastLocation && (lastLocation === location2.initializer || lastLocation === location2.name && isBindingPattern(lastLocation))) {
if (!associatedDeclarationForContainingInitializerOrBindingName) {
associatedDeclarationForContainingInitializerOrBindingName = location2;
}
}
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
if (lastLocation && (lastLocation === location2.initializer || lastLocation === location2.name && isBindingPattern(lastLocation))) {
if (isParameterDeclaration(location2) && !associatedDeclarationForContainingInitializerOrBindingName) {
associatedDeclarationForContainingInitializerOrBindingName = location2;
}
}
break;
- case 195 /* InferType */:
+ case 197 /* InferType */:
if (meaning & 262144 /* TypeParameter */) {
const parameterName = location2.typeParameter.name;
if (parameterName && name === parameterName.escapedText) {
@@ -47254,7 +47430,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (!result) {
if (lastLocation) {
- Debug.assert(lastLocation.kind === 314 /* SourceFile */);
+ Debug.assert(lastLocation.kind === 317 /* SourceFile */);
if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) {
return lastLocation.symbol;
}
@@ -47351,7 +47527,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) {
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */);
if (typeOnlyDeclaration) {
- const message = typeOnlyDeclaration.kind === 284 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
+ const message = typeOnlyDeclaration.kind === 287 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
const unescapedName = unescapeLeadingUnderscores(name);
addTypeOnlyDeclarationRelatedInfo(
error(errorLocation, message, unescapedName),
@@ -47371,14 +47547,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
diagnostic,
createDiagnosticForNode(
typeOnlyDeclaration,
- typeOnlyDeclaration.kind === 284 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
+ typeOnlyDeclaration.kind === 287 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
unescapedName
)
);
}
function getIsDeferredContext(location2, lastLocation) {
- if (location2.kind !== 219 /* ArrowFunction */ && location2.kind !== 218 /* FunctionExpression */) {
- return isTypeQueryNode(location2) || (isFunctionLikeDeclaration(location2) || location2.kind === 171 /* PropertyDeclaration */ && !isStatic(location2)) && (!lastLocation || lastLocation !== location2.name);
+ if (location2.kind !== 221 /* ArrowFunction */ && location2.kind !== 220 /* FunctionExpression */) {
+ return isTypeQueryNode(location2) || (isFunctionLikeDeclaration(location2) || location2.kind === 172 /* PropertyDeclaration */ && !isStatic(location2)) && (!lastLocation || lastLocation !== location2.name);
}
if (lastLocation && lastLocation === location2.name) {
return false;
@@ -47390,12 +47566,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isSelfReferenceLocation(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 273 /* ModuleDeclaration */:
return true;
default:
return false;
@@ -47407,7 +47583,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isTypeParameterSymbolDeclaredInContainer(symbol, container) {
if (symbol.declarations) {
for (const decl of symbol.declarations) {
- if (decl.kind === 167 /* TypeParameter */) {
+ if (decl.kind === 168 /* TypeParameter */) {
const parent2 = isJSDocTemplateTag(decl.parent) ? getJSDocHost(decl.parent) : decl.parent;
if (parent2 === container) {
return !(isJSDocTemplateTag(decl.parent) && find(decl.parent.parent.tags, isJSDocTypeAlias));
@@ -47457,9 +47633,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getEntityNameForExtendingInterface(node) {
switch (node.kind) {
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return node.parent ? getEntityNameForExtendingInterface(node.parent) : void 0;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
if (isEntityNameExpression(node.expression)) {
return node.expression;
}
@@ -47507,7 +47683,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown";
}
function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) {
- if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 284 /* ExportSpecifier */) {
+ if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 287 /* ExportSpecifier */) {
error(errorLocation, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name);
return true;
}
@@ -47596,7 +47772,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const declaration = (_a2 = result.declarations) == null ? void 0 : _a2.find(
- (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || d.kind === 269 /* EnumDeclaration */
+ (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || d.kind === 272 /* EnumDeclaration */
);
if (declaration === void 0)
return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");
@@ -47630,13 +47806,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getAnyImportSyntax(node) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return node;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return node.parent;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return node.parent.parent;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return node.parent.parent.parent;
default:
return void 0;
@@ -47646,7 +47822,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return symbol.declarations && findLast(symbol.declarations, isAliasSymbolDeclaration2);
}
function isAliasSymbolDeclaration2(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */ || node.kind === 273 /* NamespaceExportDeclaration */ || node.kind === 276 /* ImportClause */ && !!node.name || node.kind === 277 /* NamespaceImport */ || node.kind === 283 /* NamespaceExport */ || node.kind === 279 /* ImportSpecifier */ || node.kind === 284 /* ExportSpecifier */ || node.kind === 280 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 306 /* ShorthandPropertyAssignment */ || node.kind === 305 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 261 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 208 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
+ return node.kind === 277 /* ImportEqualsDeclaration */ || node.kind === 276 /* NamespaceExportDeclaration */ || node.kind === 279 /* ImportClause */ && !!node.name || node.kind === 280 /* NamespaceImport */ || node.kind === 286 /* NamespaceExport */ || node.kind === 282 /* ImportSpecifier */ || node.kind === 287 /* ExportSpecifier */ || node.kind === 283 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 309 /* ShorthandPropertyAssignment */ || node.kind === 308 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 263 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 210 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
}
function isAliasableOrJsExpression(e) {
return isAliasableExpression(e) || isFunctionExpression(e) && isJSConstructor(e);
@@ -47657,7 +47833,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const name = getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0];
return isIdentifier(commonJSPropertyAccess.name) ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) : void 0;
}
- if (isVariableDeclaration(node) || node.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ if (isVariableDeclaration(node) || node.moduleReference.kind === 289 /* ExternalModuleReference */) {
const immediate = resolveExternalModuleName(
node,
getExternalModuleRequireArgument(node) || getExternalModuleImportEqualsDeclarationExpression(node)
@@ -47673,7 +47849,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) {
if (markSymbolOfAliasDeclarationIfTypeOnly(node, void 0, resolved, false) && !node.isTypeOnly) {
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfNode(node));
- const isExport = typeOnlyDeclaration.kind === 284 /* ExportSpecifier */;
+ const isExport = typeOnlyDeclaration.kind === 287 /* ExportSpecifier */;
const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here;
const name = unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
@@ -47775,15 +47951,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getModuleSpecifierForImportOrExport(node) {
switch (node.kind) {
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return node.parent.moduleSpecifier;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : void 0;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return node.parent.parent.moduleSpecifier;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return node.parent.parent.parent.moduleSpecifier;
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return node.parent.parent.moduleSpecifier;
default:
return Debug.assertNever(node);
@@ -48028,31 +48204,31 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTargetOfAliasDeclaration(node, dontRecursivelyResolve = false) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
- case 261 /* VariableDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 263 /* VariableDeclaration */:
return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return getTargetOfImportClause(node, dontRecursivelyResolve);
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return getTargetOfNamespaceImport(node, dontRecursivelyResolve);
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
return getTargetOfNamespaceExport(node, dontRecursivelyResolve);
- case 279 /* ImportSpecifier */:
- case 208 /* BindingElement */:
+ case 282 /* ImportSpecifier */:
+ case 210 /* BindingElement */:
return getTargetOfImportSpecifier(node, dontRecursivelyResolve);
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve);
- case 280 /* ExportAssignment */:
- case 227 /* BinaryExpression */:
+ case 283 /* ExportAssignment */:
+ case 229 /* BinaryExpression */:
return getTargetOfExportAssignment(node, dontRecursivelyResolve);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, true, dontRecursivelyResolve);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getTargetOfAliasLikeExpression(node.initializer, dontRecursivelyResolve);
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return getTargetOfAccessExpression(node, dontRecursivelyResolve);
default:
return Debug.fail();
@@ -48183,10 +48359,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (entityName.kind === 79 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
- if (entityName.kind === 79 /* Identifier */ || entityName.parent.kind === 165 /* QualifiedName */) {
+ if (entityName.kind === 79 /* Identifier */ || entityName.parent.kind === 166 /* QualifiedName */) {
return resolveEntityName(entityName, 1920 /* Namespace */, false, dontResolveAlias);
} else {
- Debug.assert(entityName.parent.kind === 274 /* ImportEqualsDeclaration */);
+ Debug.assert(entityName.parent.kind === 277 /* ImportEqualsDeclaration */);
return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, false, dontResolveAlias);
}
}
@@ -48246,9 +48422,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!symbol) {
return getMergedSymbol(symbolFromJSPrototype);
}
- } else if (name.kind === 165 /* QualifiedName */ || name.kind === 211 /* PropertyAccessExpression */) {
- const left = name.kind === 165 /* QualifiedName */ ? name.left : name.expression;
- const right = name.kind === 165 /* QualifiedName */ ? name.right : name.name;
+ } else if (name.kind === 166 /* QualifiedName */ || name.kind === 213 /* PropertyAccessExpression */) {
+ const left = name.kind === 166 /* QualifiedName */ ? name.left : name.expression;
+ const right = name.kind === 166 /* QualifiedName */ ? name.right : name.name;
let namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, false, location2);
if (!namespace || nodeIsMissing(right)) {
return void 0;
@@ -48305,7 +48481,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
throw Debug.assertNever(name, "Unknown entity name kind.");
}
Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here.");
- if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 280 /* ExportAssignment */)) {
+ if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 283 /* ExportAssignment */)) {
markSymbolOfAliasDeclarationIfTypeOnly(getAliasDeclarationFromName(name), symbol, void 0, true);
}
return symbol.flags & meaning || dontResolveAlias ? symbol : resolveAlias(symbol);
@@ -48608,7 +48784,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
var _a2;
const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
if (!dontResolveAlias && symbol) {
- if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 314 /* SourceFile */)) {
+ if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 317 /* SourceFile */)) {
const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop";
error(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName);
return symbol;
@@ -48926,7 +49102,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function findConstructorDeclaration(node) {
const members = node.members;
for (const member of members) {
- if (member.kind === 176 /* Constructor */ && nodeIsPresent(member.body)) {
+ if (member.kind === 178 /* Constructor */ && nodeIsPresent(member.body)) {
return member;
}
}
@@ -49036,19 +49212,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
switch (location2.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (!isExternalOrCommonJsModule(location2)) {
break;
}
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const sym = getSymbolOfNode(location2);
if (result = callback((sym == null ? void 0 : sym.exports) || emptySymbols, void 0, true, location2)) {
return result;
}
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
let table;
(getSymbolOfNode(location2).members || emptySymbols).forEach((memberSymbol, key) => {
if (memberSymbol.flags & (788968 /* Type */ & ~67108864 /* Assignment */)) {
@@ -49104,7 +49280,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return [symbol];
}
const result2 = forEachEntry(symbols, (symbolFromSymbolTable) => {
- if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 284 /* ExportSpecifier */))) {
+ if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 287 /* ExportSpecifier */))) {
const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
const candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification);
if (candidate) {
@@ -49140,7 +49316,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (symbolFromSymbolTable === symbol) {
return true;
}
- const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 284 /* ExportSpecifier */);
+ const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 287 /* ExportSpecifier */);
symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
const flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
if (flags & meaning) {
@@ -49155,10 +49331,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (symbol.declarations && symbol.declarations.length) {
for (const declaration of symbol.declarations) {
switch (declaration.kind) {
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
continue;
default:
return false;
@@ -49257,10 +49433,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return node && getSymbolOfNode(node);
}
function hasExternalModuleSymbol(declaration) {
- return isAmbientModule(declaration) || declaration.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
+ return isAmbientModule(declaration) || declaration.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
}
function hasNonGlobalAugmentationExternalModuleSymbol(declaration) {
- return isModuleWithStringLiteralName(declaration) || declaration.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
+ return isModuleWithStringLiteralName(declaration) || declaration.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
}
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
let aliasesToMakeVisible;
@@ -49306,9 +49482,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
let meaning;
- if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 234 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 166 /* ComputedPropertyName */) {
+ if (entityName.parent.kind === 188 /* TypeQuery */ || entityName.parent.kind === 236 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
- } else if (entityName.kind === 165 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 274 /* ImportEqualsDeclaration */) {
+ } else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 213 /* PropertyAccessExpression */ || entityName.parent.kind === 277 /* ImportEqualsDeclaration */) {
meaning = 1920 /* Namespace */;
} else {
meaning = 788968 /* Type */;
@@ -49348,7 +49524,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
function symbolToStringWorker(writer2) {
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
- const printer3 = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 314 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
+ const printer3 = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 317 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
printer3.writeNode(4 /* Unspecified */, entity, sourceFile, writer2);
return writer2;
@@ -49359,9 +49535,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function signatureToStringWorker(writer2) {
let sigOutput;
if (flags & 262144 /* WriteArrowStyleSignature */) {
- sigOutput = kind === 1 /* Construct */ ? 185 /* ConstructorType */ : 184 /* FunctionType */;
+ sigOutput = kind === 1 /* Construct */ ? 187 /* ConstructorType */ : 186 /* FunctionType */;
} else {
- sigOutput = kind === 1 /* Construct */ ? 180 /* ConstructSignature */ : 179 /* CallSignature */;
+ sigOutput = kind === 1 /* Construct */ ? 182 /* ConstructSignature */ : 181 /* CallSignature */;
}
const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
const printer3 = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
@@ -49855,7 +50031,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function shouldWriteTypeOfFunctionSymbol() {
var _a3;
const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && some(symbol.declarations, (declaration) => isStatic(declaration));
- const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || forEach(symbol.declarations, (declaration) => declaration.parent.kind === 314 /* SourceFile */ || declaration.parent.kind === 271 /* ModuleBlock */));
+ const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || forEach(symbol.declarations, (declaration) => declaration.parent.kind === 317 /* SourceFile */ || declaration.parent.kind === 274 /* ModuleBlock */));
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a3 = context.visitedTypes) == null ? void 0 : _a3.has(typeId))) && (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
}
@@ -49934,12 +50110,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
const signature = resolved.callSignatures[0];
- const signatureNode = signatureToSignatureDeclarationHelper(signature, 184 /* FunctionType */, context);
+ const signatureNode = signatureToSignatureDeclarationHelper(signature, 186 /* FunctionType */, context);
return signatureNode;
}
if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {
const signature = resolved.constructSignatures[0];
- const signatureNode = signatureToSignatureDeclarationHelper(signature, 185 /* ConstructorType */, context);
+ const signatureNode = signatureToSignatureDeclarationHelper(signature, 187 /* ConstructorType */, context);
return signatureNode;
}
}
@@ -50107,12 +50283,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const typeElements = [];
for (const signature of resolvedType.callSignatures) {
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 179 /* CallSignature */, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 181 /* CallSignature */, context));
}
for (const signature of resolvedType.constructSignatures) {
if (signature.flags & 4 /* Abstract */)
continue;
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 182 /* ConstructSignature */, context));
}
for (const info of resolvedType.indexInfos) {
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
@@ -50184,7 +50360,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {
const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */);
for (const signature of signatures) {
- const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 173 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
+ const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 175 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
typeElements.push(preserveCommentsOn(methodDeclaration));
}
} else {
@@ -50215,8 +50391,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function preserveCommentsOn(node) {
var _a3;
- if (some(propertySymbol.declarations, (d) => d.kind === 356 /* JSDocPropertyTag */)) {
- const d = (_a3 = propertySymbol.declarations) == null ? void 0 : _a3.find((d2) => d2.kind === 356 /* JSDocPropertyTag */);
+ if (some(propertySymbol.declarations, (d) => d.kind === 359 /* JSDocPropertyTag */)) {
+ const d = (_a3 = propertySymbol.declarations) == null ? void 0 : _a3.find((d2) => d2.kind === 359 /* JSDocPropertyTag */);
const commentText = getTextOfJSDocComment(d.comment);
if (commentText) {
setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
@@ -50319,7 +50495,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
typeParameters = signature.typeParameters && signature.typeParameters.map((parameter) => typeParameterToDeclaration(parameter, context));
}
const expandedParams = getExpandedParameters(signature, true)[0];
- const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
+ const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 178 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
if (thisParameter) {
parameters.unshift(thisParameter);
@@ -50340,11 +50516,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
let modifiers = options == null ? void 0 : options.modifiers;
- if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
+ if (kind === 187 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
const flags = modifiersToFlags(modifiers);
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
}
- const node = kind === 179 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 180 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 173 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 176 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0) : kind === 177 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 178 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 181 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 326 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 184 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 185 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 263 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 218 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 219 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
+ const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
if (typeArguments) {
node.typeArguments = factory.createNodeArray(typeArguments);
}
@@ -50382,9 +50558,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return typeParameterToDeclarationWithConstraint(type, context, constraintNode);
}
function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) {
- let parameterDeclaration = getDeclarationOfKind(parameterSymbol, 168 /* Parameter */);
+ let parameterDeclaration = getDeclarationOfKind(parameterSymbol, 169 /* Parameter */);
if (!parameterDeclaration && !isTransientSymbol(parameterSymbol)) {
- parameterDeclaration = getDeclarationOfKind(parameterSymbol, 349 /* JSDocParameterTag */);
+ parameterDeclaration = getDeclarationOfKind(parameterSymbol, 352 /* JSDocParameterTag */);
}
let parameterType = getTypeOfSymbol(parameterSymbol);
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
@@ -50394,7 +50570,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && preserveModifierFlags && parameterDeclaration && canHaveModifiers(parameterDeclaration) ? map(getModifiers(parameterDeclaration), factory.cloneNode) : void 0;
const isRest = parameterDeclaration && isRestParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 32768 /* RestParameter */;
const dotDotDotToken = isRest ? factory.createToken(25 /* DotDotDotToken */) : void 0;
- const name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 79 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 165 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol);
+ const name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 79 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 166 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol);
const isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 16384 /* OptionalParameter */;
const questionToken = isOptional ? factory.createToken(57 /* QuestionToken */) : void 0;
const parameterNode = factory.createParameterDeclaration(
@@ -50542,11 +50718,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getSpecifierForModuleSymbol(symbol, context, overrideImportMode) {
var _a2;
- let file = getDeclarationOfKind(symbol, 314 /* SourceFile */);
+ let file = getDeclarationOfKind(symbol, 317 /* SourceFile */);
if (!file) {
const equivalentFileSymbol = firstDefined(symbol.declarations, (d) => getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol));
if (equivalentFileSymbol) {
- file = getDeclarationOfKind(equivalentFileSymbol, 314 /* SourceFile */);
+ file = getDeclarationOfKind(equivalentFileSymbol, 317 /* SourceFile */);
}
}
if (file && file.moduleName !== void 0) {
@@ -50986,7 +51162,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return transformed === existing ? setTextRange(factory.cloneNode(existing), existing) : transformed;
function visitExistingNodeTreeSymbols(node) {
- if (isJSDocAllType(node) || node.kind === 328 /* JSDocNamepathType */) {
+ if (isJSDocAllType(node) || node.kind === 331 /* JSDocNamepathType */) {
return factory.createKeywordTypeNode(132 /* AnyKeyword */);
}
if (isJSDocUnknownType(node)) {
@@ -51126,8 +51302,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function symbolTableToDeclarationStatements(symbolTable, context, bundled) {
- const serializePropertySymbolForClass = makeSerializePropertySymbol(factory.createPropertyDeclaration, 174 /* MethodDeclaration */, true);
- const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol((mods, name, question, type) => factory.createPropertySignature(mods, name, question, type), 173 /* MethodSignature */, false);
+ const serializePropertySymbolForClass = makeSerializePropertySymbol(factory.createPropertyDeclaration, 176 /* MethodDeclaration */, true);
+ const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol((mods, name, question, type) => factory.createPropertySignature(mods, name, question, type), 175 /* MethodSignature */, false);
const enclosingDeclaration = context.enclosingDeclaration;
let results = [];
const visitedSymbols = new Set2();
@@ -51501,8 +51677,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const baseTypes = getBaseTypes(interfaceType);
const baseType = length(baseTypes) ? getIntersectionType(baseTypes) : void 0;
const members = flatMap(getPropertiesOfType(interfaceType), (p) => serializePropertySymbolForInterface(p, baseType));
- const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 179 /* CallSignature */);
- const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 180 /* ConstructSignature */);
+ const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 181 /* CallSignature */);
+ const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 182 /* ConstructSignature */);
const indexSignatures = serializeIndexSignatures(interfaceType, baseType);
const heritageClauses = !length(baseTypes) ? void 0 : [factory.createHeritageClause(95 /* ExtendsKeyword */, mapDefined(baseTypes, (b) => trySerializeAsTypeReference(b, 111551 /* Value */)))];
addResult(factory.createInterfaceDeclaration(
@@ -51570,7 +51746,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags) {
const signatures = getSignaturesOfType(type, 0 /* Call */);
for (const sig of signatures) {
- const decl = signatureToSignatureDeclarationHelper(sig, 263 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled });
+ const decl = signatureToSignatureDeclarationHelper(sig, 265 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled });
addResult(setTextRange(decl, getSignatureTextRangeLocation(sig)), modifierFlags);
}
if (!(symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && !!symbol.exports && !!symbol.exports.size)) {
@@ -51705,7 +51881,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
(p) => serializePropertySymbolForClass(p, true, staticBaseType)
);
const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */));
- const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 176 /* Constructor */);
+ const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 178 /* Constructor */);
const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]);
context.enclosingDeclaration = oldEnclosing;
addResult(setTextRange(factory.createClassDeclaration(
@@ -51752,8 +51928,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const targetName = getInternalSymbolName(target, verbatimTargetName);
includePrivateSymbol(target);
switch (node.kind) {
- case 208 /* BindingElement */:
- if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 261 /* VariableDeclaration */) {
+ case 210 /* BindingElement */:
+ if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 263 /* VariableDeclaration */) {
const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context);
const { propertyName } = node;
addResult(factory.createImportDeclaration(
@@ -51769,15 +51945,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
Debug.failBadSyntaxKind(((_c = node.parent) == null ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization");
- case 306 /* ShorthandPropertyAssignment */:
- if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 227 /* BinaryExpression */) {
+ case 309 /* ShorthandPropertyAssignment */:
+ if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 229 /* BinaryExpression */) {
serializeExportSpecifier(
unescapeLeadingUnderscores(symbol.escapedName),
targetName
);
}
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
if (isPropertyAccessExpression(node.initializer)) {
const initializer = node.initializer;
const uniqueName = factory.createUniqueName(localName);
@@ -51796,7 +51972,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
), modifierFlags);
break;
}
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, isJsonSourceFile)) {
serializeMaybeAliasAssignment(symbol);
break;
@@ -51809,10 +51985,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
isLocalImport ? symbolToName(target, context, 67108863 /* All */, false) : factory.createExternalModuleReference(factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))
), isLocalImport ? modifierFlags : 0 /* None */);
break;
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
addResult(factory.createNamespaceExportDeclaration(idText(node.name)), 0 /* None */);
break;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
addResult(factory.createImportDeclaration(
void 0,
factory.createImportClause(false, factory.createIdentifier(localName), void 0),
@@ -51820,7 +51996,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void 0
), 0 /* None */);
break;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
addResult(factory.createImportDeclaration(
void 0,
factory.createImportClause(false, void 0, factory.createNamespaceImport(factory.createIdentifier(localName))),
@@ -51828,7 +52004,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void 0
), 0 /* None */);
break;
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
addResult(factory.createExportDeclaration(
void 0,
false,
@@ -51836,7 +52012,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))
), 0 /* None */);
break;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
addResult(factory.createImportDeclaration(
void 0,
factory.createImportClause(
@@ -51854,7 +52030,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void 0
), 0 /* None */);
break;
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
const specifier = node.parent.parent.moduleSpecifier;
serializeExportSpecifier(
unescapeLeadingUnderscores(symbol.escapedName),
@@ -51862,12 +52038,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
specifier && isStringLiteralLike(specifier) ? factory.createStringLiteral(specifier.text) : void 0
);
break;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
serializeMaybeAliasAssignment(symbol);
break;
- case 227 /* BinaryExpression */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 229 /* BinaryExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (symbol.escapedName === "default" /* Default */ || symbol.escapedName === "export=" /* ExportEquals */) {
serializeMaybeAliasAssignment(symbol);
} else {
@@ -52243,17 +52419,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeAliasForTypeLiteral(type) {
if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */ && type.symbol.declarations) {
const node = walkUpParenthesizedTypes(type.symbol.declarations[0].parent);
- if (node.kind === 268 /* TypeAliasDeclaration */) {
+ if (node.kind === 271 /* TypeAliasDeclaration */) {
return getSymbolOfNode(node);
}
}
return void 0;
}
function isTopLevelInExternalModuleAugmentation(node) {
- return node && node.parent && node.parent.kind === 271 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent);
+ return node && node.parent && node.parent.kind === 274 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent);
}
function isDefaultBindingContext(location2) {
- return location2.kind === 314 /* SourceFile */ || isAmbientModule(location2);
+ return location2.kind === 317 /* SourceFile */ || isAmbientModule(location2);
}
function getNameOfSymbolFromNameType(symbol, context) {
const nameType = getSymbolLinks(symbol).nameType;
@@ -52298,17 +52474,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!declaration) {
declaration = symbol.declarations[0];
}
- if (declaration.parent && declaration.parent.kind === 261 /* VariableDeclaration */) {
+ if (declaration.parent && declaration.parent.kind === 263 /* VariableDeclaration */) {
return declarationNameToString(declaration.parent.name);
}
switch (declaration.kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) {
context.encounteredError = true;
}
- return declaration.kind === 232 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)";
+ return declaration.kind === 234 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)";
}
}
const name = getNameOfSymbolFromNameType(symbol, context);
@@ -52325,68 +52501,68 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
function determineIfDeclarationIsVisible() {
switch (node.kind) {
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
- case 348 /* JSDocEnumTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 351 /* JSDocEnumTag */:
return !!(node.parent && node.parent.parent && node.parent.parent.parent && isSourceFile(node.parent.parent.parent));
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return isDeclarationVisible(node.parent.parent);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
if (isBindingPattern(node.name) && !node.name.elements.length) {
return false;
}
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 269 /* EnumDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 268 /* AnnotationDeclaration */:
if (isExternalModuleAugmentation(node)) {
return true;
}
const parent2 = getDeclarationContainer(node);
- if (!(getCombinedModifierFlags(node) & 1 /* Export */) && !(node.kind !== 274 /* ImportEqualsDeclaration */ && parent2.kind !== 314 /* SourceFile */ && parent2.flags & 16777216 /* Ambient */)) {
+ if (!(getCombinedModifierFlags(node) & 1 /* Export */) && !(node.kind !== 277 /* ImportEqualsDeclaration */ && parent2.kind !== 317 /* SourceFile */ && parent2.flags & 16777216 /* Ambient */)) {
return isGlobalSourceFile(parent2);
}
return isDeclarationVisible(parent2);
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (hasEffectiveModifier(node, 8 /* Private */ | 16 /* Protected */)) {
return false;
}
- case 176 /* Constructor */:
- case 180 /* ConstructSignature */:
- case 179 /* CallSignature */:
- case 181 /* IndexSignature */:
- case 168 /* Parameter */:
- case 271 /* ModuleBlock */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 187 /* TypeLiteral */:
- case 183 /* TypeReference */:
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 196 /* ParenthesizedType */:
- case 202 /* NamedTupleMember */:
+ case 178 /* Constructor */:
+ case 182 /* ConstructSignature */:
+ case 181 /* CallSignature */:
+ case 183 /* IndexSignature */:
+ case 169 /* Parameter */:
+ case 274 /* ModuleBlock */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 189 /* TypeLiteral */:
+ case 185 /* TypeReference */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 198 /* ParenthesizedType */:
+ case 204 /* NamedTupleMember */:
return isDeclarationVisible(node.parent);
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
return false;
- case 167 /* TypeParameter */:
- case 314 /* SourceFile */:
- case 273 /* NamespaceExportDeclaration */:
+ case 168 /* TypeParameter */:
+ case 317 /* SourceFile */:
+ case 276 /* NamespaceExportDeclaration */:
return true;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return false;
default:
return false;
@@ -52395,9 +52571,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function collectLinkedAliases(node, setVisibility) {
let exportSymbol;
- if (node.parent && node.parent.kind === 280 /* ExportAssignment */) {
+ if (node.parent && node.parent.kind === 283 /* ExportAssignment */) {
exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, void 0, node, false);
- } else if (node.parent.kind === 284 /* ExportSpecifier */) {
+ } else if (node.parent.kind === 287 /* ExportSpecifier */) {
exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */);
}
let result;
@@ -52492,12 +52668,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getDeclarationContainer(node) {
return findAncestor(getRootDeclaration(node), (node2) => {
switch (node2.kind) {
- case 261 /* VariableDeclaration */:
- case 262 /* VariableDeclarationList */:
- case 279 /* ImportSpecifier */:
- case 278 /* NamedImports */:
- case 277 /* NamespaceImport */:
- case 276 /* ImportClause */:
+ case 263 /* VariableDeclaration */:
+ case 264 /* VariableDeclarationList */:
+ case 282 /* ImportSpecifier */:
+ case 281 /* NamedImports */:
+ case 280 /* NamespaceImport */:
+ case 279 /* ImportClause */:
return false;
default:
return true;
@@ -52601,23 +52777,23 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getParentElementAccess(node) {
const ancestor = node.parent.parent;
switch (ancestor.kind) {
- case 208 /* BindingElement */:
- case 305 /* PropertyAssignment */:
+ case 210 /* BindingElement */:
+ case 308 /* PropertyAssignment */:
return getSyntheticElementAccess(ancestor);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return getSyntheticElementAccess(node.parent);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return ancestor.initializer;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return ancestor.right;
}
}
function getDestructuringPropertyName(node) {
const parent2 = node.parent;
- if (node.kind === 208 /* BindingElement */ && parent2.kind === 206 /* ObjectBindingPattern */) {
+ if (node.kind === 210 /* BindingElement */ && parent2.kind === 208 /* ObjectBindingPattern */) {
return getLiteralPropertyNameText(node.propertyName || node.name);
}
- if (node.kind === 305 /* PropertyAssignment */ || node.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.kind === 308 /* PropertyAssignment */ || node.kind === 309 /* ShorthandPropertyAssignment */) {
return getLiteralPropertyNameText(node.name);
}
return "" + parent2.elements.indexOf(node);
@@ -52642,7 +52818,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */);
}
let type;
- if (pattern.kind === 206 /* ObjectBindingPattern */) {
+ if (pattern.kind === 208 /* ObjectBindingPattern */) {
if (declaration.dotDotDotToken) {
parentType = getReducedType(parentType);
if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) {
@@ -52697,17 +52873,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isEmptyArrayLiteral2(node) {
const expr = skipParentheses(node, true);
- return expr.kind === 209 /* ArrayLiteralExpression */ && expr.elements.length === 0;
+ return expr.kind === 211 /* ArrayLiteralExpression */ && expr.elements.length === 0;
}
function addOptionality(type, isProperty = false, isOptional = true) {
return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type;
}
function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) {
- if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250 /* ForInStatement */) {
+ if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 252 /* ForInStatement */) {
const indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression, checkMode)));
return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType;
}
- if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) {
+ if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 253 /* ForOfStatement */) {
const forOfStatement = declaration.parent.parent;
return checkRightHandSideOfForOf(forOfStatement) || anyType;
}
@@ -52730,8 +52906,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (isParameter(declaration)) {
const func = declaration.parent;
- if (func.kind === 178 /* SetAccessor */ && hasBindableName(func)) {
- const getter = getDeclarationOfKind(getSymbolOfNode(declaration.parent), 177 /* GetAccessor */);
+ if (func.kind === 180 /* SetAccessor */ && hasBindableName(func)) {
+ const getter = getDeclarationOfKind(getSymbolOfNode(declaration.parent), 179 /* GetAccessor */);
if (getter) {
const getterSignature = getSignatureFromDeclaration(getter);
const thisParameter = getAccessorThisParameter(func);
@@ -52784,7 +52960,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const links = getSymbolLinks(symbol);
if (links.isConstructorDeclaredProperty === void 0) {
links.isConstructorDeclaredProperty = false;
- links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 212 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(void 0, declaration, symbol, declaration));
+ links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 214 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(void 0, declaration, symbol, declaration));
}
return links.isConstructorDeclaredProperty;
}
@@ -52800,7 +52976,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
for (const declaration of symbol.declarations) {
const container = getThisContainer(declaration, false);
- if (container && (container.kind === 176 /* Constructor */ || isJSConstructor(container))) {
+ if (container && (container.kind === 178 /* Constructor */ || isJSConstructor(container))) {
return container;
}
}
@@ -53062,7 +53238,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isDeclarationInConstructor(expression) {
const thisContainer = getThisContainer(expression, false);
- return thisContainer.kind === 176 /* Constructor */ || thisContainer.kind === 263 /* FunctionDeclaration */ || thisContainer.kind === 218 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent);
+ return thisContainer.kind === 178 /* Constructor */ || thisContainer.kind === 265 /* FunctionDeclaration */ || thisContainer.kind === 220 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent);
}
function getConstructorDefinedThisAssignmentTypes(types, declarations) {
Debug.assert(types.length === declarations.length);
@@ -53118,7 +53294,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2) {
const elements = pattern.elements;
const lastElement = lastOrUndefined(elements);
- const restElement = lastElement && lastElement.kind === 208 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0;
+ const restElement = lastElement && lastElement.kind === 210 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0;
if (elements.length === 0 || elements.length === 1 && restElement) {
return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType;
}
@@ -53134,7 +53310,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
}
function getTypeFromBindingPattern(pattern, includePatternInType = false, reportErrors2 = false) {
- return pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2);
+ return pattern.kind === 208 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2);
}
function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors2) {
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, true, 0 /* Normal */), declaration, reportErrors2);
@@ -53167,7 +53343,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function declarationBelongsToPrivateAmbientMember(declaration) {
const root = getRootDeclaration(declaration);
- const memberDeclaration = root.kind === 168 /* Parameter */ ? root.parent : root;
+ const memberDeclaration = root.kind === 169 /* Parameter */ ? root.parent : root;
return isPrivateWithinAmbient(memberDeclaration);
}
function tryGetTypeFromEffectiveTypeNode(node) {
@@ -53235,7 +53411,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return reportCircularityError(symbol);
}
let type;
- if (declaration.kind === 280 /* ExportAssignment */) {
+ if (declaration.kind === 283 /* ExportAssignment */) {
type = widenTypeForVariableLikeDeclaration(tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionCached(declaration.expression), declaration);
} else if (isBinaryExpression(declaration) || isInJSFile(declaration) && (isCallExpression(declaration) || (isPropertyAccessExpression(declaration) || isBindableStaticElementAccessExpression(declaration)) && isBinaryExpression(declaration.parent))) {
type = getWidenedTypeForAssignmentDeclaration(symbol);
@@ -53252,7 +53428,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, 0 /* Normal */);
} else if (isObjectLiteralMethod(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, 0 /* Normal */);
- } else if (isParameter(declaration) || isPropertyDeclaration(declaration) || isPropertySignature(declaration) || isAnnotationPropertyDeclaration(declaration) || isVariableDeclaration(declaration) || isBindingElement(declaration) || isJSDocPropertyLikeTag(declaration)) {
+ } else if (isParameter(declaration) || isPropertyDeclaration(declaration) || isPropertySignature(declaration) || isAnnotationPropertyDeclaration(declaration) || isVariableDeclaration(declaration) || isBindingElement(declaration) || isOverloadPropertyDeclaration(declaration) || isJSDocPropertyLikeTag(declaration)) {
type = getWidenedTypeForVariableLikeDeclaration(declaration, true);
} else if (isEnumDeclaration(declaration)) {
type = getTypeOfFuncClassEnumModule(symbol);
@@ -53272,13 +53448,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getAnnotatedAccessorTypeNode(accessor) {
if (accessor) {
switch (accessor.kind) {
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
const getterTypeAnnotation = getEffectiveReturnTypeNode(accessor);
return getterTypeAnnotation;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
const setterTypeAnnotation = getEffectiveSetAccessorTypeAnnotationNode(accessor);
return setterTypeAnnotation;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
Debug.assert(hasAccessorModifier(accessor));
const accessorTypeAnnotation = getEffectiveTypeAnnotationNode(accessor);
return accessorTypeAnnotation;
@@ -53303,9 +53479,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!pushTypeResolution(symbol, 0 /* Type */)) {
return errorType;
}
- const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */);
- const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */);
- const accessor = tryCast(getDeclarationOfKind(symbol, 171 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
+ const getter = getDeclarationOfKind(symbol, 179 /* GetAccessor */);
+ const setter = getDeclarationOfKind(symbol, 180 /* SetAccessor */);
+ const accessor = tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && accessor.initializer && getWidenedTypeForVariableLikeDeclaration(accessor, true);
if (!type) {
if (setter && !isPrivateWithinAmbient(setter)) {
@@ -53340,7 +53516,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!pushTypeResolution(symbol, 8 /* WriteType */)) {
return errorType;
}
- const setter = (_a2 = getDeclarationOfKind(symbol, 178 /* SetAccessor */)) != null ? _a2 : tryCast(getDeclarationOfKind(symbol, 171 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
+ const setter = (_a2 = getDeclarationOfKind(symbol, 180 /* SetAccessor */)) != null ? _a2 : tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
let writeType = getAnnotatedAccessorType(setter);
if (!popTypeResolution()) {
if (getAnnotatedAccessorTypeNode(setter)) {
@@ -53375,7 +53551,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const declaration = symbol.valueDeclaration;
if (symbol.flags & 1536 /* Module */ && isShorthandAmbientModuleSymbol(symbol)) {
return anyType;
- } else if (declaration && (declaration.kind === 227 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 227 /* BinaryExpression */)) {
+ } else if (declaration && (declaration.kind === 229 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 229 /* BinaryExpression */)) {
return getWidenedTypeForAssignmentDeclaration(symbol);
} else if (symbol.flags & 512 /* ValueModule */ && declaration && isSourceFile(declaration) && declaration.commonJsModuleIndicator) {
const resolvedModule = resolveExternalModuleSymbol(symbol);
@@ -53431,7 +53607,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
);
return errorType;
}
- if (noImplicitAny && (declaration.kind !== 168 /* Parameter */ || declaration.initializer)) {
+ if (noImplicitAny && (declaration.kind !== 169 /* Parameter */ || declaration.initializer)) {
error(
symbol.valueDeclaration,
Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,
@@ -53542,43 +53718,43 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 326 /* JSDocFunctionType */:
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 268 /* TypeAliasDeclaration */:
- case 353 /* JSDocTemplateTag */:
- case 354 /* JSDocTypedefTag */:
- case 348 /* JSDocEnumTag */:
- case 347 /* JSDocCallbackTag */:
- case 200 /* MappedType */:
- case 194 /* ConditionalType */: {
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 329 /* JSDocFunctionType */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 271 /* TypeAliasDeclaration */:
+ case 356 /* JSDocTemplateTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 351 /* JSDocEnumTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 202 /* MappedType */:
+ case 196 /* ConditionalType */: {
const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
- if (node.kind === 200 /* MappedType */) {
+ if (node.kind === 202 /* MappedType */) {
return append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)));
- } else if (node.kind === 194 /* ConditionalType */) {
+ } else if (node.kind === 196 /* ConditionalType */) {
return concatenate(outerTypeParameters, getInferTypeParameters(node));
}
const outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, getEffectiveTypeParameterDeclarations(node));
- const thisType = includeThisTypes && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || node.kind === 267 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
+ const thisType = includeThisTypes && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 270 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
return thisType ? append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters;
}
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
const paramSymbol = getParameterSymbolFromJSDoc(node);
if (paramSymbol) {
node = paramSymbol.valueDeclaration;
}
break;
- case 329 /* JSDoc */: {
+ case 332 /* JSDoc */: {
const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
return node.tags ? appendTypeParameters(outerTypeParameters, flatMap(node.tags, (t) => isJSDocTemplateTag(t) ? t.typeParameters : void 0)) : outerTypeParameters;
}
@@ -53586,7 +53762,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getOuterTypeParametersOfClassOrInterface(symbol) {
- const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 267 /* InterfaceDeclaration */);
+ const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 270 /* InterfaceDeclaration */);
Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
return getOuterTypeParameters(declaration);
}
@@ -53596,7 +53772,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let result;
for (const node of symbol.declarations) {
- if (node.kind === 267 /* InterfaceDeclaration */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) {
+ if (node.kind === 270 /* InterfaceDeclaration */ || node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) {
const declaration = node;
result = appendTypeParameters(result, getEffectiveTypeParameterDeclarations(declaration));
}
@@ -53729,7 +53905,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (!popTypeResolution() && type.symbol.declarations) {
for (const declaration of type.symbol.declarations) {
- if (declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 267 /* InterfaceDeclaration */) {
+ if (declaration.kind === 266 /* ClassDeclaration */ || declaration.kind === 270 /* InterfaceDeclaration */) {
reportCircularBaseType(declaration, type);
}
}
@@ -53812,7 +53988,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray;
if (type.symbol.declarations) {
for (const declaration of type.symbol.declarations) {
- if (declaration.kind === 267 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) {
+ if (declaration.kind === 270 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) {
for (const node of getInterfaceBaseTypeNodes(declaration)) {
const baseType = getReducedType(getTypeFromTypeNode(node));
if (!isErrorType(baseType)) {
@@ -53840,7 +54016,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
for (const declaration of symbol.declarations) {
- if (declaration.kind === 267 /* InterfaceDeclaration */) {
+ if (declaration.kind === 270 /* InterfaceDeclaration */) {
if (declaration.flags & 128 /* ContainsThis */) {
return false;
}
@@ -53906,7 +54082,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
} else {
type = errorType;
- if (declaration.kind === 348 /* JSDocEnumTag */) {
+ if (declaration.kind === 351 /* JSDocEnumTag */) {
error(declaration.typeExpression.type, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
} else {
error(isNamedDeclaration(declaration) ? declaration.name || declaration : declaration, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
@@ -53919,7 +54095,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isStringConcatExpression(expr) {
if (isStringLiteralLike(expr)) {
return true;
- } else if (expr.kind === 227 /* BinaryExpression */) {
+ } else if (expr.kind === 229 /* BinaryExpression */) {
return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right);
}
return false;
@@ -53934,11 +54110,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return true;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */;
case 79 /* Identifier */:
return nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isStringConcatExpression(expr);
default:
return false;
@@ -53952,7 +54128,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let hasNonLiteralMember = false;
if (symbol.declarations) {
for (const declaration of symbol.declarations) {
- if (declaration.kind === 269 /* EnumDeclaration */) {
+ if (declaration.kind === 272 /* EnumDeclaration */) {
for (const member of declaration.members) {
if (member.initializer && isStringLiteralLike(member.initializer)) {
return links.enumKind = 1 /* Literal */;
@@ -53979,7 +54155,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const memberTypeList = [];
if (symbol.declarations) {
for (const declaration of symbol.declarations) {
- if (declaration.kind === 269 /* EnumDeclaration */) {
+ if (declaration.kind === 272 /* EnumDeclaration */) {
for (const member of declaration.members) {
const value = getEnumMemberValue(member);
const memberType = getFreshTypeOfLiteralType(getEnumLiteralType(value !== void 0 ? value : 0, enumCount, getSymbolOfNode(member)));
@@ -54057,11 +54233,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 115 /* VoidKeyword */:
case 157 /* UndefinedKeyword */:
case 145 /* NeverKeyword */:
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return true;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return isThislessType(node.elementType);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return !node.typeArguments || node.typeArguments.every(isThislessType);
}
return false;
@@ -54077,21 +54253,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isThislessFunctionLikeDeclaration(node) {
const returnType = getEffectiveReturnTypeNode(node);
const typeParameters = getEffectiveTypeParameterDeclarations(node);
- return (node.kind === 176 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter);
+ return (node.kind === 178 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter);
}
function isThisless(symbol) {
if (symbol.declarations && symbol.declarations.length === 1) {
const declaration = symbol.declarations[0];
if (declaration) {
switch (declaration.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return isThislessVariableLikeDeclaration(declaration);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return isThislessFunctionLikeDeclaration(declaration);
}
}
@@ -54956,7 +55132,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isMappedTypeWithKeyofConstraintDeclaration(type) {
const constraintDeclaration = getConstraintDeclarationForMappedType(type);
- return constraintDeclaration.kind === 198 /* TypeOperator */ && constraintDeclaration.operator === 142 /* KeyOfKeyword */;
+ return constraintDeclaration.kind === 200 /* TypeOperator */ && constraintDeclaration.operator === 142 /* KeyOfKeyword */;
}
function getModifiersTypeFromMappedType(type) {
if (!type.modifiersType) {
@@ -55683,7 +55859,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
}
function isJSDocOptionalParameter(node) {
- return isInJSFile(node) && (node.type && node.type.kind === 325 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 325 /* JSDocOptionalType */));
+ return isInJSFile(node) && (node.type && node.type.kind === 328 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 328 /* JSDocOptionalType */));
}
function tryFindAmbientModule(moduleName, withAugmentations) {
if (isExternalModuleNameRelative(moduleName)) {
@@ -55716,7 +55892,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
const { isBracketed, typeExpression } = node;
- return isBracketed || !!typeExpression && typeExpression.type.kind === 325 /* JSDocOptionalType */;
+ return isBracketed || !!typeExpression && typeExpression.type.kind === 328 /* JSDocOptionalType */;
}
function createTypePredicate(kind, parameterName, parameterIndex, type) {
return { kind, parameterName, parameterIndex, type };
@@ -55784,7 +55960,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
parameters.push(paramSymbol);
}
- if (type && type.kind === 201 /* LiteralType */) {
+ if (type && type.kind === 203 /* LiteralType */) {
flags |= 2 /* HasLiteralTypes */;
}
const isOptionalParameter2 = isOptionalJSDocPropertyLikeTag(param) || param.initializer || param.questionToken || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type || isJSDocOptionalParameter(param);
@@ -55792,14 +55968,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
minArgumentCount = parameters.length;
}
}
- if ((declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) {
- const otherKind = declaration.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */;
+ if ((declaration.kind === 179 /* GetAccessor */ || declaration.kind === 180 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) {
+ const otherKind = declaration.kind === 179 /* GetAccessor */ ? 180 /* SetAccessor */ : 179 /* GetAccessor */;
const other = getDeclarationOfKind(getSymbolOfNode(declaration), otherKind);
if (other) {
thisParameter = getAnnotatedAccessorThisParameter(other);
}
}
- const classType = declaration.kind === 176 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
+ const classType = declaration.kind === 178 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
flags |= 1 /* HasRestParameter */;
@@ -55875,15 +56051,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
return node.escapedText === argumentsSymbol.escapedName && getReferencedValueSymbol(node) === argumentsSymbol;
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- return node.name.kind === 166 /* ComputedPropertyName */ && traverse(node.name);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ return node.name.kind === 167 /* ComputedPropertyName */ && traverse(node.name);
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return traverse(node.expression);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return traverse(node.initializer);
default:
return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && !!forEachChild(node, traverse);
@@ -55950,7 +56126,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function createTypePredicateFromTypePredicateNode(node, signature) {
const parameterName = node.parameterName;
const type = node.type && getTypeFromTypeNode(node.type);
- return parameterName.kind === 197 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, void 0, void 0, type) : createTypePredicate(
+ return parameterName.kind === 199 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, void 0, void 0, type) : createTypePredicate(
node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */,
parameterName.escapedText,
findIndex(signature.parameters, (p) => p.escapedName === parameterName.escapedText),
@@ -55993,7 +56169,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return signature.resolvedReturnType;
}
function getReturnTypeFromAnnotation(declaration) {
- if (declaration.kind === 176 /* Constructor */) {
+ if (declaration.kind === 178 /* Constructor */) {
return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol));
}
if (isJSDocConstructSignature(declaration)) {
@@ -56003,12 +56179,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (typeNode) {
return getTypeFromTypeNode(typeNode);
}
- if (declaration.kind === 177 /* GetAccessor */ && hasBindableName(declaration)) {
+ if (declaration.kind === 179 /* GetAccessor */ && hasBindableName(declaration)) {
const jsDocType = isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration);
if (jsDocType) {
return jsDocType;
}
- const setter = getDeclarationOfKind(getSymbolOfNode(declaration), 178 /* SetAccessor */);
+ const setter = getDeclarationOfKind(getSymbolOfNode(declaration), 180 /* SetAccessor */);
const setterType = getAnnotatedAccessorType(setter);
if (setterType) {
return setterType;
@@ -56096,7 +56272,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
var _a2;
if (!signature.isolatedSignatureType) {
const kind = (_a2 = signature.declaration) == null ? void 0 : _a2.kind;
- const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
+ const isConstructor = kind === void 0 || kind === 178 /* Constructor */ || kind === 182 /* ConstructSignature */ || kind === 187 /* ConstructorType */;
const type = createObjectType(16 /* Anonymous */);
type.members = emptySymbols;
type.properties = emptyArray;
@@ -56155,9 +56331,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let inferences;
if ((_a2 = typeParameter.symbol) == null ? void 0 : _a2.declarations) {
for (const declaration of typeParameter.symbol.declarations) {
- if (declaration.parent.kind === 195 /* InferType */) {
+ if (declaration.parent.kind === 197 /* InferType */) {
const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent);
- if (grandParent.kind === 183 /* TypeReference */ && !omitTypeReferences) {
+ if (grandParent.kind === 185 /* TypeReference */ && !omitTypeReferences) {
const typeReference = grandParent;
const typeParameters = getTypeParametersForTypeReference(typeReference);
if (typeParameters) {
@@ -56175,13 +56351,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- } else if (grandParent.kind === 168 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 191 /* RestType */ || grandParent.kind === 202 /* NamedTupleMember */ && grandParent.dotDotDotToken) {
+ } else if (grandParent.kind === 169 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 193 /* RestType */ || grandParent.kind === 204 /* NamedTupleMember */ && grandParent.dotDotDotToken) {
inferences = append(inferences, createArrayType(unknownType));
- } else if (grandParent.kind === 204 /* TemplateLiteralTypeSpan */) {
+ } else if (grandParent.kind === 206 /* TemplateLiteralTypeSpan */) {
inferences = append(inferences, stringType);
- } else if (grandParent.kind === 167 /* TypeParameter */ && grandParent.parent.kind === 200 /* MappedType */) {
+ } else if (grandParent.kind === 168 /* TypeParameter */ && grandParent.parent.kind === 202 /* MappedType */) {
inferences = append(inferences, keyofConstraintType);
- } else if (grandParent.kind === 200 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 194 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 200 /* MappedType */ && grandParent.parent.checkType.type) {
+ } else if (grandParent.kind === 202 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 196 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 202 /* MappedType */ && grandParent.parent.checkType.type) {
const checkMappedType2 = grandParent.parent.checkType;
const nodeType = getTypeFromTypeNode(checkMappedType2.type);
inferences = append(inferences, instantiateType(
@@ -56206,7 +56382,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
let type = getTypeFromTypeNode(constraintDeclaration);
if (type.flags & 1 /* Any */ && !isErrorType(type)) {
- type = constraintDeclaration.parent.parent.kind === 200 /* MappedType */ ? keyofConstraintType : unknownType;
+ type = constraintDeclaration.parent.parent.kind === 202 /* MappedType */ ? keyofConstraintType : unknownType;
}
typeParameter.constraint = type;
}
@@ -56215,7 +56391,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return typeParameter.constraint === noConstraintType ? void 0 : typeParameter.constraint;
}
function getParentSymbolOfTypeParameter(typeParameter) {
- const tp = getDeclarationOfKind(typeParameter.symbol, 167 /* TypeParameter */);
+ const tp = getDeclarationOfKind(typeParameter.symbol, 168 /* TypeParameter */);
const host2 = isJSDocTemplateTag(tp.parent) ? getEffectiveContainerForJSDocTemplateTag(tp.parent) : tp.parent;
return host2 && getSymbolOfNode(host2);
}
@@ -56295,7 +56471,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return ((_a2 = type.target.localTypeParameters) == null ? void 0 : _a2.map(() => errorType)) || emptyArray;
}
const node = type.node;
- const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
+ const typeArguments = !node ? emptyArray : node.kind === 185 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 190 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
if (popTypeResolution()) {
type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
} else {
@@ -56329,7 +56505,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return errorType;
}
}
- if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
+ if (node.kind === 185 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
return createDeferredTypeReference(type, node, void 0);
}
const typeArguments = concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgumentsFromTypeReferenceNode(node), typeParameters, minTypeArgumentCount, isJs));
@@ -56397,9 +56573,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTypeReferenceName(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return node.typeName;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
const expr = node.expression;
if (isEntityNameExpression(expr)) {
return expr;
@@ -56411,10 +56587,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return symbol.parent ? `${getSymbolPath(symbol.parent)}.${symbol.escapedName}` : symbol.escapedName;
}
function getUnresolvedSymbolForEntityName(name) {
- const identifier = name.kind === 165 /* QualifiedName */ ? name.right : name.kind === 211 /* PropertyAccessExpression */ ? name.name : name;
+ const identifier = name.kind === 166 /* QualifiedName */ ? name.right : name.kind === 213 /* PropertyAccessExpression */ ? name.name : name;
const text = identifier.escapedText;
if (text) {
- const parentSymbol = name.kind === 165 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 211 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0;
+ const parentSymbol = name.kind === 166 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 213 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0;
const path2 = parentSymbol ? `${getSymbolPath(parentSymbol)}.${text}` : text;
let result = unresolvedSymbols.get(path2);
if (!result) {
@@ -56490,7 +56666,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const valueType = getTypeOfSymbol(symbol);
let typeType = valueType;
if (symbol.valueDeclaration) {
- const isImportTypeWithQualifier = node.kind === 205 /* ImportType */ && node.qualifier;
+ const isImportTypeWithQualifier = node.kind === 207 /* ImportType */ && node.qualifier;
if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) {
typeType = getTypeReferenceType(node, valueType.symbol);
}
@@ -56518,7 +56694,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
}
function isUnaryTupleTypeNode(node) {
- return node.kind === 189 /* TupleType */ && node.elements.length === 1;
+ return node.kind === 191 /* TupleType */ && node.elements.length === 1;
}
function getImpliedConstraint(type, checkNode, extendsNode) {
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) : void 0;
@@ -56526,17 +56702,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getConditionalFlowTypeOfType(type, node) {
let constraints;
let covariant = true;
- while (node && !isStatement(node) && node.kind !== 329 /* JSDoc */) {
+ while (node && !isStatement(node) && node.kind !== 332 /* JSDoc */) {
const parent2 = node.parent;
- if (parent2.kind === 168 /* Parameter */) {
+ if (parent2.kind === 169 /* Parameter */) {
covariant = !covariant;
}
- if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 194 /* ConditionalType */ && node === parent2.trueType) {
+ if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 196 /* ConditionalType */ && node === parent2.trueType) {
const constraint = getImpliedConstraint(type, parent2.checkType, parent2.extendsType);
if (constraint) {
constraints = append(constraints, constraint);
}
- } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && node === parent2.type) {
+ } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 202 /* MappedType */ && node === parent2.type) {
const mappedType = getTypeFromTypeNode(parent2);
if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
const typeParameter = getHomomorphicTypeVariable(mappedType);
@@ -56553,7 +56729,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return constraints ? getSubstitutionType(type, getIntersectionType(constraints)) : type;
}
function isJSDocTypeReference(node) {
- return !!(node.flags & 8388608 /* JSDoc */) && (node.kind === 183 /* TypeReference */ || node.kind === 205 /* ImportType */);
+ return !!(node.flags & 8388608 /* JSDoc */) && (node.kind === 185 /* TypeReference */ || node.kind === 207 /* ImportType */);
}
function checkNoTypeArguments(node, symbol) {
if (node.typeArguments) {
@@ -56659,9 +56835,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (declarations) {
for (const declaration of declarations) {
switch (declaration.kind) {
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
return declaration;
}
}
@@ -56822,11 +56998,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTupleElementFlags(node) {
switch (node.kind) {
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return 2 /* Optional */;
- case 191 /* RestType */:
+ case 193 /* RestType */:
return getRestTypeElementFlags(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */;
default:
return 1 /* Required */;
@@ -56842,55 +57018,55 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return readonly ? globalReadonlyArrayType : globalArrayType;
}
const elementFlags = map(node.elements, getTupleElementFlags);
- const missingName = some(node.elements, (e) => e.kind !== 202 /* NamedTupleMember */);
+ const missingName = some(node.elements, (e) => e.kind !== 204 /* NamedTupleMember */);
return getTupleTargetType(elementFlags, readonly, missingName ? void 0 : node.elements);
}
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
- return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
+ return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 190 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 191 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
}
function isResolvedByTypeAlias(node) {
const parent2 = node.parent;
switch (parent2.kind) {
- case 196 /* ParenthesizedType */:
- case 202 /* NamedTupleMember */:
- case 183 /* TypeReference */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 199 /* IndexedAccessType */:
- case 194 /* ConditionalType */:
- case 198 /* TypeOperator */:
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
+ case 198 /* ParenthesizedType */:
+ case 204 /* NamedTupleMember */:
+ case 185 /* TypeReference */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 201 /* IndexedAccessType */:
+ case 196 /* ConditionalType */:
+ case 200 /* TypeOperator */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
return isResolvedByTypeAlias(parent2);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
}
return false;
}
function mayResolveTypeAlias(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node, 788968 /* Type */).flags & 524288 /* TypeAlias */);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return true;
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return node.operator !== 158 /* UniqueKeyword */ && mayResolveTypeAlias(node.type);
- case 196 /* ParenthesizedType */:
- case 190 /* OptionalType */:
- case 202 /* NamedTupleMember */:
- case 325 /* JSDocOptionalType */:
- case 323 /* JSDocNullableType */:
- case 324 /* JSDocNonNullableType */:
- case 318 /* JSDocTypeExpression */:
+ case 198 /* ParenthesizedType */:
+ case 192 /* OptionalType */:
+ case 204 /* NamedTupleMember */:
+ case 328 /* JSDocOptionalType */:
+ case 326 /* JSDocNullableType */:
+ case 327 /* JSDocNonNullableType */:
+ case 321 /* JSDocTypeExpression */:
return mayResolveTypeAlias(node.type);
- case 191 /* RestType */:
- return node.type.kind !== 188 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 193 /* RestType */:
+ return node.type.kind !== 190 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return some(node.types, mayResolveTypeAlias);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType);
}
return false;
@@ -56901,10 +57077,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const target = getArrayOrTupleTargetType(node);
if (target === emptyGenericType) {
links.resolvedType = emptyObjectType;
- } else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
- links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, void 0);
+ } else if (!(node.kind === 191 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
+ links.resolvedType = node.kind === 191 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, void 0);
} else {
- const elementTypes = node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
+ const elementTypes = node.kind === 190 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
links.resolvedType = createNormalizedTypeReference(target, elementTypes);
}
}
@@ -57885,7 +58061,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, accessNode, accessFlags) {
var _a2;
- const accessExpression = accessNode && accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode : void 0;
+ const accessExpression = accessNode && accessNode.kind === 214 /* ElementAccessExpression */ ? accessNode : void 0;
const propName = accessNode && isPrivateIdentifier(accessNode) ? void 0 : getPropertyNameFromIndex(indexType, accessNode);
if (propName !== void 0) {
if (accessFlags & 256 /* Contextual */) {
@@ -58053,7 +58229,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getIndexNodeForAccessExpression(accessNode) {
- return accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 199 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 166 /* ComputedPropertyName */ ? accessNode.expression : accessNode;
+ return accessNode.kind === 214 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 201 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 167 /* ComputedPropertyName */ ? accessNode.expression : accessNode;
}
function isPatternLiteralPlaceholderType(type) {
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
@@ -58184,7 +58360,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
accessFlags |= 1 /* IncludeUndefined */;
- if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
+ if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 201 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
if (objectType.flags & 3 /* AnyOrUnknown */) {
return objectType;
}
@@ -58724,7 +58900,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getThisType(node) {
const container = getThisContainer(node, false);
const parent2 = container && container.parent;
- if (parent2 && (isClassLike(parent2) || parent2.kind === 267 /* InterfaceDeclaration */)) {
+ if (parent2 && (isClassLike(parent2) || parent2.kind === 270 /* InterfaceDeclaration */)) {
if (!isStatic(container) && (!isConstructorDeclaration(container) || isNodeDescendantOf(node, container.body))) {
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent2)).thisType;
}
@@ -58754,17 +58930,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getArrayElementTypeNode(node) {
switch (node.kind) {
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return getArrayElementTypeNode(node.type);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
if (node.elements.length === 1) {
node = node.elements[0];
- if (node.kind === 191 /* RestType */ || node.kind === 202 /* NamedTupleMember */ && node.dotDotDotToken) {
+ if (node.kind === 193 /* RestType */ || node.kind === 204 /* NamedTupleMember */ && node.dotDotDotToken) {
return getArrayElementTypeNode(node.type);
}
}
break;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return node.elementType;
}
return void 0;
@@ -58779,8 +58955,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeFromTypeNodeWorker(node) {
switch (node.kind) {
case 132 /* AnyKeyword */:
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
return anyType;
case 159 /* UnknownKeyword */:
return unknownType;
@@ -58806,66 +58982,66 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return node.flags & 262144 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType;
case 140 /* IntrinsicKeyword */:
return intrinsicMarkerType;
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 109 /* ThisKeyword */:
return getTypeFromThisTypeNode(node);
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return getTypeFromLiteralTypeNode(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return getTypeFromTypeReference(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return node.assertsModifier ? voidType : booleanType;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return getTypeFromTypeReference(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return getTypeFromTypeQueryNode(node);
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
return getTypeFromArrayOrTupleTypeNode(node);
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return getTypeFromOptionalTypeNode(node);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return getTypeFromUnionTypeNode(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return getTypeFromIntersectionTypeNode(node);
- case 323 /* JSDocNullableType */:
+ case 326 /* JSDocNullableType */:
return getTypeFromJSDocNullableTypeNode(node);
- case 325 /* JSDocOptionalType */:
+ case 328 /* JSDocOptionalType */:
return addOptionality(getTypeFromTypeNode(node.type));
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return getTypeFromNamedTupleTypeNode(node);
- case 196 /* ParenthesizedType */:
- case 324 /* JSDocNonNullableType */:
- case 318 /* JSDocTypeExpression */:
+ case 198 /* ParenthesizedType */:
+ case 327 /* JSDocNonNullableType */:
+ case 321 /* JSDocTypeExpression */:
return getTypeFromTypeNode(node.type);
- case 191 /* RestType */:
+ case 193 /* RestType */:
return getTypeFromRestTypeNode(node);
- case 327 /* JSDocVariadicType */:
+ case 330 /* JSDocVariadicType */:
return getTypeFromJSDocVariadicType(node);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 326 /* JSDocFunctionType */:
- case 332 /* JSDocSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 329 /* JSDocFunctionType */:
+ case 335 /* JSDocSignature */:
return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return getTypeFromTypeOperatorNode(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return getTypeFromIndexedAccessTypeNode(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return getTypeFromMappedTypeNode(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return getTypeFromConditionalTypeNode(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return getTypeFromInferTypeNode(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return getTypeFromTemplateTypeNode(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return getTypeFromImportTypeNode(node);
case 79 /* Identifier */:
- case 165 /* QualifiedName */:
- case 211 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
const symbol = getSymbolAtLocation(node);
return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType;
default:
@@ -59060,13 +59236,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type;
}
function maybeTypeParameterReference(node) {
- return !(node.parent.kind === 183 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 205 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
+ return !(node.parent.kind === 185 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 207 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
}
function isTypeParameterPossiblyReferenced(tp, node) {
if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {
const container = tp.symbol.declarations[0].parent;
for (let n = node; n !== container; n = n.parent) {
- if (!n || n.kind === 242 /* Block */ || n.kind === 194 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) {
+ if (!n || n.kind === 244 /* Block */ || n.kind === 196 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) {
return true;
}
}
@@ -59075,17 +59251,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
function containsReference(node2) {
switch (node2.kind) {
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return !!tp.isThisType;
case 79 /* Identifier */:
return !tp.isThisType && isPartOfTypeNode(node2) && maybeTypeParameterReference(node2) && getTypeFromTypeNodeWorker(node2) === tp;
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
const entityName = node2.exprName;
const firstIdentifier = getFirstIdentifier(entityName);
const firstIdentifierSymbol = getResolvedSymbol(firstIdentifier);
const tpDeclaration = tp.symbol.declarations[0];
let tpScope;
- if (tpDeclaration.kind === 167 /* TypeParameter */) {
+ if (tpDeclaration.kind === 168 /* TypeParameter */) {
tpScope = tpDeclaration.parent;
} else if (tp.isThisType) {
tpScope = tpDeclaration;
@@ -59096,8 +59272,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return some(firstIdentifierSymbol.declarations, (idDecl) => isNodeDescendantOf(idDecl, tpScope)) || some(node2.typeArguments, containsReference);
}
return true;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return !node2.type && !!node2.body || some(node2.typeParameters, containsReference) || some(node2.parameters, containsReference) || !!node2.type && containsReference(node2.type);
}
return !!forEachChild(node2, containsReference);
@@ -59328,32 +59504,32 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
}
function isContextSensitive(node) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
switch (node.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
return isContextSensitiveFunctionLikeDeclaration(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return some(node.properties, isContextSensitive);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return some(node.elements, isContextSensitive);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right));
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return isContextSensitive(node.initializer);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isContextSensitive(node.expression);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return some(node.properties, isContextSensitive) || isJsxOpeningElement(node.parent) && some(node.parent.parent.children, isContextSensitive);
- case 294 /* JsxAttribute */: {
+ case 297 /* JsxAttribute */: {
const { initializer } = node;
return !!initializer && isContextSensitive(initializer);
}
- case 297 /* JsxExpression */: {
+ case 300 /* JsxExpression */: {
const { expression } = node;
return !!expression && isContextSensitive(expression);
}
@@ -59364,7 +59540,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
}
function hasContextSensitiveReturnExpression(node) {
- return !node.typeParameters && !getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 242 /* Block */ && isContextSensitive(node.body);
+ return !node.typeParameters && !getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 244 /* Block */ && isContextSensitive(node.body);
}
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func);
@@ -59437,23 +59613,23 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
switch (node.kind) {
- case 297 /* JsxExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 300 /* JsxExpression */:
+ case 219 /* ParenthesizedExpression */:
return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (node.operatorToken.kind) {
case 63 /* EqualsToken */:
case 27 /* CommaToken */:
return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
}
break;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer);
}
return false;
@@ -59627,16 +59803,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) {
switch (child.kind) {
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return { errorNode: child, innerExpression: child.expression, nameType };
case 11 /* JsxText */:
if (child.containsOnlyTriviaWhiteSpaces) {
break;
}
return { errorNode: child, innerExpression: void 0, nameType, errorMessage: getInvalidTextDiagnostic() };
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
return { errorNode: child, innerExpression: child, nameType };
default:
return Debug.assertNever(child, "Found invalid jsx child");
@@ -59762,13 +59938,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
}
switch (prop.kind) {
- case 178 /* SetAccessor */:
- case 177 /* GetAccessor */:
- case 174 /* MethodDeclaration */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 180 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 309 /* ShorthandPropertyAssignment */:
yield { errorNode: prop.name, innerExpression: void 0, nameType: type };
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type, errorMessage: isComputedNonLiteralName(prop.name) ? Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 : void 0 };
break;
default:
@@ -59822,7 +59998,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers);
}
const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
- const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 174 /* MethodDeclaration */ && kind !== 173 /* MethodSignature */ && kind !== 176 /* Constructor */;
+ const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 176 /* MethodDeclaration */ && kind !== 175 /* MethodSignature */ && kind !== 178 /* Constructor */;
let result = -1 /* True */;
const sourceThisType = getThisTypeOfSignature(source);
if (sourceThisType && sourceThisType !== voidType) {
@@ -61668,7 +61844,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const sourceSignature = first(sourceSignatures);
const targetSignature = first(targetSignatures);
result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, incompatibleReporter(sourceSignature, targetSignature));
- if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 176 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 176 /* Constructor */)) {
+ if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 178 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 178 /* Constructor */)) {
const constructSignatureToString = (signature) => signatureToString(signature, void 0, 262144 /* WriteArrowStyleSignature */, kind);
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature));
reportError(Diagnostics.Types_of_construct_signatures_are_incompatible);
@@ -62286,7 +62462,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const target = type.target;
if (getObjectFlags(target) & 1 /* Class */) {
const baseTypeNode = getBaseTypeNodeOfClass(target);
- if (baseTypeNode && baseTypeNode.expression.kind !== 79 /* Identifier */ && baseTypeNode.expression.kind !== 211 /* PropertyAccessExpression */) {
+ if (baseTypeNode && baseTypeNode.expression.kind !== 79 /* Identifier */ && baseTypeNode.expression.kind !== 213 /* PropertyAccessExpression */) {
return void 0;
}
}
@@ -62653,12 +62829,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let diagnostic;
switch (declaration.kind) {
- case 227 /* BinaryExpression */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 229 /* BinaryExpression */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
diagnostic = noImplicitAny ? Diagnostics.Member_0_implicitly_has_an_1_type : Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
const param = declaration;
if (isIdentifier(param.name) && (isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(param, param.name.escapedText, 788968 /* Type */, void 0, param.name.escapedText, true) || param.name.originalKeywordKind && isTypeNodeKind(param.name.originalKeywordKind))) {
const newName = "arg" + param.parent.parameters.indexOf(param);
@@ -62668,22 +62844,22 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
diagnostic = Diagnostics.Binding_element_0_implicitly_has_an_1_type;
if (!noImplicitAny) {
return;
}
break;
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
return;
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
if (noImplicitAny && !declaration.name) {
if (wideningKind === 3 /* GeneratorYield */) {
error(declaration, Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString);
@@ -62694,7 +62870,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
diagnostic = !noImplicitAny ? Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage : wideningKind === 3 /* GeneratorYield */ ? Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type;
break;
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
if (noImplicitAny) {
error(declaration, Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type);
}
@@ -62791,7 +62967,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function inferFromIntraExpressionSites(context) {
if (context.intraExpressionInferenceSites) {
for (const { node, type } of context.intraExpressionInferenceSites) {
- const contextualType = node.kind === 174 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */);
+ const contextualType = node.kind === 176 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */);
if (contextualType) {
inferTypes(context.inferences, type, contextualType);
}
@@ -62843,8 +63019,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isNonGenericTopLevelType(type) {
if (type.aliasSymbol && !type.aliasTypeArguments) {
- const declaration = getDeclarationOfKind(type.aliasSymbol, 268 /* TypeAliasDeclaration */);
- return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 314 /* SourceFile */ ? true : n.kind === 270 /* ModuleDeclaration */ ? false : "quit"));
+ const declaration = getDeclarationOfKind(type.aliasSymbol, 271 /* TypeAliasDeclaration */);
+ return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 317 /* SourceFile */ ? true : n.kind === 273 /* ModuleDeclaration */ ? false : "quit"));
}
return false;
}
@@ -63589,7 +63765,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function inferFromSignature(source, target) {
const saveBivariant = bivariant;
const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
- bivariant = bivariant || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 176 /* Constructor */;
+ bivariant = bivariant || kind === 176 /* MethodDeclaration */ || kind === 175 /* MethodSignature */ || kind === 178 /* Constructor */;
applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
bivariant = saveBivariant;
applyToReturnTypes(source, target, inferFromTypes);
@@ -63745,7 +63921,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function;
}
default:
- if (node.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.parent.kind === 309 /* ShorthandPropertyAssignment */) {
return Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;
} else {
return Diagnostics.Cannot_find_name_0;
@@ -63770,7 +63946,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isInTypeQuery(node) {
return !!findAncestor(
node,
- (n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 79 /* Identifier */ || n.kind === 165 /* QualifiedName */ ? false : "quit"
+ (n) => n.kind === 188 /* TypeQuery */ ? true : n.kind === 79 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
);
}
function getFlowCacheKey(node, declaredType, initialType, flowContainer) {
@@ -63782,59 +63958,59 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
case 109 /* ThisKeyword */:
return `0|${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}`;
- case 236 /* NonNullExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
const left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer);
return left && left + "." + node.right.escapedText;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const propName = getAccessedPropertyName(node);
if (propName !== void 0) {
const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
return key && key + "." + propName;
}
break;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
return `${getNodeId(node)}#${getTypeId(declaredType)}`;
}
return void 0;
}
function isMatchingReference(source, target) {
switch (target.kind) {
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return isMatchingReference(source, target.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isAssignmentExpression(target) && isMatchingReference(source, target.left) || isBinaryExpression(target) && target.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source, target.right);
}
switch (source.kind) {
- case 237 /* MetaProperty */:
- return target.kind === 237 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText;
+ case 239 /* MetaProperty */:
+ return target.kind === 239 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText;
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
- return isThisInTypeQuery(source) ? target.kind === 109 /* ThisKeyword */ : target.kind === 79 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || (target.kind === 261 /* VariableDeclaration */ || target.kind === 208 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
+ return isThisInTypeQuery(source) ? target.kind === 109 /* ThisKeyword */ : target.kind === 79 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || (target.kind === 263 /* VariableDeclaration */ || target.kind === 210 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
case 109 /* ThisKeyword */:
return target.kind === 109 /* ThisKeyword */;
case 107 /* SuperKeyword */:
return target.kind === 107 /* SuperKeyword */;
- case 236 /* NonNullExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
return isMatchingReference(source.expression, target);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const sourcePropertyName = getAccessedPropertyName(source);
const targetPropertyName = isAccessExpression(target) ? getAccessedPropertyName(target) : void 0;
return sourcePropertyName !== void 0 && targetPropertyName !== void 0 && targetPropertyName === sourcePropertyName && isMatchingReference(source.expression, target.expression);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return isAccessExpression(target) && source.right.escapedText === getAccessedPropertyName(target) && isMatchingReference(source.left, target.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isBinaryExpression(source) && source.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source.right, target);
}
return false;
@@ -63984,7 +64160,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getMatchingUnionConstituentForObjectLiteral(unionType, node) {
const keyPropertyName = getKeyPropertyName(unionType);
- const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 305 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer));
+ const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 308 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer));
const propType = propNode && getContextFreeTypeOfExpression(propNode.initializer);
return propType && getConstituentTypeForKeyType(unionType, propType);
}
@@ -63999,7 +64175,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (expression.expression.kind === 211 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) {
+ if (expression.expression.kind === 213 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) {
return true;
}
return false;
@@ -64160,11 +64336,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, void 0) || errorType);
}
function getAssignedTypeOfBinaryExpression(node) {
- const isDestructuringDefaultAssignment = node.parent.kind === 209 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 305 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);
+ const isDestructuringDefaultAssignment = node.parent.kind === 211 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 308 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);
return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right);
}
function isDestructuringAssignmentTarget(parent2) {
- return parent2.parent.kind === 227 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 251 /* ForOfStatement */ && parent2.parent.initializer === parent2;
+ return parent2.parent.kind === 229 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 253 /* ForOfStatement */ && parent2.parent.initializer === parent2;
}
function getAssignedTypeOfArrayLiteralElement(node, element) {
return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element));
@@ -64181,21 +64357,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getAssignedType(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return stringType;
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return checkRightHandSideOfForOf(parent2) || errorType;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return getAssignedTypeOfBinaryExpression(parent2);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return undefinedType;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return getAssignedTypeOfArrayLiteralElement(parent2, node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return getAssignedTypeOfSpreadExpression(parent2);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getAssignedTypeOfPropertyAssignment(parent2);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return getAssignedTypeOfShorthandPropertyAssignment(parent2);
}
return errorType;
@@ -64203,7 +64379,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getInitialTypeOfBindingElement(node) {
const pattern = node.parent;
const parentType = getInitialType(pattern.parent);
- const type = pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType);
+ const type = pattern.kind === 208 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType);
return getTypeWithDefault(type, node.initializer);
}
function getTypeOfInitializer(node) {
@@ -64214,25 +64390,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.initializer) {
return getTypeOfInitializer(node.initializer);
}
- if (node.parent.parent.kind === 250 /* ForInStatement */) {
+ if (node.parent.parent.kind === 252 /* ForInStatement */) {
return stringType;
}
- if (node.parent.parent.kind === 251 /* ForOfStatement */) {
+ if (node.parent.parent.kind === 253 /* ForOfStatement */) {
return checkRightHandSideOfForOf(node.parent.parent) || errorType;
}
return errorType;
}
function getInitialType(node) {
- return node.kind === 261 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node);
+ return node.kind === 263 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node);
}
function isEmptyArrayAssignment(node) {
- return node.kind === 261 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 208 /* BindingElement */ && node.parent.kind === 227 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right);
+ return node.kind === 263 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 210 /* BindingElement */ && node.parent.kind === 229 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right);
}
function getReferenceCandidate(node) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return getReferenceCandidate(node.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (node.operatorToken.kind) {
case 63 /* EqualsToken */:
case 75 /* BarBarEqualsToken */:
@@ -64247,10 +64423,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getReferenceRoot(node) {
const { parent: parent2 } = node;
- return parent2.kind === 217 /* ParenthesizedExpression */ || parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 63 /* EqualsToken */ && parent2.left === node || parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 27 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node;
+ return parent2.kind === 219 /* ParenthesizedExpression */ || parent2.kind === 229 /* BinaryExpression */ && parent2.operatorToken.kind === 63 /* EqualsToken */ && parent2.left === node || parent2.kind === 229 /* BinaryExpression */ && parent2.operatorToken.kind === 27 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node;
}
function getTypeOfSwitchClause(clause) {
- if (clause.kind === 298 /* CaseClause */) {
+ if (clause.kind === 301 /* CaseClause */) {
return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression));
}
return neverType;
@@ -64266,12 +64442,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return links.switchTypes;
}
function getSwitchClauseTypeOfWitnesses(switchStatement) {
- if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 298 /* CaseClause */ && !isStringLiteralLike(clause.expression))) {
+ if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 301 /* CaseClause */ && !isStringLiteralLike(clause.expression))) {
return void 0;
}
const witnesses = [];
for (const clause of switchStatement.caseBlock.clauses) {
- const text = clause.kind === 298 /* CaseClause */ ? clause.expression.text : void 0;
+ const text = clause.kind === 301 /* CaseClause */ ? clause.expression.text : void 0;
witnesses.push(text && !contains(witnesses, text) ? text : void 0);
}
return witnesses;
@@ -64421,8 +64597,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isEvolvingArrayOperationTarget(node) {
const root = getReferenceRoot(node);
const parent2 = root.parent;
- const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 213 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name));
- const isElementAssignment = parent2.kind === 212 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 227 /* BinaryExpression */ && parent2.parent.operatorToken.kind === 63 /* EqualsToken */ && parent2.parent.left === parent2 && !isAssignmentTarget(parent2.parent) && isTypeAssignableToKind(getTypeOfExpression(parent2.argumentExpression), 296 /* NumberLike */);
+ const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 215 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name));
+ const isElementAssignment = parent2.kind === 214 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 229 /* BinaryExpression */ && parent2.parent.operatorToken.kind === 63 /* EqualsToken */ && parent2.parent.left === parent2 && !isAssignmentTarget(parent2.parent) && isTypeAssignableToKind(getTypeOfExpression(parent2.argumentExpression), 296 /* NumberLike */);
return isLengthPushOrUnshift || isElementAssignment;
}
function isDeclarationWithExplicitTypeAnnotation(node) {
@@ -64445,7 +64621,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isDeclarationWithExplicitTypeAnnotation(declaration)) {
return getTypeOfSymbol(symbol);
}
- if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) {
+ if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 253 /* ForOfStatement */) {
const statement = declaration.parent.parent;
const expressionType = getTypeOfDottedName(statement.expression, void 0);
if (expressionType) {
@@ -64469,7 +64645,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getExplicitThisType(node);
case 107 /* SuperKeyword */:
return checkSuperExpression(node);
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const type = getTypeOfDottedName(node.expression, diagnostic);
if (type) {
const name = node.name;
@@ -64486,7 +64662,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return void 0;
}
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return getTypeOfDottedName(node.expression, diagnostic);
}
}
@@ -64496,7 +64672,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let signature = links.effectsSignature;
if (signature === void 0) {
let funcType;
- if (node.parent.kind === 245 /* ExpressionStatement */) {
+ if (node.parent.kind === 247 /* ExpressionStatement */) {
funcType = getTypeOfDottedName(node.expression, void 0);
} else if (node.expression.kind !== 107 /* SuperKeyword */) {
if (isOptionalChain(node)) {
@@ -64538,7 +64714,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isFalseExpression(expr) {
const node = skipParentheses(expr, true);
- return node.kind === 96 /* FalseKeyword */ || node.kind === 227 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right));
+ return node.kind === 96 /* FalseKeyword */ || node.kind === 229 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right));
}
function isReachableFlowNodeWorker(flow, noCacheCheck) {
while (true) {
@@ -64637,8 +64813,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const symbol = getResolvedSymbol(node);
return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
}
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
}
return false;
@@ -64658,7 +64834,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode));
sharedFlowCount = sharedFlowStart;
const resultType = getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
- if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 236 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
+ if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 238 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
return declaredType;
}
return resultType === nonNullUnknownType ? unknownType : resultType;
@@ -64727,7 +64903,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
target.antecedents = saveAntecedents;
} else if (flags & 2 /* Start */) {
const container = flow.node;
- if (container && container !== flowContainer && reference.kind !== 211 /* PropertyAccessExpression */ && reference.kind !== 212 /* ElementAccessExpression */ && reference.kind !== 109 /* ThisKeyword */) {
+ if (container && container !== flowContainer && reference.kind !== 213 /* PropertyAccessExpression */ && reference.kind !== 214 /* ElementAccessExpression */ && reference.kind !== 109 /* ThisKeyword */) {
flow = container.flowNode;
continue;
}
@@ -64746,7 +64922,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getInitialOrAssignedType(flow) {
const node = flow.node;
- return getNarrowableTypeForReference(node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference);
+ return getNarrowableTypeForReference(node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference);
}
function getTypeAtFlowAssignment(flow) {
const node = flow.node;
@@ -64776,13 +64952,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (isVariableDeclaration(node) && (isInJSFile(node) || isVarConst(node))) {
const init = getDeclaredExpandoInitializer(node);
- if (init && (init.kind === 218 /* FunctionExpression */ || init.kind === 219 /* ArrowFunction */)) {
+ if (init && (init.kind === 220 /* FunctionExpression */ || init.kind === 221 /* ArrowFunction */)) {
return getTypeAtFlowNode(flow.antecedent);
}
}
return declaredType;
}
- if (isVariableDeclaration(node) && node.parent.parent.kind === 250 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
+ if (isVariableDeclaration(node) && node.parent.parent.kind === 252 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))));
}
return void 0;
@@ -64792,7 +64968,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.kind === 96 /* FalseKeyword */) {
return unreachableNeverType;
}
- if (node.kind === 227 /* BinaryExpression */) {
+ if (node.kind === 229 /* BinaryExpression */) {
if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) {
return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right);
}
@@ -64821,13 +64997,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeAtFlowArrayMutation(flow) {
if (declaredType === autoType || declaredType === autoArrayType) {
const node = flow.node;
- const expr = node.kind === 213 /* CallExpression */ ? node.expression.expression : node.left.expression;
+ const expr = node.kind === 215 /* CallExpression */ ? node.expression.expression : node.left.expression;
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
const flowType = getTypeAtFlowNode(flow.antecedent);
const type = getTypeFromFlowType(flowType);
if (getObjectFlags(type) & 256 /* EvolvingArray */) {
let evolvedType2 = type;
- if (node.kind === 213 /* CallExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
for (const arg of node.arguments) {
evolvedType2 = addEvolvingArrayElementType(evolvedType2, arg);
}
@@ -64864,7 +65040,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let type = getTypeFromFlowType(flowType);
if (isMatchingReference(reference, expr)) {
type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
- } else if (expr.kind === 222 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
+ } else if (expr.kind === 224 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
} else {
if (strictNullChecks) {
@@ -64876,7 +65052,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
flow.clauseEnd,
(t) => !(t.flags & (32768 /* Undefined */ | 131072 /* Never */))
);
- } else if (expr.kind === 222 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) {
+ } else if (expr.kind === 224 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) {
type = narrowTypeBySwitchOptionalChainContainment(
type,
flow.switchStatement,
@@ -65125,10 +65301,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const operator = expr.operatorToken.kind;
const left = getReferenceCandidate(expr.left);
const right = getReferenceCandidate(expr.right);
- if (left.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(right)) {
+ if (left.kind === 224 /* TypeOfExpression */ && isStringLiteralLike(right)) {
return narrowTypeByTypeof(type, left, operator, right, assumeTrue);
}
- if (right.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(left)) {
+ if (right.kind === 224 /* TypeOfExpression */ && isStringLiteralLike(left)) {
return narrowTypeByTypeof(type, right, operator, left, assumeTrue);
}
if (isMatchingReference(reference, left)) {
@@ -65326,7 +65502,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!witnesses) {
return type;
}
- const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 299 /* DefaultClause */);
+ const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 302 /* DefaultClause */);
const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd;
if (hasDefaultClause) {
const notEqualFacts = getNotEqualFactsFromTypeofSwitch(clauseStart, clauseEnd, witnesses);
@@ -65479,17 +65655,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
case 109 /* ThisKeyword */:
case 107 /* SuperKeyword */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return narrowTypeByTruthiness(type, expr, assumeTrue);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return narrowTypeByCallExpression(type, expr, assumeTrue);
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return narrowType(type, expr.expression, assumeTrue);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
if (expr.operator === 53 /* ExclamationToken */) {
return narrowType(type, expr.operand, !assumeTrue);
}
@@ -65527,7 +65703,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getNonMissingTypeOfSymbol(symbol);
}
function getControlFlowContainer(node) {
- return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 271 /* ModuleBlock */ || node2.kind === 314 /* SourceFile */ || node2.kind === 171 /* PropertyDeclaration */ || node2.kind === 172 /* AnnotationPropertyDeclaration */);
+ return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 274 /* ModuleBlock */ || node2.kind === 317 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */ || node2.kind === 173 /* AnnotationPropertyDeclaration */);
}
function isSymbolAssigned(symbol) {
if (!symbol.valueDeclaration) {
@@ -65563,7 +65739,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function removeOptionalityFromDeclaredType(declaredType, declaration) {
if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) {
- const annotationIncludesUndefined = strictNullChecks && declaration.kind === 168 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
+ const annotationIncludesUndefined = strictNullChecks && declaration.kind === 169 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
popTypeResolution();
return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
} else {
@@ -65573,7 +65749,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isConstraintPosition(type, node) {
const parent2 = node.parent;
- return parent2.kind === 211 /* PropertyAccessExpression */ || parent2.kind === 165 /* QualifiedName */ || parent2.kind === 213 /* CallExpression */ && parent2.expression === node || parent2.kind === 212 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression)));
+ return parent2.kind === 213 /* PropertyAccessExpression */ || parent2.kind === 166 /* QualifiedName */ || parent2.kind === 215 /* CallExpression */ && parent2.expression === node || parent2.kind === 214 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression)));
}
function isGenericTypeWithUnionConstraint(type) {
return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithUnionConstraint) : !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */));
@@ -65621,14 +65797,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (declaration) {
if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
const parent2 = declaration.parent.parent;
- if (parent2.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent2.kind === 168 /* Parameter */) {
+ if (parent2.kind === 263 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent2.kind === 169 /* Parameter */) {
const links = getNodeLinks(parent2);
if (!(links.flags & 268435456 /* InCheckIdentifier */)) {
links.flags |= 268435456 /* InCheckIdentifier */;
const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
links.flags &= ~268435456 /* InCheckIdentifier */;
- if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 168 /* Parameter */ && isSymbolAssigned(symbol))) {
+ if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
const pattern = declaration.parent;
const narrowedType = getFlowTypeOfReference(pattern, parentTypeConstraint, parentTypeConstraint, void 0, location2.flowNode);
if (narrowedType.flags & 131072 /* Never */) {
@@ -65671,7 +65847,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const container = getContainingFunction(node);
if (languageVersion < 2 /* ES2015 */) {
- if (container.kind === 219 /* ArrowFunction */) {
+ if (container.kind === 221 /* ArrowFunction */) {
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
} else if (hasSyntacticModifier(container, 512 /* Async */)) {
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
@@ -65692,7 +65868,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let declaration = localOrExportSymbol.valueDeclaration;
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
- if (declaration.kind === 264 /* ClassDeclaration */ && nodeIsDecorated(declaration)) {
+ if (declaration.kind === 266 /* ClassDeclaration */ && nodeIsDecorated(declaration)) {
let container = getContainingClass(node);
while (container !== void 0) {
if (container === declaration && container.name !== node) {
@@ -65702,9 +65878,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
container = getContainingClass(container);
}
- } else if (declaration.kind === 232 /* ClassExpression */) {
+ } else if (declaration.kind === 234 /* ClassExpression */) {
let container = getThisContainer(node, false);
- while (container.kind !== 314 /* SourceFile */) {
+ while (container.kind !== 317 /* SourceFile */) {
if (container.parent === declaration) {
if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */;
@@ -65752,16 +65928,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type;
}
type = getNarrowableTypeForReference(type, node, checkMode);
- const isParameter2 = getRootDeclaration(declaration).kind === 168 /* Parameter */;
+ const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */;
const declarationContainer = getControlFlowContainer(declaration);
let flowContainer = getControlFlowContainer(node);
const isOuterVariable = flowContainer !== declarationContainer;
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
- while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 220 /* FunctionExpression */ || flowContainer.kind === 221 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
flowContainer = getControlFlowContainer(flowContainer);
}
- const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || node.parent.kind === 284 /* ExportSpecifier */) || node.parent.kind === 236 /* NonNullExpression */ || declaration.kind === 261 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
+ const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || node.parent.kind === 287 /* ExportSpecifier */) || node.parent.kind === 238 /* NonNullExpression */ || declaration.kind === 263 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
@@ -65811,7 +65987,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return findAncestor(node, (n) => !n || nodeStartsNewLexicalEnvironment(n) ? "quit" : isIterationStatement(n, false));
}
function checkNestedBlockScopedBinding(node, symbol) {
- if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 301 /* CatchClause */) {
+ if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 304 /* CatchClause */) {
return;
}
const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration);
@@ -65821,7 +65997,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isCaptured) {
let capturesBlockScopeBindingInLoopBody = true;
if (isForStatement(container)) {
- const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */);
+ const varDeclList = getAncestor(symbol.valueDeclaration, 264 /* VariableDeclarationList */);
if (varDeclList && varDeclList.parent === container) {
const part = getPartOfForStatementContainingNode(node.parent, container);
if (part) {
@@ -65840,7 +66016,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
if (isForStatement(container)) {
- const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */);
+ const varDeclList = getAncestor(symbol.valueDeclaration, 264 /* VariableDeclarationList */);
if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */;
}
@@ -65857,13 +66033,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isAssignedInBodyOfForStatement(node, container) {
let current = node;
- while (current.parent.kind === 217 /* ParenthesizedExpression */) {
+ while (current.parent.kind === 219 /* ParenthesizedExpression */) {
current = current.parent;
}
let isAssigned = false;
if (isAssignmentTarget(current)) {
isAssigned = true;
- } else if (current.parent.kind === 225 /* PrefixUnaryExpression */ || current.parent.kind === 226 /* PostfixUnaryExpression */) {
+ } else if (current.parent.kind === 227 /* PrefixUnaryExpression */ || current.parent.kind === 228 /* PostfixUnaryExpression */) {
const expr = current.parent;
isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */;
}
@@ -65874,7 +66050,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function captureLexicalThis(node, container) {
getNodeLinks(node).flags |= 2 /* LexicalThis */;
- if (container.kind === 171 /* PropertyDeclaration */ || container.kind === 176 /* Constructor */) {
+ if (container.kind === 172 /* PropertyDeclaration */ || container.kind === 178 /* Constructor */) {
const classNode = container.parent;
getNodeLinks(classNode).flags |= 4 /* CaptureThis */;
} else {
@@ -65908,27 +66084,27 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const isNodeInTypeQuery = isInTypeQuery(node);
let container = getThisContainer(node, true);
let capturedByArrowFunction = false;
- if (container.kind === 176 /* Constructor */) {
+ if (container.kind === 178 /* Constructor */) {
checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class);
}
- if (container.kind === 219 /* ArrowFunction */) {
+ if (container.kind === 221 /* ArrowFunction */) {
container = getThisContainer(container, false);
capturedByArrowFunction = true;
}
checkThisInStaticClassFieldInitializerInDecoratedClass(node, container);
switch (container.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
error(node, Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
error(node, Diagnostics.this_cannot_be_referenced_in_current_location);
break;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
if (isInConstructorArgumentInitializer(node, container)) {
error(node, Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
}
break;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
error(node, Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);
break;
}
@@ -66002,13 +66178,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getClassNameFromPrototypeMethod(container) {
- if (container.kind === 218 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) {
+ if (container.kind === 220 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) {
return container.parent.left.expression.expression;
- } else if (container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) {
+ } else if (container.kind === 176 /* MethodDeclaration */ && container.parent.kind === 212 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) {
return container.parent.parent.left.expression;
- } else if (container.kind === 218 /* FunctionExpression */ && container.parent.kind === 305 /* PropertyAssignment */ && container.parent.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) {
+ } else if (container.kind === 220 /* FunctionExpression */ && container.parent.kind === 308 /* PropertyAssignment */ && container.parent.parent.kind === 212 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) {
return container.parent.parent.parent.left.expression;
- } else if (container.kind === 218 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {
+ } else if (container.kind === 220 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {
return container.parent.parent.parent.arguments[0].expression;
} else if (isMethodDeclaration(container) && isIdentifier(container.name) && (container.name.escapedText === "value" || container.name.escapedText === "get" || container.name.escapedText === "set") && isObjectLiteralExpression(container.parent) && isCallExpression(container.parent.parent) && container.parent.parent.arguments[2] === container.parent && getAssignmentDeclarationKind(container.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {
return container.parent.parent.arguments[0].expression;
@@ -66016,7 +66192,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTypeForThisExpressionFromJSDoc(node) {
const jsdocType = getJSDocType(node);
- if (jsdocType && jsdocType.kind === 326 /* JSDocFunctionType */) {
+ if (jsdocType && jsdocType.kind === 329 /* JSDocFunctionType */) {
const jsDocFunctionType = jsdocType;
if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && jsDocFunctionType.parameters[0].name.escapedText === "this" /* This */) {
return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type);
@@ -66028,16 +66204,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isInConstructorArgumentInitializer(node, constructorDecl) {
- return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 168 /* Parameter */ && n.parent === constructorDecl);
+ return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 169 /* Parameter */ && n.parent === constructorDecl);
}
function checkSuperExpression(node) {
- const isCallExpression2 = node.parent.kind === 213 /* CallExpression */ && node.parent.expression === node;
+ const isCallExpression2 = node.parent.kind === 215 /* CallExpression */ && node.parent.expression === node;
const immediateContainer = getSuperContainer(node, true);
let container = immediateContainer;
let needToCaptureLexicalThis = false;
let inAsyncFunction = false;
if (!isCallExpression2) {
- while (container && container.kind === 219 /* ArrowFunction */) {
+ while (container && container.kind === 221 /* ArrowFunction */) {
if (hasSyntacticModifier(container, 512 /* Async */))
inAsyncFunction = true;
container = getSuperContainer(container, true);
@@ -66049,19 +66225,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const canUseSuperExpression = isLegalUsageOfSuperExpression(container);
let nodeCheckFlag = 0;
if (!canUseSuperExpression) {
- const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 166 /* ComputedPropertyName */);
- if (current && current.kind === 166 /* ComputedPropertyName */) {
+ const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 167 /* ComputedPropertyName */);
+ if (current && current.kind === 167 /* ComputedPropertyName */) {
error(node, Diagnostics.super_cannot_be_referenced_in_a_computed_property_name);
} else if (isCallExpression2) {
error(node, Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors);
- } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 210 /* ObjectLiteralExpression */)) {
+ } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 212 /* ObjectLiteralExpression */)) {
error(node, Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions);
} else {
error(node, Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class);
}
return errorType;
}
- if (!isCallExpression2 && immediateContainer.kind === 176 /* Constructor */) {
+ if (!isCallExpression2 && immediateContainer.kind === 178 /* Constructor */) {
checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class);
}
if (isStatic(container) || isCallExpression2) {
@@ -66077,7 +66253,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
nodeCheckFlag = 256 /* SuperInstance */;
}
getNodeLinks(node).flags |= nodeCheckFlag;
- if (container.kind === 174 /* MethodDeclaration */ && inAsyncFunction) {
+ if (container.kind === 176 /* MethodDeclaration */ && inAsyncFunction) {
if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) {
getNodeLinks(container).flags |= 4096 /* MethodWithSuperPropertyAssignmentInAsync */;
} else {
@@ -66087,7 +66263,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (needToCaptureLexicalThis) {
captureLexicalThis(node.parent, container);
}
- if (container.parent.kind === 210 /* ObjectLiteralExpression */) {
+ if (container.parent.kind === 212 /* ObjectLiteralExpression */) {
if (languageVersion < 2 /* ES2015 */) {
error(node, Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);
return errorType;
@@ -66105,7 +66281,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!baseClassType) {
return errorType;
}
- if (container.kind === 176 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) {
+ if (container.kind === 178 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) {
error(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
return errorType;
}
@@ -66115,13 +66291,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
if (isCallExpression2) {
- return container2.kind === 176 /* Constructor */;
+ return container2.kind === 178 /* Constructor */;
} else {
- if (isClassLike(container2.parent) || container2.parent.kind === 210 /* ObjectLiteralExpression */) {
+ if (isClassLike(container2.parent) || container2.parent.kind === 212 /* ObjectLiteralExpression */) {
if (isStatic(container2)) {
- return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 171 /* PropertyDeclaration */ || container2.kind === 175 /* ClassStaticBlockDeclaration */;
+ return container2.kind === 176 /* MethodDeclaration */ || container2.kind === 175 /* MethodSignature */ || container2.kind === 179 /* GetAccessor */ || container2.kind === 180 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 177 /* ClassStaticBlockDeclaration */;
} else {
- return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 171 /* PropertyDeclaration */ || container2.kind === 170 /* PropertySignature */ || container2.kind === 176 /* Constructor */;
+ return container2.kind === 176 /* MethodDeclaration */ || container2.kind === 175 /* MethodSignature */ || container2.kind === 179 /* GetAccessor */ || container2.kind === 180 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 171 /* PropertySignature */ || container2.kind === 178 /* Constructor */;
}
}
}
@@ -66129,7 +66305,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getContainingObjectLiteral(func) {
- return (func.kind === 174 /* MethodDeclaration */ || func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) && func.parent.kind === 210 /* ObjectLiteralExpression */ ? func.parent : func.kind === 218 /* FunctionExpression */ && func.parent.kind === 305 /* PropertyAssignment */ ? func.parent.parent : void 0;
+ return (func.kind === 176 /* MethodDeclaration */ || func.kind === 179 /* GetAccessor */ || func.kind === 180 /* SetAccessor */) && func.parent.kind === 212 /* ObjectLiteralExpression */ ? func.parent : func.kind === 220 /* FunctionExpression */ && func.parent.kind === 308 /* PropertyAssignment */ ? func.parent.parent : void 0;
}
function getThisTypeArgument(type) {
return getObjectFlags(type) & 4 /* Reference */ && type.target === globalThisType ? getTypeArguments(type)[0] : void 0;
@@ -66140,7 +66316,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
}
function getContextualThisParameterType(func) {
- if (func.kind === 219 /* ArrowFunction */) {
+ if (func.kind === 221 /* ArrowFunction */) {
return void 0;
}
if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
@@ -66164,7 +66340,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (thisType) {
return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral)));
}
- if (literal.parent.kind !== 305 /* PropertyAssignment */) {
+ if (literal.parent.kind !== 308 /* PropertyAssignment */) {
break;
}
literal = literal.parent.parent;
@@ -66173,7 +66349,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getWidenedType(contextualType ? getNonNullableType3(contextualType) : checkExpressionCached(containingLiteral));
}
const parent2 = walkUpParenthesizedExpressions(func.parent);
- if (parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 63 /* EqualsToken */) {
+ if (parent2.kind === 229 /* BinaryExpression */ && parent2.operatorToken.kind === 63 /* EqualsToken */) {
const target = parent2.left;
if (isAccessExpression(target)) {
const { expression } = target;
@@ -66220,11 +66396,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getTypeFromTypeNode(typeNode);
}
switch (declaration.kind) {
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return getContextuallyTypedParameterType(declaration);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getContextualTypeForBindingElement(declaration, contextFlags);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (isStatic(declaration)) {
return getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags);
}
@@ -66233,10 +66409,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getContextualTypeForBindingElement(declaration, contextFlags) {
const parent2 = declaration.parent.parent;
const name = declaration.propertyName || declaration.name;
- const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 208 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */);
+ const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 210 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */);
if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name))
return void 0;
- if (parent2.name.kind === 207 /* ArrayBindingPattern */) {
+ if (parent2.name.kind === 209 /* ArrayBindingPattern */) {
const index = indexOfNode(declaration.parent.elements, declaration);
if (index < 0)
return void 0;
@@ -66369,7 +66545,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return signatureHasRestParameter(signature) && argIndex >= restIndex ? getIndexedAccessType(getTypeOfSymbol(signature.parameters[restIndex]), getNumberLiteralType(argIndex - restIndex), 256 /* Contextual */) : getTypeAtPosition(signature, argIndex);
}
function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {
- if (template.parent.kind === 215 /* TaggedTemplateExpression */) {
+ if (template.parent.kind === 217 /* TaggedTemplateExpression */) {
return getContextualTypeForArgument(template.parent, substitutionExpression);
}
return void 0;
@@ -66628,10 +66804,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
case 157 /* UndefinedKeyword */:
return true;
- case 211 /* PropertyAccessExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 219 /* ParenthesizedExpression */:
return isPossiblyDiscriminantValue(node.expression);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return !node.expression || isPossiblyDiscriminantValue(node.expression);
}
return false;
@@ -66641,7 +66817,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
contextualType,
concatenate(
map(
- filter(node.properties, (p) => !!p.symbol && p.kind === 305 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName)),
+ filter(node.properties, (p) => !!p.symbol && p.kind === 308 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName)),
(prop) => [() => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
),
map(
@@ -66661,7 +66837,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
contextualType,
concatenate(
map(
- filter(node.properties, (p) => !!p.symbol && p.kind === 294 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))),
+ filter(node.properties, (p) => !!p.symbol && p.kind === 297 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))),
(prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
),
map(
@@ -66718,63 +66894,63 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 210 /* BindingElement */:
return getContextualTypeForInitializerExpression(node, contextFlags);
- case 219 /* ArrowFunction */:
- case 254 /* ReturnStatement */:
+ case 221 /* ArrowFunction */:
+ case 256 /* ReturnStatement */:
return getContextualTypeForReturnExpression(node, contextFlags);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return getContextualTypeForYieldOperand(parent2, contextFlags);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return getContextualTypeForAwaitOperand(parent2, contextFlags);
- case 213 /* CallExpression */:
- case 220 /* EtsComponentExpression */:
+ case 215 /* CallExpression */:
+ case 222 /* EtsComponentExpression */:
if (isInEtsFile(parent2) && parent2.expression.kind === 101 /* ImportKeyword */) {
return stringType;
}
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return getContextualTypeForArgument(parent2, node);
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return isConstTypeReference(parent2.type) ? tryFindWhenConstTypeReference(parent2) : getTypeFromTypeNode(parent2.type);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return getContextualTypeForBinaryOperand(node, contextFlags);
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return getContextualTypeForObjectLiteralElement(parent2, contextFlags);
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return getContextualType2(parent2.parent, contextFlags);
- case 209 /* ArrayLiteralExpression */: {
+ case 211 /* ArrayLiteralExpression */: {
const arrayLiteral = parent2;
const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags);
return getContextualTypeForElementExpression(type, indexOfNode(arrayLiteral.elements, node));
}
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return getContextualTypeForConditionalOperand(node, contextFlags);
- case 240 /* TemplateSpan */:
- Debug.assert(parent2.parent.kind === 229 /* TemplateExpression */);
+ case 242 /* TemplateSpan */:
+ Debug.assert(parent2.parent.kind === 231 /* TemplateExpression */);
return getContextualTypeForSubstitutionExpression(parent2.parent, node);
- case 217 /* ParenthesizedExpression */: {
+ case 219 /* ParenthesizedExpression */: {
const tag = isInJSFile(parent2) ? getJSDocTypeTag(parent2) : void 0;
return !tag ? getContextualType2(parent2, contextFlags) : isJSDocTypeTag(tag) && isConstTypeReference(tag.typeExpression.type) ? tryFindWhenConstTypeReference(parent2) : getTypeFromTypeNode(tag.typeExpression.type);
}
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return getContextualType2(parent2, contextFlags);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return getTypeFromTypeNode(parent2.type);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return tryGetTypeFromEffectiveTypeNode(parent2);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return getContextualTypeForJsxExpression(parent2, contextFlags);
- case 294 /* JsxAttribute */:
- case 296 /* JsxSpreadAttribute */:
+ case 297 /* JsxAttribute */:
+ case 299 /* JsxSpreadAttribute */:
return getContextualTypeForJsxAttribute(parent2, contextFlags);
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return getContextualJsxElementAttributesType(parent2, contextFlags);
}
return void 0;
@@ -66996,7 +67172,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return isFunctionExpressionOrArrowFunction(node) || isObjectLiteralMethod(node) ? getContextualSignature(node) : void 0;
}
function getContextualSignature(node) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
const typeTagSignature = getSignatureOfTypeTag(node);
if (typeTagSignature) {
return typeTagSignature;
@@ -67037,7 +67213,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type;
}
function hasDefaultValue(node) {
- return node.kind === 208 /* BindingElement */ && !!node.initializer || node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */;
+ return node.kind === 210 /* BindingElement */ && !!node.initializer || node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */;
}
function checkArrayLiteral(node, checkMode, forceTuple) {
const elements = node.elements;
@@ -67050,7 +67226,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let hasOmittedExpression = false;
for (let i = 0; i < elementCount; i++) {
const e = elements[i];
- if (e.kind === 231 /* SpreadElement */) {
+ if (e.kind === 233 /* SpreadElement */) {
if (languageVersion < 2 /* ES2015 */) {
checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
}
@@ -67066,7 +67242,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
elementTypes.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, e.expression));
elementFlags.push(4 /* Rest */);
}
- } else if (exactOptionalPropertyTypes && e.kind === 233 /* OmittedExpression */) {
+ } else if (exactOptionalPropertyTypes && e.kind === 235 /* OmittedExpression */) {
hasOmittedExpression = true;
elementTypes.push(missingType);
elementFlags.push(2 /* Optional */);
@@ -67103,7 +67279,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isNumericName(name) {
switch (name.kind) {
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return isNumericComputedName(name);
case 79 /* Identifier */:
return isNumericLiteralName(name.escapedText);
@@ -67120,7 +67296,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkComputedPropertyName(node) {
const links = getNodeLinks(node.expression);
if (!links.resolvedType) {
- if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 102 /* InKeyword */ && node.parent.kind !== 177 /* GetAccessor */ && node.parent.kind !== 178 /* SetAccessor */) {
+ if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 102 /* InKeyword */ && node.parent.kind !== 179 /* GetAccessor */ && node.parent.kind !== 180 /* SetAccessor */) {
return links.resolvedType = errorType;
}
links.resolvedType = checkExpression(node.expression);
@@ -67179,7 +67355,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let propertiesArray = [];
let spread = emptyObjectType;
const contextualType = getApparentTypeOfContextualType(node, void 0);
- const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 206 /* ObjectBindingPattern */ || contextualType.pattern.kind === 210 /* ObjectLiteralExpression */);
+ const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 208 /* ObjectBindingPattern */ || contextualType.pattern.kind === 212 /* ObjectLiteralExpression */);
const inConstContext = isConstContext(node);
const checkFlags = inConstContext ? 8 /* Readonly */ : 0;
const isInJavascript = isInJSFile(node) && !isInJsonFile(node);
@@ -67198,9 +67374,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let offset = 0;
for (const memberDecl of node.properties) {
let member = getSymbolOfNode(memberDecl);
- const computedNameType = memberDecl.name && memberDecl.name.kind === 166 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
- if (memberDecl.kind === 305 /* PropertyAssignment */ || memberDecl.kind === 306 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
- let type = memberDecl.kind === 305 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : memberDecl.kind === 306 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode);
+ const computedNameType = memberDecl.name && memberDecl.name.kind === 167 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
+ if (memberDecl.kind === 308 /* PropertyAssignment */ || memberDecl.kind === 309 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
+ let type = memberDecl.kind === 308 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : memberDecl.kind === 309 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode);
if (isInJavascript) {
const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
if (jsDocType) {
@@ -67217,7 +67393,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
prop.nameType = nameType;
}
if (inDestructuringPattern) {
- const isOptional = memberDecl.kind === 305 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 306 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer;
+ const isOptional = memberDecl.kind === 308 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 309 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer;
if (isOptional) {
prop.flags |= 16777216 /* Optional */;
}
@@ -67243,16 +67419,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
prop.target = member;
member = prop;
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
- if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 305 /* PropertyAssignment */ || memberDecl.kind === 174 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
+ if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 308 /* PropertyAssignment */ || memberDecl.kind === 176 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
const inferenceContext = getInferenceContext(node);
Debug.assert(inferenceContext);
- const inferenceNode = memberDecl.kind === 305 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
+ const inferenceNode = memberDecl.kind === 308 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type);
}
if (type.symbol && type.symbol.flags & 268435456 /* Annotation */) {
error(memberDecl, Diagnostics.Annotation_cannot_be_used_as_a_value);
}
- } else if (memberDecl.kind === 307 /* SpreadAssignment */) {
+ } else if (memberDecl.kind === 310 /* SpreadAssignment */) {
if (languageVersion < 2 /* ES2015 */) {
checkExternalEmitHelpers(memberDecl, 2 /* Assign */);
}
@@ -67281,7 +67457,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
continue;
} else {
- Debug.assert(memberDecl.kind === 177 /* GetAccessor */ || memberDecl.kind === 178 /* SetAccessor */);
+ Debug.assert(memberDecl.kind === 179 /* GetAccessor */ || memberDecl.kind === 180 /* SetAccessor */);
checkNodeDeferred(memberDecl);
}
if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) {
@@ -67305,13 +67481,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (contextualTypeHasPattern) {
const rootPatternParent = findAncestor(
contextualType.pattern.parent,
- (n) => n.kind === 261 /* VariableDeclaration */ || n.kind === 227 /* BinaryExpression */ || n.kind === 168 /* Parameter */
+ (n) => n.kind === 263 /* VariableDeclaration */ || n.kind === 229 /* BinaryExpression */ || n.kind === 169 /* Parameter */
);
const spreadOrOutsideRootObject = findAncestor(
node,
- (n) => n === rootPatternParent || n.kind === 307 /* SpreadAssignment */
+ (n) => n === rootPatternParent || n.kind === 310 /* SpreadAssignment */
);
- if (spreadOrOutsideRootObject.kind !== 307 /* SpreadAssignment */) {
+ if (spreadOrOutsideRootObject.kind !== 310 /* SpreadAssignment */) {
for (const prop of getPropertiesOfType(contextualType)) {
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
if (!(prop.flags & 16777216 /* Optional */)) {
@@ -67440,7 +67616,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
} else {
- Debug.assert(attributeDecl.kind === 296 /* JsxSpreadAttribute */);
+ Debug.assert(attributeDecl.kind === 299 /* JsxSpreadAttribute */);
if (attributesTable.size > 0) {
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false);
attributesTable = createSymbolTable();
@@ -67465,7 +67641,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false);
}
}
- const parent2 = openingLikeElement.parent.kind === 287 /* JsxElement */ ? openingLikeElement.parent : void 0;
+ const parent2 = openingLikeElement.parent.kind === 290 /* JsxElement */ ? openingLikeElement.parent : void 0;
if (parent2 && parent2.openingElement === openingLikeElement && parent2.children.length > 0) {
const childrenTypes = checkJsxChildren(parent2, checkMode);
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
@@ -67511,7 +67687,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!child.containsOnlyTriviaWhiteSpaces) {
childrenTypes.push(stringType);
}
- } else if (child.kind === 297 /* JsxExpression */ && !child.expression) {
+ } else if (child.kind === 300 /* JsxExpression */ && !child.expression) {
continue;
} else {
childrenTypes.push(checkExpressionForMutableLocation(child, checkMode));
@@ -67828,7 +68004,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkPropertyAccessibility(node, isSuper, writing, type, prop, reportError = true) {
- const errorNode = !reportError ? void 0 : node.kind === 165 /* QualifiedName */ ? node.right : node.kind === 205 /* ImportType */ ? node : node.kind === 208 /* BindingElement */ && node.propertyName ? node.propertyName : node.name;
+ const errorNode = !reportError ? void 0 : node.kind === 166 /* QualifiedName */ ? node.right : node.kind === 207 /* ImportType */ ? node : node.kind === 210 /* BindingElement */ && node.propertyName ? node.propertyName : node.name;
return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode);
}
function checkPropertyAccessibilityAtLocation(location2, isSuper, writing, containingType, prop, errorNode) {
@@ -68041,7 +68217,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return checkPropertyAccessExpressionOrQualifiedName(node, node.left, leftType, node.right, checkMode);
}
function isMethodAccessForCall(node) {
- while (node.parent.kind === 217 /* ParenthesizedExpression */) {
+ while (node.parent.kind === 219 /* ParenthesizedExpression */) {
node = node.parent;
}
return isCallOrNewExpression(node.parent) && node.parent.expression === node;
@@ -68196,7 +68372,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return isErrorType(apparentType) ? errorType : apparentType;
}
- prop = getPropertyOfType(apparentType, right.escapedText, false, node.kind === 165 /* QualifiedName */);
+ prop = getPropertyOfType(apparentType, right.escapedText, false, node.kind === 166 /* QualifiedName */);
if (!prop) {
const etsComponentExpressionNode = getEtsComponentExpressionInnerCallExpressionNode(node) || getRootEtsComponentInnerCallExpressionNode(node);
const locals = getSourceFileOfNode(node).locals;
@@ -68221,7 +68397,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 308 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {
+ if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 311 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {
markAliasReferenced(parentSymbol, node);
}
let propType;
@@ -68319,7 +68495,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (declaration && isPropertyWithoutInitializer(declaration)) {
if (!isStatic(declaration)) {
const flowContainer = getControlFlowContainer(node);
- if (flowContainer.kind === 176 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 16777216 /* Ambient */)) {
+ if (flowContainer.kind === 178 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 16777216 /* Ambient */)) {
assumeUninitialized = true;
}
}
@@ -68363,7 +68539,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!needInitialization && !(hasRequireDecorator && checkStructPropertyPosition(valueDeclaration, node))) {
diagnosticMessage = error(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
}
- } else if (valueDeclaration.kind === 264 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 16777216 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
+ } else if (valueDeclaration.kind === 266 /* ClassDeclaration */ && node.parent.kind !== 185 /* TypeReference */ && !(valueDeclaration.flags & 16777216 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
diagnosticMessage = error(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
}
if (diagnosticMessage) {
@@ -68376,25 +68552,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isInPropertyInitializerOrClassStaticBlock(node) {
return !!findAncestor(node, (node2) => {
switch (node2.kind) {
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return true;
- case 305 /* PropertyAssignment */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 307 /* SpreadAssignment */:
- case 166 /* ComputedPropertyName */:
- case 240 /* TemplateSpan */:
- case 297 /* JsxExpression */:
- case 294 /* JsxAttribute */:
- case 295 /* JsxAttributes */:
- case 296 /* JsxSpreadAttribute */:
- case 289 /* JsxOpeningElement */:
- case 234 /* ExpressionWithTypeArguments */:
- case 300 /* HeritageClause */:
+ case 308 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 310 /* SpreadAssignment */:
+ case 167 /* ComputedPropertyName */:
+ case 242 /* TemplateSpan */:
+ case 300 /* JsxExpression */:
+ case 297 /* JsxAttribute */:
+ case 298 /* JsxAttributes */:
+ case 299 /* JsxSpreadAttribute */:
+ case 292 /* JsxOpeningElement */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 303 /* HeritageClause */:
return false;
- case 219 /* ArrowFunction */:
- case 245 /* ExpressionStatement */:
+ case 221 /* ArrowFunction */:
+ case 247 /* ExpressionStatement */:
return isBlock(node2.parent) && isClassStaticBlockDeclaration(node2.parent.parent) ? true : "quit";
default:
return isExpressionNode(node2) ? false : "quit";
@@ -68629,18 +68805,18 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isValidPropertyAccess(node, propertyName) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return isValidPropertyAccessWithType(node, node.expression.kind === 107 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression)));
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return isValidPropertyAccessWithType(node, false, propertyName, getWidenedType(checkExpression(node.left)));
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return isValidPropertyAccessWithType(node, false, propertyName, getTypeFromTypeNode(node));
}
}
function isValidPropertyAccessForCompletions(node, type, property) {
return isPropertyAccessible(
node,
- node.kind === 211 /* PropertyAccessExpression */ && node.expression.kind === 107 /* SuperKeyword */,
+ node.kind === 213 /* PropertyAccessExpression */ && node.expression.kind === 107 /* SuperKeyword */,
false,
type,
property
@@ -68665,7 +68841,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getForInVariableSymbol(node) {
const initializer = node.initializer;
- if (initializer.kind === 262 /* VariableDeclarationList */) {
+ if (initializer.kind === 264 /* VariableDeclarationList */) {
const variable = initializer.declarations[0];
if (variable && !isBindingPattern(variable.name)) {
return getSymbolOfNode(variable);
@@ -68686,7 +68862,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let child = expr;
let node = expr.parent;
while (node) {
- if (node.kind === 250 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
+ if (node.kind === 252 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
return true;
}
child = node;
@@ -68730,11 +68906,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (callLikeExpressionMayHaveTypeArguments(node)) {
forEach(node.typeArguments, checkSourceElement);
}
- if (node.kind === 215 /* TaggedTemplateExpression */) {
+ if (node.kind === 217 /* TaggedTemplateExpression */) {
checkExpression(node.template);
} else if (isJsxOpeningLikeElement(node)) {
checkExpression(node.attributes);
- } else if (node.kind !== 169 /* Decorator */) {
+ } else if (node.kind !== 170 /* Decorator */) {
forEach(node.arguments, (argument) => {
checkExpression(argument);
});
@@ -68779,7 +68955,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isSpreadArgument(arg) {
- return !!arg && (arg.kind === 231 /* SpreadElement */ || arg.kind === 238 /* SyntheticExpression */ && arg.isSpread);
+ return !!arg && (arg.kind === 233 /* SpreadElement */ || arg.kind === 240 /* SyntheticExpression */ && arg.isSpread);
}
function getSpreadArgumentIndex(args) {
return findIndex(args, isSpreadArgument);
@@ -68795,9 +68971,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let callIsIncomplete = false;
let effectiveParameterCount = getParameterCount(signature);
let effectiveMinimumArguments = getMinArgumentCount(signature);
- if (node.kind === 215 /* TaggedTemplateExpression */) {
+ if (node.kind === 217 /* TaggedTemplateExpression */) {
argCount = args.length;
- if (node.template.kind === 229 /* TemplateExpression */) {
+ if (node.template.kind === 231 /* TemplateExpression */) {
const lastSpan = last(node.template.templateSpans);
callIsIncomplete = nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated;
} else {
@@ -68805,7 +68981,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
Debug.assert(templateLiteral.kind === 14 /* NoSubstitutionTemplateLiteral */);
callIsIncomplete = !!templateLiteral.isUnterminated;
}
- } else if (node.kind === 169 /* Decorator */) {
+ } else if (node.kind === 170 /* Decorator */) {
argCount = getDecoratorArgumentCount(node, signature);
} else if (isJsxOpeningLikeElement(node)) {
callIsIncomplete = node.attributes.end === node.end;
@@ -68816,7 +68992,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
effectiveParameterCount = args.length === 0 ? effectiveParameterCount : 1;
effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1);
} else if (!node.arguments) {
- Debug.assert(node.kind === 214 /* NewExpression */);
+ Debug.assert(node.kind === 216 /* NewExpression */);
return getMinArgumentCount(signature) === 0;
} else {
argCount = signatureHelpTrailingComma ? args.length + 1 : args.length;
@@ -68897,7 +69073,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isJsxOpeningLikeElement(node)) {
return inferJsxTypeArguments(node, signature, checkMode, context);
}
- if (node.kind !== 169 /* Decorator */) {
+ if (node.kind !== 170 /* Decorator */) {
const skipBindingPatterns = every(signature.typeParameters, (p) => !!getDefaultFromTypeParameter(p));
const contextualType = getContextualType2(node, skipBindingPatterns ? 8 /* SkipBindingPatterns */ : 0 /* None */);
if (contextualType) {
@@ -68934,7 +69110,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
for (let i = 0; i < argCount; i++) {
const arg = args[i];
- if (arg.kind !== 233 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
+ if (arg.kind !== 235 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
const paramType = getTypeAtPosition(signature, i);
if (couldContainTypeVariables(paramType)) {
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -68955,7 +69131,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (index >= argCount - 1) {
const arg = args[argCount - 1];
if (isSpreadArgument(arg)) {
- return getMutableArrayOrTupleType(arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode));
+ return getMutableArrayOrTupleType(arg.kind === 240 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode));
}
}
const types = [];
@@ -68964,12 +69140,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
for (let i = index; i < argCount; i++) {
const arg = args[i];
if (isSpreadArgument(arg)) {
- const spreadType = arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression);
+ const spreadType = arg.kind === 240 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression);
if (isArrayLikeType2(spreadType)) {
types.push(spreadType);
flags.push(8 /* Variadic */);
} else {
- types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 231 /* SpreadElement */ ? arg.expression : arg));
+ types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 233 /* SpreadElement */ ? arg.expression : arg));
flags.push(4 /* Rest */);
}
} else {
@@ -68979,7 +69155,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType));
flags.push(1 /* Required */);
}
- if (arg.kind === 238 /* SyntheticExpression */ && arg.tupleNameSource) {
+ if (arg.kind === 240 /* SyntheticExpression */ && arg.tupleNameSource) {
names.push(arg.tupleNameSource);
}
}
@@ -69122,7 +69298,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
const thisType = getThisTypeOfSignature(signature);
- if (thisType && thisType !== voidType && node.kind !== 214 /* NewExpression */) {
+ if (thisType && thisType !== voidType && node.kind !== 216 /* NewExpression */) {
const thisArgumentNode = getThisArgumentOfCall(node);
const thisArgumentType = getThisArgumentType(thisArgumentNode);
const errorNode = reportErrors2 ? thisArgumentNode || node : void 0;
@@ -69137,7 +69313,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length;
for (let i = 0; i < argCount; i++) {
const arg = args[i];
- if (arg.kind !== 233 /* OmittedExpression */) {
+ if (arg.kind !== 235 /* OmittedExpression */) {
const paramType = getTypeAtPosition(signature, i);
const argType = checkExpressionWithContextualType(arg, paramType, void 0, checkMode);
const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;
@@ -69172,7 +69348,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getThisArgumentOfCall(node) {
- const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : void 0;
+ const expression = node.kind === 215 /* CallExpression */ ? node.expression : node.kind === 217 /* TaggedTemplateExpression */ ? node.tag : void 0;
if (expression) {
const callee = skipOuterExpressions(expression);
if (isAccessExpression(callee)) {
@@ -69187,17 +69363,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
}
function getEffectiveCallArguments(node) {
- if (node.kind === 215 /* TaggedTemplateExpression */) {
+ if (node.kind === 217 /* TaggedTemplateExpression */) {
const template = node.template;
const args2 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())];
- if (template.kind === 229 /* TemplateExpression */) {
+ if (template.kind === 231 /* TemplateExpression */) {
forEach(template.templateSpans, (span) => {
args2.push(span.expression);
});
}
return args2;
}
- if (node.kind === 169 /* Decorator */) {
+ if (node.kind === 170 /* Decorator */) {
return getEffectiveDecoratorArguments(node);
}
if (isJsxOpeningLikeElement(node)) {
@@ -69209,7 +69385,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const effectiveArgs = args.slice(0, spreadIndex);
for (let i = spreadIndex; i < args.length; i++) {
const arg = args[i];
- const spreadType = arg.kind === 231 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
+ const spreadType = arg.kind === 233 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
if (spreadType && isTupleType(spreadType)) {
forEach(getTypeArguments(spreadType), (t, i2) => {
var _a2;
@@ -69234,30 +69410,30 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const parent2 = node.parent;
const expr = node.expression;
switch (parent2.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return [
createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent2)))
];
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
const func = parent2.parent;
return [
- createSyntheticExpression(expr, parent2.parent.kind === 176 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),
+ createSyntheticExpression(expr, parent2.parent.kind === 178 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),
createSyntheticExpression(expr, anyType),
createSyntheticExpression(expr, numberType)
];
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent2) || hasAccessorModifier(parent2));
return [
createSyntheticExpression(expr, getParentTypeOfClassElement(parent2)),
createSyntheticExpression(expr, getClassElementPropertyKeyType(parent2)),
createSyntheticExpression(expr, hasPropDesc ? createTypedPropertyDescriptorType(getTypeOfNode(parent2)) : anyType)
];
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (isEtsFunctionDecorators(getNameOfDecorator(node), compilerOptions)) {
const symbol = getSymbolOfNode(expr);
return symbol ? [
@@ -69270,19 +69446,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getDecoratorArgumentCount(node, signature) {
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return 1;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return hasAccessorModifier(node.parent) ? 3 : 2;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return 3;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (isEtsFunctionDecorators(getNameOfDecorator(node), compilerOptions)) {
return isCallExpression(node.expression) ? 1 : 0;
}
@@ -69409,10 +69585,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
}
function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) {
- const isTaggedTemplate = node.kind === 215 /* TaggedTemplateExpression */;
- const isDecorator2 = node.kind === 169 /* Decorator */;
+ const isTaggedTemplate = node.kind === 217 /* TaggedTemplateExpression */;
+ const isDecorator2 = node.kind === 170 /* Decorator */;
const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
- const isEtsComponentExpression2 = node.kind === 220 /* EtsComponentExpression */;
+ const isEtsComponentExpression2 = node.kind === 222 /* EtsComponentExpression */;
const reportErrors2 = !candidatesOutArray;
let typeArguments;
let virtual;
@@ -69442,7 +69618,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let candidateForArgumentArityError;
let candidateForTypeArgumentError;
let result;
- const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 213 /* CallExpression */ && node.arguments.hasTrailingComma;
+ const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 215 /* CallExpression */ && node.arguments.hasTrailingComma;
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
}
@@ -69892,7 +70068,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const declaration = signature.declaration;
const modifiers = getSelectedEffectiveModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */);
- if (!modifiers || declaration.kind !== 176 /* Constructor */) {
+ if (!modifiers || declaration.kind !== 178 /* Constructor */) {
return true;
}
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol);
@@ -70034,19 +70210,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getDiagnosticHeadMessageForDecoratorResolution(node) {
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
const decoratorName = getNameOfDecorator(node);
if (isEtsFunctionDecorators(decoratorName, compilerOptions)) {
return Diagnostics.Unable_to_resolve_signature_of_function_decorator_when_decorators_are_not_valid;
@@ -70206,20 +70382,20 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function resolveSignature(node, candidatesOutArray, checkMode) {
switch (node.kind) {
- case 213 /* CallExpression */:
- case 220 /* EtsComponentExpression */:
+ case 215 /* CallExpression */:
+ case 222 /* EtsComponentExpression */:
return resolveCallExpression(node, candidatesOutArray, checkMode);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return resolveNewExpression(node, candidatesOutArray, checkMode);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
if (isAnnotation(node)) {
return resolveAnnotation(node);
}
return resolveDecorator(node, candidatesOutArray, checkMode);
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode);
}
}
@@ -70324,7 +70500,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
let parent2 = node.parent;
- while (parent2 && parent2.kind === 211 /* PropertyAccessExpression */) {
+ while (parent2 && parent2.kind === 213 /* PropertyAccessExpression */) {
parent2 = parent2.parent;
}
if (parent2 && isBinaryExpression(parent2) && isPrototypeAccess(parent2.left) && parent2.operatorToken.kind === 63 /* EqualsToken */) {
@@ -70343,9 +70519,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.expression.kind === 107 /* SuperKeyword */) {
return voidType;
}
- if (node.kind === 214 /* NewExpression */) {
+ if (node.kind === 216 /* NewExpression */) {
const declaration = signature.declaration;
- if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
+ if (declaration && declaration.kind !== 178 /* Constructor */ && declaration.kind !== 182 /* ConstructSignature */ && declaration.kind !== 187 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
if (noImplicitAny) {
error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);
}
@@ -70359,7 +70535,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) {
return getESSymbolLikeTypeForNode(walkUpParenthesizedExpressions(node.parent));
}
- if (node.kind === 213 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 245 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) {
+ if (node.kind === 215 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 247 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) {
if (!isDottedName(node.expression)) {
error(node.expression, Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);
} else if (!getEffectsSignature(node)) {
@@ -70379,7 +70555,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.expression, Diagnostics.UI_component_0_cannot_be_used_in_this_place, diagnosticName(node.expression));
}
const signatureDeclaration = signature.declaration;
- if (node.kind === 213 /* CallExpression */ && signatureDeclaration && !isJSDocSignature(signatureDeclaration) && (isMethodDeclaration(signatureDeclaration) || isMethodSignature(signatureDeclaration) || isFunctionDeclaration(signatureDeclaration))) {
+ if (node.kind === 215 /* CallExpression */ && signatureDeclaration && !isJSDocSignature(signatureDeclaration) && (isMethodDeclaration(signatureDeclaration) || isMethodSignature(signatureDeclaration) || isFunctionDeclaration(signatureDeclaration))) {
if (shouldCheckThrows(signatureDeclaration) && !hasAsyncErrorCallbacks(signatureDeclaration)) {
checkThrowableFunction(node);
}
@@ -70719,20 +70895,20 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getDeprecatedSuggestionNode(node) {
node = skipParentheses(node);
switch (node.kind) {
- case 213 /* CallExpression */:
- case 169 /* Decorator */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 170 /* Decorator */:
+ case 216 /* NewExpression */:
return getDeprecatedSuggestionNode(node.expression);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return getDeprecatedSuggestionNode(node.tag);
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return getDeprecatedSuggestionNode(node.tagName);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return node.argumentExpression;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return node.name;
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
const typeReference = node;
return isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference;
default:
@@ -70841,7 +71017,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (resolvedRequire.flags & 2097152 /* Alias */) {
return false;
}
- const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 263 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 261 /* VariableDeclaration */ : 0 /* Unknown */;
+ const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 265 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 263 /* VariableDeclaration */ : 0 /* Unknown */;
if (targetDeclarationKind !== 0 /* Unknown */) {
const decl = getDeclarationOfKind(resolvedRequire, targetDeclarationKind);
return !!decl && !!(decl.flags & 16777216 /* Ambient */);
@@ -70859,7 +71035,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getReturnTypeOfSignature(signature);
}
function checkAssertion(node) {
- if (node.kind === 216 /* TypeAssertionExpression */) {
+ if (node.kind === 218 /* TypeAssertionExpression */) {
const file = getSourceFileOfNode(node);
if (file && fileExtensionIsOneOf(file.fileName, [".cts" /* Cts */, ".mts" /* Mts */])) {
grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
@@ -70875,18 +71051,18 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 9 /* BigIntLiteral */:
case 111 /* TrueKeyword */:
case 96 /* FalseKeyword */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 229 /* TemplateExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 231 /* TemplateExpression */:
return true;
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isValidConstAssertionArgument(node.expression);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const op = node.operator;
const arg = node.operand;
return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = node.expression;
let symbol = getTypeOfNode(expr).symbol;
if (symbol && symbol.flags & 2097152 /* Alias */) {
@@ -70932,7 +71108,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkExpressionWithTypeArguments(node) {
checkGrammarExpressionWithTypeArguments(node);
- const exprType = node.kind === 234 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
+ const exprType = node.kind === 236 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
const typeArguments = node.typeArguments;
if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) {
return exprType;
@@ -71027,7 +71203,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!container) {
error(node, Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target");
return errorType;
- } else if (container.kind === 176 /* Constructor */) {
+ } else if (container.kind === 178 /* Constructor */) {
const symbol = getSymbolOfNode(container.parent);
return getTypeOfSymbol(symbol);
} else {
@@ -71077,7 +71253,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getParameterIdentifierNameAtPosition(signature, pos) {
var _a2;
- if (((_a2 = signature.declaration) == null ? void 0 : _a2.kind) === 326 /* JSDocFunctionType */) {
+ if (((_a2 = signature.declaration) == null ? void 0 : _a2.kind) === 329 /* JSDocFunctionType */) {
return void 0;
}
const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
@@ -71109,7 +71285,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return symbol.valueDeclaration && isParameter(symbol.valueDeclaration) && isIdentifier(symbol.valueDeclaration.name);
}
function isValidDeclarationForTupleLabel(d) {
- return d.kind === 202 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name);
+ return d.kind === 204 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name);
}
function getNameableDeclarationAtPosition(signature, pos) {
const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
@@ -71368,7 +71544,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let yieldType;
let nextType;
let fallbackReturnType = voidType;
- if (func.body.kind !== 242 /* Block */) {
+ if (func.body.kind !== 244 /* Block */) {
returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */);
if (isAsync) {
returnType = unwrapAwaitedType(checkAwaitedType(returnType, false, func, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member));
@@ -71502,7 +71678,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return links.isExhaustive;
}
function computeExhaustiveSwitchStatement(node) {
- if (node.expression.kind === 222 /* TypeOfExpression */) {
+ if (node.expression.kind === 224 /* TypeOfExpression */) {
const witnesses = getSwitchClauseTypeOfWitnesses(node);
if (!witnesses) {
return false;
@@ -71557,11 +71733,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function mayReturnNever(func) {
switch (func.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
- case 174 /* MethodDeclaration */:
- return func.parent.kind === 210 /* ObjectLiteralExpression */;
+ case 176 /* MethodDeclaration */:
+ return func.parent.kind === 212 /* ObjectLiteralExpression */;
default:
return false;
}
@@ -71603,7 +71779,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return judgeReturnTypeOfStyles();
}
}
- if (func.kind === 173 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 242 /* Block */ || !functionHasImplicitReturn(func)) {
+ if (func.kind === 175 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 244 /* Block */ || !functionHasImplicitReturn(func)) {
return;
}
const hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */;
@@ -71639,7 +71815,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
checkNodeDeferred(node);
if (isFunctionExpression(node)) {
checkCollisionsForDeclarationName(node, node.name);
@@ -71662,7 +71838,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return anyFunctionType;
}
const hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
- if (!hasGrammarError && node.kind === 218 /* FunctionExpression */) {
+ if (!hasGrammarError && node.kind === 220 /* FunctionExpression */) {
checkGrammarForGenerator(node);
}
contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -71706,7 +71882,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
const functionFlags = getFunctionFlags(node);
const returnType = getReturnTypeFromAnnotation(node);
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
@@ -71714,7 +71890,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!getEffectiveReturnTypeNode(node)) {
getReturnTypeOfSignature(getSignatureFromDeclaration(node));
}
- if (node.body.kind === 242 /* Block */) {
+ if (node.body.kind === 244 /* Block */) {
checkSourceElement(node.body);
} else {
const exprType = checkExpression(node.body);
@@ -71780,7 +71956,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isReadonlySymbol(symbol)) {
if (symbol.flags & 4 /* Property */ && isAccessExpression(expr) && expr.expression.kind === 109 /* ThisKeyword */) {
const ctor = getContainingFunction(expr);
- if (!(ctor && (ctor.kind === 176 /* Constructor */ || isJSConstructor(ctor)))) {
+ if (!(ctor && (ctor.kind === 178 /* Constructor */ || isJSConstructor(ctor)))) {
return true;
}
if (symbol.valueDeclaration) {
@@ -71801,7 +71977,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const symbol2 = getNodeLinks(node).resolvedSymbol;
if (symbol2.flags & 2097152 /* Alias */) {
const declaration = getDeclarationOfAliasSymbol(symbol2);
- return !!declaration && declaration.kind === 277 /* NamespaceImport */;
+ return !!declaration && declaration.kind === 280 /* NamespaceImport */;
}
}
}
@@ -71906,7 +72082,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!hasParseDiagnostics(sourceFile)) {
const span = getSpanOfTokenAtPosition(sourceFile, node.pos);
const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);
- if (container && container.kind !== 176 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) {
+ if (container && container.kind !== 178 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) {
const relatedInfo = createDiagnosticForNode(container, Diagnostics.Did_you_mean_to_mark_this_function_as_async);
addRelatedInfo(diagnostic, relatedInfo);
}
@@ -72099,7 +72275,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis = false) {
const properties = node.properties;
const property = properties[propertyIndex];
- if (property.kind === 305 /* PropertyAssignment */ || property.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (property.kind === 308 /* PropertyAssignment */ || property.kind === 309 /* ShorthandPropertyAssignment */) {
const name = property.name;
const exprType = getLiteralTypeFromPropertyName(name);
if (isTypeUsableAsPropertyName(exprType)) {
@@ -72112,8 +72288,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const elementType = getIndexedAccessType(objectLiteralType, exprType, 32 /* ExpressionPosition */, name);
const type = getFlowTypeOfDestructuring(property, elementType);
- return checkDestructuringAssignment(property.kind === 306 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);
- } else if (property.kind === 307 /* SpreadAssignment */) {
+ return checkDestructuringAssignment(property.kind === 309 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);
+ } else if (property.kind === 310 /* SpreadAssignment */) {
if (propertyIndex < properties.length - 1) {
error(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
} else {
@@ -72145,7 +72321,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let inBoundsType = compilerOptions.noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType;
for (let i = 0; i < elements.length; i++) {
let type = possiblyOutOfBoundsType;
- if (node.elements[i].kind === 231 /* SpreadElement */) {
+ if (node.elements[i].kind === 233 /* SpreadElement */) {
type = inBoundsType = inBoundsType != null ? inBoundsType : checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType;
}
checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode);
@@ -72155,8 +72331,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) {
const elements = node.elements;
const element = elements[elementIndex];
- if (element.kind !== 233 /* OmittedExpression */) {
- if (element.kind !== 231 /* SpreadElement */) {
+ if (element.kind !== 235 /* OmittedExpression */) {
+ if (element.kind !== 233 /* SpreadElement */) {
const indexType = getNumberLiteralType(elementIndex);
if (isArrayLikeType2(sourceType)) {
const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(element) ? 16 /* NoTupleBoundsCheck */ : 0);
@@ -72171,7 +72347,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
} else {
const restExpression = element.expression;
- if (restExpression.kind === 227 /* BinaryExpression */ && restExpression.operatorToken.kind === 63 /* EqualsToken */) {
+ if (restExpression.kind === 229 /* BinaryExpression */ && restExpression.operatorToken.kind === 63 /* EqualsToken */) {
error(restExpression.operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer);
} else {
checkGrammarForDisallowedTrailingComma(node.elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);
@@ -72184,7 +72360,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) {
let target;
- if (exprOrAssignment.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (exprOrAssignment.kind === 309 /* ShorthandPropertyAssignment */) {
const prop = exprOrAssignment;
if (prop.objectAssignmentInitializer) {
if (strictNullChecks && !(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216 /* IsUndefined */)) {
@@ -72196,25 +72372,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
target = exprOrAssignment;
}
- if (target.kind === 227 /* BinaryExpression */ && target.operatorToken.kind === 63 /* EqualsToken */) {
+ if (target.kind === 229 /* BinaryExpression */ && target.operatorToken.kind === 63 /* EqualsToken */) {
checkBinaryExpression(target, checkMode);
target = target.left;
if (strictNullChecks) {
sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);
}
}
- if (target.kind === 210 /* ObjectLiteralExpression */) {
+ if (target.kind === 212 /* ObjectLiteralExpression */) {
return checkObjectLiteralAssignment(target, sourceType, rightIsThis);
}
- if (target.kind === 209 /* ArrayLiteralExpression */) {
+ if (target.kind === 211 /* ArrayLiteralExpression */) {
return checkArrayLiteralAssignment(target, sourceType, checkMode);
}
return checkReferenceAssignment(target, sourceType, checkMode);
}
function checkReferenceAssignment(target, sourceType, checkMode) {
const targetType = checkExpression(target, checkMode);
- const error2 = target.parent.kind === 307 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;
- const optionalError = target.parent.kind === 307 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;
+ const error2 = target.parent.kind === 310 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;
+ const optionalError = target.parent.kind === 310 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;
if (checkReferenceExpression(target, error2, optionalError)) {
checkTypeAssignableToAndOptionallyElaborate(sourceType, targetType, target, target);
}
@@ -72229,8 +72405,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
case 10 /* StringLiteral */:
case 13 /* RegularExpressionLiteral */:
- case 215 /* TaggedTemplateExpression */:
- case 229 /* TemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 231 /* TemplateExpression */:
case 14 /* NoSubstitutionTemplateLiteral */:
case 8 /* NumericLiteral */:
case 9 /* BigIntLiteral */:
@@ -72238,25 +72414,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 96 /* FalseKeyword */:
case 105 /* NullKeyword */:
case 157 /* UndefinedKeyword */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
- case 219 /* ArrowFunction */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 222 /* TypeOfExpression */:
- case 236 /* NonNullExpression */:
- case 288 /* JsxSelfClosingElement */:
- case 287 /* JsxElement */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 224 /* TypeOfExpression */:
+ case 238 /* NonNullExpression */:
+ case 291 /* JsxSelfClosingElement */:
+ case 290 /* JsxElement */:
return true;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isAssignmentOperator(node.operatorToken.kind)) {
return false;
}
return isSideEffectFree(node.left) && isSideEffectFree(node.right);
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
switch (node.operator) {
case 53 /* ExclamationToken */:
case 39 /* PlusToken */:
@@ -72265,9 +72441,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
return false;
- case 223 /* VoidExpression */:
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 225 /* VoidExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
default:
return false;
}
@@ -72303,7 +72479,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
checkGrammarNullishCoalesceWithLogicalExpression(node);
const operator = node.operatorToken.kind;
- if (operator === 63 /* EqualsToken */ && (node.left.kind === 210 /* ObjectLiteralExpression */ || node.left.kind === 209 /* ArrayLiteralExpression */)) {
+ if (operator === 63 /* EqualsToken */ && (node.left.kind === 212 /* ObjectLiteralExpression */ || node.left.kind === 211 /* ArrayLiteralExpression */)) {
state.skip = true;
setLastResult(state, checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 109 /* ThisKeyword */));
return state;
@@ -72325,7 +72501,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) {
if (operator === 55 /* AmpersandAmpersandToken */) {
let parent2 = node.parent;
- while (parent2.kind === 217 /* ParenthesizedExpression */ || isBinaryExpression(parent2) && (parent2.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || parent2.operatorToken.kind === 56 /* BarBarToken */)) {
+ while (parent2.kind === 219 /* ParenthesizedExpression */ || isBinaryExpression(parent2) && (parent2.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || parent2.operatorToken.kind === 56 /* BarBarToken */)) {
parent2 = parent2.parent;
}
checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent2) ? parent2.thenStatement : void 0);
@@ -72392,7 +72568,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) {
const operator = operatorToken.kind;
- if (operator === 63 /* EqualsToken */ && (left.kind === 210 /* ObjectLiteralExpression */ || left.kind === 209 /* ArrayLiteralExpression */)) {
+ if (operator === 63 /* EqualsToken */ && (left.kind === 212 /* ObjectLiteralExpression */ || left.kind === 211 /* ArrayLiteralExpression */)) {
return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 109 /* ThisKeyword */);
}
let leftType;
@@ -72830,7 +73006,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */));
}
function getContextNode2(node) {
- if (node.kind === 295 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) {
+ if (node.kind === 298 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) {
return node.parent.parent;
}
return node;
@@ -72871,12 +73047,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isTypeAssertion3(node) {
node = skipParentheses(node, true);
- return node.kind === 216 /* TypeAssertionExpression */ || node.kind === 235 /* AsExpression */ || isJSDocTypeAssertion(node);
+ return node.kind === 218 /* TypeAssertionExpression */ || node.kind === 237 /* AsExpression */ || isJSDocTypeAssertion(node);
}
function checkDeclarationInitializer(declaration, checkMode, contextualType) {
const initializer = getEffectiveInitializer(declaration);
const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, void 0, checkMode || 0 /* Normal */) : checkExpressionCached(initializer, checkMode));
- return isParameter(declaration) && declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type;
+ return isParameter(declaration) && declaration.name.kind === 209 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type;
}
function padTupleType(type, pattern) {
const patternElements = pattern.elements;
@@ -72884,7 +73060,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const elementFlags = type.target.elementFlags.slice();
for (let i = getTypeReferenceArity(type); i < patternElements.length; i++) {
const e = patternElements[i];
- if (i < patternElements.length - 1 || !(e.kind === 208 /* BindingElement */ && e.dotDotDotToken)) {
+ if (i < patternElements.length - 1 || !(e.kind === 210 /* BindingElement */ && e.dotDotDotToken)) {
elementTypes.push(!isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, false, false) : anyType);
elementFlags.push(2 /* Optional */);
if (!isOmittedExpression(e) && !hasDefaultValue(e)) {
@@ -72930,14 +73106,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) : isTypeAssertion3(node) ? type : getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType2(node, void 0) : contextualType, node, void 0));
}
function checkPropertyAssignment(node, checkMode) {
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
return checkExpressionForMutableLocation(node.initializer, checkMode);
}
function checkObjectLiteralMethod(node, checkMode) {
checkGrammarMethod(node);
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
const uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -73143,7 +73319,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type;
}
function checkConstEnumAccess(node, type) {
- const ok = node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 79 /* Identifier */ || node.kind === 165 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 186 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 284 /* ExportSpecifier */;
+ const ok = node.parent.kind === 213 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 214 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 79 /* Identifier */ || node.kind === 166 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 188 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 287 /* ExportSpecifier */;
if (!ok) {
error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);
}
@@ -73166,9 +73342,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
}
@@ -73199,87 +73375,87 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return trueType;
case 96 /* FalseKeyword */:
return falseType;
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return checkTemplateExpression(node);
case 13 /* RegularExpressionLiteral */:
return globalRegExpType;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return checkArrayLiteral(node, checkMode, forceTuple);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return checkObjectLiteral(node, checkMode);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return checkPropertyAccessExpression(node, checkMode);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return checkQualifiedName(node, checkMode);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return checkIndexedAccess(node, checkMode);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (node.expression.kind === 101 /* ImportKeyword */) {
return checkImportCallExpression(node);
}
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return checkCallExpression(node, checkMode);
- case 220 /* EtsComponentExpression */:
+ case 222 /* EtsComponentExpression */:
const newNode = node;
if (newNode.body && newNode.body.statements.length) {
traverseEtsComponentStatements(newNode.body.statements, checkMode);
}
return checkCallExpression(node, checkMode);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return checkTaggedTemplateExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return checkParenthesizedExpression(node, checkMode);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return checkClassExpression(node);
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return checkTypeOfExpression(node);
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return checkAssertion(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return checkNonNullAssertion(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return checkExpressionWithTypeArguments(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return checkSatisfiesExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return checkMetaProperty(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return checkDeleteExpression(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return checkVoidExpression(node);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return checkAwaitExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return checkPrefixUnaryExpression(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return checkPostfixUnaryExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return checkBinaryExpression(node, checkMode);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return checkConditionalExpression(node, checkMode);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return checkSpreadExpression(node, checkMode);
- case 233 /* OmittedExpression */:
+ case 235 /* OmittedExpression */:
return undefinedWideningType;
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return checkYieldExpression(node);
- case 238 /* SyntheticExpression */:
+ case 240 /* SyntheticExpression */:
return checkSyntheticExpression(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return checkJsxExpression(node, checkMode);
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return checkJsxElement(node, checkMode);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return checkJsxSelfClosingElement(node, checkMode);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return checkJsxFragment(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return checkJsxAttributes(node, checkMode);
- case 289 /* JsxOpeningElement */:
+ case 292 /* JsxOpeningElement */:
Debug.fail("Shouldn't ever directly check a JsxOpeningElement");
}
return errorType;
@@ -73364,10 +73540,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkVariableLikeDeclaration(node);
const func = getContainingFunction(node);
if (hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) {
- if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) {
+ if (!(func.kind === 178 /* Constructor */ && nodeIsPresent(func.body))) {
error(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
}
- if (func.kind === 176 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") {
+ if (func.kind === 178 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") {
error(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name);
}
}
@@ -73378,13 +73554,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (func.parameters.indexOf(node) !== 0) {
error(node, Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText);
}
- if (func.kind === 176 /* Constructor */ || func.kind === 180 /* ConstructSignature */ || func.kind === 185 /* ConstructorType */) {
+ if (func.kind === 178 /* Constructor */ || func.kind === 182 /* ConstructSignature */ || func.kind === 187 /* ConstructorType */) {
error(node, Diagnostics.A_constructor_cannot_have_a_this_parameter);
}
- if (func.kind === 219 /* ArrowFunction */) {
+ if (func.kind === 221 /* ArrowFunction */) {
error(node, Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
}
- if (func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) {
+ if (func.kind === 179 /* GetAccessor */ || func.kind === 180 /* SetAccessor */) {
error(node, Diagnostics.get_and_set_accessors_cannot_declare_this_parameters);
}
}
@@ -73439,13 +73615,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTypePredicateParent(node) {
switch (node.parent.kind) {
- case 219 /* ArrowFunction */:
- case 179 /* CallSignature */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 184 /* FunctionType */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 221 /* ArrowFunction */:
+ case 181 /* CallSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 186 /* FunctionType */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
const parent2 = node.parent;
if (node === parent2.type) {
return parent2;
@@ -73465,7 +73641,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
predicateVariableName
);
return true;
- } else if (name.kind === 207 /* ArrayBindingPattern */ || name.kind === 206 /* ObjectBindingPattern */) {
+ } else if (name.kind === 209 /* ArrayBindingPattern */ || name.kind === 208 /* ObjectBindingPattern */) {
if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(
name,
predicateVariableNode,
@@ -73477,9 +73653,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkSignatureDeclaration(node) {
- if (node.kind === 181 /* IndexSignature */) {
+ if (node.kind === 183 /* IndexSignature */) {
checkGrammarIndexSignature(node);
- } else if (node.kind === 184 /* FunctionType */ || node.kind === 263 /* FunctionDeclaration */ || node.kind === 185 /* ConstructorType */ || node.kind === 179 /* CallSignature */ || node.kind === 176 /* Constructor */ || node.kind === 180 /* ConstructSignature */) {
+ } else if (node.kind === 186 /* FunctionType */ || node.kind === 265 /* FunctionDeclaration */ || node.kind === 187 /* ConstructorType */ || node.kind === 181 /* CallSignature */ || node.kind === 178 /* Constructor */ || node.kind === 182 /* ConstructSignature */) {
checkGrammarFunctionLikeDeclaration(node);
}
const functionFlags = getFunctionFlags(node);
@@ -73506,10 +73682,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const returnTypeNode = getEffectiveReturnTypeNode(node);
if (noImplicitAny && !returnTypeNode) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
error(node, Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
error(node, Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
}
@@ -73531,7 +73707,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkAsyncFunctionReturnType(node, returnTypeNode);
}
}
- if (node.kind !== 181 /* IndexSignature */ && node.kind !== 326 /* JSDocFunctionType */) {
+ if (node.kind !== 183 /* IndexSignature */ && node.kind !== 329 /* JSDocFunctionType */) {
registerForUnusedIdentifiersCheck(node);
}
}
@@ -73541,7 +73717,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const staticNames = new Map2();
const privateIdentifiers = new Map2();
for (const member of node.members) {
- if (member.kind === 176 /* Constructor */) {
+ if (member.kind === 178 /* Constructor */) {
for (const param of member.parameters) {
if (isParameterPropertyDeclaration(param, member) && !isBindingPattern(param.name)) {
addName(instanceNames, param.name, param.name.escapedText, 3 /* GetOrSetAccessor */);
@@ -73559,19 +73735,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const memberName = name && getPropertyNameForPropertyNameNode(name);
if (memberName) {
switch (member.kind) {
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
addName(names, name, memberName, 1 /* GetAccessor */ | privateStaticFlags);
break;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
addName(names, name, memberName, 2 /* SetAccessor */ | privateStaticFlags);
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags);
break;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags);
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
addName(names, name, memberName, 8 /* Method */ | privateStaticFlags);
break;
}
@@ -73624,7 +73800,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkObjectTypeForDuplicateDeclarations(node) {
const names = new Map2();
for (const member of node.members) {
- if (member.kind === 170 /* PropertySignature */) {
+ if (member.kind === 171 /* PropertySignature */) {
let memberName;
const name = member.name;
switch (name.kind) {
@@ -73648,7 +73824,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkTypeForDuplicateIndexSignatures(node) {
- if (node.kind === 267 /* InterfaceDeclaration */) {
+ if (node.kind === 270 /* InterfaceDeclaration */) {
const nodeSymbol = getSymbolOfNode(node);
if (nodeSymbol.declarations && nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {
return;
@@ -73684,7 +73860,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (type.symbol.declarations) {
for (const decl of type.symbol.declarations) {
- if (decl.kind === 269 /* EnumDeclaration */) {
+ if (decl.kind === 272 /* EnumDeclaration */) {
const members = decl.members;
for (let i = 0; i < members.length; ++i) {
if (i > 1 && typeof getConstantValue2(members[i - 1]) !== typeof getConstantValue2(members[i])) {
@@ -73756,7 +73932,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function evaluateAnnotationPropertyConstantExpression(expr) {
switch (expr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const value = evaluateAnnotationPropertyConstantExpression(expr.operand);
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean") {
switch (expr.operator) {
@@ -73775,7 +73951,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const left = evaluateAnnotationPropertyConstantExpression(expr.left);
const right = evaluateAnnotationPropertyConstantExpression(expr.right);
if (left !== void 0 && right !== void 0 && typeof left === typeof right) {
@@ -73844,7 +74020,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
const elements = expr.elements;
const result = new Array(elements.length);
for (let i = 0; i < elements.length; ++i) {
@@ -73868,7 +74044,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
checkGrammarNumericLiteral(expr);
return +expr.text;
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return evaluateAnnotationPropertyConstantExpression(expr.expression);
case 79 /* Identifier */:
if (isInfinityOrNaNString(expr.escapedText)) {
@@ -73882,7 +74058,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return evaluateAnnotationPropertyConstantExpression(symbol.valueDeclaration.initializer);
}
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isConstantMemberAccess(expr)) {
return getConstantValue2(expr);
}
@@ -73901,7 +74077,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
checkVariableLikeDeclaration(node);
setNodeLinksForPrivateIdentifierScope(node);
- if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 171 /* PropertyDeclaration */ && node.initializer) {
+ if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 172 /* PropertyDeclaration */ && node.initializer) {
error(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name));
}
if (isAnnotationPropertyDeclaration(node)) {
@@ -73992,7 +74168,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.name, Diagnostics.Class_constructor_may_not_be_a_generator);
}
checkFunctionOrMethodDeclaration(node);
- if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 174 /* MethodDeclaration */ && node.body) {
+ if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 176 /* MethodDeclaration */ && node.body) {
error(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name));
}
if (isPrivateIdentifier(node.name) && !getContainingClass(node)) {
@@ -74040,7 +74216,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isPrivateIdentifierClassElementDeclaration(n)) {
return true;
}
- return n.kind === 171 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer;
+ return n.kind === 172 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer;
}
function checkConstructorDeclarationDiagnostics() {
const containingClassDecl = node.parent;
@@ -74103,20 +74279,20 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkGrammarComputedPropertyName(node.name);
checkDecorators(node);
checkSignatureDeclaration(node);
- if (node.kind === 177 /* GetAccessor */) {
+ if (node.kind === 179 /* GetAccessor */) {
if (!(node.flags & 16777216 /* Ambient */) && nodeIsPresent(node.body) && node.flags & 256 /* HasImplicitReturn */) {
if (!(node.flags & 512 /* HasExplicitReturn */)) {
error(node.name, Diagnostics.A_get_accessor_must_return_a_value);
}
}
}
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
if (hasBindableName(node)) {
const symbol = getSymbolOfNode(node);
- const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */);
- const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */);
+ const getter = getDeclarationOfKind(symbol, 179 /* GetAccessor */);
+ const setter = getDeclarationOfKind(symbol, 180 /* SetAccessor */);
if (getter && setter && !(getNodeCheckFlags(getter) & 1 /* TypeChecked */)) {
getNodeLinks(getter).flags |= 1 /* TypeChecked */;
const getterFlags = getEffectiveModifierFlags(getter);
@@ -74137,7 +74313,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
const returnType = getTypeOfAccessors(getSymbolOfNode(node));
- if (node.kind === 177 /* GetAccessor */) {
+ if (node.kind === 179 /* GetAccessor */) {
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
}
}
@@ -74192,7 +74368,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkTypeReferenceNode(node) {
checkGrammarTypeArguments(node, node.typeArguments);
- if (node.kind === 183 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) {
+ if (node.kind === 185 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) {
grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
}
forEach(node.typeArguments, checkSourceElement);
@@ -74256,7 +74432,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let seenRestElement = false;
const hasNamedElement = some(elementTypes, isNamedTupleMember);
for (const e of elementTypes) {
- if (e.kind !== 202 /* NamedTupleMember */ && hasNamedElement) {
+ if (e.kind !== 204 /* NamedTupleMember */ && hasNamedElement) {
grammarErrorOnNode(e, Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names);
break;
}
@@ -74301,7 +74477,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const objectType = type.objectType;
const indexType = type.indexType;
if (isTypeAssignableTo(indexType, getIndexType(objectType, false))) {
- if (accessNode.kind === 212 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
+ if (accessNode.kind === 214 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
}
return type;
@@ -74362,7 +74538,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
forEachChild(node, checkSourceElement);
}
function checkInferType(node) {
- if (!findAncestor(node, (n) => n.parent && n.parent.kind === 194 /* ConditionalType */ && n.parent.extendsType === n)) {
+ if (!findAncestor(node, (n) => n.parent && n.parent.kind === 196 /* ConditionalType */ && n.parent.extendsType === n)) {
grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
}
checkSourceElement(node.typeParameter);
@@ -74372,7 +74548,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!links.typeParametersChecked) {
links.typeParametersChecked = true;
const typeParameter = getDeclaredTypeOfTypeParameter(symbol);
- const declarations = getDeclarationsOfKind(symbol, 167 /* TypeParameter */);
+ const declarations = getDeclarationsOfKind(symbol, 168 /* TypeParameter */);
if (!areTypeParametersIdentical(declarations, [typeParameter], (decl) => [decl])) {
const name = symbolToString(symbol);
for (const declaration of declarations) {
@@ -74410,10 +74586,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.dotDotDotToken && node.questionToken) {
grammarErrorOnNode(node, Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest);
}
- if (node.type.kind === 190 /* OptionalType */) {
+ if (node.type.kind === 192 /* OptionalType */) {
grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type);
}
- if (node.type.kind === 191 /* RestType */) {
+ if (node.type.kind === 193 /* RestType */) {
grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type);
}
checkSourceElement(node.type);
@@ -74424,7 +74600,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getEffectiveDeclarationFlags(n, flagsToCheck) {
let flags = getCombinedModifierFlags(n);
- if (n.parent.kind !== 267 /* InterfaceDeclaration */ && n.parent.kind !== 264 /* ClassDeclaration */ && n.parent.kind !== 232 /* ClassExpression */ && n.flags & 16777216 /* Ambient */) {
+ if (n.parent.kind !== 270 /* InterfaceDeclaration */ && n.parent.kind !== 266 /* ClassDeclaration */ && n.parent.kind !== 234 /* ClassExpression */ && n.flags & 16777216 /* Ambient */) {
if (!(flags & 2 /* Ambient */) && !(isModuleBlock(n.parent) && isModuleDeclaration(n.parent.parent) && isGlobalScopeAugmentation(n.parent.parent))) {
flags |= 1 /* Export */;
}
@@ -74497,7 +74673,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const errorNode2 = subsequentNode.name || subsequentNode;
const subsequentName = subsequentNode.name;
if (node.name && subsequentName && (isPrivateIdentifier(node.name) && isPrivateIdentifier(subsequentName) && node.name.escapedText === subsequentName.escapedText || isComputedPropertyName(node.name) && isComputedPropertyName(subsequentName) || isPropertyNameLiteral(node.name) && isPropertyNameLiteral(subsequentName) && getEscapedTextOfIdentifierOrLiteral(node.name) === getEscapedTextOfIdentifierOrLiteral(subsequentName))) {
- const reportError = (node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode);
+ const reportError = (node.kind === 176 /* MethodDeclaration */ || node.kind === 175 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode);
if (reportError) {
const diagnostic = isStatic(node) ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static;
error(errorNode2, diagnostic);
@@ -74529,14 +74705,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
for (const current of declarations) {
const node = current;
const inAmbientContext = node.flags & 16777216 /* Ambient */;
- const inAmbientContextOrInterface = node.parent && (node.parent.kind === 267 /* InterfaceDeclaration */ || node.parent.kind === 187 /* TypeLiteral */) || inAmbientContext;
+ const inAmbientContextOrInterface = node.parent && (node.parent.kind === 270 /* InterfaceDeclaration */ || node.parent.kind === 189 /* TypeLiteral */) || inAmbientContext;
if (inAmbientContextOrInterface) {
previousDeclaration = void 0;
}
- if ((node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */) && !inAmbientContext) {
+ if ((node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */) && !inAmbientContext) {
hasNonAmbientClass = true;
}
- if (node.kind === 263 /* FunctionDeclaration */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 176 /* Constructor */) {
+ if (node.kind === 265 /* FunctionDeclaration */ || node.kind === 176 /* MethodDeclaration */ || node.kind === 175 /* MethodSignature */ || node.kind === 178 /* Constructor */) {
functionDeclarations.push(node);
const currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);
someNodeFlags |= currentNodeFlags;
@@ -74578,9 +74754,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
}
if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 /* Function */ && declarations) {
- const relatedDiagnostics = filter(declarations, (d) => d.kind === 264 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class));
+ const relatedDiagnostics = filter(declarations, (d) => d.kind === 266 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class));
forEach(declarations, (declaration) => {
- const diagnostic = declaration.kind === 264 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 263 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0;
+ const diagnostic = declaration.kind === 266 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 265 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0;
if (diagnostic) {
addRelatedInfo(
error(getNameOfDeclaration(declaration) || declaration, diagnostic, symbolName(symbol)),
@@ -74659,43 +74835,43 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getDeclarationSpaces(decl) {
let d = decl;
switch (d.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return 2 /* ExportType */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return isAmbientModule(d) || getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */;
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
return 2 /* ExportType */ | 1 /* ExportValue */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */;
- case 280 /* ExportAssignment */:
- case 227 /* BinaryExpression */:
+ case 283 /* ExportAssignment */:
+ case 229 /* BinaryExpression */:
const node2 = d;
const expression = isExportAssignment(node2) ? node2.expression : node2.right;
if (!isEntityNameExpression(expression)) {
return 1 /* ExportValue */;
}
d = expression;
- case 274 /* ImportEqualsDeclaration */:
- case 277 /* NamespaceImport */:
- case 276 /* ImportClause */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 280 /* NamespaceImport */:
+ case 279 /* ImportClause */:
let result = 0 /* None */;
const target = resolveAlias(getSymbolOfNode(d));
forEach(target.declarations, (d2) => {
result |= getDeclarationSpaces(d2);
});
return result;
- case 261 /* VariableDeclaration */:
- case 208 /* BindingElement */:
- case 263 /* FunctionDeclaration */:
- case 279 /* ImportSpecifier */:
+ case 263 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 265 /* FunctionDeclaration */:
+ case 282 /* ImportSpecifier */:
case 79 /* Identifier */:
return 1 /* ExportValue */;
default:
@@ -74946,21 +75122,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let headMessage;
let expectedReturnType;
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
const classSymbol = getSymbolOfNode(node.parent);
const classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
expectedReturnType = voidType;
break;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
const methodType = getTypeOfNode(node.parent);
const descriptorType = createTypedPropertyDescriptorType(methodType);
@@ -75006,15 +75182,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getEntityNameForDecoratorMetadata(node) {
if (node) {
switch (node.kind) {
- case 193 /* IntersectionType */:
- case 192 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 194 /* UnionType */:
return getEntityNameForDecoratorMetadataFromTypeList(node.types);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]);
- case 196 /* ParenthesizedType */:
- case 202 /* NamedTupleMember */:
+ case 198 /* ParenthesizedType */:
+ case 204 /* NamedTupleMember */:
return getEntityNameForDecoratorMetadata(node.type);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return node.typeName;
}
}
@@ -75022,13 +75198,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getEntityNameForDecoratorMetadataFromTypeList(types) {
let commonEntityName;
for (let typeNode of types) {
- while (typeNode.kind === 196 /* ParenthesizedType */ || typeNode.kind === 202 /* NamedTupleMember */) {
+ while (typeNode.kind === 198 /* ParenthesizedType */ || typeNode.kind === 204 /* NamedTupleMember */) {
typeNode = typeNode.type;
}
if (typeNode.kind === 145 /* NeverKeyword */) {
continue;
}
- if (!strictNullChecks && (typeNode.kind === 201 /* LiteralType */ && typeNode.literal.kind === 105 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) {
+ if (!strictNullChecks && (typeNode.kind === 203 /* LiteralType */ && typeNode.literal.kind === 105 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) {
continue;
}
const individualEntityName = getEntityNameForDecoratorMetadata(typeNode);
@@ -75088,9 +75264,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
switch (annotatedDecl.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
const enclosingDecl = annotatedDecl.parent;
Debug.assert(isClassDeclaration(enclosingDecl));
if (hasSyntacticModifier(enclosingDecl, 256 /* Abstract */)) {
@@ -75121,10 +75297,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
ident = da.expression;
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
ident = da.expression;
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
ident = getIdentifierFromEntityNameExpression(da.expression.expression);
break;
default:
@@ -75179,13 +75355,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */);
- if (node.kind === 168 /* Parameter */) {
+ if (node.kind === 169 /* Parameter */) {
checkExternalEmitHelpers(firstDecorator, 32 /* Param */);
}
if (compilerOptions.emitDecoratorMetadata) {
checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */);
switch (node.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const constructor = getFirstConstructorWithBody(node);
if (constructor) {
for (const parameter of constructor.parameters) {
@@ -75193,22 +75369,22 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- const otherKind = node.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */;
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ const otherKind = node.kind === 179 /* GetAccessor */ ? 180 /* SetAccessor */ : 179 /* GetAccessor */;
const otherAccessor = getDeclarationOfKind(getSymbolOfNode(node), otherKind);
markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
for (const parameter of node.parameters) {
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
}
markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(node));
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveTypeAnnotationNode(node));
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node));
const containingSignature = node.parent;
for (const parameter of containingSignature.parameters) {
@@ -75306,7 +75482,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
return node;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return node.name;
default:
return void 0;
@@ -75317,7 +75493,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkDecorators(node);
checkSignatureDeclaration(node);
const functionFlags = getFunctionFlags(node);
- if (node.name && node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name && node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
if (hasBindableName(node)) {
@@ -75333,7 +75509,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkFunctionOrConstructorSymbol(symbol);
}
}
- const body = node.kind === 173 /* MethodSignature */ ? void 0 : node.body;
+ const body = node.kind === 175 /* MethodSignature */ ? void 0 : node.body;
checkSourceElement(body);
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node));
addLazyDiagnostic(checkFunctionOrMethodDeclarationDiagnostics);
@@ -75369,43 +75545,43 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) {
for (const node of potentiallyUnusedIdentifiers) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
checkUnusedClassMembers(node, addDiagnostic);
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 314 /* SourceFile */:
- case 270 /* ModuleDeclaration */:
- case 242 /* Block */:
- case 272 /* CaseBlock */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 317 /* SourceFile */:
+ case 273 /* ModuleDeclaration */:
+ case 244 /* Block */:
+ case 275 /* CaseBlock */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
checkUnusedLocalsAndParameters(node, addDiagnostic);
break;
- case 176 /* Constructor */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
if (node.body) {
checkUnusedLocalsAndParameters(node, addDiagnostic);
}
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 195 /* InferType */:
+ case 197 /* InferType */:
checkUnusedInferTypeParameter(node, addDiagnostic);
break;
default:
@@ -75424,11 +75600,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkUnusedClassMembers(node, addDiagnostic) {
for (const member of node.members) {
switch (member.kind) {
- case 174 /* MethodDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- if (member.kind === 178 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) {
+ case 176 /* MethodDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ if (member.kind === 180 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) {
break;
}
const symbol = getSymbolOfNode(member);
@@ -75436,16 +75612,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
addDiagnostic(member, 0 /* Local */, createDiagnosticForNode(member.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
}
break;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
for (const parameter of member.parameters) {
if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter, 8 /* Private */)) {
addDiagnostic(parameter, 0 /* Local */, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol)));
}
}
break;
- case 181 /* IndexSignature */:
- case 241 /* SemicolonClassElement */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 183 /* IndexSignature */:
+ case 243 /* SemicolonClassElement */:
+ case 177 /* ClassStaticBlockDeclaration */:
break;
default:
Debug.fail("Unexpected class member");
@@ -75469,7 +75645,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
const name = idText(typeParameter.name);
const { parent: parent2 } = typeParameter;
- if (parent2.kind !== 195 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) {
+ if (parent2.kind !== 197 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) {
if (tryAddToSet(seenParentsWithEveryUnused, parent2)) {
const sourceFile = getSourceFileOfNode(parent2);
const range = isJSDocTemplateTag(parent2) ? rangeOfNode(parent2) : rangeOfTypeParameters(sourceFile, parent2.typeParameters);
@@ -75549,7 +75725,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
unusedImports.forEach(([importClause, unuseds]) => {
const importDecl = importClause.parent;
- const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 277 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0);
+ const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 280 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0);
if (nDeclarations === unuseds.length) {
addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 ? createDiagnosticForNode(importDecl, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(first(unuseds).name)) : createDiagnosticForNode(importDecl, Diagnostics.All_imports_in_import_declaration_are_unused));
} else {
@@ -75560,7 +75736,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
unusedDestructures.forEach(([bindingPattern, bindingElements]) => {
const kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */;
if (bindingPattern.elements.length === bindingElements.length) {
- if (bindingElements.length === 1 && bindingPattern.parent.kind === 261 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 262 /* VariableDeclarationList */) {
+ if (bindingElements.length === 1 && bindingPattern.parent.kind === 263 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 264 /* VariableDeclarationList */) {
addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId);
} else {
addDiagnostic(bindingPattern, kind, bindingElements.length === 1 ? createDiagnosticForNode(bindingPattern, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(bindingElements).name)) : createDiagnosticForNode(bindingPattern, Diagnostics.All_destructured_elements_are_unused));
@@ -75573,7 +75749,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
unusedVariables.forEach(([declarationList, declarations]) => {
if (declarationList.declarations.length === declarations.length) {
- addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 244 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused));
+ addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 246 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused));
} else {
for (const decl of declarations) {
addDiagnostic(decl, 0 /* Local */, createDiagnosticForNode(decl, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(decl.name)));
@@ -75602,21 +75778,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (name.kind) {
case 79 /* Identifier */:
return idText(name);
- case 207 /* ArrayBindingPattern */:
- case 206 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
return bindingNameText(cast(first(name.elements), isBindingElement).name);
default:
return Debug.assertNever(name);
}
}
function isImportedDeclaration(node) {
- return node.kind === 276 /* ImportClause */ || node.kind === 279 /* ImportSpecifier */ || node.kind === 277 /* NamespaceImport */;
+ return node.kind === 279 /* ImportClause */ || node.kind === 282 /* ImportSpecifier */ || node.kind === 280 /* NamespaceImport */;
}
function importClauseFromImported(decl) {
- return decl.kind === 276 /* ImportClause */ ? decl : decl.kind === 277 /* NamespaceImport */ ? decl.parent : decl.parent.parent;
+ return decl.kind === 279 /* ImportClause */ ? decl : decl.kind === 280 /* NamespaceImport */ ? decl.parent : decl.parent.parent;
}
function checkBlock(node) {
- if (node.kind === 242 /* Block */) {
+ if (node.kind === 244 /* Block */) {
checkGrammarStatementInAmbientContext(node);
}
if (isFunctionOrModuleBlock(node)) {
@@ -75644,7 +75820,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if ((identifier == null ? void 0 : identifier.escapedText) !== name) {
return false;
}
- if (node.kind === 171 /* PropertyDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */ || node.kind === 305 /* PropertyAssignment */) {
+ if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 176 /* MethodDeclaration */ || node.kind === 175 /* MethodSignature */ || node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */ || node.kind === 308 /* PropertyAssignment */) {
return false;
}
if (node.flags & 16777216 /* Ambient */) {
@@ -75700,7 +75876,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const parent2 = getDeclarationContainer(node);
- if (parent2.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(parent2)) {
+ if (parent2.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(parent2)) {
errorSkippedOn(
"noEmit",
name,
@@ -75718,7 +75894,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const parent2 = getDeclarationContainer(node);
- if (parent2.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(parent2) && parent2.flags & 2048 /* HasAsyncFunctions */) {
+ if (parent2.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(parent2) && parent2.flags & 2048 /* HasAsyncFunctions */) {
errorSkippedOn(
"noEmit",
name,
@@ -75800,7 +75976,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if ((getCombinedNodeFlags(node) & 3 /* BlockScoped */) !== 0 || isParameterDeclaration(node)) {
return;
}
- if (node.kind === 261 /* VariableDeclaration */ && !node.initializer) {
+ if (node.kind === 263 /* VariableDeclaration */ && !node.initializer) {
return;
}
const symbol = getSymbolOfNode(node);
@@ -75810,9 +75986,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const localDeclarationSymbol = resolveName(node, node.name.escapedText, 3 /* Variable */, void 0, void 0, false);
if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) {
if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) {
- const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 262 /* VariableDeclarationList */);
- const container = varDeclList.parent.kind === 244 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0;
- const namesShareScope = container && (container.kind === 242 /* Block */ && isFunctionLike(container.parent) || container.kind === 271 /* ModuleBlock */ || container.kind === 270 /* ModuleDeclaration */ || container.kind === 314 /* SourceFile */);
+ const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 264 /* VariableDeclarationList */);
+ const container = varDeclList.parent.kind === 246 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0;
+ const namesShareScope = container && (container.kind === 244 /* Block */ && isFunctionLike(container.parent) || container.kind === 274 /* ModuleBlock */ || container.kind === 273 /* ModuleDeclaration */ || container.kind === 317 /* SourceFile */);
if (!namesShareScope) {
const name = symbolToString(localDeclarationSymbol);
error(node, Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name);
@@ -75833,7 +76009,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!node.name) {
return;
}
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
if (hasOnlyExpressionInitializer(node) && node.initializer) {
checkExpressionCached(node.initializer);
@@ -75847,7 +76023,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ES2018 */) {
checkExternalEmitHelpers(node, 4 /* Rest */);
}
- if (node.propertyName && node.propertyName.kind === 166 /* ComputedPropertyName */) {
+ if (node.propertyName && node.propertyName.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.propertyName);
}
const parent2 = node.parent.parent;
@@ -75867,7 +76043,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
if (isBindingPattern(node.name)) {
- if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
+ if (node.name.kind === 209 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
checkExternalEmitHelpers(node, 512 /* Read */);
}
forEach(node.name.elements, checkSourceElement);
@@ -75877,7 +76053,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
if (isBindingPattern(node.name)) {
- const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 250 /* ForInStatement */;
+ const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 252 /* ForInStatement */;
const needCheckWidenedType = !some(node.name.elements, not(isOmittedExpression));
if (needCheckInitializer || needCheckWidenedType) {
const widenedType = getWidenedTypeForVariableLikeDeclaration(node);
@@ -75900,7 +76076,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const symbol = getSymbolOfNode(node);
- if (symbol.flags & 2097152 /* Alias */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 208 /* BindingElement */ ? node.parent.parent : node)) {
+ if (symbol.flags & 2097152 /* Alias */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 210 /* BindingElement */ ? node.parent.parent : node)) {
checkAliasSymbol(node);
return;
}
@@ -75909,7 +76085,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const initializer = hasOnlyExpressionInitializer(node) && getEffectiveInitializer(node);
if (initializer) {
const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((_a2 = symbol.exports) == null ? void 0 : _a2.size);
- if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 250 /* ForInStatement */) {
+ if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 252 /* ForInStatement */) {
checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, void 0);
}
}
@@ -75930,9 +76106,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name));
}
}
- if (node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 170 /* PropertySignature */ && node.kind !== 172 /* AnnotationPropertyDeclaration */) {
+ if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 173 /* AnnotationPropertyDeclaration */) {
checkExportsOnMergedDeclarations(node);
- if (node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
+ if (node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */) {
checkVarDeclaredNamesNotShadowed(node);
}
checkCollisionsForDeclarationName(node, node.name);
@@ -75940,7 +76116,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) {
const nextDeclarationName = getNameOfDeclaration(nextDeclaration);
- const message = nextDeclaration.kind === 171 /* PropertyDeclaration */ || nextDeclaration.kind === 170 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;
+ const message = nextDeclaration.kind === 172 /* PropertyDeclaration */ || nextDeclaration.kind === 171 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;
const declName = declarationNameToString(nextDeclarationName);
const err = error(
nextDeclarationName,
@@ -75957,7 +76133,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function areDeclarationFlagsIdentical(left, right) {
- if (left.kind === 168 /* Parameter */ && right.kind === 261 /* VariableDeclaration */ || left.kind === 261 /* VariableDeclaration */ && right.kind === 168 /* Parameter */) {
+ if (left.kind === 169 /* Parameter */ && right.kind === 263 /* VariableDeclaration */ || left.kind === 263 /* VariableDeclaration */ && right.kind === 169 /* Parameter */) {
return true;
}
if (hasQuestionToken(left) !== hasQuestionToken(right)) {
@@ -75993,7 +76169,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const type = checkTruthinessExpression(node.expression);
checkTestingKnownTruthyCallableOrAwaitableType(node.expression, type, node.thenStatement);
checkSourceElement(node.thenStatement);
- if (node.thenStatement.kind === 243 /* EmptyStatement */) {
+ if (node.thenStatement.kind === 245 /* EmptyStatement */) {
error(node.thenStatement, Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
}
checkSourceElement(node.elseStatement);
@@ -76109,12 +76285,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkForStatement(node) {
if (!checkGrammarStatementInAmbientContext(node)) {
- if (node.initializer && node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer && node.initializer.kind === 264 /* VariableDeclarationList */) {
checkGrammarVariableDeclarationList(node.initializer);
}
}
if (node.initializer) {
- if (node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind === 264 /* VariableDeclarationList */) {
forEach(node.initializer.declarations, checkVariableDeclaration);
} else {
checkExpression(node.initializer);
@@ -76144,12 +76320,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ES2015 */) {
checkExternalEmitHelpers(node, 256 /* ForOfIncludes */);
}
- if (node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind === 264 /* VariableDeclarationList */) {
checkForInOrForOfVariableDeclaration(node);
} else {
const varExpr = node.initializer;
const iteratedType = checkRightHandSideOfForOf(node);
- if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) {
+ if (varExpr.kind === 211 /* ArrayLiteralExpression */ || varExpr.kind === 212 /* ObjectLiteralExpression */) {
checkDestructuringAssignment(varExpr, iteratedType || errorType);
} else {
const leftType = checkExpression(varExpr);
@@ -76171,7 +76347,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkForInStatement(node) {
checkGrammarForInOrForOfStatement(node);
const rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression));
- if (node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind === 264 /* VariableDeclarationList */) {
const variable = node.initializer.declarations[0];
if (variable && isBindingPattern(variable.name)) {
error(variable.name, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
@@ -76180,7 +76356,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
const varExpr = node.initializer;
const leftType = checkExpression(varExpr);
- if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) {
+ if (varExpr.kind === 211 /* ArrayLiteralExpression */ || varExpr.kind === 212 /* ObjectLiteralExpression */) {
error(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
} else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) {
error(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any);
@@ -76737,11 +76913,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const functionFlags = getFunctionFlags(container);
if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) {
const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
- if (container.kind === 178 /* SetAccessor */) {
+ if (container.kind === 180 /* SetAccessor */) {
if (node.expression) {
error(node, Diagnostics.Setters_cannot_return_a_value);
}
- } else if (container.kind === 176 /* Constructor */) {
+ } else if (container.kind === 178 /* Constructor */) {
if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) {
error(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
}
@@ -76752,7 +76928,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression);
}
}
- } else if (container.kind !== 176 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) {
+ } else if (container.kind !== 178 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) {
error(node, Diagnostics.Not_all_code_paths_return_a_value);
}
}
@@ -76777,7 +76953,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const expressionType = checkExpression(node.expression);
const expressionIsLiteral = isLiteralType3(expressionType);
forEach(node.caseBlock.clauses, (clause) => {
- if (clause.kind === 299 /* DefaultClause */ && !hasDuplicateDefaultClause) {
+ if (clause.kind === 302 /* DefaultClause */ && !hasDuplicateDefaultClause) {
if (firstDefaultClause === void 0) {
firstDefaultClause = clause;
} else {
@@ -76785,7 +76961,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
hasDuplicateDefaultClause = true;
}
}
- if (clause.kind === 298 /* CaseClause */) {
+ if (clause.kind === 301 /* CaseClause */) {
addLazyDiagnostic(createLazyCaseClauseDiagnostics(clause));
}
forEach(clause.statements, checkSourceElement);
@@ -76817,7 +76993,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isFunctionLike(current)) {
return "quit";
}
- if (current.kind === 257 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) {
+ if (current.kind === 259 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) {
grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNode(node.label));
return true;
}
@@ -76901,8 +77077,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const indexInfos = getApplicableIndexInfos(type, propNameType);
- const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 267 /* InterfaceDeclaration */) : void 0;
- const propDeclaration = declaration && declaration.kind === 227 /* BinaryExpression */ || name && name.kind === 166 /* ComputedPropertyName */ ? declaration : void 0;
+ const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 270 /* InterfaceDeclaration */) : void 0;
+ const propDeclaration = declaration && declaration.kind === 229 /* BinaryExpression */ || name && name.kind === 167 /* ComputedPropertyName */ ? declaration : void 0;
const localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : void 0;
for (const info of indexInfos) {
const localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : void 0;
@@ -76926,7 +77102,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkIndexConstraintForIndexSignature(type, checkInfo) {
const declaration = checkInfo.declaration;
const indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
- const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 267 /* InterfaceDeclaration */) : void 0;
+ const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 270 /* InterfaceDeclaration */) : void 0;
const localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : void 0;
for (const info of indexInfos) {
if (info === checkInfo)
@@ -77031,7 +77207,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkTypeParametersNotReferenced(root, typeParameters, index) {
visit(root);
function visit(node) {
- if (node.kind === 183 /* TypeReference */) {
+ if (node.kind === 185 /* TypeReference */) {
const type = getTypeFromTypeReference(node);
if (type.flags & 262144 /* TypeParameter */) {
for (let i = index; i < typeParameters.length; i++) {
@@ -77458,7 +77634,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getCheckFlags(s) & 1 /* Instantiated */ ? s.target : s;
}
function getClassOrInterfaceDeclarationsOfSymbol(symbol) {
- return filter(symbol.declarations, (d) => d.kind === 264 /* ClassDeclaration */ || d.kind === 267 /* InterfaceDeclaration */);
+ return filter(symbol.declarations, (d) => d.kind === 266 /* ClassDeclaration */ || d.kind === 270 /* InterfaceDeclaration */);
}
function checkKindsOfPropertyMemberOverrides(type, baseType) {
var _a2, _b, _c, _d;
@@ -77488,7 +77664,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue basePropertyCheck;
}
}
- if (derivedClassDecl.kind === 232 /* ClassExpression */) {
+ if (derivedClassDecl.kind === 234 /* ClassExpression */) {
error(
derivedClassDecl,
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
@@ -77523,7 +77699,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
} else if (useDefineForClassFields) {
- const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 171 /* PropertyDeclaration */ && !d.initializer);
+ const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer);
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_d = derived.declarations) == null ? void 0 : _d.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
const propName = uninitialized.name;
@@ -77626,7 +77802,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isPropertyWithoutInitializer(node) {
- return node.kind === 171 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer;
+ return node.kind === 172 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer;
}
function isPropertyInitializedInStaticBlocks(propName, propType, staticBlocks, startPos, endPos) {
for (const staticBlock of staticBlocks) {
@@ -77660,7 +77836,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkExportsOnMergedDeclarations(node);
const symbol = getSymbolOfNode(node);
checkTypeParameterListsIdentical(symbol);
- const firstInterfaceDecl = getDeclarationOfKind(symbol, 267 /* InterfaceDeclaration */);
+ const firstInterfaceDecl = getDeclarationOfKind(symbol, 270 /* InterfaceDeclaration */);
if (node === firstInterfaceDecl) {
const type = getDeclaredTypeOfSymbol(symbol);
const typeWithThis = getTypeWithThisArgument(type);
@@ -77759,7 +77935,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return value;
function evaluate(expr) {
switch (expr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const value2 = evaluate(expr.operand);
if (typeof value2 === "number") {
switch (expr.operator) {
@@ -77772,7 +77948,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const left = evaluate(expr.left);
const right = evaluate(expr.right);
if (typeof left === "number" && typeof right === "number") {
@@ -77812,7 +77988,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
checkGrammarNumericLiteral(expr);
return +expr.text;
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return evaluate(expr.expression);
case 79 /* Identifier */:
const identifier = expr;
@@ -77820,13 +77996,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return +identifier.escapedText;
}
return nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isConstantMemberAccess(expr)) {
const type = getTypeOfExpression(expr.expression);
if (type.symbol && type.symbol.flags & 384 /* Enum */) {
let name;
- if (expr.kind === 211 /* PropertyAccessExpression */) {
+ if (expr.kind === 213 /* PropertyAccessExpression */) {
name = expr.name.escapedText;
} else {
name = escapeLeadingUnderscores(cast(expr.argumentExpression, isLiteralExpression).text);
@@ -77860,7 +78036,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (type === errorType) {
return false;
}
- return node.kind === 79 /* Identifier */ || node.kind === 211 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || node.kind === 212 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && isStringLiteralLike(node.argumentExpression);
+ return node.kind === 79 /* Identifier */ || node.kind === 213 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || node.kind === 214 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && isStringLiteralLike(node.argumentExpression);
}
function checkEnumDeclaration(node) {
addLazyDiagnostic(() => checkEnumDeclarationWorker(node));
@@ -77884,7 +78060,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let seenEnumMissingInitialInitializer = false;
forEach(enumSymbol.declarations, (declaration) => {
- if (declaration.kind !== 269 /* EnumDeclaration */) {
+ if (declaration.kind !== 272 /* EnumDeclaration */) {
return false;
}
const enumDeclaration = declaration;
@@ -77911,7 +78087,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const declarations = symbol.declarations;
if (declarations) {
for (const declaration of declarations) {
- if ((declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 263 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 16777216 /* Ambient */)) {
+ if ((declaration.kind === 266 /* ClassDeclaration */ || declaration.kind === 265 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 16777216 /* Ambient */)) {
return declaration;
}
}
@@ -77967,7 +78143,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged);
}
}
- const mergedClass = getDeclarationOfKind(symbol, 264 /* ClassDeclaration */);
+ const mergedClass = getDeclarationOfKind(symbol, 266 /* ClassDeclaration */);
if (mergedClass && inSameLexicalScope(node, mergedClass)) {
getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */;
}
@@ -77998,21 +78174,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkModuleAugmentationElement(node, isGlobalAugmentation) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
for (const decl of node.declarationList.declarations) {
checkModuleAugmentationElement(decl, isGlobalAugmentation);
}
break;
- case 280 /* ExportAssignment */:
- case 281 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 284 /* ExportDeclaration */:
grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
break;
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
break;
- case 208 /* BindingElement */:
- case 261 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
const name = node.name;
if (isBindingPattern(name)) {
for (const el of name.elements) {
@@ -78020,12 +78196,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
break;
}
- case 264 /* ClassDeclaration */:
- case 269 /* EnumDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
if (isGlobalAugmentation) {
return;
}
@@ -78036,12 +78212,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
return node;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
do {
node = node.left;
} while (node.kind !== 79 /* Identifier */);
return node;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
do {
if (isModuleExportsAccessExpression(node.expression) && !isPrivateIdentifier(node.name)) {
return node.name;
@@ -78060,9 +78236,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(moduleName, Diagnostics.String_literal_expected);
return false;
}
- const inAmbientExternalModule = node.parent.kind === 271 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
- if (node.parent.kind !== 314 /* SourceFile */ && !inAmbientExternalModule) {
- error(moduleName, node.kind === 281 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
+ const inAmbientExternalModule = node.parent.kind === 274 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
+ if (node.parent.kind !== 317 /* SourceFile */ && !inAmbientExternalModule) {
+ error(moduleName, node.kind === 284 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
return false;
}
if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) {
@@ -78091,8 +78267,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
symbol = getMergedSymbol(symbol.exportSymbol || symbol);
if (isInJSFile(node) && !(target.flags & 111551 /* Value */) && !isTypeOnlyImportOrExportDeclaration(node)) {
const errorNode = isImportOrExportSpecifier(node) ? node.propertyName || node.name : isNamedDeclaration(node) ? node.name : node;
- Debug.assert(node.kind !== 283 /* NamespaceExport */);
- if (node.kind === 284 /* ExportSpecifier */) {
+ Debug.assert(node.kind !== 286 /* NamespaceExport */);
+ if (node.kind === 287 /* ExportSpecifier */) {
const diag2 = error(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
const alreadyExportedSymbol = (_b = (_a2 = getSourceFileOfNode(node).symbol) == null ? void 0 : _a2.exports) == null ? void 0 : _b.get((node.propertyName || node.name).escapedText);
if (alreadyExportedSymbol === target) {
@@ -78106,7 +78282,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
} else {
- Debug.assert(node.kind !== 261 /* VariableDeclaration */);
+ Debug.assert(node.kind !== 263 /* VariableDeclaration */);
const importDeclaration = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration));
const moduleSpecifier = (_e = importDeclaration && ((_d = tryGetModuleSpecifierFromDeclaration(importDeclaration)) == null ? void 0 : _d.text)) != null ? _e : "...";
const importedIdentifier = unescapeLeadingUnderscores(isIdentifier(errorNode) ? errorNode.escapedText : symbol.escapedName);
@@ -78122,7 +78298,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const targetFlags = getAllSymbolFlags(target);
const excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) | (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0);
if (targetFlags & excludedMeanings) {
- const message = node.kind === 284 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
+ const message = node.kind === 287 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
error(node, message, symbolToString(symbol));
}
if (compilerOptions.isolatedModules && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216 /* Ambient */)) {
@@ -78130,25 +78306,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const isType3 = !(targetFlags & 111551 /* Value */);
if (isType3 || typeOnlyAlias) {
switch (node.kind) {
- case 276 /* ImportClause */:
- case 279 /* ImportSpecifier */:
- case 274 /* ImportEqualsDeclaration */: {
+ case 279 /* ImportClause */:
+ case 282 /* ImportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */: {
if (compilerOptions.preserveValueImports) {
Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name");
const message = isType3 ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled;
- const name = idText(node.kind === 279 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
+ const name = idText(node.kind === 282 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
addTypeOnlyDeclarationRelatedInfo(
error(node, message, name),
isType3 ? void 0 : typeOnlyAlias,
name
);
}
- if (isType3 && node.kind === 274 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) {
+ if (isType3 && node.kind === 277 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) {
error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided);
}
break;
}
- case 284 /* ExportSpecifier */: {
+ case 287 /* ExportSpecifier */: {
if (getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) {
const message = isType3 ? Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled;
const name = idText(node.propertyName || node.name);
@@ -78217,7 +78393,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkImportBinding(node) {
checkCollisionsForDeclarationName(node, node.name);
checkAliasSymbol(node);
- if (node.kind === 279 /* ImportSpecifier */ && idText(node.propertyName || node.name) === "default" && getESModuleInterop(compilerOptions) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
+ if (node.kind === 282 /* ImportSpecifier */ && idText(node.propertyName || node.name) === "default" && getESModuleInterop(compilerOptions) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
}
}
@@ -78264,7 +78440,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkImportBinding(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (importClause.namedBindings.kind === 280 /* NamespaceImport */) {
checkImportBinding(importClause.namedBindings);
if (moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && getESModuleInterop(compilerOptions)) {
checkExternalEmitHelpers(node, 65536 /* ImportStar */);
@@ -78290,7 +78466,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (hasSyntacticModifier(node, 1 /* Export */)) {
markExportAsReferenced(node);
}
- if (node.moduleReference.kind !== 286 /* ExternalModuleReference */) {
+ if (node.moduleReference.kind !== 289 /* ExternalModuleReference */) {
const target = resolveAlias(getSymbolOfNode(node));
if (target !== unknownSymbol) {
const targetFlags = getAllSymbolFlags(target);
@@ -78328,9 +78504,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
if (node.exportClause && !isNamespaceExport(node.exportClause)) {
forEach(node.exportClause.elements, checkExportSpecifier);
- const inAmbientExternalModule = node.parent.kind === 271 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
- const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 271 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 16777216 /* Ambient */;
- if (node.parent.kind !== 314 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
+ const inAmbientExternalModule = node.parent.kind === 274 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
+ const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 274 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 16777216 /* Ambient */;
+ if (node.parent.kind !== 317 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
error(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
}
} else {
@@ -78356,7 +78532,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkGrammarExportDeclaration(node) {
var _a2;
if (node.isTypeOnly) {
- if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 282 /* NamedExports */) {
+ if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 285 /* NamedExports */) {
return checkGrammarNamedImportsOrExports(node.exportClause);
} else {
return grammarErrorOnNode(node, Diagnostics.Only_named_exports_may_use_export_type);
@@ -78365,7 +78541,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function checkGrammarModuleElementContext(node, errorMessage) {
- const isInAppropriateContext = node.parent.kind === 314 /* SourceFile */ || node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 270 /* ModuleDeclaration */;
+ const isInAppropriateContext = node.parent.kind === 317 /* SourceFile */ || node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 273 /* ModuleDeclaration */;
if (!isInAppropriateContext) {
grammarErrorOnFirstToken(node, errorMessage);
}
@@ -78438,7 +78614,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
ident = node.expression;
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
ident = node.expression;
break;
default:
@@ -78463,8 +78639,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
return;
}
- const container = node.parent.kind === 314 /* SourceFile */ ? node.parent : node.parent.parent;
- if (container.kind === 270 /* ModuleDeclaration */ && !isAmbientModule(container)) {
+ const container = node.parent.kind === 317 /* SourceFile */ ? node.parent : node.parent.parent;
+ if (container.kind === 273 /* ModuleDeclaration */ && !isAmbientModule(container)) {
if (node.isExportEquals) {
error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
} else {
@@ -78576,186 +78752,188 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
cancellationToken.throwIfCancellationRequested();
}
}
- if (kind >= 244 /* FirstStatement */ && kind <= 260 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) {
+ if (kind >= 246 /* FirstStatement */ && kind <= 262 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) {
errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, Diagnostics.Unreachable_code_detected);
}
switch (kind) {
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return checkTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return checkParameter(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return checkPropertyDeclaration(node);
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
return checkPropertySignature(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return checkPropertyDeclaration(node);
- case 185 /* ConstructorType */:
- case 184 /* FunctionType */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 187 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return checkSignatureDeclaration(node);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return checkMethodDeclaration(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return checkClassStaticBlockDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return checkConstructorDeclaration(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return checkAccessorDeclaration(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return checkTypeReferenceNode(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return checkTypePredicate(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return checkTypeQuery(node);
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return checkTypeLiteral(node);
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return checkArrayType(node);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
return checkTupleType(node);
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return checkUnionOrIntersectionType(node);
- case 196 /* ParenthesizedType */:
- case 190 /* OptionalType */:
- case 191 /* RestType */:
+ case 198 /* ParenthesizedType */:
+ case 192 /* OptionalType */:
+ case 193 /* RestType */:
return checkSourceElement(node.type);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return checkThisType(node);
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return checkTypeOperator(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return checkConditionalType(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return checkInferType(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return checkTemplateLiteralType(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return checkImportType(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return checkNamedTupleMember(node);
- case 337 /* JSDocAugmentsTag */:
+ case 340 /* JSDocAugmentsTag */:
return checkJSDocAugmentsTag(node);
- case 338 /* JSDocImplementsTag */:
+ case 341 /* JSDocImplementsTag */:
return checkJSDocImplementsTag(node);
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return checkJSDocTypeAliasTag(node);
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return checkJSDocTemplateTag(node);
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return checkJSDocTypeTag(node);
- case 333 /* JSDocLink */:
- case 334 /* JSDocLinkCode */:
- case 335 /* JSDocLinkPlain */:
+ case 336 /* JSDocLink */:
+ case 337 /* JSDocLinkCode */:
+ case 338 /* JSDocLinkPlain */:
return checkJSDocLinkLikeTag(node);
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
return checkJSDocParameterTag(node);
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
return checkJSDocPropertyTag(node);
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
checkJSDocFunctionType(node);
- case 324 /* JSDocNonNullableType */:
- case 323 /* JSDocNullableType */:
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
- case 331 /* JSDocTypeLiteral */:
+ case 327 /* JSDocNonNullableType */:
+ case 326 /* JSDocNullableType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
+ case 334 /* JSDocTypeLiteral */:
checkJSDocTypeIsInJsFile(node);
forEachChild(node, checkSourceElement);
return;
- case 327 /* JSDocVariadicType */:
+ case 330 /* JSDocVariadicType */:
checkJSDocVariadicType(node);
return;
- case 318 /* JSDocTypeExpression */:
+ case 321 /* JSDocTypeExpression */:
return checkSourceElement(node.type);
- case 342 /* JSDocPublicTag */:
- case 344 /* JSDocProtectedTag */:
- case 343 /* JSDocPrivateTag */:
+ case 345 /* JSDocPublicTag */:
+ case 347 /* JSDocProtectedTag */:
+ case 346 /* JSDocPrivateTag */:
return checkJSDocAccessibilityModifiers(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return checkIndexedAccessType(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return checkMappedType(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return checkFunctionDeclaration(node);
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
return checkBlock(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return checkVariableStatement(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return checkExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return checkIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return checkDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return checkWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return checkForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return checkForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return checkForOfStatement(node);
- case 252 /* ContinueStatement */:
- case 253 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
return checkBreakOrContinueStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return checkReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return checkWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return checkSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return checkLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return checkThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return checkTryStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return checkVariableDeclaration(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return checkBindingElement(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return checkClassDeclaration(node);
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return checkStructDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return checkAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return;
+ case 270 /* InterfaceDeclaration */:
return checkInterfaceDeclaration(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return checkTypeAliasDeclaration(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return checkEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return checkModuleDeclaration(node);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return checkImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return checkImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return checkExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return checkExportAssignment(node);
- case 243 /* EmptyStatement */:
- case 260 /* DebuggerStatement */:
+ case 245 /* EmptyStatement */:
+ case 262 /* DebuggerStatement */:
checkGrammarStatementInAmbientContext(node);
return;
- case 285 /* MissingDeclaration */:
+ case 288 /* MissingDeclaration */:
return checkMissingDeclaration(node);
}
}
@@ -78842,33 +79020,33 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
currentNode = node;
instantiationCount = 0;
switch (node.kind) {
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 215 /* TaggedTemplateExpression */:
- case 169 /* Decorator */:
- case 289 /* JsxOpeningElement */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 170 /* Decorator */:
+ case 292 /* JsxOpeningElement */:
resolveUntypedCall(node);
break;
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
checkFunctionExpressionOrObjectLiteralMethodDeferred(node);
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
checkAccessorDeclaration(node);
break;
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
checkClassExpressionDeferred(node);
break;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
checkTypeParameterDeferred(node);
break;
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
checkJsxSelfClosingElementDeferred(node);
break;
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
checkJsxElementDeferred(node);
break;
}
@@ -79032,27 +79210,27 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
copySymbols(location2.locals, meaning);
}
switch (location2.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (!isExternalModule(location2))
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
copyLocallyVisibleExportSymbols(getSymbolOfNode(location2).exports, meaning & 2623475 /* ModuleMember */);
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
copySymbols(getSymbolOfNode(location2).exports, meaning & 8 /* EnumMember */);
break;
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
const className = location2.name;
if (className) {
copySymbol(location2.symbol, meaning);
}
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
if (!isStaticSymbol) {
copySymbols(getMembersOfSymbol(getSymbolOfNode(location2)), meaning & 788968 /* Type */);
}
break;
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
const funcName = location2.name;
if (funcName) {
copySymbol(location2.symbol, meaning);
@@ -79085,7 +79263,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function copyLocallyVisibleExportSymbols(source, meaning2) {
if (meaning2) {
source.forEach((symbol) => {
- if (!getDeclarationOfKind(symbol, 284 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 283 /* NamespaceExport */)) {
+ if (!getDeclarationOfKind(symbol, 287 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 286 /* NamespaceExport */)) {
copySymbol(symbol, meaning2);
}
});
@@ -79096,16 +79274,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return name.kind === 79 /* Identifier */ && isTypeDeclaration(name.parent) && getNameOfDeclaration(name.parent) === name;
}
function isTypeReferenceIdentifier(node) {
- while (node.parent.kind === 165 /* QualifiedName */) {
+ while (node.parent.kind === 166 /* QualifiedName */) {
node = node.parent;
}
- return node.parent.kind === 183 /* TypeReference */;
+ return node.parent.kind === 185 /* TypeReference */;
}
function isHeritageClauseElementIdentifier(node) {
- while (node.parent.kind === 211 /* PropertyAccessExpression */) {
+ while (node.parent.kind === 213 /* PropertyAccessExpression */) {
node = node.parent;
}
- return node.parent.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.parent.kind === 236 /* ExpressionWithTypeArguments */;
}
function forEachEnclosingClass(node, callback) {
let result;
@@ -79132,13 +79310,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return !!forEachEnclosingClass(node, (n) => n === classDeclaration);
}
function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {
- while (nodeOnRightSide.parent.kind === 165 /* QualifiedName */) {
+ while (nodeOnRightSide.parent.kind === 166 /* QualifiedName */) {
nodeOnRightSide = nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 274 /* ImportEqualsDeclaration */) {
+ if (nodeOnRightSide.parent.kind === 277 /* ImportEqualsDeclaration */) {
return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : void 0;
}
- if (nodeOnRightSide.parent.kind === 280 /* ExportAssignment */) {
+ if (nodeOnRightSide.parent.kind === 283 /* ExportAssignment */) {
return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : void 0;
}
return void 0;
@@ -79164,7 +79342,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
node = parent2;
parent2 = parent2.parent;
}
- if (parent2 && parent2.kind === 205 /* ImportType */ && parent2.qualifier === node) {
+ if (parent2 && parent2.kind === 207 /* ImportType */ && parent2.qualifier === node) {
return parent2;
}
return void 0;
@@ -79173,7 +79351,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isDeclarationName(name)) {
return getSymbolOfNode(name.parent);
}
- if (isInJSFile(name) && name.parent.kind === 211 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) {
+ if (isInJSFile(name) && name.parent.kind === 213 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) {
if (!isPrivateIdentifier(name) && !isJSDocMemberName(name)) {
const specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name);
if (specialPropertyAssignmentSymbol) {
@@ -79181,7 +79359,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (name.parent.kind === 280 /* ExportAssignment */ && isEntityNameExpression(name)) {
+ if (name.parent.kind === 283 /* ExportAssignment */ && isEntityNameExpression(name)) {
const success = resolveEntityName(
name,
111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */,
@@ -79191,7 +79369,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return success;
}
} else if (isEntityName(name) && isInRightSideOfImportOrExportAssignment(name)) {
- const importEqualsDeclaration = getAncestor(name, 274 /* ImportEqualsDeclaration */);
+ const importEqualsDeclaration = getAncestor(name, 277 /* ImportEqualsDeclaration */);
Debug.assert(importEqualsDeclaration !== void 0);
return getSymbolOfPartOfRightHandSideOfImportEquals(name, true);
}
@@ -79208,7 +79386,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (isHeritageClauseElementIdentifier(name)) {
let meaning = 0 /* None */;
- if (name.parent.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (name.parent.kind === 236 /* ExpressionWithTypeArguments */) {
meaning = 788968 /* Type */;
if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) {
meaning |= 111551 /* Value */;
@@ -79222,10 +79400,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return entityNameSymbol;
}
}
- if (name.parent.kind === 349 /* JSDocParameterTag */) {
+ if (name.parent.kind === 352 /* JSDocParameterTag */) {
return getParameterSymbolFromJSDoc(name.parent);
}
- if (name.parent.kind === 167 /* TypeParameter */ && name.parent.parent.kind === 353 /* JSDocTemplateTag */) {
+ if (name.parent.kind === 168 /* TypeParameter */ && name.parent.parent.kind === 356 /* JSDocTemplateTag */) {
Debug.assert(!isInJSFile(name));
const typeParameter = getTypeParameterFromJsDoc(name.parent);
return typeParameter && typeParameter.symbol;
@@ -79257,12 +79435,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
} else if (isPrivateIdentifier(name)) {
return getSymbolForPrivateIdentifierExpression(name);
- } else if (name.kind === 211 /* PropertyAccessExpression */ || name.kind === 165 /* QualifiedName */) {
+ } else if (name.kind === 213 /* PropertyAccessExpression */ || name.kind === 166 /* QualifiedName */) {
const links = getNodeLinks(name);
if (links.resolvedSymbol) {
return links.resolvedSymbol;
}
- if (name.kind === 211 /* PropertyAccessExpression */) {
+ if (name.kind === 213 /* PropertyAccessExpression */) {
checkPropertyAccessExpression(name, 0 /* Normal */);
if (!links.resolvedSymbol) {
const expressionType = checkExpressionCached(name.expression);
@@ -79302,11 +79480,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return resolveJSDocMemberName(name);
}
} else if (isTypeReferenceIdentifier(name)) {
- const meaning = name.parent.kind === 183 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */;
+ const meaning = name.parent.kind === 185 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */;
const symbol = resolveEntityName(name, meaning, true, true);
return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name);
}
- if (name.parent.kind === 182 /* TypePredicate */) {
+ if (name.parent.kind === 184 /* TypePredicate */) {
return resolveEntityName(name, 1 /* FunctionScopedVariable */, true);
}
return void 0;
@@ -79331,7 +79509,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getSymbolAtLocation(node, ignoreErrors) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return isExternalModule(node) ? getMergedSymbol(node.symbol) : void 0;
}
const { parent: parent2 } = node;
@@ -79348,7 +79526,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.kind === 79 /* Identifier */) {
if (isInRightSideOfImportOrExportAssignment(node)) {
return getSymbolOfNameOrPropertyAccessExpression(node);
- } else if (parent2.kind === 208 /* BindingElement */ && grandParent.kind === 206 /* ObjectBindingPattern */ && node === parent2.propertyName) {
+ } else if (parent2.kind === 210 /* BindingElement */ && grandParent.kind === 208 /* ObjectBindingPattern */ && node === parent2.propertyName) {
const typeOfPattern = getTypeOfNode(grandParent);
const propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText);
if (propertyDeclaration) {
@@ -79367,8 +79545,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
- case 211 /* PropertyAccessExpression */:
- case 165 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
if (!isThisInTypeQuery(node)) {
return getSymbolOfNameOrPropertyAccessExpression(node);
}
@@ -79383,19 +79561,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isInExpressionContext(node)) {
return checkExpression(node).symbol;
}
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return getTypeFromThisTypeNode(node).symbol;
case 107 /* SuperKeyword */:
return checkExpression(node).symbol;
case 136 /* ConstructorKeyword */:
const constructorDeclaration = node.parent;
- if (constructorDeclaration && constructorDeclaration.kind === 176 /* Constructor */) {
+ if (constructorDeclaration && constructorDeclaration.kind === 178 /* Constructor */) {
return constructorDeclaration.parent.symbol;
}
return void 0;
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 275 /* ImportDeclaration */ || node.parent.kind === 281 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(node.parent, false) || isImportCall(node.parent)) || isLiteralTypeNode(node.parent) && isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent) {
+ if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 278 /* ImportDeclaration */ || node.parent.kind === 284 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(node.parent, false) || isImportCall(node.parent)) || isLiteralTypeNode(node.parent) && isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent) {
return resolveExternalModuleName(node, node, ignoreErrors);
}
if (isCallExpression(parent2) && isBindableObjectDefinePropertyCall(parent2) && parent2.arguments[1] === node) {
@@ -79409,14 +79587,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 38 /* EqualsGreaterThanToken */:
case 84 /* ClassKeyword */:
return getSymbolOfNode(node.parent);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : void 0;
case 94 /* ExportKeyword */:
return isExportAssignment(node.parent) ? Debug.checkDefined(node.parent.symbol) : void 0;
case 101 /* ImportKeyword */:
case 104 /* NewKeyword */:
return isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : void 0;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return checkExpression(node).symbol;
default:
return void 0;
@@ -79432,7 +79610,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
function getShorthandAssignmentValueSymbol(location2) {
- if (location2 && location2.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (location2 && location2.kind === 309 /* ShorthandPropertyAssignment */) {
return resolveEntityName(location2.name, 111551 /* Value */ | 2097152 /* Alias */, true);
}
return void 0;
@@ -79517,16 +79695,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getTypeOfNode(node);
}
function getTypeOfAssignmentPattern(expr) {
- Debug.assert(expr.kind === 210 /* ObjectLiteralExpression */ || expr.kind === 209 /* ArrayLiteralExpression */);
- if (expr.parent.kind === 251 /* ForOfStatement */) {
+ Debug.assert(expr.kind === 212 /* ObjectLiteralExpression */ || expr.kind === 211 /* ArrayLiteralExpression */);
+ if (expr.parent.kind === 253 /* ForOfStatement */) {
const iteratedType = checkRightHandSideOfForOf(expr.parent);
return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 227 /* BinaryExpression */) {
+ if (expr.parent.kind === 229 /* BinaryExpression */) {
const iteratedType = getTypeOfExpression(expr.parent.right);
return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 305 /* PropertyAssignment */) {
+ if (expr.parent.kind === 308 /* PropertyAssignment */) {
const node2 = cast(expr.parent.parent, isObjectLiteralExpression);
const typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node2) || errorType;
const propertyIndex = indexOfNode(node2.properties, expr.parent);
@@ -79559,7 +79737,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
case 10 /* StringLiteral */:
return getStringLiteralType(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
const nameType = checkComputedPropertyName(name);
return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType;
default:
@@ -79650,7 +79828,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const parentSymbol = getParentOfSymbol(symbol);
if (parentSymbol) {
- if (parentSymbol.flags & 512 /* ValueModule */ && ((_a2 = parentSymbol.valueDeclaration) == null ? void 0 : _a2.kind) === 314 /* SourceFile */) {
+ if (parentSymbol.flags & 512 /* ValueModule */ && ((_a2 = parentSymbol.valueDeclaration) == null ? void 0 : _a2.kind) === 317 /* SourceFile */) {
const symbolFile = parentSymbol.valueDeclaration;
const referenceFile = getSourceFileOfNode(node);
const symbolIsUmdExport = symbolFile !== referenceFile;
@@ -79675,7 +79853,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
function isSymbolOfDestructuredElementOfCatchBinding(symbol) {
- return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 301 /* CatchClause */;
+ return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 304 /* CatchClause */;
}
function isSymbolOfDeclarationWithCollidingName(symbol) {
if (symbol.flags & 418 /* BlockScoped */ && symbol.valueDeclaration && !isSourceFile(symbol.valueDeclaration)) {
@@ -79689,7 +79867,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else if (nodeLinks2.flags & 262144 /* CapturedBlockScopedBinding */) {
const isDeclaredInLoop = nodeLinks2.flags & 524288 /* BlockScopedBindingInLoop */;
const inLoopInitializer = isIterationStatement(container, false);
- const inLoopBodyBlock = container.kind === 242 /* Block */ && isIterationStatement(container.parent, false);
+ const inLoopBodyBlock = container.kind === 244 /* Block */ && isIterationStatement(container.parent, false);
links.isDeclarationWithCollidingName = !isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || !inLoopInitializer && !inLoopBodyBlock);
} else {
links.isDeclarationWithCollidingName = false;
@@ -79724,25 +79902,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isValueAliasDeclaration(node) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return isAliasResolvedToValue(getSymbolOfNode(node));
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
const symbol = getSymbolOfNode(node);
return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportClause = node.exportClause;
return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return node.expression && node.expression.kind === 79 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true;
}
return false;
}
function isTopLevelValueImportEqualsWithEntityName(nodeIn) {
const node = getParseTreeNode(nodeIn, isImportEqualsDeclaration);
- if (node === void 0 || node.parent.kind !== 314 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) {
+ if (node === void 0 || node.parent.kind !== 317 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) {
return false;
}
const isValue = isAliasResolvedToValue(getSymbolOfNode(node));
@@ -79831,15 +80009,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function canHaveConstantValue(node) {
switch (node.kind) {
- case 308 /* EnumMember */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 311 /* EnumMember */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return true;
}
return false;
}
function getConstantValue2(node) {
- if (node.kind === 308 /* EnumMember */) {
+ if (node.kind === 311 /* EnumMember */) {
return getEnumMemberValue(node);
}
const symbol = getNodeLinks(node).resolvedSymbol;
@@ -80037,7 +80215,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
ident = node.expression;
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
ident = node.expression;
break;
default:
@@ -80144,12 +80322,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
getJsxFragmentFactoryEntity,
getAllAccessorDeclarations(accessor) {
accessor = getParseTreeNode(accessor, isGetOrSetAccessorDeclaration);
- const otherKind = accessor.kind === 178 /* SetAccessor */ ? 177 /* GetAccessor */ : 178 /* SetAccessor */;
+ const otherKind = accessor.kind === 180 /* SetAccessor */ ? 179 /* GetAccessor */ : 180 /* SetAccessor */;
const otherAccessor = getDeclarationOfKind(getSymbolOfNode(accessor), otherKind);
const firstAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? otherAccessor : accessor;
const secondAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? accessor : otherAccessor;
- const setAccessor = accessor.kind === 178 /* SetAccessor */ ? accessor : otherAccessor;
- const getAccessor = accessor.kind === 177 /* GetAccessor */ ? accessor : otherAccessor;
+ const setAccessor = accessor.kind === 180 /* SetAccessor */ ? accessor : otherAccessor;
+ const getAccessor = accessor.kind === 179 /* GetAccessor */ ? accessor : otherAccessor;
return {
firstAccessor,
secondAccessor,
@@ -80165,7 +80343,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
},
getDeclarationStatementsForSourceFile: (node, flags, tracker, bundled) => {
const n = getParseTreeNode(node);
- Debug.assert(n && n.kind === 314 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
+ Debug.assert(n && n.kind === 317 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
const sym = getSymbolOfNode(node);
if (!sym) {
return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled);
@@ -80277,18 +80455,18 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function isInHeritageClause(node) {
- return node.parent && node.parent.kind === 234 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 300 /* HeritageClause */;
+ return node.parent && node.parent.kind === 236 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 303 /* HeritageClause */;
}
function getTypeReferenceDirectivesForEntityName(node) {
if (!fileToDirective) {
return void 0;
}
let meaning;
- if (node.parent.kind === 166 /* ComputedPropertyName */) {
+ if (node.parent.kind === 167 /* ComputedPropertyName */) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
} else {
meaning = 788968 /* Type */ | 1920 /* Namespace */;
- if (node.kind === 79 /* Identifier */ && isInTypeQuery(node) || node.kind === 211 /* PropertyAccessExpression */ && !isInHeritageClause(node)) {
+ if (node.kind === 79 /* Identifier */ && isInTypeQuery(node) || node.kind === 213 /* PropertyAccessExpression */ && !isInHeritageClause(node)) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
}
}
@@ -80326,7 +80504,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
}
- if (current.valueDeclaration && current.valueDeclaration.kind === 314 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
+ if (current.valueDeclaration && current.valueDeclaration.kind === 317 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
return false;
}
for (const decl of symbol.declarations) {
@@ -80351,12 +80529,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getExternalModuleFileFromDeclaration(declaration) {
- const specifier = declaration.kind === 270 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration);
+ const specifier = declaration.kind === 273 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration);
const moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, void 0);
if (!moduleSymbol) {
return void 0;
}
- return getDeclarationOfKind(moduleSymbol, 314 /* SourceFile */);
+ return getDeclarationOfKind(moduleSymbol, 317 /* SourceFile */);
}
function initializeTypeChecker() {
for (const file of host.getSourceFiles()) {
@@ -80585,7 +80763,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
if (!nodeCanBeDecorated(node, node.parent, node.parent.parent, compilerOptions)) {
- const isMethodDeclarationAndNodeIsNotPresent = node.kind === 174 /* MethodDeclaration */ && !nodeIsPresent(node.body);
+ const isMethodDeclarationAndNodeIsNotPresent = node.kind === 176 /* MethodDeclaration */ && !nodeIsPresent(node.body);
const message = isMethodDeclarationAndNodeIsNotPresent ? Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload : Diagnostics.Decorators_are_not_valid_here;
for (const decorator of decorators) {
if (!grammarErrorOnNode(decorator, message)) {
@@ -80593,7 +80771,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
return true;
- } else if (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */) {
+ } else if (node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */) {
const accessors = getAllAccessorDeclarations(node.parent.members, node);
if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) {
return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
@@ -80613,21 +80791,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
}
if (modifier.kind !== 147 /* ReadonlyKeyword */) {
- if (node.kind === 170 /* PropertySignature */ || node.kind === 173 /* MethodSignature */) {
+ if (node.kind === 171 /* PropertySignature */ || node.kind === 175 /* MethodSignature */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind));
}
- if (node.kind === 181 /* IndexSignature */ && (modifier.kind !== 125 /* StaticKeyword */ || !isClassLike(node.parent))) {
+ if (node.kind === 183 /* IndexSignature */ && (modifier.kind !== 125 /* StaticKeyword */ || !isClassLike(node.parent))) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind));
}
}
if (modifier.kind !== 102 /* InKeyword */ && modifier.kind !== 146 /* OutKeyword */) {
- if (node.kind === 167 /* TypeParameter */) {
+ if (node.kind === 168 /* TypeParameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind));
}
}
switch (modifier.kind) {
case 86 /* ConstKeyword */:
- if (node.kind !== 269 /* EnumDeclaration */) {
+ if (node.kind !== 272 /* EnumDeclaration */) {
return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(86 /* ConstKeyword */));
}
break;
@@ -80662,7 +80840,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly");
} else if (flags & 512 /* Async */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
- } else if (node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ } else if (node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
} else if (flags & 256 /* Abstract */) {
if (modifier.kind === 122 /* PrivateKeyword */) {
@@ -80684,9 +80862,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
} else if (flags & 128 /* Accessor */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor");
- } else if (node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ } else if (node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
} else if (flags & 256 /* Abstract */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
@@ -80703,7 +80881,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly");
} else if (flags & 2 /* Ambient */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare");
- } else if (node.kind !== 171 /* PropertyDeclaration */) {
+ } else if (node.kind !== 172 /* PropertyDeclaration */) {
return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration);
}
flags |= 128 /* Accessor */;
@@ -80711,7 +80889,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 147 /* ReadonlyKeyword */:
if (flags & 64 /* Readonly */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly");
- } else if (node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 170 /* PropertySignature */ && node.kind !== 181 /* IndexSignature */ && node.kind !== 168 /* Parameter */) {
+ } else if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 183 /* IndexSignature */ && node.kind !== 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
}
flags |= 64 /* Readonly */;
@@ -80727,14 +80905,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
} else if (isClassLike(node.parent)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export");
}
flags |= 1 /* Export */;
break;
case 89 /* DefaultKeyword */:
- const container = node.parent.kind === 314 /* SourceFile */ ? node.parent : node.parent.parent;
- if (container.kind === 270 /* ModuleDeclaration */ && !isAmbientModule(container)) {
+ const container = node.parent.kind === 317 /* SourceFile */ ? node.parent : node.parent.parent;
+ if (container.kind === 273 /* ModuleDeclaration */ && !isAmbientModule(container)) {
return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
} else if (!(flags & 1 /* Export */)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default");
@@ -80750,9 +80928,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override");
} else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
- } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 271 /* ModuleBlock */) {
+ } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 274 /* ModuleBlock */) {
return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
} else if (isPrivateIdentifierClassElementDeclaration(node)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
@@ -80764,11 +80942,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (flags & 256 /* Abstract */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract");
}
- if (node.kind !== 264 /* ClassDeclaration */ && node.kind !== 185 /* ConstructorType */) {
- if (node.kind !== 174 /* MethodDeclaration */ && node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 177 /* GetAccessor */ && node.kind !== 178 /* SetAccessor */) {
+ if (node.kind !== 266 /* ClassDeclaration */ && node.kind !== 187 /* ConstructorType */) {
+ if (node.kind !== 176 /* MethodDeclaration */ && node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 179 /* GetAccessor */ && node.kind !== 180 /* SetAccessor */) {
return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
}
- if (!(node.parent.kind === 264 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) {
+ if (!(node.parent.kind === 266 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) {
return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);
}
if (flags & 32 /* Static */) {
@@ -80797,7 +80975,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async");
} else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
}
if (flags & 256 /* Abstract */) {
@@ -80810,7 +80988,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 146 /* OutKeyword */:
const inOutFlag = modifier.kind === 102 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */;
const inOutText = modifier.kind === 102 /* InKeyword */ ? "in" : "out";
- if (node.kind !== 167 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
+ if (node.kind !== 168 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
}
if (flags & inOutFlag) {
@@ -80823,7 +81001,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
}
- if (node.kind === 176 /* Constructor */) {
+ if (node.kind === 178 /* Constructor */) {
if (flags & 32 /* Static */) {
return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
}
@@ -80834,11 +81012,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async");
}
return false;
- } else if ((node.kind === 275 /* ImportDeclaration */ || node.kind === 274 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) {
+ } else if ((node.kind === 278 /* ImportDeclaration */ || node.kind === 277 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) {
return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
- } else if (node.kind === 168 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) {
+ } else if (node.kind === 169 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) {
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
- } else if (node.kind === 168 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && node.dotDotDotToken) {
+ } else if (node.kind === 169 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && node.dotDotDotToken) {
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
}
if (flags & 512 /* Async */) {
@@ -80851,49 +81029,51 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function shouldReportBadModifier(node) {
switch (node.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 270 /* ModuleDeclaration */:
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 168 /* Parameter */:
- case 167 /* TypeParameter */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 273 /* ModuleDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 169 /* Parameter */:
+ case 168 /* TypeParameter */:
return false;
- case 175 /* ClassStaticBlockDeclaration */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 273 /* NamespaceExportDeclaration */:
- case 184 /* FunctionType */:
- case 285 /* MissingDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 276 /* NamespaceExportDeclaration */:
+ case 186 /* FunctionType */:
+ case 288 /* MissingDeclaration */:
return true;
default:
- if (node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ if (node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
return false;
}
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return nodeHasAnyModifiersExcept(node, 133 /* AsyncKeyword */);
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 185 /* ConstructorType */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 187 /* ConstructorType */:
return nodeHasAnyModifiersExcept(node, 127 /* AbstractKeyword */);
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 244 /* VariableStatement */:
- case 268 /* TypeAliasDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 246 /* VariableStatement */:
+ case 271 /* TypeAliasDeclaration */:
return true;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return nodeHasAnyModifiersExcept(node, 86 /* ConstKeyword */);
default:
Debug.assertNever(node);
@@ -80911,10 +81091,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkGrammarAsyncModifier(node, asyncModifier) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return false;
}
return grammarErrorOnNode(asyncModifier, Diagnostics._0_modifier_cannot_be_used_here, "async");
@@ -81127,11 +81307,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function checkGrammarComputedPropertyName(node) {
- if (node.kind !== 166 /* ComputedPropertyName */) {
+ if (node.kind !== 167 /* ComputedPropertyName */) {
return false;
}
const computedPropertyName = node;
- if (computedPropertyName.expression.kind === 227 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) {
+ if (computedPropertyName.expression.kind === 229 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) {
return grammarErrorOnNode(computedPropertyName.expression, Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name);
}
return false;
@@ -81139,7 +81319,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkGrammarForGenerator(node) {
if (node.asteriskToken) {
Debug.assert(
- node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */ || node.kind === 174 /* MethodDeclaration */
+ node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */ || node.kind === 176 /* MethodDeclaration */
);
if (node.flags & 16777216 /* Ambient */) {
return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
@@ -81158,7 +81338,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkGrammarObjectLiteralExpression(node, inDestructuring) {
const seen = new Map2();
for (const prop of node.properties) {
- if (prop.kind === 307 /* SpreadAssignment */) {
+ if (prop.kind === 310 /* SpreadAssignment */) {
if (inDestructuring) {
const expression = skipParentheses(prop.expression);
if (isArrayLiteralExpression(expression) || isObjectLiteralExpression(expression)) {
@@ -81168,10 +81348,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
}
const name = prop.name;
- if (name.kind === 166 /* ComputedPropertyName */) {
+ if (name.kind === 167 /* ComputedPropertyName */) {
checkGrammarComputedPropertyName(name);
}
- if (prop.kind === 306 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
+ if (prop.kind === 309 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
grammarErrorOnNode(prop.equalsToken, Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);
}
if (name.kind === 80 /* PrivateIdentifier */) {
@@ -81179,7 +81359,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (canHaveModifiers(prop) && prop.modifiers) {
for (const mod of prop.modifiers) {
- if (isModifier(mod) && (mod.kind !== 133 /* AsyncKeyword */ || prop.kind !== 174 /* MethodDeclaration */)) {
+ if (isModifier(mod) && (mod.kind !== 133 /* AsyncKeyword */ || prop.kind !== 176 /* MethodDeclaration */)) {
grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod));
}
}
@@ -81190,8 +81370,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let currentKind;
switch (prop.kind) {
- case 306 /* ShorthandPropertyAssignment */:
- case 305 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
checkGrammarForInvalidExclamationToken(prop.exclamationToken, Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);
checkGrammarForInvalidQuestionMark(prop.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional);
if (name.kind === 8 /* NumericLiteral */) {
@@ -81199,13 +81379,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
currentKind = 4 /* PropertyAssignment */;
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
currentKind = 8 /* Method */;
break;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
currentKind = 1 /* GetAccessor */;
break;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
currentKind = 2 /* SetAccessor */;
break;
default:
@@ -81242,7 +81422,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkGrammarTypeArguments(node, node.typeArguments);
const seen = new Map2();
for (const attr of node.attributes.properties) {
- if (attr.kind === 296 /* JsxSpreadAttribute */) {
+ if (attr.kind === 299 /* JsxSpreadAttribute */) {
continue;
}
const { name, initializer } = attr;
@@ -81251,7 +81431,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
return grammarErrorOnNode(name, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
}
- if (initializer && initializer.kind === 297 /* JsxExpression */ && !initializer.expression) {
+ if (initializer && initializer.kind === 300 /* JsxExpression */ && !initializer.expression) {
return grammarErrorOnNode(initializer, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression);
}
}
@@ -81286,7 +81466,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) {
return true;
}
- if (forInOrOfStatement.kind === 251 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) {
+ if (forInOrOfStatement.kind === 253 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) {
if (!(forInOrOfStatement.flags & 32768 /* AwaitContext */)) {
const sourceFile = getSourceFileOfNode(forInOrOfStatement);
if (isInTopLevelContext(forInOrOfStatement)) {
@@ -81326,7 +81506,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!hasParseDiagnostics(sourceFile)) {
const diagnostic = createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);
const func = getContainingFunction(forInOrOfStatement);
- if (func && func.kind !== 176 /* Constructor */) {
+ if (func && func.kind !== 178 /* Constructor */) {
Debug.assert((getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function.");
const relatedInfo = createDiagnosticForNode(func, Diagnostics.Did_you_mean_to_mark_this_function_as_async);
addRelatedInfo(diagnostic, relatedInfo);
@@ -81342,7 +81522,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
grammarErrorOnNode(forInOrOfStatement.initializer, Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async);
return false;
}
- if (forInOrOfStatement.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (forInOrOfStatement.initializer.kind === 264 /* VariableDeclarationList */) {
const variableList = forInOrOfStatement.initializer;
if (!checkGrammarVariableDeclarationList(variableList)) {
const declarations = variableList.declarations;
@@ -81350,16 +81530,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
if (declarations.length > 1) {
- const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
+ const diagnostic = forInOrOfStatement.kind === 252 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic);
}
const firstDeclaration = declarations[0];
if (firstDeclaration.initializer) {
- const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
+ const diagnostic = forInOrOfStatement.kind === 252 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
return grammarErrorOnNode(firstDeclaration.name, diagnostic);
}
if (firstDeclaration.type) {
- const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
+ const diagnostic = forInOrOfStatement.kind === 252 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
return grammarErrorOnNode(firstDeclaration, diagnostic);
}
}
@@ -81367,7 +81547,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function checkGrammarAccessor(accessor) {
- if (!(accessor.flags & 16777216 /* Ambient */) && accessor.parent.kind !== 187 /* TypeLiteral */ && accessor.parent.kind !== 267 /* InterfaceDeclaration */) {
+ if (!(accessor.flags & 16777216 /* Ambient */) && accessor.parent.kind !== 189 /* TypeLiteral */ && accessor.parent.kind !== 270 /* InterfaceDeclaration */) {
if (languageVersion < 1 /* ES5 */) {
return grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);
}
@@ -81382,7 +81562,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (hasSyntacticModifier(accessor, 256 /* Abstract */)) {
return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation);
}
- if (accessor.parent.kind === 187 /* TypeLiteral */ || accessor.parent.kind === 267 /* InterfaceDeclaration */) {
+ if (accessor.parent.kind === 189 /* TypeLiteral */ || accessor.parent.kind === 270 /* InterfaceDeclaration */) {
return grammarErrorOnNode(accessor.body, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
}
@@ -81392,10 +81572,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!doesAccessorHaveCorrectParameterCount(accessor)) {
return grammarErrorOnNode(
accessor.name,
- accessor.kind === 177 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter
+ accessor.kind === 179 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter
);
}
- if (accessor.kind === 178 /* SetAccessor */) {
+ if (accessor.kind === 180 /* SetAccessor */) {
if (accessor.type) {
return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);
}
@@ -81413,10 +81593,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function doesAccessorHaveCorrectParameterCount(accessor) {
- return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 0 : 1);
+ return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 179 /* GetAccessor */ ? 0 : 1);
}
function getAccessorThisParameter(accessor) {
- if (accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 1 : 2)) {
+ if (accessor.parameters.length === (accessor.kind === 179 /* GetAccessor */ ? 1 : 2)) {
return getThisParameter(accessor);
}
}
@@ -81433,7 +81613,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
switch (parent2.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
const decl = parent2;
if (decl.name.kind !== 79 /* Identifier */) {
return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);
@@ -81445,12 +81625,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(parent2.name, Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (!isStatic(parent2) || !hasEffectiveReadonlyModifier(parent2)) {
return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);
}
break;
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
if (!hasSyntacticModifier(parent2, 64 /* Readonly */)) {
return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);
}
@@ -81459,7 +81639,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_here);
}
} else if (node.operator === 147 /* ReadonlyKeyword */) {
- if (node.type.kind !== 188 /* ArrayType */ && node.type.kind !== 189 /* TupleType */) {
+ if (node.type.kind !== 190 /* ArrayType */ && node.type.kind !== 191 /* TupleType */) {
return grammarErrorOnFirstToken(node, Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, tokenToString(154 /* SymbolKeyword */));
}
}
@@ -81473,8 +81653,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (checkGrammarFunctionLikeDeclaration(node)) {
return true;
}
- if (node.kind === 174 /* MethodDeclaration */) {
- if (node.parent.kind === 210 /* ObjectLiteralExpression */) {
+ if (node.kind === 176 /* MethodDeclaration */) {
+ if (node.parent.kind === 212 /* ObjectLiteralExpression */) {
if (node.modifiers && !(node.modifiers.length === 1 && first(node.modifiers).kind === 133 /* AsyncKeyword */)) {
return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here);
} else if (checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional)) {
@@ -81495,12 +81675,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (node.flags & 16777216 /* Ambient */) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
- } else if (node.kind === 174 /* MethodDeclaration */ && !node.body) {
+ } else if (node.kind === 176 /* MethodDeclaration */ && !node.body) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
}
- } else if (node.parent.kind === 267 /* InterfaceDeclaration */) {
+ } else if (node.parent.kind === 270 /* InterfaceDeclaration */) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
- } else if (node.parent.kind === 187 /* TypeLiteral */) {
+ } else if (node.parent.kind === 189 /* TypeLiteral */) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
}
}
@@ -81511,17 +81691,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary);
}
switch (current.kind) {
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
if (node.label && current.label.escapedText === node.label.escapedText) {
- const isMisplacedContinueLabel = node.kind === 252 /* ContinueStatement */ && !isIterationStatement(current.statement, true);
+ const isMisplacedContinueLabel = node.kind === 254 /* ContinueStatement */ && !isIterationStatement(current.statement, true);
if (isMisplacedContinueLabel) {
return grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);
}
return false;
}
break;
- case 256 /* SwitchStatement */:
- if (node.kind === 253 /* BreakStatement */ && !node.label) {
+ case 258 /* SwitchStatement */:
+ if (node.kind === 255 /* BreakStatement */ && !node.label) {
return false;
}
break;
@@ -81534,10 +81714,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
current = current.parent;
}
if (node.label) {
- const message = node.kind === 253 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
+ const message = node.kind === 255 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
} else {
- const message = node.kind === 253 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
+ const message = node.kind === 255 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
}
}
@@ -81557,10 +81737,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isStringOrNumberLiteralExpression(expr) {
- return isStringOrNumericLiteralLike(expr) || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */;
+ return isStringOrNumericLiteralLike(expr) || expr.kind === 227 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */;
}
function isBigIntLiteralExpression(expr) {
- return expr.kind === 9 /* BigIntLiteral */ || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */;
+ return expr.kind === 9 /* BigIntLiteral */ || expr.kind === 227 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */;
}
function isSimpleLiteralEnumReference(expr) {
if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) {
@@ -81582,7 +81762,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkGrammarVariableDeclaration(node) {
- if (node.parent.parent.kind !== 250 /* ForInStatement */ && node.parent.parent.kind !== 251 /* ForOfStatement */) {
+ if (node.parent.parent.kind !== 252 /* ForInStatement */ && node.parent.parent.kind !== 253 /* ForOfStatement */) {
if (node.flags & 16777216 /* Ambient */) {
checkAmbientInitializer(node);
} else if (!node.initializer) {
@@ -81594,7 +81774,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (node.exclamationToken && (node.parent.parent.kind !== 244 /* VariableStatement */ || !node.type || node.initializer || node.flags & 16777216 /* Ambient */)) {
+ if (node.exclamationToken && (node.parent.parent.kind !== 246 /* VariableStatement */ || !node.type || node.initializer || node.flags & 16777216 /* Ambient */)) {
const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context;
return grammarErrorOnNode(node.exclamationToken, message);
}
@@ -81646,15 +81826,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function allowLetAndConstDeclarations(parent2) {
switch (parent2.kind) {
- case 246 /* IfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 255 /* WithStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 248 /* IfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 257 /* WithStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
return false;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return allowLetAndConstDeclarations(parent2.parent);
}
return true;
@@ -81756,7 +81936,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isAutoAccessorPropertyDeclaration(node) && checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_accessor_property_cannot_be_declared_optional)) {
return true;
}
- } else if (node.parent.kind === 267 /* InterfaceDeclaration */) {
+ } else if (node.parent.kind === 270 /* InterfaceDeclaration */) {
if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) {
return true;
}
@@ -81782,14 +81962,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
- if (node.kind === 267 /* InterfaceDeclaration */ || node.kind === 268 /* TypeAliasDeclaration */ || node.kind === 275 /* ImportDeclaration */ || node.kind === 274 /* ImportEqualsDeclaration */ || node.kind === 281 /* ExportDeclaration */ || node.kind === 280 /* ExportAssignment */ || node.kind === 273 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 1024 /* Default */)) {
+ if (node.kind === 270 /* InterfaceDeclaration */ || node.kind === 271 /* TypeAliasDeclaration */ || node.kind === 278 /* ImportDeclaration */ || node.kind === 277 /* ImportEqualsDeclaration */ || node.kind === 284 /* ExportDeclaration */ || node.kind === 283 /* ExportAssignment */ || node.kind === 276 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 1024 /* Default */)) {
return false;
}
return grammarErrorOnFirstToken(node, Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier);
}
function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) {
for (const decl of file.statements) {
- if (isDeclaration(decl) || decl.kind === 244 /* VariableStatement */) {
+ if (isDeclaration(decl) || decl.kind === 246 /* VariableStatement */) {
if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) {
return true;
}
@@ -81806,7 +81986,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!links.hasReportedStatementInAmbientContext && (isFunctionLike(node.parent) || isAccessor(node.parent))) {
return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
- if (node.parent.kind === 242 /* Block */ || node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ if (node.parent.kind === 244 /* Block */ || node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
const links2 = getNodeLinks(node.parent);
if (!links2.hasReportedStatementInAmbientContext) {
return links2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts);
@@ -81821,9 +82001,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let diagnosticMessage;
if (languageVersion >= 1 /* ES5 */) {
diagnosticMessage = Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0;
- } else if (isChildOfNodeWithKind(node, 201 /* LiteralType */)) {
+ } else if (isChildOfNodeWithKind(node, 203 /* LiteralType */)) {
diagnosticMessage = Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;
- } else if (isChildOfNodeWithKind(node, 308 /* EnumMember */)) {
+ } else if (isChildOfNodeWithKind(node, 311 /* EnumMember */)) {
diagnosticMessage = Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0;
}
if (diagnosticMessage) {
@@ -81883,7 +82063,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.isTypeOnly && node.name && node.namedBindings) {
return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);
}
- if (node.isTypeOnly && ((_a2 = node.namedBindings) == null ? void 0 : _a2.kind) === 278 /* NamedImports */) {
+ if (node.isTypeOnly && ((_a2 = node.namedBindings) == null ? void 0 : _a2.kind) === 281 /* NamedImports */) {
return checkGrammarNamedImportsOrExports(node.namedBindings);
}
return false;
@@ -81893,7 +82073,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (specifier.isTypeOnly) {
return grammarErrorOnFirstToken(
specifier,
- specifier.kind === 279 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement
+ specifier.kind === 282 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement
);
}
});
@@ -82002,12 +82182,12 @@ function isNotAccessor(declaration) {
return !isAccessor(declaration);
}
function isNotOverload(declaration) {
- return declaration.kind !== 263 /* FunctionDeclaration */ && declaration.kind !== 174 /* MethodDeclaration */ || !!declaration.body;
+ return declaration.kind !== 265 /* FunctionDeclaration */ && declaration.kind !== 176 /* MethodDeclaration */ || !!declaration.body;
}
function isDeclarationNameOrImportPropertyName(name) {
switch (name.parent.kind) {
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return isIdentifier(name);
default:
return isDeclarationName(name);
@@ -82285,20 +82465,20 @@ var visitEachChildTable = {
nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)
);
},
- [165 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [166 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateQualifiedName(
node,
nodeVisitor(node.left, visitor, isEntityName),
nodeVisitor(node.right, visitor, isIdentifier)
);
},
- [166 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [167 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateComputedPropertyName(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [167 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [168 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeParameterDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82307,7 +82487,7 @@ var visitEachChildTable = {
nodeVisitor(node.default, visitor, isTypeNode)
);
},
- [168 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [169 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateParameterDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -82318,14 +82498,14 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [169 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [170 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDecorator(
node,
nodeVisitor(node.expression, visitor, isExpression),
node.annotationDeclaration
);
},
- [170 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [171 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updatePropertySignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82334,7 +82514,16 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [171 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [174 /* OverloadPropertyDeclaration */]: function visitEachChildOfOverloadPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ return context.factory.updateOverloadPropertyDeclaration(
+ node,
+ nodesVisitor(node.modifiers, visitor, isModifier),
+ nodeVisitor(node.name, visitor, isPropertyName),
+ nodeVisitor(node.questionToken, tokenVisitor, isToken),
+ nodeVisitor(node.type, visitor, isTypeNode)
+ );
+ },
+ [172 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
var _a2;
return context.factory.updatePropertyDeclaration(
node,
@@ -82345,7 +82534,7 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [172 /* AnnotationPropertyDeclaration */]: function visitEachChildOfAnnotationPropertyDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [173 /* AnnotationPropertyDeclaration */]: function visitEachChildOfAnnotationPropertyDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAnnotationPropertyDeclaration(
node,
nodeVisitor(node.name, visitor, isPropertyName),
@@ -82353,7 +82542,7 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [173 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [175 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMethodSignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82364,7 +82553,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [174 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [176 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMethodDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -82377,7 +82566,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [176 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [178 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructorDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82385,7 +82574,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [177 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [179 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
if (context.isLexicalEnvironmentSuspended && context.isLexicalEnvironmentSuspended()) {
return context.factory.updateGetAccessorDeclaration(
node,
@@ -82406,7 +82595,7 @@ var visitEachChildTable = {
);
}
},
- [178 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [180 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
if (context.isLexicalEnvironmentSuspended && context.isLexicalEnvironmentSuspended()) {
return context.factory.updateSetAccessorDeclaration(
node,
@@ -82425,7 +82614,7 @@ var visitEachChildTable = {
);
}
},
- [175 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [177 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
context.startLexicalEnvironment();
context.suspendLexicalEnvironment();
return context.factory.updateClassStaticBlockDeclaration(
@@ -82433,7 +82622,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [179 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [181 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCallSignature(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -82441,7 +82630,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [180 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [182 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructSignature(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -82449,7 +82638,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [181 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [183 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIndexSignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82457,7 +82646,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [182 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [184 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypePredicateNode(
node,
nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword),
@@ -82465,14 +82654,14 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [183 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [185 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeReferenceNode(
node,
nodeVisitor(node.typeName, visitor, isEntityName),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [184 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [186 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateFunctionTypeNode(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -82480,7 +82669,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [185 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [187 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructorTypeNode(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82489,56 +82678,56 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [186 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [188 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeQueryNode(
node,
nodeVisitor(node.exprName, visitor, isEntityName),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [187 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [189 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeLiteralNode(
node,
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [188 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [190 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayTypeNode(
node,
nodeVisitor(node.elementType, visitor, isTypeNode)
);
},
- [189 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [191 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateTupleTypeNode(
node,
nodesVisitor(node.elements, visitor, isTypeNode)
);
},
- [190 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [192 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateOptionalTypeNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [191 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [193 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateRestTypeNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [192 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [194 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateUnionTypeNode(
node,
nodesVisitor(node.types, visitor, isTypeNode)
);
},
- [193 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [195 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateIntersectionTypeNode(
node,
nodesVisitor(node.types, visitor, isTypeNode)
);
},
- [194 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [196 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConditionalTypeNode(
node,
nodeVisitor(node.checkType, visitor, isTypeNode),
@@ -82547,13 +82736,13 @@ var visitEachChildTable = {
nodeVisitor(node.falseType, visitor, isTypeNode)
);
},
- [195 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [197 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateInferTypeNode(
node,
nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)
);
},
- [205 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [207 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportTypeNode(
node,
nodeVisitor(node.argument, visitor, isTypeNode),
@@ -82563,14 +82752,14 @@ var visitEachChildTable = {
node.isTypeOf
);
},
- [304 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [307 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportTypeAssertionContainer(
node,
nodeVisitor(node.assertClause, visitor, isAssertClause),
node.multiLine
);
},
- [202 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [204 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateNamedTupleMember(
node,
nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken),
@@ -82579,26 +82768,26 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [196 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [198 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateParenthesizedType(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [198 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [200 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeOperatorNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [199 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [201 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIndexedAccessTypeNode(
node,
nodeVisitor(node.objectType, visitor, isTypeNode),
nodeVisitor(node.indexType, visitor, isTypeNode)
);
},
- [200 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [202 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMappedTypeNode(
node,
nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken),
@@ -82609,39 +82798,39 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [201 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [203 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateLiteralTypeNode(
node,
nodeVisitor(node.literal, visitor, isExpression)
);
},
- [203 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [205 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateLiteralType(
node,
nodeVisitor(node.head, visitor, isTemplateHead),
nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan)
);
},
- [204 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [206 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateLiteralTypeSpan(
node,
nodeVisitor(node.type, visitor, isTypeNode),
nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)
);
},
- [206 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [208 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateObjectBindingPattern(
node,
nodesVisitor(node.elements, visitor, isBindingElement)
);
},
- [207 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [209 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayBindingPattern(
node,
nodesVisitor(node.elements, visitor, isArrayBindingElement)
);
},
- [208 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [210 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateBindingElement(
node,
nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken),
@@ -82650,19 +82839,19 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [209 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [211 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayLiteralExpression(
node,
nodesVisitor(node.elements, visitor, isExpression)
);
},
- [210 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [212 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateObjectLiteralExpression(
node,
nodesVisitor(node.properties, visitor, isObjectLiteralElementLike)
);
},
- [211 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [213 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82674,7 +82863,7 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isMemberName)
);
},
- [212 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [214 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return isElementAccessChain(node) ? context.factory.updateElementAccessChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82686,7 +82875,7 @@ var visitEachChildTable = {
nodeVisitor(node.argumentExpression, visitor, isExpression)
);
},
- [213 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [215 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return isCallChain(node) ? context.factory.updateCallChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82700,7 +82889,7 @@ var visitEachChildTable = {
nodesVisitor(node.arguments, visitor, isExpression)
);
},
- [220 /* EtsComponentExpression */]: function visitEachChildOfEtsComponentExpression(node, visitor, context, nodesVisitor, nodeVisitor) {
+ [222 /* EtsComponentExpression */]: function visitEachChildOfEtsComponentExpression(node, visitor, context, nodesVisitor, nodeVisitor) {
return context.factory.updateEtsComponentExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82708,7 +82897,7 @@ var visitEachChildTable = {
nodeVisitor(node.body, visitor, isBlock)
);
},
- [214 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [216 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNewExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82716,7 +82905,7 @@ var visitEachChildTable = {
nodesVisitor(node.arguments, visitor, isExpression)
);
},
- [215 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [217 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTaggedTemplateExpression(
node,
nodeVisitor(node.tag, visitor, isExpression),
@@ -82724,20 +82913,20 @@ var visitEachChildTable = {
nodeVisitor(node.template, visitor, isTemplateLiteral)
);
},
- [216 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [218 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeAssertion(
node,
nodeVisitor(node.type, visitor, isTypeNode),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [217 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [219 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateParenthesizedExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [218 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [220 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateFunctionExpression(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82749,7 +82938,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [219 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [221 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateArrowFunction(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82760,43 +82949,43 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [221 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [223 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDeleteExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [222 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [224 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeOfExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [223 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [225 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateVoidExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [224 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [226 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAwaitExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [225 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [227 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePrefixUnaryExpression(
node,
nodeVisitor(node.operand, visitor, isExpression)
);
},
- [226 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [228 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePostfixUnaryExpression(
node,
nodeVisitor(node.operand, visitor, isExpression)
);
},
- [227 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [229 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateBinaryExpression(
node,
nodeVisitor(node.left, visitor, isExpression),
@@ -82804,7 +82993,7 @@ var visitEachChildTable = {
nodeVisitor(node.right, visitor, isExpression)
);
},
- [228 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [230 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateConditionalExpression(
node,
nodeVisitor(node.condition, visitor, isExpression),
@@ -82814,27 +83003,27 @@ var visitEachChildTable = {
nodeVisitor(node.whenFalse, visitor, isExpression)
);
},
- [229 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [231 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateExpression(
node,
nodeVisitor(node.head, visitor, isTemplateHead),
nodesVisitor(node.templateSpans, visitor, isTemplateSpan)
);
},
- [230 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [232 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateYieldExpression(
node,
nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [231 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [233 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSpreadElement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [232 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [234 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateClassExpression(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -82844,28 +83033,28 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [234 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [236 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExpressionWithTypeArguments(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [235 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [237 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAsExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [239 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [241 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSatisfiesExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [236 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [238 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return isOptionalChain(node) ? context.factory.updateNonNullChain(
node,
nodeVisitor(node.expression, visitor, isExpression)
@@ -82874,39 +83063,39 @@ var visitEachChildTable = {
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [237 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [239 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateMetaProperty(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [240 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [242 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateSpan(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)
);
},
- [242 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [244 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateBlock(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [244 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [246 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateVariableStatement(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)
);
},
- [245 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [247 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExpressionStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [246 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [248 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIfStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82914,21 +83103,21 @@ var visitEachChildTable = {
nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [247 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [249 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDoStatement(
node,
visitIterationBody(node.statement, visitor, context, nodeVisitor),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [248 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [250 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateWhileStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [249 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [251 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateForStatement(
node,
nodeVisitor(node.initializer, visitor, isForInitializer),
@@ -82937,7 +83126,7 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [250 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [252 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateForInStatement(
node,
nodeVisitor(node.initializer, visitor, isForInitializer),
@@ -82945,7 +83134,7 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [251 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [253 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateForOfStatement(
node,
nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword),
@@ -82954,52 +83143,52 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [252 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [254 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateContinueStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier)
);
},
- [253 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [255 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateBreakStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier)
);
},
- [254 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [256 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateReturnStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [255 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [257 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateWithStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [256 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [258 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSwitchStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.caseBlock, visitor, isCaseBlock)
);
},
- [257 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [259 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateLabeledStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier),
nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [258 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [260 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateThrowStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [259 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [261 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTryStatement(
node,
nodeVisitor(node.tryBlock, visitor, isBlock),
@@ -83007,7 +83196,7 @@ var visitEachChildTable = {
nodeVisitor(node.finallyBlock, visitor, isBlock)
);
},
- [261 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [263 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateVariableDeclaration(
node,
nodeVisitor(node.name, visitor, isBindingName),
@@ -83016,13 +83205,13 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [262 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [264 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateVariableDeclarationList(
node,
nodesVisitor(node.declarations, visitor, isVariableDeclaration)
);
},
- [263 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [265 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateFunctionDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83034,7 +83223,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [264 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [266 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateClassDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -83044,7 +83233,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [265 /* StructDeclaration */]: function visitEachChildOfStructDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [267 /* StructDeclaration */]: function visitEachChildOfStructDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateStructDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83054,7 +83243,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [266 /* AnnotationDeclaration */]: function visitEachChildOfAnnotationDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [268 /* AnnotationDeclaration */]: function visitEachChildOfAnnotationDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAnnotationDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83062,7 +83251,15 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isAnnotationElement)
);
},
- [267 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [269 /* OverloadDeclaration */]: function visitEachChildOfOverloadDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ return context.factory.updateOverloadDeclaration(
+ node,
+ nodesVisitor(node.modifiers, visitor, isModifier),
+ nodeVisitor(node.name, visitor, isIdentifier),
+ nodesVisitor(node.members, visitor, isOverloadElement)
+ );
+ },
+ [270 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateInterfaceDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83072,7 +83269,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [268 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [271 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeAliasDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83081,7 +83278,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [269 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [272 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateEnumDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83089,7 +83286,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isEnumMember)
);
},
- [270 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [273 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateModuleDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83097,25 +83294,25 @@ var visitEachChildTable = {
nodeVisitor(node.body, visitor, isModuleBody)
);
},
- [271 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [274 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateModuleBlock(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [272 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [275 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateCaseBlock(
node,
nodesVisitor(node.clauses, visitor, isCaseOrDefaultClause)
);
},
- [273 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [276 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceExportDeclaration(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [274 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [277 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportEqualsDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83124,7 +83321,7 @@ var visitEachChildTable = {
nodeVisitor(node.moduleReference, visitor, isModuleReference)
);
},
- [275 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [278 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83133,21 +83330,21 @@ var visitEachChildTable = {
nodeVisitor(node.assertClause, visitor, isAssertClause)
);
},
- [302 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [305 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateAssertClause(
node,
nodesVisitor(node.elements, visitor, isAssertEntry),
node.multiLine
);
},
- [303 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [306 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAssertEntry(
node,
nodeVisitor(node.name, visitor, isAssertionKey),
nodeVisitor(node.value, visitor, isExpression)
);
},
- [276 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [279 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportClause(
node,
node.isTypeOnly,
@@ -83155,25 +83352,25 @@ var visitEachChildTable = {
nodeVisitor(node.namedBindings, visitor, isNamedImportBindings)
);
},
- [277 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [280 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceImport(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [283 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [286 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceExport(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [278 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [281 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateNamedImports(
node,
nodesVisitor(node.elements, visitor, isImportSpecifier)
);
},
- [279 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [282 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportSpecifier(
node,
node.isTypeOnly,
@@ -83181,14 +83378,14 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [280 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [283 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportAssignment(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [281 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [284 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83198,13 +83395,13 @@ var visitEachChildTable = {
nodeVisitor(node.assertClause, visitor, isAssertClause)
);
},
- [282 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [285 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateNamedExports(
node,
nodesVisitor(node.elements, visitor, isExportSpecifier)
);
},
- [284 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [287 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportSpecifier(
node,
node.isTypeOnly,
@@ -83212,13 +83409,13 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [286 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [289 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExternalModuleReference(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [287 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [290 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxElement(
node,
nodeVisitor(node.openingElement, visitor, isJsxOpeningElement),
@@ -83226,7 +83423,7 @@ var visitEachChildTable = {
nodeVisitor(node.closingElement, visitor, isJsxClosingElement)
);
},
- [288 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [291 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxSelfClosingElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression),
@@ -83234,7 +83431,7 @@ var visitEachChildTable = {
nodeVisitor(node.attributes, visitor, isJsxAttributes)
);
},
- [289 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [292 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxOpeningElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression),
@@ -83242,13 +83439,13 @@ var visitEachChildTable = {
nodeVisitor(node.attributes, visitor, isJsxAttributes)
);
},
- [290 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [293 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxClosingElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)
);
},
- [291 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [294 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxFragment(
node,
nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment),
@@ -83256,97 +83453,97 @@ var visitEachChildTable = {
nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)
);
},
- [294 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [297 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxAttribute(
node,
nodeVisitor(node.name, visitor, isIdentifier),
nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression)
);
},
- [295 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [298 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxAttributes(
node,
nodesVisitor(node.properties, visitor, isJsxAttributeLike)
);
},
- [296 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [299 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxSpreadAttribute(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [297 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [300 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [298 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [301 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCaseClause(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [299 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [302 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateDefaultClause(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [300 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [303 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateHeritageClause(
node,
nodesVisitor(node.types, visitor, isExpressionWithTypeArguments)
);
},
- [301 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [304 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCatchClause(
node,
nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration),
nodeVisitor(node.block, visitor, isBlock)
);
},
- [305 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [308 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePropertyAssignment(
node,
nodeVisitor(node.name, visitor, isPropertyName),
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [306 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [309 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateShorthandPropertyAssignment(
node,
nodeVisitor(node.name, visitor, isIdentifier),
nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression)
);
},
- [307 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [310 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSpreadAssignment(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [308 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [311 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateEnumMember(
node,
nodeVisitor(node.name, visitor, isPropertyName),
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [314 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [317 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateSourceFile(
node,
visitLexicalEnvironment(node.statements, visitor, context)
);
},
- [359 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [362 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePartiallyEmittedExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [360 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [363 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateCommaListExpression(
node,
nodesVisitor(node.elements, visitor, isExpression)
@@ -83920,7 +84117,7 @@ function isNamedDefaultReference(e) {
function chainBundle(context, transformSourceFile) {
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- return node.kind === 314 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
+ return node.kind === 317 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
}
function transformBundle(node) {
return context.factory.createBundle(map(node.sourceFiles, transformSourceFile), node.prepends);
@@ -83963,7 +84160,7 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
let hasImportDefault = false;
for (const node of sourceFile.statements) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
externalImports.push(node);
if (!hasImportStar && getImportNeedsImportStarHelper(node)) {
hasImportStar = true;
@@ -83972,12 +84169,12 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
hasImportDefault = true;
}
break;
- case 274 /* ImportEqualsDeclaration */:
- if (node.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ case 277 /* ImportEqualsDeclaration */:
+ if (node.moduleReference.kind === 289 /* ExternalModuleReference */) {
externalImports.push(node);
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
if (node.moduleSpecifier) {
if (!node.exportClause) {
externalImports.push(node);
@@ -84000,19 +84197,19 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
addExportedNamesForExportDeclaration(node);
}
break;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
if (node.isExportEquals && !exportEquals) {
exportEquals = node;
}
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (hasSyntacticModifier(node, 1 /* Export */)) {
for (const decl of node.declarationList.declarations) {
exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames);
}
}
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (hasSyntacticModifier(node, 1 /* Export */)) {
if (hasSyntacticModifier(node, 1024 /* Default */)) {
if (!hasExportDefault) {
@@ -84029,7 +84226,7 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
}
}
break;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
if (hasSyntacticModifier(node, 1 /* Export */)) {
if (hasSyntacticModifier(node, 1024 /* Default */)) {
if (!hasExportDefault) {
@@ -84173,7 +84370,7 @@ function isStaticPropertyDeclaration(member) {
return isPropertyDeclaration(member) && hasStaticModifier(member);
}
function isInitializedProperty(member) {
- return member.kind === 171 /* PropertyDeclaration */ && member.initializer !== void 0;
+ return member.kind === 172 /* PropertyDeclaration */ && member.initializer !== void 0;
}
function isNonStaticMethodOrAccessorWithPrivateName(member) {
return !isStatic(member) && (isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member)) && isPrivateIdentifier(member.name);
@@ -84210,12 +84407,12 @@ function getAllDecoratorsOfClass(node) {
}
function getAllDecoratorsOfClassElement(member, parent2) {
switch (member.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return getAllDecoratorsOfAccessors(member, parent2);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return getAllDecoratorsOfMethod(member);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return getAllDecoratorsOfProperty(member);
default:
return void 0;
@@ -84687,8 +84884,8 @@ function transformTypeScript(context) {
const previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(212 /* ElementAccessExpression */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(214 /* ElementAccessExpression */);
let currentSourceFile;
let currentNamespace;
let currentNamespaceContainerName;
@@ -84699,14 +84896,14 @@ function transformTypeScript(context) {
let applicableSubstitutions;
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- if (node.kind === 315 /* Bundle */) {
+ if (node.kind === 318 /* Bundle */) {
return transformBundle(node);
}
return transformSourceFile(node);
}
function transformBundle(node) {
return factory2.createBundle(node.sourceFiles.map(transformSourceFile), mapDefined(node.prepends, (prepend) => {
- if (prepend.kind === 317 /* InputFiles */) {
+ if (prepend.kind === 320 /* InputFiles */) {
return createUnparsedSourceFile(prepend, "js");
}
return prepend;
@@ -84737,22 +84934,22 @@ function transformTypeScript(context) {
}
function onBeforeVisitNode(node) {
switch (node.kind) {
- case 314 /* SourceFile */:
- case 272 /* CaseBlock */:
- case 271 /* ModuleBlock */:
- case 242 /* Block */:
+ case 317 /* SourceFile */:
+ case 275 /* CaseBlock */:
+ case 274 /* ModuleBlock */:
+ case 244 /* Block */:
currentLexicalScope = node;
currentScopeFirstDeclarationsOfName = void 0;
break;
- case 264 /* ClassDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (hasSyntacticModifier(node, 2 /* Ambient */)) {
break;
}
if (node.name) {
recordEmittedDeclarationInScope(node);
} else {
- Debug.assert(node.kind === 264 /* ClassDeclaration */ || hasSyntacticModifier(node, 1024 /* Default */));
+ Debug.assert(node.kind === 266 /* ClassDeclaration */ || hasSyntacticModifier(node, 1024 /* Default */));
}
break;
}
@@ -84771,10 +84968,10 @@ function transformTypeScript(context) {
}
function sourceElementVisitorWorker(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 280 /* ExportAssignment */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 284 /* ExportDeclaration */:
return visitElidableStatement(node);
default:
return visitorWorker(node);
@@ -84792,13 +84989,13 @@ function transformTypeScript(context) {
return node;
}
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
default:
Debug.fail("Unhandled ellided statement");
@@ -84808,7 +85005,7 @@ function transformTypeScript(context) {
return saveStateAndInvoke(node, namespaceElementVisitorWorker);
}
function namespaceElementVisitorWorker(node) {
- if (node.kind === 281 /* ExportDeclaration */ || node.kind === 275 /* ImportDeclaration */ || node.kind === 276 /* ImportClause */ || node.kind === 274 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ if (node.kind === 284 /* ExportDeclaration */ || node.kind === 278 /* ImportDeclaration */ || node.kind === 279 /* ImportClause */ || node.kind === 277 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 289 /* ExternalModuleReference */) {
return void 0;
} else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 1 /* Export */)) {
return visitTypeScript(node);
@@ -84820,21 +85017,21 @@ function transformTypeScript(context) {
}
function classElementVisitorWorker(node, parent2) {
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return visitConstructor(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return visitPropertyDeclaration(node, parent2);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return visitGetAccessor(node, parent2);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return visitSetAccessor(node, parent2);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node, parent2);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return visitEachChild(node, visitor, context);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return node;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return;
default:
return Debug.failBadSyntaxKind(node);
@@ -84845,15 +85042,15 @@ function transformTypeScript(context) {
}
function objectLiteralElementVisitorWorker(node, parent2) {
switch (node.kind) {
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return visitor(node);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return visitGetAccessor(node, parent2);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return visitSetAccessor(node, parent2);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node, parent2);
default:
return Debug.failBadSyntaxKind(node);
@@ -84888,13 +85085,13 @@ function transformTypeScript(context) {
case 147 /* ReadonlyKeyword */:
case 102 /* InKeyword */:
case 146 /* OutKeyword */:
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
- case 190 /* OptionalType */:
- case 191 /* RestType */:
- case 187 /* TypeLiteral */:
- case 182 /* TypePredicate */:
- case 167 /* TypeParameter */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
+ case 192 /* OptionalType */:
+ case 193 /* RestType */:
+ case 189 /* TypeLiteral */:
+ case 184 /* TypePredicate */:
+ case 168 /* TypeParameter */:
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
case 135 /* BooleanKeyword */:
@@ -84903,83 +85100,86 @@ function transformTypeScript(context) {
case 145 /* NeverKeyword */:
case 115 /* VoidKeyword */:
case 154 /* SymbolKeyword */:
- case 185 /* ConstructorType */:
- case 184 /* FunctionType */:
- case 186 /* TypeQuery */:
- case 183 /* TypeReference */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 194 /* ConditionalType */:
- case 196 /* ParenthesizedType */:
- case 197 /* ThisType */:
- case 198 /* TypeOperator */:
- case 199 /* IndexedAccessType */:
- case 200 /* MappedType */:
- case 201 /* LiteralType */:
- case 181 /* IndexSignature */:
+ case 187 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 188 /* TypeQuery */:
+ case 185 /* TypeReference */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 196 /* ConditionalType */:
+ case 198 /* ParenthesizedType */:
+ case 199 /* ThisType */:
+ case 200 /* TypeOperator */:
+ case 201 /* IndexedAccessType */:
+ case 202 /* MappedType */:
+ case 203 /* LiteralType */:
+ case 183 /* IndexSignature */:
return void 0;
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return factory2.createNotEmittedStatement(node);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return void 0;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return factory2.createNotEmittedStatement(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ return factory2.createNotEmittedStatement(node);
+ case 269 /* OverloadDeclaration */:
return factory2.createNotEmittedStatement(node);
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return visitHeritageClause(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return visitExpressionWithTypeArguments(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
return Debug.fail("Class and object literal elements must be visited with their respective visitors");
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return visitArrowFunction(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameter(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node);
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return visitAssertionExpression(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return visitSatisfiesExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return visitNewExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return visitNonNullExpression(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return visitEnumDeclaration(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return visitVariableDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return visitModuleDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return visitJsxSelfClosingElement(node);
- case 289 /* JsxOpeningElement */:
+ case 292 /* JsxOpeningElement */:
return visitJsxJsxOpeningElement(node);
default:
return visitEachChild(node, visitor, context);
@@ -85211,19 +85411,19 @@ function transformTypeScript(context) {
}
function shouldAddTypeMetadata(node) {
const kind = node.kind;
- return kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 171 /* PropertyDeclaration */;
+ return kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 172 /* PropertyDeclaration */;
}
function shouldAddReturnTypeMetadata(node) {
- return node.kind === 174 /* MethodDeclaration */;
+ return node.kind === 176 /* MethodDeclaration */;
}
function shouldAddParamTypesMetadata(node) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return getFirstConstructorWithBody(node) !== void 0;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
}
return false;
@@ -85756,12 +85956,12 @@ function transformTypeScript(context) {
factory2.createVariableDeclaration(
factory2.getLocalName(node, false, true)
)
- ], currentLexicalScope.kind === 314 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)
+ ], currentLexicalScope.kind === 317 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)
);
setOriginalNode(statement, node);
recordEmittedDeclarationInScope(node);
if (isFirstEmittedDeclarationInScope(node)) {
- if (node.kind === 269 /* EnumDeclaration */) {
+ if (node.kind === 272 /* EnumDeclaration */) {
setSourceMapRange(statement.declarationList, node);
} else {
setSourceMapRange(statement, node);
@@ -85843,7 +86043,7 @@ function transformTypeScript(context) {
let statementsLocation;
let blockLocation;
if (node.body) {
- if (node.body.kind === 271 /* ModuleBlock */) {
+ if (node.body.kind === 274 /* ModuleBlock */) {
saveStateAndInvoke(node.body, (body) => addRange(statements, visitNodes2(body.statements, namespaceElementVisitor, isStatement)));
statementsLocation = node.body.statements;
blockLocation = node.body;
@@ -85872,13 +86072,13 @@ function transformTypeScript(context) {
true
);
setTextRange(block, blockLocation);
- if (!node.body || node.body.kind !== 271 /* ModuleBlock */) {
+ if (!node.body || node.body.kind !== 274 /* ModuleBlock */) {
setEmitFlags(block, getEmitFlags(block) | 1536 /* NoComments */);
}
return block;
}
function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) {
- if (moduleDeclaration.body.kind === 270 /* ModuleDeclaration */) {
+ if (moduleDeclaration.body.kind === 273 /* ModuleDeclaration */) {
const recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body);
return recursiveInnerModule || moduleDeclaration.body;
}
@@ -85906,7 +86106,7 @@ function transformTypeScript(context) {
return name || namedBindings ? factory2.updateImportClause(node, false, name, namedBindings) : void 0;
}
function visitNamedImportBindings(node) {
- if (node.kind === 277 /* NamespaceImport */) {
+ if (node.kind === 280 /* NamespaceImport */) {
return shouldEmitAliasDeclaration(node) ? node : void 0;
} else {
const allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */);
@@ -86076,15 +86276,15 @@ function transformTypeScript(context) {
if ((enabledSubstitutions & 2 /* NamespaceExports */) === 0) {
enabledSubstitutions |= 2 /* NamespaceExports */;
context.enableSubstitution(79 /* Identifier */);
- context.enableSubstitution(306 /* ShorthandPropertyAssignment */);
- context.enableEmitNotification(270 /* ModuleDeclaration */);
+ context.enableSubstitution(309 /* ShorthandPropertyAssignment */);
+ context.enableEmitNotification(273 /* ModuleDeclaration */);
}
}
function isTransformedModuleDeclaration(node) {
- return getOriginalNode(node).kind === 270 /* ModuleDeclaration */;
+ return getOriginalNode(node).kind === 273 /* ModuleDeclaration */;
}
function isTransformedEnumDeclaration(node) {
- return getOriginalNode(node).kind === 269 /* EnumDeclaration */;
+ return getOriginalNode(node).kind === 272 /* EnumDeclaration */;
}
function onEmitNode(hint, node, emitCallback) {
const savedApplicableSubstitutions = applicableSubstitutions;
@@ -86129,9 +86329,9 @@ function transformTypeScript(context) {
switch (node.kind) {
case 79 /* Identifier */:
return substituteExpressionIdentifier(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return substitutePropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return substituteElementAccessExpression(node);
}
return node;
@@ -86142,8 +86342,8 @@ function transformTypeScript(context) {
function trySubstituteNamespaceExportedName(node) {
if (enabledSubstitutions & applicableSubstitutions && !isGeneratedIdentifier(node) && !isLocalName(node)) {
const container = resolver.getReferencedExportContainer(node, false);
- if (container && container.kind !== 314 /* SourceFile */) {
- const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 270 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 269 /* EnumDeclaration */;
+ if (container && container.kind !== 317 /* SourceFile */) {
+ const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 273 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 272 /* EnumDeclaration */;
if (substitute) {
return setTextRange(
factory2.createPropertyAccessExpression(factory2.getGeneratedNameForNode(container), node),
@@ -86245,45 +86445,49 @@ function transformClassFields(context) {
switch (node.kind) {
case 128 /* AccessorKeyword */:
return shouldTransformAutoAccessors ? void 0 : node;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return void 0;
- case 232 /* ClassExpression */:
+ case 269 /* OverloadDeclaration */:
+ return void 0;
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return visitClassStaticBlockDeclaration(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return visitPropertyDeclaration(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ return void 0;
+ case 174 /* OverloadPropertyDeclaration */:
return void 0;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
case 80 /* PrivateIdentifier */:
return visitPrivateIdentifier(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return visitPropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitElementAccessExpression(node);
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPreOrPostfixUnaryExpression(node, false);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, false);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */: {
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */: {
return setCurrentStaticPropertyDeclarationOrStaticBlockAnd(
void 0,
fallbackVisitor,
@@ -86299,10 +86503,10 @@ function transformClassFields(context) {
}
function discardedValueVisitor(node) {
switch (node.kind) {
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPreOrPostfixUnaryExpression(node, true);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, true);
default:
return visitor(node);
@@ -86310,9 +86514,9 @@ function transformClassFields(context) {
}
function heritageClauseVisitor(node) {
switch (node.kind) {
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return visitEachChild(node, heritageClauseVisitor, context);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return visitExpressionWithTypeArgumentsInHeritageClause(node);
default:
return visitor(node);
@@ -86320,8 +86524,8 @@ function transformClassFields(context) {
}
function assignmentTargetVisitor(node) {
switch (node.kind) {
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return visitAssignmentPattern(node);
default:
return visitor(node);
@@ -86329,25 +86533,25 @@ function transformClassFields(context) {
}
function classElementVisitor(node) {
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return visitConstructorDeclaration(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
return setCurrentStaticPropertyDeclarationOrStaticBlockAnd(
void 0,
visitMethodOrAccessorDeclaration,
node
);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return setCurrentStaticPropertyDeclarationOrStaticBlockAnd(
void 0,
visitPropertyDeclaration,
node
);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return visitComputedPropertyName(node);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return node;
default:
return visitor(node);
@@ -86355,10 +86559,10 @@ function transformClassFields(context) {
}
function accessorFieldResultVisitor(node) {
switch (node.kind) {
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return transformFieldInitializer(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return classElementVisitor(node);
default:
Debug.assertMissingNode(node, "Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration");
@@ -87442,14 +87646,14 @@ function transformClassFields(context) {
if ((enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */) === 0) {
enabledSubstitutions |= 2 /* ClassStaticThisOrSuperReference */;
context.enableSubstitution(109 /* ThisKeyword */);
- context.enableEmitNotification(263 /* FunctionDeclaration */);
- context.enableEmitNotification(218 /* FunctionExpression */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(171 /* PropertyDeclaration */);
- context.enableEmitNotification(166 /* ComputedPropertyName */);
+ context.enableEmitNotification(265 /* FunctionDeclaration */);
+ context.enableEmitNotification(220 /* FunctionExpression */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(172 /* PropertyDeclaration */);
+ context.enableEmitNotification(167 /* ComputedPropertyName */);
}
}
function addMethodStatements(statements, methods, receiver) {
@@ -87491,12 +87695,12 @@ function transformClassFields(context) {
}
}
switch (node.kind) {
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
if (isArrowFunction(original) || getEmitFlags(node) & 262144 /* AsyncFunctionBody */) {
break;
}
- case 263 /* FunctionDeclaration */:
- case 176 /* Constructor */: {
+ case 265 /* FunctionDeclaration */:
+ case 178 /* Constructor */: {
const savedClassLexicalEnvironment = currentClassLexicalEnvironment;
const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
currentClassLexicalEnvironment = void 0;
@@ -87506,10 +87710,10 @@ function transformClassFields(context) {
currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment;
return;
}
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- case 171 /* PropertyDeclaration */: {
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 172 /* PropertyDeclaration */: {
const savedClassLexicalEnvironment = currentClassLexicalEnvironment;
const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
currentComputedPropertyNameClassLexicalEnvironment = currentClassLexicalEnvironment;
@@ -87519,7 +87723,7 @@ function transformClassFields(context) {
currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment;
return;
}
- case 166 /* ComputedPropertyName */: {
+ case 167 /* ComputedPropertyName */: {
const savedClassLexicalEnvironment = currentClassLexicalEnvironment;
const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
currentClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
@@ -87993,15 +88197,15 @@ function createRuntimeTypeSerializer(context) {
}
function serializeTypeOfNode(node) {
switch (node.kind) {
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
return serializeTypeNode(node.type);
- case 178 /* SetAccessor */:
- case 177 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 179 /* GetAccessor */:
return serializeTypeNode(getAccessorTypeNode(node));
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 174 /* MethodDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 176 /* MethodDeclaration */:
return factory.createIdentifier("Function");
default:
return factory.createVoidZero();
@@ -88028,7 +88232,7 @@ function createRuntimeTypeSerializer(context) {
return factory.createArrayLiteralExpression(expressions);
}
function getParametersOfDecoratedDeclaration(node, container) {
- if (container && node.kind === 177 /* GetAccessor */) {
+ if (container && node.kind === 179 /* GetAccessor */) {
const { setAccessor } = getAllAccessorDeclarations(container.members, node);
if (setAccessor) {
return setAccessor.parameters;
@@ -88054,22 +88258,22 @@ function createRuntimeTypeSerializer(context) {
case 157 /* UndefinedKeyword */:
case 145 /* NeverKeyword */:
return factory.createVoidZero();
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return factory.createIdentifier("Function");
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
return factory.createIdentifier("Array");
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return node.assertsModifier ? factory.createVoidZero() : factory.createIdentifier("Boolean");
case 135 /* BooleanKeyword */:
return factory.createIdentifier("Boolean");
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
case 153 /* StringKeyword */:
return factory.createIdentifier("String");
case 150 /* ObjectKeyword */:
return factory.createIdentifier("Object");
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return serializeLiteralOfLiteralTypeNode(node.literal);
case 149 /* NumberKeyword */:
return factory.createIdentifier("Number");
@@ -88077,37 +88281,37 @@ function createRuntimeTypeSerializer(context) {
return getGlobalConstructor("BigInt", 7 /* ES2020 */);
case 154 /* SymbolKeyword */:
return getGlobalConstructor("Symbol", 2 /* ES2015 */);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return serializeTypeReferenceNode(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return serializeUnionOrIntersectionConstituents(node.types, true);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return serializeUnionOrIntersectionConstituents(node.types, false);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return serializeUnionOrIntersectionConstituents([node.trueType, node.falseType], false);
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
if (node.operator === 147 /* ReadonlyKeyword */) {
return serializeTypeNode(node.type);
}
break;
- case 186 /* TypeQuery */:
- case 199 /* IndexedAccessType */:
- case 200 /* MappedType */:
- case 187 /* TypeLiteral */:
+ case 188 /* TypeQuery */:
+ case 201 /* IndexedAccessType */:
+ case 202 /* MappedType */:
+ case 189 /* TypeLiteral */:
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
- case 197 /* ThisType */:
- case 205 /* ImportType */:
+ case 199 /* ThisType */:
+ case 207 /* ImportType */:
break;
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
- case 326 /* JSDocFunctionType */:
- case 327 /* JSDocVariadicType */:
- case 328 /* JSDocNamepathType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
+ case 329 /* JSDocFunctionType */:
+ case 330 /* JSDocVariadicType */:
+ case 331 /* JSDocNamepathType */:
break;
- case 323 /* JSDocNullableType */:
- case 324 /* JSDocNonNullableType */:
- case 325 /* JSDocOptionalType */:
+ case 326 /* JSDocNullableType */:
+ case 327 /* JSDocNonNullableType */:
+ case 328 /* JSDocOptionalType */:
return serializeTypeNode(node.type);
default:
return Debug.failBadSyntaxKind(node);
@@ -88119,7 +88323,7 @@ function createRuntimeTypeSerializer(context) {
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return factory.createIdentifier("String");
- case 225 /* PrefixUnaryExpression */: {
+ case 227 /* PrefixUnaryExpression */: {
const operand = node.operand;
switch (operand.kind) {
case 8 /* NumericLiteral */:
@@ -88252,7 +88456,7 @@ function createRuntimeTypeSerializer(context) {
name.original = void 0;
setParent(name, getParseTreeNode(currentLexicalScope));
return name;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return serializeQualifiedNameAsExpression(node);
}
}
@@ -88300,23 +88504,23 @@ function transformLegacyDecorators(context) {
return node;
}
switch (node.kind) {
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return void 0;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return visitConstructorDeclaration(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return visitSetAccessorDeclaration(node);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return visitGetAccessorDeclaration(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return visitPropertyDeclaration(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameterDeclaration(node);
default:
return visitEachChild(node, visitor, context);
@@ -88725,34 +88929,34 @@ function transformES2017(context) {
switch (node.kind) {
case 133 /* AsyncKeyword */:
return void 0;
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return visitAwaitExpression(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 107 /* SuperKeyword */) {
capturedSuperProperties.add(node.name.escapedText);
}
return visitEachChild(node, visitor, context);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (capturedSuperProperties && node.expression.kind === 107 /* SuperKeyword */) {
hasSuperElementAccess = true;
}
return visitEachChild(node, visitor, context);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitGetAccessorDeclaration, node);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitSetAccessorDeclaration, node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitConstructorDeclaration, node);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node);
default:
return visitEachChild(node, visitor, context);
@@ -88761,27 +88965,27 @@ function transformES2017(context) {
function asyncBodyVisitor(node) {
if (isNodeWithPossibleHoistedDeclaration(node)) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatementInAsyncBody(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatementInAsyncBody(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatementInAsyncBody(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatementInAsyncBody(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClauseInAsyncBody(node);
- case 242 /* Block */:
- case 256 /* SwitchStatement */:
- case 272 /* CaseBlock */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 259 /* TryStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 246 /* IfStatement */:
- case 255 /* WithStatement */:
- case 257 /* LabeledStatement */:
+ case 244 /* Block */:
+ case 258 /* SwitchStatement */:
+ case 275 /* CaseBlock */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 261 /* TryStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 248 /* IfStatement */:
+ case 257 /* WithStatement */:
+ case 259 /* LabeledStatement */:
return visitEachChild(node, asyncBodyVisitor, context);
default:
return Debug.assertNever(node, "Unhandled node.");
@@ -89031,7 +89235,7 @@ function transformES2017(context) {
const original = getOriginalNode(node, isFunctionLike);
const nodeType = original.type;
const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
- const isArrowFunction2 = node.kind === 219 /* ArrowFunction */;
+ const isArrowFunction2 = node.kind === 221 /* ArrowFunction */;
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0;
const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
enclosingFunctionParameterNames = new Set2();
@@ -89120,15 +89324,15 @@ function transformES2017(context) {
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) {
enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */;
- context.enableSubstitution(213 /* CallExpression */);
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(212 /* ElementAccessExpression */);
- context.enableEmitNotification(264 /* ClassDeclaration */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(244 /* VariableStatement */);
+ context.enableSubstitution(215 /* CallExpression */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(214 /* ElementAccessExpression */);
+ context.enableEmitNotification(266 /* ClassDeclaration */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(246 /* VariableStatement */);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -89159,11 +89363,11 @@ function transformES2017(context) {
}
function substituteExpression(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return substitutePropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return substituteElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return substituteCallExpression(node);
}
return node;
@@ -89206,7 +89410,7 @@ function transformES2017(context) {
}
function isSuperContainer(node) {
const kind = node.kind;
- return kind === 264 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 266 /* ClassDeclaration */ || kind === 178 /* Constructor */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function createSuperElementAccessInAsyncMethod(argumentExpression, location2) {
if (enclosingSuperContainerFlags & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
@@ -89413,115 +89617,115 @@ function transformES2018(context) {
return node;
}
switch (node.kind) {
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return visitAwaitExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return visitYieldExpression(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitReturnStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, expressionResultIsUnused2);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return visitCommaListExpression(node, expressionResultIsUnused2);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return visitVariableDeclaration(node);
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 250 /* ForInStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 252 /* ForInStatement */:
return doWithHierarchyFacts(
visitDefault,
node,
0 /* IterationStatementExcludes */,
2 /* IterationStatementIncludes */
);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node, void 0);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return doWithHierarchyFacts(
visitForStatement,
node,
0 /* IterationStatementExcludes */,
2 /* IterationStatementIncludes */
);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return visitVoidExpression(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return doWithHierarchyFacts(
visitConstructorDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return doWithHierarchyFacts(
visitMethodDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return doWithHierarchyFacts(
visitGetAccessorDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return doWithHierarchyFacts(
visitSetAccessorDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return doWithHierarchyFacts(
visitFunctionDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return doWithHierarchyFacts(
visitFunctionExpression,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return doWithHierarchyFacts(
visitArrowFunction,
node,
2 /* ArrowFunctionExcludes */,
0 /* ArrowFunctionIncludes */
);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameter(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, expressionResultIsUnused2);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 107 /* SuperKeyword */) {
capturedSuperProperties.add(node.name.escapedText);
}
return visitEachChild(node, visitor, context);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (capturedSuperProperties && node.expression.kind === 107 /* SuperKeyword */) {
hasSuperElementAccess = true;
}
return visitEachChild(node, visitor, context);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return doWithHierarchyFacts(
visitDefault,
node,
@@ -89599,7 +89803,7 @@ function transformES2018(context) {
function visitLabeledStatement(node) {
if (enclosingFunctionFlags & 2 /* Async */) {
const statement = unwrapInnermostStatementOfLabel(node);
- if (statement.kind === 251 /* ForOfStatement */ && statement.awaitModifier) {
+ if (statement.kind === 253 /* ForOfStatement */ && statement.awaitModifier) {
return visitForOfStatement(statement, node);
}
return factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node);
@@ -89610,7 +89814,7 @@ function transformES2018(context) {
let chunkObject;
const objects = [];
for (const e of elements) {
- if (e.kind === 307 /* SpreadAssignment */) {
+ if (e.kind === 310 /* SpreadAssignment */) {
if (chunkObject) {
objects.push(factory2.createObjectLiteralExpression(chunkObject));
chunkObject = void 0;
@@ -89618,7 +89822,7 @@ function transformES2018(context) {
const target = e.expression;
objects.push(visitNode(target, visitor, isExpression));
} else {
- chunkObject = append(chunkObject, e.kind === 305 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike));
+ chunkObject = append(chunkObject, e.kind === 308 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike));
}
}
if (chunkObject) {
@@ -89629,7 +89833,7 @@ function transformES2018(context) {
function visitObjectLiteralExpression(node) {
if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) {
const objects = chunkObjectLiteralElements(node.properties);
- if (objects.length && objects[0].kind !== 210 /* ObjectLiteralExpression */) {
+ if (objects.length && objects[0].kind !== 212 /* ObjectLiteralExpression */) {
objects.unshift(factory2.createObjectLiteralExpression());
}
let expression = objects[0];
@@ -90282,15 +90486,15 @@ function transformES2018(context) {
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) {
enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */;
- context.enableSubstitution(213 /* CallExpression */);
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(212 /* ElementAccessExpression */);
- context.enableEmitNotification(264 /* ClassDeclaration */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(244 /* VariableStatement */);
+ context.enableSubstitution(215 /* CallExpression */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(214 /* ElementAccessExpression */);
+ context.enableEmitNotification(266 /* ClassDeclaration */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(246 /* VariableStatement */);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -90321,11 +90525,11 @@ function transformES2018(context) {
}
function substituteExpression(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return substitutePropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return substituteElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return substituteCallExpression(node);
}
return node;
@@ -90368,7 +90572,7 @@ function transformES2018(context) {
}
function isSuperContainer(node) {
const kind = node.kind;
- return kind === 264 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 266 /* ClassDeclaration */ || kind === 178 /* Constructor */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function createSuperElementAccessInAsyncMethod(argumentExpression, location2) {
if (enclosingSuperContainerFlags & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
@@ -90411,7 +90615,7 @@ function transformES2019(context) {
return node;
}
switch (node.kind) {
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
default:
return visitEachChild(node, visitor, context);
@@ -90447,25 +90651,25 @@ function transformES2020(context) {
return node;
}
switch (node.kind) {
- case 213 /* CallExpression */: {
+ case 215 /* CallExpression */: {
const updated = visitNonOptionalCallExpression(node, false);
Debug.assertNotNode(updated, isSyntheticReference);
return updated;
}
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (isOptionalChain(node)) {
const updated = visitOptionalExpression(node, false, false);
Debug.assertNotNode(updated, isSyntheticReference);
return updated;
}
return visitEachChild(node, visitor, context);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) {
return transformNullishCoalescingExpression(node);
}
return visitEachChild(node, visitor, context);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return visitDeleteExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -90503,7 +90707,7 @@ function transformES2020(context) {
thisArg = expression;
}
}
- expression = node.kind === 211 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression));
+ expression = node.kind === 213 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression));
return thisArg ? factory2.createSyntheticReferenceExpression(expression, thisArg) : expression;
}
function visitNonOptionalCallExpression(node, captureThisArg) {
@@ -90522,12 +90726,12 @@ function transformES2020(context) {
}
function visitNonOptionalExpression(node, captureThisArg, isDelete) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitNonOptionalCallExpression(node, captureThisArg);
default:
return visitNode(node, visitor, isExpression);
@@ -90548,8 +90752,8 @@ function transformES2020(context) {
for (let i = 0; i < chain.length; i++) {
const segment = chain[i];
switch (segment.kind) {
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (i === chain.length - 1 && captureThisArg) {
if (!isSimpleCopiableExpression(rightExpression)) {
thisArg = factory2.createTempVariable(hoistVariableDeclaration);
@@ -90558,9 +90762,9 @@ function transformES2020(context) {
thisArg = rightExpression;
}
}
- rightExpression = segment.kind === 211 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression));
+ rightExpression = segment.kind === 213 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression));
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (i === 0 && leftThisArg) {
if (!isGeneratedIdentifier(leftThisArg)) {
leftThisArg = factory2.cloneNode(leftThisArg);
@@ -90639,7 +90843,7 @@ function transformES2021(context) {
return node;
}
switch (node.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const binaryExpression = node;
if (isLogicalOrCoalescingAssignmentExpression(binaryExpression)) {
return transformLogicalAssignment(binaryExpression);
@@ -90817,13 +91021,13 @@ function transformJsx(context) {
}
function visitorWorker(node) {
switch (node.kind) {
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return visitJsxElement(node, false);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return visitJsxSelfClosingElement(node, false);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return visitJsxFragment(node, false);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return visitJsxExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -90833,13 +91037,13 @@ function transformJsx(context) {
switch (node.kind) {
case 11 /* JsxText */:
return visitJsxText(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return visitJsxExpression(node);
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return visitJsxElement(node, true);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return visitJsxSelfClosingElement(node, true);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return visitJsxFragment(node, true);
default:
return Debug.failBadSyntaxKind(node);
@@ -91034,7 +91238,7 @@ function transformJsx(context) {
const literal = factory2.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote);
return setTextRange(literal, node);
}
- if (node.kind === 297 /* JsxExpression */) {
+ if (node.kind === 300 /* JsxExpression */) {
if (node.expression === void 0) {
return factory2.createTrue();
}
@@ -91096,7 +91300,7 @@ function transformJsx(context) {
return decoded === text ? void 0 : decoded;
}
function getTagName(node) {
- if (node.kind === 287 /* JsxElement */) {
+ if (node.kind === 290 /* JsxElement */) {
return getTagName(node.openingElement);
} else {
const name = node.tagName;
@@ -91395,7 +91599,7 @@ function transformES2016(context) {
return node;
}
switch (node.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -91523,7 +91727,7 @@ function transformES2015(context) {
hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -32768 /* SubtreeFactsMask */ | ancestorFacts;
}
function isReturnVoidStatementInConstructorWithCapturedSuper(node) {
- return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 && node.kind === 254 /* ReturnStatement */ && !node.expression;
+ return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 && node.kind === 256 /* ReturnStatement */ && !node.expression;
}
function isOrMayContainReturnCompletion(node) {
return node.transformFlags & 4194304 /* ContainsHoistedDeclarationOrCompletion */ && (isReturnStatement(node) || isIfStatement(node) || isWithStatement(node) || isSwitchStatement(node) || isCaseBlock(node) || isCaseClause(node) || isDefaultClause(node) || isTryStatement(node) || isCatchClause(node) || isLabeledStatement(node) || isIterationStatement(node, false) || isBlock(node));
@@ -91563,65 +91767,65 @@ function transformES2015(context) {
switch (node.kind) {
case 125 /* StaticKeyword */:
return void 0;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameter(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return visitArrowFunction(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return visitVariableDeclaration(node);
case 79 /* Identifier */:
return visitIdentifier(node);
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return visitVariableDeclarationList(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return visitSwitchStatement(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return visitCaseBlock(node);
- case 242 /* Block */:
+ case 244 /* Block */:
return visitBlock(node, false);
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
return visitBreakOrContinueStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return visitDoOrWhileStatement(node, void 0);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, void 0);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node, void 0);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node, void 0);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return visitShorthandPropertyAssignment(node);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return visitComputedPropertyName(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return visitArrayLiteralExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return visitNewExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, expressionResultIsUnused2);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, expressionResultIsUnused2);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return visitCommaListExpression(node, expressionResultIsUnused2);
case 14 /* NoSubstitutionTemplateLiteral */:
case 15 /* TemplateHead */:
@@ -91632,30 +91836,30 @@ function transformES2015(context) {
return visitStringLiteral(node);
case 8 /* NumericLiteral */:
return visitNumericLiteral(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return visitTemplateExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return visitYieldExpression(node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return visitSpreadElement(node);
case 107 /* SuperKeyword */:
return visitSuperKeyword(false);
case 109 /* ThisKeyword */:
return visitThisKeyword(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return visitMetaProperty(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return visitAccessorDeclaration(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitReturnStatement(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return visitVoidExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -91756,13 +91960,13 @@ function transformES2015(context) {
}
function visitBreakOrContinueStatement(node) {
if (convertedLoopState) {
- const jump = node.kind === 253 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */;
+ const jump = node.kind === 255 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */;
const canUseBreakOrContinue = node.label && convertedLoopState.labels && convertedLoopState.labels.get(idText(node.label)) || !node.label && convertedLoopState.allowedNonLabeledJumps & jump;
if (!canUseBreakOrContinue) {
let labelMarker;
const label = node.label;
if (!label) {
- if (node.kind === 253 /* BreakStatement */) {
+ if (node.kind === 255 /* BreakStatement */) {
convertedLoopState.nonLocalJumps |= 2 /* Break */;
labelMarker = "break";
} else {
@@ -91770,7 +91974,7 @@ function transformES2015(context) {
labelMarker = "continue";
}
} else {
- if (node.kind === 253 /* BreakStatement */) {
+ if (node.kind === 255 /* BreakStatement */) {
labelMarker = `break-${label.escapedText}`;
setLabeledJump(convertedLoopState, true, idText(label), labelMarker);
} else {
@@ -92014,14 +92218,14 @@ function transformES2015(context) {
};
}
function isSufficientlyCoveredByReturnStatements(statement) {
- if (statement.kind === 254 /* ReturnStatement */) {
+ if (statement.kind === 256 /* ReturnStatement */) {
return true;
- } else if (statement.kind === 246 /* IfStatement */) {
+ } else if (statement.kind === 248 /* IfStatement */) {
const ifStatement = statement;
if (ifStatement.elseStatement) {
return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement);
}
- } else if (statement.kind === 242 /* Block */) {
+ } else if (statement.kind === 244 /* Block */) {
const lastStatement = lastOrUndefined(statement.statements);
if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {
return true;
@@ -92263,7 +92467,7 @@ function transformES2015(context) {
return true;
}
function insertCaptureThisForNodeIfNeeded(statements, node) {
- if (hierarchyFacts & 65536 /* CapturedLexicalThis */ && node.kind !== 219 /* ArrowFunction */) {
+ if (hierarchyFacts & 65536 /* CapturedLexicalThis */ && node.kind !== 221 /* ArrowFunction */) {
insertCaptureThisForNode(statements, node, factory2.createThis());
return true;
}
@@ -92302,21 +92506,21 @@ function transformES2015(context) {
if (hierarchyFacts & 32768 /* NewTarget */) {
let newTarget;
switch (node.kind) {
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return statements;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
newTarget = factory2.createVoidZero();
break;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
newTarget = factory2.createPropertyAccessExpression(
setEmitFlags(factory2.createThis(), 4 /* NoSubstitution */),
"constructor"
);
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
newTarget = factory2.createConditionalExpression(
factory2.createLogicalAnd(
setEmitFlags(factory2.createThis(), 4 /* NoSubstitution */),
@@ -92360,21 +92564,21 @@ function transformES2015(context) {
function addClassMembers(statements, node) {
for (const member of node.members) {
switch (member.kind) {
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
statements.push(transformSemicolonClassElementToStatement(member));
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node));
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
const accessors = getAllAccessorDeclarations(node.members, member);
if (member === accessors.firstAccessor) {
statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node));
}
break;
- case 176 /* Constructor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 177 /* ClassStaticBlockDeclaration */:
break;
default:
Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName);
@@ -92527,7 +92731,7 @@ function transformES2015(context) {
const ancestorFacts = container && isClassLike(container) && !isStatic(node) ? enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */) : enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */);
const parameters = visitParameterList(node.parameters, visitor, context);
const body = transformFunctionBody2(node);
- if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) {
+ if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */)) {
name = factory2.getGeneratedNameForNode(node);
}
exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */);
@@ -92573,7 +92777,7 @@ function transformES2015(context) {
multiLine = true;
}
} else {
- Debug.assert(node.kind === 219 /* ArrowFunction */);
+ Debug.assert(node.kind === 221 /* ArrowFunction */);
statementsLocation = moveRangeEnd(body, -1);
const equalsGreaterThanToken = node.equalsGreaterThanToken;
if (!nodeIsSynthesized(equalsGreaterThanToken) && !nodeIsSynthesized(body)) {
@@ -92776,14 +92980,14 @@ function transformES2015(context) {
}
function visitIterationStatement(node, outermostLabeledStatement) {
switch (node.kind) {
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return visitDoOrWhileStatement(node, outermostLabeledStatement);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, outermostLabeledStatement);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node, outermostLabeledStatement);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node, outermostLabeledStatement);
}
}
@@ -93060,7 +93264,7 @@ function transformES2015(context) {
let numInitialProperties = -1, hasComputed = false;
for (let i = 0; i < properties.length; i++) {
const property = properties[i];
- if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 166 /* ComputedPropertyName */)) {
+ if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 167 /* ComputedPropertyName */)) {
numInitialProperties = i;
break;
}
@@ -93172,15 +93376,15 @@ function transformES2015(context) {
}
function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) {
switch (node.kind) {
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return convertForStatement(node, initializerFunction, convertedLoopBody);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return convertForInStatement(node, convertedLoopBody);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return convertForOfStatement(node, convertedLoopBody);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return convertDoStatement(node, convertedLoopBody);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return convertWhileStatement(node, convertedLoopBody);
default:
return Debug.failBadSyntaxKind(node, "IterationStatement expected");
@@ -93231,11 +93435,11 @@ function transformES2015(context) {
function createConvertedLoopState(node) {
let loopInitializer;
switch (node.kind) {
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
const initializer = node.initializer;
- if (initializer && initializer.kind === 262 /* VariableDeclarationList */) {
+ if (initializer && initializer.kind === 264 /* VariableDeclarationList */) {
loopInitializer = initializer;
}
break;
@@ -93589,20 +93793,20 @@ function transformES2015(context) {
for (let i = start2; i < numProperties; i++) {
const property = properties[i];
switch (property.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
const accessors = getAllAccessorDeclarations(node.properties, property);
if (property === accessors.firstAccessor) {
expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine));
}
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine));
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
default:
@@ -93705,7 +93909,7 @@ function transformES2015(context) {
let updated;
const parameters = visitParameterList(node.parameters, visitor, context);
const body = transformFunctionBody2(node);
- if (node.kind === 177 /* GetAccessor */) {
+ if (node.kind === 179 /* GetAccessor */) {
updated = factory2.updateGetAccessorDeclaration(node, node.modifiers, node.name, parameters, node.type, body);
} else {
updated = factory2.updateSetAccessorDeclaration(node, node.modifiers, node.name, parameters, body);
@@ -94007,13 +94211,13 @@ function transformES2015(context) {
if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) {
enabledSubstitutions |= 1 /* CapturedThis */;
context.enableSubstitution(109 /* ThisKeyword */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(219 /* ArrowFunction */);
- context.enableEmitNotification(218 /* FunctionExpression */);
- context.enableEmitNotification(263 /* FunctionDeclaration */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(221 /* ArrowFunction */);
+ context.enableEmitNotification(220 /* FunctionExpression */);
+ context.enableEmitNotification(265 /* FunctionDeclaration */);
}
}
function onSubstituteNode(hint, node) {
@@ -94037,10 +94241,10 @@ function transformES2015(context) {
}
function isNameOfDeclarationWithCollidingName(node) {
switch (node.parent.kind) {
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
- case 269 /* EnumDeclaration */:
- case 261 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 263 /* VariableDeclaration */:
return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent);
}
return false;
@@ -94097,11 +94301,11 @@ function transformES2015(context) {
return false;
}
const statement = firstOrUndefined(constructor.body.statements);
- if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 245 /* ExpressionStatement */) {
+ if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 247 /* ExpressionStatement */) {
return false;
}
const statementExpression = statement.expression;
- if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 213 /* CallExpression */) {
+ if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 215 /* CallExpression */) {
return false;
}
const callTarget = statementExpression.expression;
@@ -94109,7 +94313,7 @@ function transformES2015(context) {
return false;
}
const callArgument = singleOrUndefined(statementExpression.arguments);
- if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 231 /* SpreadElement */) {
+ if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 233 /* SpreadElement */) {
return false;
}
const expression = callArgument.expression;
@@ -94126,24 +94330,24 @@ function transformES5(context) {
if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) {
previousOnEmitNode = context.onEmitNode;
context.onEmitNode = onEmitNode;
- context.enableEmitNotification(289 /* JsxOpeningElement */);
- context.enableEmitNotification(290 /* JsxClosingElement */);
- context.enableEmitNotification(288 /* JsxSelfClosingElement */);
+ context.enableEmitNotification(292 /* JsxOpeningElement */);
+ context.enableEmitNotification(293 /* JsxClosingElement */);
+ context.enableEmitNotification(291 /* JsxSelfClosingElement */);
noSubstitution = [];
}
const previousOnSubstituteNode = context.onSubstituteNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(305 /* PropertyAssignment */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(308 /* PropertyAssignment */);
return chainBundle(context, transformSourceFile);
function transformSourceFile(node) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
switch (node.kind) {
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
const tagName = node.tagName;
noSubstitution[getOriginalNodeId(tagName)] = true;
break;
@@ -94269,13 +94473,13 @@ function transformGenerators(context) {
}
function visitJavaScriptInStatementContainingYield(node) {
switch (node.kind) {
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return visitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return visitWhileStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return visitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
default:
return visitJavaScriptInGeneratorFunctionBody(node);
@@ -94283,24 +94487,24 @@ function transformGenerators(context) {
}
function visitJavaScriptInGeneratorFunctionBody(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return visitAccessorDeclaration(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return visitBreakStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return visitContinueStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitReturnStatement(node);
default:
if (node.transformFlags & 1048576 /* ContainsYield */) {
@@ -94314,23 +94518,23 @@ function transformGenerators(context) {
}
function visitJavaScriptContainingYield(node) {
switch (node.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return visitCommaListExpression(node);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return visitConditionalExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return visitYieldExpression(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return visitArrayLiteralExpression(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return visitNewExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -94338,9 +94542,9 @@ function transformGenerators(context) {
}
function visitGenerator(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
default:
return Debug.failBadSyntaxKind(node);
@@ -94507,14 +94711,14 @@ function transformGenerators(context) {
if (containsYield(right)) {
let target;
switch (left.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
target = factory2.updatePropertyAccessExpression(
left,
cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)),
left.name
);
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
target = factory2.updateElementAccessExpression(
left,
cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)),
@@ -94786,35 +94990,35 @@ function transformGenerators(context) {
}
function transformAndEmitStatementWorker(node) {
switch (node.kind) {
- case 242 /* Block */:
+ case 244 /* Block */:
return transformAndEmitBlock(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return transformAndEmitExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return transformAndEmitIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return transformAndEmitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return transformAndEmitWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return transformAndEmitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return transformAndEmitForInStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return transformAndEmitContinueStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return transformAndEmitBreakStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return transformAndEmitReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return transformAndEmitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return transformAndEmitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return transformAndEmitLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return transformAndEmitThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return transformAndEmitTryStatement(node);
default:
return emitStatement(visitNode(node, visitor, isStatement));
@@ -95139,7 +95343,7 @@ function transformGenerators(context) {
for (let i = 0; i < numClauses; i++) {
const clause = caseBlock.clauses[i];
clauseLabels.push(defineLabel());
- if (clause.kind === 299 /* DefaultClause */ && defaultClauseIndex === -1) {
+ if (clause.kind === 302 /* DefaultClause */ && defaultClauseIndex === -1) {
defaultClauseIndex = i;
}
}
@@ -95149,7 +95353,7 @@ function transformGenerators(context) {
let defaultClausesSkipped = 0;
for (let i = clausesWritten; i < numClauses; i++) {
const clause = caseBlock.clauses[i];
- if (clause.kind === 298 /* CaseClause */) {
+ if (clause.kind === 301 /* CaseClause */) {
if (containsYield(clause.expression) && pendingClauses.length > 0) {
break;
}
@@ -96074,12 +96278,12 @@ function transformModule(context) {
const previousOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(213 /* CallExpression */);
- context.enableSubstitution(215 /* TaggedTemplateExpression */);
+ context.enableSubstitution(215 /* CallExpression */);
+ context.enableSubstitution(217 /* TaggedTemplateExpression */);
context.enableSubstitution(79 /* Identifier */);
- context.enableSubstitution(227 /* BinaryExpression */);
- context.enableSubstitution(306 /* ShorthandPropertyAssignment */);
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableSubstitution(229 /* BinaryExpression */);
+ context.enableSubstitution(309 /* ShorthandPropertyAssignment */);
+ context.enableEmitNotification(317 /* SourceFile */);
const moduleInfoMap = [];
const deferredExports = [];
let currentSourceFile;
@@ -96387,23 +96591,23 @@ function transformModule(context) {
}
function topLevelVisitor(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 361 /* MergeDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return visitMergeDeclarationMarker(node);
- case 362 /* EndOfDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return visitEndOfDeclarationMarker(node);
default:
return visitor(node);
@@ -96414,26 +96618,26 @@ function transformModule(context) {
return node;
}
switch (node.kind) {
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, valueIsDiscarded);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
return visitImportCallExpression(node);
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
return visitDestructuringAssignment(node, valueIsDiscarded);
}
break;
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPreOrPostfixUnaryExpression(node, valueIsDiscarded);
}
return visitEachChild(node, visitor, context);
@@ -96448,24 +96652,24 @@ function transformModule(context) {
if (isObjectLiteralExpression(node)) {
for (const elem of node.properties) {
switch (elem.kind) {
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (destructuringNeedsFlattening(elem.initializer)) {
return true;
}
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
if (destructuringNeedsFlattening(elem.name)) {
return true;
}
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
if (destructuringNeedsFlattening(elem.expression)) {
return true;
}
break;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return false;
default:
Debug.assertNever(elem, "Unhandled object member kind");
@@ -97122,7 +97326,7 @@ function transformModule(context) {
}
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 244 /* VariableStatement */) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 246 /* VariableStatement */) {
const id = getOriginalNodeId(node);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original);
}
@@ -97154,10 +97358,10 @@ function transformModule(context) {
const namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
for (const importBinding of namedBindings.elements) {
statements = appendExportsOfDeclaration(statements, importBinding, true);
}
@@ -97301,7 +97505,7 @@ function transformModule(context) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
currentSourceFile = node;
currentModuleInfo = moduleInfoMap[getOriginalNodeId(currentSourceFile)];
previousOnEmitNode(hint, node, emitCallback);
@@ -97339,11 +97543,11 @@ function transformModule(context) {
switch (node.kind) {
case 79 /* Identifier */:
return substituteExpressionIdentifier(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return substituteCallExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return substituteTaggedTemplateExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return substituteBinaryExpression(node);
}
return node;
@@ -97394,7 +97598,7 @@ function transformModule(context) {
return node;
} else if (!(isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node));
- if (exportContainer && exportContainer.kind === 314 /* SourceFile */) {
+ if (exportContainer && exportContainer.kind === 317 /* SourceFile */) {
return setTextRange(
factory2.createPropertyAccessExpression(
factory2.createIdentifier("exports"),
@@ -97473,10 +97677,10 @@ function transformSystemModule(context) {
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
context.enableSubstitution(79 /* Identifier */);
- context.enableSubstitution(306 /* ShorthandPropertyAssignment */);
- context.enableSubstitution(227 /* BinaryExpression */);
- context.enableSubstitution(237 /* MetaProperty */);
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableSubstitution(309 /* ShorthandPropertyAssignment */);
+ context.enableSubstitution(229 /* BinaryExpression */);
+ context.enableSubstitution(239 /* MetaProperty */);
+ context.enableEmitNotification(317 /* SourceFile */);
const moduleInfoMap = [];
const deferredExports = [];
const exportFunctionsMap = [];
@@ -97626,7 +97830,7 @@ function transformSystemModule(context) {
if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) {
let hasExportDeclarationWithExportClause = false;
for (const externalImport of moduleInfo.externalImports) {
- if (externalImport.kind === 281 /* ExportDeclaration */ && externalImport.exportClause) {
+ if (externalImport.kind === 284 /* ExportDeclaration */ && externalImport.exportClause) {
hasExportDeclarationWithExportClause = true;
break;
}
@@ -97745,11 +97949,11 @@ function transformSystemModule(context) {
for (const entry of group2.externalImports) {
const importVariableName = getLocalNameForExternalImport(factory2, entry, currentSourceFile);
switch (entry.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
if (!entry.importClause) {
break;
}
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
Debug.assert(importVariableName !== void 0);
statements.push(
factory2.createExpressionStatement(
@@ -97771,7 +97975,7 @@ function transformSystemModule(context) {
);
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
Debug.assert(importVariableName !== void 0);
if (entry.exportClause) {
if (isNamedExports(entry.exportClause)) {
@@ -97840,13 +98044,13 @@ function transformSystemModule(context) {
}
function topLevelVisitor(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
default:
return topLevelNestedVisitor(node);
@@ -97991,7 +98195,7 @@ function transformSystemModule(context) {
}
}
function shouldHoistVariableDeclarationList(node) {
- return (getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 314 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);
+ return (getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 317 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);
}
function transformInitializedVariable(node, isExportedDeclaration) {
const createAssignment3 = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment;
@@ -98015,7 +98219,7 @@ function transformSystemModule(context) {
return isExportedDeclaration ? createExportExpression(name, preventSubstitution(setTextRange(factory2.createAssignment(name, value), location2))) : preventSubstitution(setTextRange(factory2.createAssignment(name, value), location2));
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 244 /* VariableStatement */) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 246 /* VariableStatement */) {
const id = getOriginalNodeId(node);
const isExportedDeclaration = hasSyntacticModifier(node.original, 1 /* Export */);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration);
@@ -98053,10 +98257,10 @@ function transformSystemModule(context) {
const namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
for (const importBinding of namedBindings.elements) {
statements = appendExportsOfDeclaration(statements, importBinding);
}
@@ -98151,43 +98355,43 @@ function transformSystemModule(context) {
}
function topLevelNestedVisitor(node) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, true);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return visitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return visitWhileStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return visitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return visitSwitchStatement(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return visitCaseBlock(node);
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
return visitCaseClause(node);
- case 299 /* DefaultClause */:
+ case 302 /* DefaultClause */:
return visitDefaultClause(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return visitTryStatement(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
- case 242 /* Block */:
+ case 244 /* Block */:
return visitBlock(node);
- case 361 /* MergeDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return visitMergeDeclarationMarker(node);
- case 362 /* EndOfDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return visitEndOfDeclarationMarker(node);
default:
return visitor(node);
@@ -98329,26 +98533,26 @@ function transformSystemModule(context) {
return node;
}
switch (node.kind) {
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, false);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, valueIsDiscarded);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
return visitDestructuringAssignment(node, valueIsDiscarded);
}
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isImportCall(node)) {
return visitImportCallExpression(node);
}
break;
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded);
}
return visitEachChild(node, visitor, context);
@@ -98408,7 +98612,7 @@ function transformSystemModule(context) {
return hasExportedReferenceInDestructuringTarget(node.initializer);
} else if (isIdentifier(node)) {
const container = resolver.getReferencedExportContainer(node);
- return container !== void 0 && container.kind === 314 /* SourceFile */;
+ return container !== void 0 && container.kind === 317 /* SourceFile */;
} else {
return false;
}
@@ -98452,7 +98656,7 @@ function transformSystemModule(context) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
const id = getOriginalNodeId(node);
currentSourceFile = node;
moduleInfo = moduleInfoMap[id];
@@ -98486,7 +98690,7 @@ function transformSystemModule(context) {
}
function substituteUnspecified(node) {
switch (node.kind) {
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return substituteShorthandPropertyAssignment(node);
}
return node;
@@ -98528,9 +98732,9 @@ function transformSystemModule(context) {
switch (node.kind) {
case 79 /* Identifier */:
return substituteExpressionIdentifier(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return substituteBinaryExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return substituteMetaProperty(node);
}
return node;
@@ -98593,7 +98797,7 @@ function transformSystemModule(context) {
const valueDeclaration = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name);
if (valueDeclaration) {
const exportContainer = resolver.getReferencedExportContainer(name, false);
- if (exportContainer && exportContainer.kind === 314 /* SourceFile */) {
+ if (exportContainer && exportContainer.kind === 317 /* SourceFile */) {
exportedNames = append(exportedNames, factory2.getDeclarationName(valueDeclaration));
}
exportedNames = addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[getOriginalNodeId(valueDeclaration)]);
@@ -98626,7 +98830,7 @@ function transformECMAScriptModule(context) {
const previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableEmitNotification(317 /* SourceFile */);
context.enableSubstitution(79 /* Identifier */);
let helperNameSubstitutions;
let currentSourceFile;
@@ -98677,11 +98881,11 @@ function transformECMAScriptModule(context) {
}
function visitor(node) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return getEmitModuleKind(compilerOptions) >= 100 /* Node16 */ ? visitImportEqualsDeclaration(node) : void 0;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportDecl = node;
return visitExportDeclaration(exportDecl);
}
@@ -98843,8 +99047,8 @@ function transformNodeModule(context) {
const cjsOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(314 /* SourceFile */);
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableSubstitution(317 /* SourceFile */);
+ context.enableEmitNotification(317 /* SourceFile */);
let currentSourceFile;
return transformSourceFileOrBundle;
function onSubstituteNode(hint, node) {
@@ -98887,7 +99091,7 @@ function transformNodeModule(context) {
return result;
}
function transformSourceFileOrBundle(node) {
- return node.kind === 314 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
+ return node.kind === 317 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
}
function transformBundle(node) {
return context.factory.createBundle(map(node.sourceFiles, transformSourceFile), node.prepends);
@@ -98917,7 +99121,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
function getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (isStatic(node)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1;
@@ -98934,7 +99138,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
function getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (isStatic(node)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1;
@@ -98942,7 +99146,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
}
}
function createGetSymbolAccessibilityDiagnosticForNode(node) {
- if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isAnnotationPropertyDeclaration(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
+ if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isAnnotationPropertyDeclaration(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node) || isOverloadPropertyDeclaration(node)) {
return getVariableDeclarationTypeVisibilityError;
} else if (isSetAccessor(node) || isGetAccessor(node)) {
return getAccessorDeclarationTypeVisibilityError;
@@ -98965,12 +99169,12 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
return Debug.assertNever(node, `Attempted to set a declaration diagnostic context for unhandled node kind: ${Debug.formatSyntaxKind(node.kind)}`);
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
- if (node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
+ if (node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
- } else if (node.kind === 171 /* PropertyDeclaration */ || node.kind === 211 /* PropertyAccessExpression */ || node.kind === 170 /* PropertySignature */ || node.kind === 168 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
+ } else if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 213 /* PropertyAccessExpression */ || node.kind === 171 /* PropertySignature */ || node.kind === 169 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
if (isStatic(node)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.kind === 264 /* ClassDeclaration */ || node.kind === 168 /* Parameter */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */ || node.kind === 169 /* Parameter */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1;
@@ -98987,7 +99191,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
}
function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) {
let diagnosticMessage;
- if (node.kind === 178 /* SetAccessor */) {
+ if (node.kind === 180 /* SetAccessor */) {
if (isStatic(node)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1;
} else {
@@ -99009,26 +99213,26 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
function getReturnTypeVisibilityError(symbolAccessibilityResult) {
let diagnosticMessage;
switch (node.kind) {
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isStatic(node)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0;
- } else if (node.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0;
} else {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;
}
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;
break;
default:
@@ -99049,29 +99253,29 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
}
function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
switch (node.parent.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;
- case 180 /* ConstructSignature */:
- case 185 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isStatic(node.parent)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.parent.kind === 266 /* ClassDeclaration */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
- case 263 /* FunctionDeclaration */:
- case 184 /* FunctionType */:
+ case 265 /* FunctionDeclaration */:
+ case 186 /* FunctionType */:
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1;
- case 178 /* SetAccessor */:
- case 177 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 179 /* GetAccessor */:
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
default:
return Debug.fail(`Unknown parent for parameter: ${Debug.formatSyntaxKind(node.parent.kind)}`);
@@ -99080,37 +99284,37 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
function getTypeParameterConstraintVisibilityError() {
let diagnosticMessage;
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;
break;
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;
break;
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isStatic(node.parent)) {
diagnosticMessage = Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.parent.kind === 266 /* ClassDeclaration */) {
diagnosticMessage = Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
} else {
diagnosticMessage = Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
break;
- case 184 /* FunctionType */:
- case 263 /* FunctionDeclaration */:
+ case 186 /* FunctionType */:
+ case 265 /* FunctionDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
break;
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
break;
default:
@@ -99163,7 +99367,7 @@ function hasInternalAnnotation(range, currentSourceFile) {
}
function isInternalDeclaration(node, currentSourceFile) {
const parseTreeNode = getParseTreeNode(node);
- if (parseTreeNode && parseTreeNode.kind === 168 /* Parameter */) {
+ if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
const text = currentSourceFile.text;
@@ -99372,10 +99576,10 @@ function transformDeclarations(context) {
return result;
}
function transformRoot(node) {
- if (node.kind === 314 /* SourceFile */ && node.isDeclarationFile) {
+ if (node.kind === 317 /* SourceFile */ && node.isDeclarationFile) {
return node;
}
- if (node.kind === 315 /* Bundle */) {
+ if (node.kind === 318 /* Bundle */) {
isBundledEmit = true;
refs = new Map2();
libs2 = new Map2();
@@ -99412,7 +99616,7 @@ function transformDeclarations(context) {
return factory2.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated2), true, [], [], false, []);
}
), mapDefined(node.prepends, (prepend) => {
- if (prepend.kind === 317 /* InputFiles */) {
+ if (prepend.kind === 320 /* InputFiles */) {
const sourceFile = createUnparsedSourceFile(prepend, "dts", stripInternal);
hasNoDefaultLib = hasNoDefaultLib || !!sourceFile.hasNoDefaultLib;
collectReferences(sourceFile, refs);
@@ -99554,14 +99758,14 @@ function transformDeclarations(context) {
if (name.kind === 79 /* Identifier */) {
return name;
} else {
- if (name.kind === 207 /* ArrayBindingPattern */) {
+ if (name.kind === 209 /* ArrayBindingPattern */) {
return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement));
} else {
return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement));
}
}
function visitBindingElement(elem) {
- if (elem.kind === 233 /* OmittedExpression */) {
+ if (elem.kind === 235 /* OmittedExpression */) {
return elem;
}
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced) {
@@ -99621,14 +99825,14 @@ function transformDeclarations(context) {
if (type !== void 0 && isTypeReferenceNode(type) && type.typeName.virtual) {
return;
}
- const shouldUseResolverType = node.kind === 168 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node));
+ const shouldUseResolverType = node.kind === 169 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node));
if (type && !shouldUseResolverType) {
return visitNode(type, visitDeclarationSubtree);
}
if (!getParseTreeNode(node)) {
return type ? visitNode(type, visitDeclarationSubtree) : factory2.createKeywordTypeNode(132 /* AnyKeyword */);
}
- if (node.kind === 178 /* SetAccessor */) {
+ if (node.kind === 180 /* SetAccessor */) {
return factory2.createKeywordTypeNode(132 /* AnyKeyword */);
}
errorNameNode = node.name;
@@ -99637,10 +99841,10 @@ function transformDeclarations(context) {
oldDiag = getSymbolAccessibilityDiagnostic;
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(node);
}
- if (node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
+ if (node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */) {
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
}
- if (node.kind === 168 /* Parameter */ || node.kind === 171 /* PropertyDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 172 /* AnnotationPropertyDeclaration */) {
+ if (node.kind === 169 /* Parameter */ || node.kind === 172 /* PropertyDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 173 /* AnnotationPropertyDeclaration */ || node.kind === 174 /* OverloadPropertyDeclaration */) {
if (isPropertySignature(node) || !node.initializer)
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType));
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
@@ -99657,23 +99861,23 @@ function transformDeclarations(context) {
function isDeclarationAndNotVisible(node) {
node = getParseTreeNode(node);
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return !resolver.isDeclarationVisible(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return !getBindingNameVisible(node);
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
return false;
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return true;
}
return false;
@@ -99738,7 +99942,7 @@ function transformDeclarations(context) {
return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree);
}
function isEnclosingDeclaration(node) {
- return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isStructDeclaration(node) || isAnnotationDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node);
+ return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isStructDeclaration(node) || isAnnotationDeclaration(node) || isOverloadDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node);
}
function checkEntityNameVisibility(entityName, enclosingDeclaration2) {
const visibilityResult = resolver.isEntityNameVisible(entityName, enclosingDeclaration2);
@@ -99754,7 +99958,7 @@ function transformDeclarations(context) {
function rewriteModuleSpecifier(parent2, input) {
if (!input)
return void 0;
- resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 270 /* ModuleDeclaration */ && parent2.kind !== 205 /* ImportType */;
+ resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 273 /* ModuleDeclaration */ && parent2.kind !== 207 /* ImportType */;
if (isStringLiteralLike(input)) {
if (isBundledEmit) {
const newName = getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent2);
@@ -99773,7 +99977,7 @@ function transformDeclarations(context) {
function transformImportEqualsDeclaration(decl) {
if (!resolver.isDeclarationVisible(decl))
return;
- if (decl.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ if (decl.moduleReference.kind === 289 /* ExternalModuleReference */) {
const specifier = getExternalModuleImportEqualsDeclarationExpression(decl);
return factory2.updateImportEqualsDeclaration(
decl,
@@ -99809,7 +100013,7 @@ function transformDeclarations(context) {
void 0
), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
}
- if (decl.importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (decl.importClause.namedBindings.kind === 280 /* NamespaceImport */) {
const namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : void 0;
return visibleDefaultBinding || namedBindings ? factory2.updateImportDeclaration(decl, decl.modifiers, factory2.updateImportClause(
decl.importClause,
@@ -99920,7 +100124,7 @@ function transformDeclarations(context) {
const oldDiag = getSymbolAccessibilityDiagnostic;
const canProduceDiagnostic = canProduceDiagnostics(input);
const oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
- let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 187 /* TypeLiteral */ || input.kind === 200 /* MappedType */) && input.parent.kind !== 268 /* TypeAliasDeclaration */;
+ let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 189 /* TypeLiteral */ || input.kind === 202 /* MappedType */) && input.parent.kind !== 271 /* TypeAliasDeclaration */;
if (isMethodDeclaration(input) || isMethodSignature(input)) {
if (hasEffectiveModifier(input, 8 /* Private */)) {
if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input)
@@ -99939,26 +100143,26 @@ function transformDeclarations(context) {
}
if (isProcessedComponent(input)) {
switch (input.kind) {
- case 234 /* ExpressionWithTypeArguments */: {
+ case 236 /* ExpressionWithTypeArguments */: {
if (isEntityName(input.expression) || isEntityNameExpression(input.expression)) {
checkEntityNameVisibility(input.expression, enclosingDeclaration);
}
const node = visitEachChild(input, visitDeclarationSubtree, context);
return cleanup(factory2.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments));
}
- case 183 /* TypeReference */: {
+ case 185 /* TypeReference */: {
checkEntityNameVisibility(input.typeName, enclosingDeclaration);
const node = visitEachChild(input, visitDeclarationSubtree, context);
return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments));
}
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return cleanup(factory2.updateConstructSignature(
input,
ensureTypeParams(input, input.typeParameters),
updateParamsList(input, input.parameters),
ensureType(input, input.type)
));
- case 176 /* Constructor */: {
+ case 178 /* Constructor */: {
const ctor = factory2.createConstructorDeclaration(
ensureModifiers(input),
updateParamsList(input, input.parameters, 0 /* None */),
@@ -99966,7 +100170,7 @@ function transformDeclarations(context) {
);
return cleanup(ctor);
}
- case 174 /* MethodDeclaration */: {
+ case 176 /* MethodDeclaration */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -99984,7 +100188,7 @@ function transformDeclarations(context) {
);
return cleanup(sig);
}
- case 177 /* GetAccessor */: {
+ case 179 /* GetAccessor */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -99998,7 +100202,7 @@ function transformDeclarations(context) {
void 0
));
}
- case 178 /* SetAccessor */: {
+ case 180 /* SetAccessor */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -100010,7 +100214,7 @@ function transformDeclarations(context) {
void 0
));
}
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -100023,14 +100227,14 @@ function transformDeclarations(context) {
ensureType(input, input.type),
ensureNoInitializer(input)
));
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return cleanup(factory2.updateAnnotationPropertyDeclaration(
input,
input.name,
ensureType(input, input.type),
input.initializer
));
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -100041,7 +100245,18 @@ function transformDeclarations(context) {
input.questionToken,
ensureType(input, input.type)
));
- case 173 /* MethodSignature */: {
+ case 174 /* OverloadPropertyDeclaration */:
+ if (isPrivateIdentifier(input.name)) {
+ return cleanup(void 0);
+ }
+ return cleanup(factory2.updateOverloadPropertyDeclaration(
+ input,
+ ensureModifiers(input),
+ input.name,
+ input.questionToken,
+ ensureType(input, input.type)
+ ));
+ case 175 /* MethodSignature */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -100055,7 +100270,7 @@ function transformDeclarations(context) {
ensureType(input, input.type)
));
}
- case 179 /* CallSignature */: {
+ case 181 /* CallSignature */: {
return cleanup(factory2.updateCallSignature(
input,
ensureTypeParams(input, input.typeParameters),
@@ -100063,7 +100278,7 @@ function transformDeclarations(context) {
ensureType(input, input.type)
));
}
- case 181 /* IndexSignature */: {
+ case 183 /* IndexSignature */: {
return cleanup(factory2.updateIndexSignature(
input,
ensureModifiers(input),
@@ -100071,7 +100286,7 @@ function transformDeclarations(context) {
visitNode(input.type, visitDeclarationSubtree) || factory2.createKeywordTypeNode(132 /* AnyKeyword */)
));
}
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
if (isBindingPattern(input.name)) {
return recreateBindingPattern(input.name);
}
@@ -100079,13 +100294,13 @@ function transformDeclarations(context) {
suppressNewDiagnosticContexts = true;
return cleanup(factory2.updateVariableDeclaration(input, input.name, void 0, ensureType(input, input.type), ensureNoInitializer(input)));
}
- case 167 /* TypeParameter */: {
+ case 168 /* TypeParameter */: {
if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) {
return cleanup(factory2.updateTypeParameterDeclaration(input, input.modifiers, input.name, void 0, void 0));
}
return cleanup(visitEachChild(input, visitDeclarationSubtree, context));
}
- case 194 /* ConditionalType */: {
+ case 196 /* ConditionalType */: {
const checkType = visitNode(input.checkType, visitDeclarationSubtree);
const extendsType = visitNode(input.extendsType, visitDeclarationSubtree);
const oldEnclosingDecl = enclosingDeclaration;
@@ -100095,13 +100310,13 @@ function transformDeclarations(context) {
const falseType = visitNode(input.falseType, visitDeclarationSubtree);
return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
}
- case 184 /* FunctionType */: {
+ case 186 /* FunctionType */: {
return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
- case 185 /* ConstructorType */: {
+ case 187 /* ConstructorType */: {
return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
- case 205 /* ImportType */: {
+ case 207 /* ImportType */: {
if (!isLiteralImportTypeNode(input))
return cleanup(input);
return cleanup(factory2.updateImportTypeNode(
@@ -100141,7 +100356,7 @@ function transformDeclarations(context) {
}
}
function isPrivateMethodTypeParameter(node) {
- return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 8 /* Private */);
+ return node.parent.kind === 176 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 8 /* Private */);
}
function visitDeclarationStatements(input) {
if (!isPreservedDeclarationStatement(input)) {
@@ -100150,7 +100365,7 @@ function transformDeclarations(context) {
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 281 /* ExportDeclaration */: {
+ case 284 /* ExportDeclaration */: {
if (isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
}
@@ -100164,7 +100379,7 @@ function transformDeclarations(context) {
getResolutionModeOverrideForClause(input.assertClause) ? input.assertClause : void 0
);
}
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
if (isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
}
@@ -100206,10 +100421,10 @@ function transformDeclarations(context) {
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 274 /* ImportEqualsDeclaration */: {
+ case 277 /* ImportEqualsDeclaration */: {
return transformImportEqualsDeclaration(input);
}
- case 275 /* ImportDeclaration */: {
+ case 278 /* ImportDeclaration */: {
return transformImportDeclaration(input);
}
}
@@ -100229,7 +100444,7 @@ function transformDeclarations(context) {
}
const previousNeedsDeclare = needsDeclare;
switch (input.kind) {
- case 268 /* TypeAliasDeclaration */: {
+ case 271 /* TypeAliasDeclaration */: {
needsDeclare = false;
const clean2 = cleanup(factory2.updateTypeAliasDeclaration(
input,
@@ -100244,7 +100459,7 @@ function transformDeclarations(context) {
needsDeclare = previousNeedsDeclare;
return clean2;
}
- case 267 /* InterfaceDeclaration */: {
+ case 270 /* InterfaceDeclaration */: {
return cleanup(factory2.updateInterfaceDeclaration(
input,
ensureModifiers(input),
@@ -100254,7 +100469,7 @@ function transformDeclarations(context) {
visitNodes2(input.members, visitDeclarationSubtree)
));
}
- case 263 /* FunctionDeclaration */: {
+ case 265 /* FunctionDeclaration */: {
const clean2 = cleanup(factory2.updateFunctionDeclaration(
input,
ensureModifiers(input),
@@ -100344,10 +100559,10 @@ function transformDeclarations(context) {
return clean2;
}
}
- case 270 /* ModuleDeclaration */: {
+ case 273 /* ModuleDeclaration */: {
needsDeclare = false;
const inner = input.body;
- if (inner && inner.kind === 271 /* ModuleBlock */) {
+ if (inner && inner.kind === 274 /* ModuleBlock */) {
const oldNeedsScopeFix = needsScopeFixMarker;
const oldHasScopeFix = resultHasScopeMarker;
resultHasScopeMarker = false;
@@ -100391,7 +100606,7 @@ function transformDeclarations(context) {
));
}
}
- case 265 /* StructDeclaration */: {
+ case 267 /* StructDeclaration */: {
errorNameNode = input.name;
errorFallbackNode = input;
const decorators = ensureEtsDecorators(input, host);
@@ -100408,7 +100623,7 @@ function transformDeclarations(context) {
members
));
}
- case 266 /* AnnotationDeclaration */: {
+ case 268 /* AnnotationDeclaration */: {
errorNameNode = input.name;
errorFallbackNode = input;
const modifiers = factory2.createNodeArray(ensureModifiers(input));
@@ -100421,7 +100636,20 @@ function transformDeclarations(context) {
members
));
}
- case 264 /* ClassDeclaration */: {
+ case 269 /* OverloadDeclaration */: {
+ errorNameNode = input.name;
+ errorFallbackNode = input;
+ const modifiers = factory2.createNodeArray(ensureModifiers(input));
+ const memberNodes = visitNodes2(input.members, visitDeclarationSubtree);
+ const members = factory2.createNodeArray(memberNodes);
+ return cleanup(factory2.updateOverloadDeclaration(
+ input,
+ modifiers,
+ input.name,
+ members
+ ));
+ }
+ case 266 /* ClassDeclaration */: {
errorNameNode = input.name;
errorFallbackNode = input;
const modifiers = factory2.createNodeArray(ensureModifiers(input));
@@ -100524,10 +100752,10 @@ function transformDeclarations(context) {
));
}
}
- case 244 /* VariableStatement */: {
+ case 246 /* VariableStatement */: {
return cleanup(transformVariableStatement(input));
}
- case 269 /* EnumDeclaration */: {
+ case 272 /* EnumDeclaration */: {
return cleanup(factory2.updateEnumDeclaration(input, factory2.createNodeArray(ensureModifiers(input)), input.name, factory2.createNodeArray(mapDefined(input.members, (m) => {
if (shouldStripInternal(m))
return;
@@ -100543,7 +100771,7 @@ function transformDeclarations(context) {
if (canProdiceDiagnostic) {
getSymbolAccessibilityDiagnostic = oldDiag;
}
- if (input.kind === 270 /* ModuleDeclaration */) {
+ if (input.kind === 273 /* ModuleDeclaration */) {
needsDeclare = previousNeedsDeclare;
}
if (node === input) {
@@ -100566,7 +100794,7 @@ function transformDeclarations(context) {
return flatten(mapDefined(d.elements, (e) => recreateBindingElement(e)));
}
function recreateBindingElement(e) {
- if (e.kind === 233 /* OmittedExpression */) {
+ if (e.kind === 235 /* OmittedExpression */) {
return;
}
if (e.name) {
@@ -100615,7 +100843,7 @@ function transformDeclarations(context) {
function ensureModifierFlags(node) {
let mask2 = 258047 /* All */ ^ (4 /* Public */ | 512 /* Async */ | 16384 /* Override */);
let additions = needsDeclare && !isAlwaysType(node) ? 2 /* Ambient */ : 0 /* None */;
- const parentIsFile = node.parent.kind === 314 /* SourceFile */;
+ const parentIsFile = node.parent.kind === 317 /* SourceFile */;
if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) {
mask2 ^= 2 /* Ambient */;
additions = 0 /* None */;
@@ -100641,7 +100869,7 @@ function transformDeclarations(context) {
}
}
function isAlwaysType(node) {
- if (node.kind === 267 /* InterfaceDeclaration */) {
+ if (node.kind === 270 /* InterfaceDeclaration */) {
return true;
}
return false;
@@ -100661,60 +100889,62 @@ function maskModifierFlags(node, modifierMask = 258047 /* All */ ^ 4 /* Public *
}
function getTypeAnnotationFromAccessor(accessor) {
if (accessor) {
- return accessor.kind === 177 /* GetAccessor */ ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : void 0;
+ return accessor.kind === 179 /* GetAccessor */ ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : void 0;
}
}
function canHaveLiteralInitializer(node) {
switch (node.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return !hasEffectiveModifier(node, 8 /* Private */);
- case 168 /* Parameter */:
- case 261 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 263 /* VariableDeclaration */:
return true;
}
return false;
}
function isPreservedDeclarationStatement(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 244 /* VariableStatement */:
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
+ case 265 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 246 /* VariableStatement */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
return true;
}
return false;
}
function isProcessedComponent(node) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 181 /* IndexSignature */:
- case 261 /* VariableDeclaration */:
- case 167 /* TypeParameter */:
- case 234 /* ExpressionWithTypeArguments */:
- case 183 /* TypeReference */:
- case 194 /* ConditionalType */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 205 /* ImportType */:
+ case 182 /* ConstructSignature */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 183 /* IndexSignature */:
+ case 263 /* VariableDeclaration */:
+ case 168 /* TypeParameter */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 185 /* TypeReference */:
+ case 196 /* ConditionalType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 207 /* ImportType */:
return true;
}
return false;
@@ -100818,7 +101048,7 @@ function noEmitNotification(hint, node, callback) {
}
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
var _a2, _b;
- const enabledSyntaxKindFeatures = new Array(364 /* Count */);
+ const enabledSyntaxKindFeatures = new Array(367 /* Count */);
let lexicalEnvironmentVariableDeclarations;
let lexicalEnvironmentFunctionDeclarations;
let lexicalEnvironmentStatements;
@@ -100897,7 +101127,7 @@ function transformNodes(resolver, host, factory2, options, nodes, transformers,
state = 1 /* Initialized */;
const transformed = [];
for (const node of nodes) {
- (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Emit, "transformNodes", node.kind === 314 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
+ (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Emit, "transformNodes", node.kind === 317 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
PerformanceDotting.start("transformRoot");
transformed.push((allowDtsFiles ? transformation : transformRoot)(node));
PerformanceDotting.stop("transformRoot");
@@ -101214,7 +101444,7 @@ function getOutputPathsForBundle(options, forceDtsPaths) {
}
function getOutputPathsFor(sourceFile, host, forceDtsPaths) {
const options = host.getCompilerOptions();
- if (sourceFile.kind === 315 /* Bundle */) {
+ if (sourceFile.kind === 318 /* Bundle */) {
return getOutputPathsForBundle(options, forceDtsPaths);
} else {
const ownOutputFilePath = getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile.fileName, options));
@@ -101587,8 +101817,8 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
}
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform2, printer3, mapOptions) {
const sourceFileOrBundle = transform2.transformed[0];
- const bundle = sourceFileOrBundle.kind === 315 /* Bundle */ ? sourceFileOrBundle : void 0;
- const sourceFile = sourceFileOrBundle.kind === 314 /* SourceFile */ ? sourceFileOrBundle : void 0;
+ const bundle = sourceFileOrBundle.kind === 318 /* Bundle */ ? sourceFileOrBundle : void 0;
+ const sourceFile = sourceFileOrBundle.kind === 317 /* SourceFile */ ? sourceFileOrBundle : void 0;
const sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];
let sourceMapGenerator;
if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) {
@@ -101642,7 +101872,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
writer.clear();
}
function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
- return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 314 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
+ return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 317 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
}
function getSourceRoot(mapOptions) {
const sourceRoot = normalizeSlashes(mapOptions.sourceRoot || "");
@@ -101993,11 +102223,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
break;
}
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return printFile(node);
- case 315 /* Bundle */:
+ case 318 /* Bundle */:
return printBundle(node);
- case 316 /* UnparsedSource */:
+ case 319 /* UnparsedSource */:
return printUnparsedSource(node);
}
writeNode(hint, node, sourceFile, beginPrint());
@@ -102311,300 +102541,304 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return emitIdentifier(node);
case 80 /* PrivateIdentifier */:
return emitPrivateIdentifier(node);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return emitQualifiedName(node);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return emitComputedPropertyName(node);
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return emitTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return emitParameter(node);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return emitDecorator(node);
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
return emitPropertySignature(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return emitPropertyDeclaration(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return emitAnnotationPropertyDeclaration(node);
- case 173 /* MethodSignature */:
+ case 174 /* OverloadPropertyDeclaration */:
+ return emitOverloadPropertyDeclaration(node);
+ case 175 /* MethodSignature */:
return emitMethodSignature(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return emitMethodDeclaration(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return emitClassStaticBlockDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return emitConstructor(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return emitAccessorDeclaration(node);
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return emitCallSignature(node);
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return emitConstructSignature(node);
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return emitIndexSignature(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return emitTypePredicate(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return emitTypeReference(node);
- case 184 /* FunctionType */:
+ case 186 /* FunctionType */:
return emitFunctionType(node);
- case 185 /* ConstructorType */:
+ case 187 /* ConstructorType */:
return emitConstructorType(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return emitTypeQuery(node);
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return emitTypeLiteral(node);
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return emitArrayType(node);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
return emitTupleType(node);
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return emitOptionalType(node);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return emitUnionType(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return emitIntersectionType(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return emitConditionalType(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return emitInferType(node);
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return emitParenthesizedType(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return emitExpressionWithTypeArguments(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return emitThisType();
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return emitTypeOperator(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return emitIndexedAccessType(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return emitMappedType(node);
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return emitLiteralType(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return emitNamedTupleMember(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return emitTemplateType(node);
- case 204 /* TemplateLiteralTypeSpan */:
+ case 206 /* TemplateLiteralTypeSpan */:
return emitTemplateTypeSpan(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return emitImportTypeNode(node);
- case 206 /* ObjectBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
return emitObjectBindingPattern(node);
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return emitArrayBindingPattern(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return emitBindingElement(node);
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return emitTemplateSpan(node);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return emitSemicolonClassElement();
- case 242 /* Block */:
+ case 244 /* Block */:
return emitBlock(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return emitVariableStatement(node);
- case 243 /* EmptyStatement */:
+ case 245 /* EmptyStatement */:
return emitEmptyStatement(false);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return emitExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return emitIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return emitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return emitWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return emitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return emitForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return emitForOfStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return emitContinueStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return emitBreakStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return emitReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return emitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return emitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return emitLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return emitThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return emitTryStatement(node);
- case 260 /* DebuggerStatement */:
+ case 262 /* DebuggerStatement */:
return emitDebuggerStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return emitVariableDeclaration(node);
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return emitVariableDeclarationList(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return emitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return emitClassOrStructDeclaration(node);
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return emitClassOrStructDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return emitAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return emitOverloadDeclaration(node);
+ case 270 /* InterfaceDeclaration */:
return emitInterfaceDeclaration(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return emitTypeAliasDeclaration(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return emitEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return emitModuleDeclaration(node);
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return emitModuleBlock(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return emitCaseBlock(node);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return emitNamespaceExportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return emitImportEqualsDeclaration(node);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return emitImportDeclaration(node);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return emitImportClause(node);
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return emitNamespaceImport(node);
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
return emitNamespaceExport(node);
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
return emitNamedImports(node);
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return emitImportSpecifier(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return emitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return emitExportDeclaration(node);
- case 282 /* NamedExports */:
+ case 285 /* NamedExports */:
return emitNamedExports(node);
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return emitExportSpecifier(node);
- case 302 /* AssertClause */:
+ case 305 /* AssertClause */:
return emitAssertClause(node);
- case 303 /* AssertEntry */:
+ case 306 /* AssertEntry */:
return emitAssertEntry(node);
- case 285 /* MissingDeclaration */:
+ case 288 /* MissingDeclaration */:
return;
- case 286 /* ExternalModuleReference */:
+ case 289 /* ExternalModuleReference */:
return emitExternalModuleReference(node);
case 11 /* JsxText */:
return emitJsxText(node);
- case 289 /* JsxOpeningElement */:
- case 292 /* JsxOpeningFragment */:
+ case 292 /* JsxOpeningElement */:
+ case 295 /* JsxOpeningFragment */:
return emitJsxOpeningElementOrFragment(node);
- case 290 /* JsxClosingElement */:
- case 293 /* JsxClosingFragment */:
+ case 293 /* JsxClosingElement */:
+ case 296 /* JsxClosingFragment */:
return emitJsxClosingElementOrFragment(node);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return emitJsxAttribute(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return emitJsxAttributes(node);
- case 296 /* JsxSpreadAttribute */:
+ case 299 /* JsxSpreadAttribute */:
return emitJsxSpreadAttribute(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return emitJsxExpression(node);
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
return emitCaseClause(node);
- case 299 /* DefaultClause */:
+ case 302 /* DefaultClause */:
return emitDefaultClause(node);
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return emitHeritageClause(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return emitCatchClause(node);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return emitPropertyAssignment(node);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return emitShorthandPropertyAssignment(node);
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return emitSpreadAssignment(node);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return emitEnumMember(node);
- case 309 /* UnparsedPrologue */:
+ case 312 /* UnparsedPrologue */:
return writeUnparsedNode(node);
- case 316 /* UnparsedSource */:
- case 310 /* UnparsedPrepend */:
+ case 319 /* UnparsedSource */:
+ case 313 /* UnparsedPrepend */:
return emitUnparsedSourceOrPrepend(node);
- case 311 /* UnparsedText */:
- case 312 /* UnparsedInternalText */:
+ case 314 /* UnparsedText */:
+ case 315 /* UnparsedInternalText */:
return emitUnparsedTextLike(node);
- case 313 /* UnparsedSyntheticReference */:
+ case 316 /* UnparsedSyntheticReference */:
return emitUnparsedSyntheticReference(node);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return emitSourceFile(node);
- case 315 /* Bundle */:
+ case 318 /* Bundle */:
return Debug.fail("Bundles should be printed using printBundle");
- case 317 /* InputFiles */:
+ case 320 /* InputFiles */:
return Debug.fail("InputFiles should not be printed");
- case 318 /* JSDocTypeExpression */:
+ case 321 /* JSDocTypeExpression */:
return emitJSDocTypeExpression(node);
- case 319 /* JSDocNameReference */:
+ case 322 /* JSDocNameReference */:
return emitJSDocNameReference(node);
- case 321 /* JSDocAllType */:
+ case 324 /* JSDocAllType */:
return writePunctuation("*");
- case 322 /* JSDocUnknownType */:
+ case 325 /* JSDocUnknownType */:
return writePunctuation("?");
- case 323 /* JSDocNullableType */:
+ case 326 /* JSDocNullableType */:
return emitJSDocNullableType(node);
- case 324 /* JSDocNonNullableType */:
+ case 327 /* JSDocNonNullableType */:
return emitJSDocNonNullableType(node);
- case 325 /* JSDocOptionalType */:
+ case 328 /* JSDocOptionalType */:
return emitJSDocOptionalType(node);
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return emitJSDocFunctionType(node);
- case 191 /* RestType */:
- case 327 /* JSDocVariadicType */:
+ case 193 /* RestType */:
+ case 330 /* JSDocVariadicType */:
return emitRestOrJSDocVariadicType(node);
- case 328 /* JSDocNamepathType */:
+ case 331 /* JSDocNamepathType */:
return;
- case 329 /* JSDoc */:
+ case 332 /* JSDoc */:
return emitJSDoc(node);
- case 331 /* JSDocTypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
return emitJSDocTypeLiteral(node);
- case 332 /* JSDocSignature */:
+ case 335 /* JSDocSignature */:
return emitJSDocSignature(node);
- case 336 /* JSDocTag */:
- case 341 /* JSDocClassTag */:
- case 346 /* JSDocOverrideTag */:
+ case 339 /* JSDocTag */:
+ case 344 /* JSDocClassTag */:
+ case 349 /* JSDocOverrideTag */:
return emitJSDocSimpleTag(node);
- case 337 /* JSDocAugmentsTag */:
- case 338 /* JSDocImplementsTag */:
+ case 340 /* JSDocAugmentsTag */:
+ case 341 /* JSDocImplementsTag */:
return emitJSDocHeritageTag(node);
- case 339 /* JSDocAuthorTag */:
- case 340 /* JSDocDeprecatedTag */:
+ case 342 /* JSDocAuthorTag */:
+ case 343 /* JSDocDeprecatedTag */:
return;
- case 342 /* JSDocPublicTag */:
- case 343 /* JSDocPrivateTag */:
- case 344 /* JSDocProtectedTag */:
- case 345 /* JSDocReadonlyTag */:
+ case 345 /* JSDocPublicTag */:
+ case 346 /* JSDocPrivateTag */:
+ case 347 /* JSDocProtectedTag */:
+ case 348 /* JSDocReadonlyTag */:
return;
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
return emitJSDocCallbackTag(node);
- case 349 /* JSDocParameterTag */:
- case 356 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
+ case 359 /* JSDocPropertyTag */:
return emitJSDocPropertyLikeTag(node);
- case 348 /* JSDocEnumTag */:
- case 350 /* JSDocReturnTag */:
- case 351 /* JSDocThisTag */:
- case 352 /* JSDocTypeTag */:
+ case 351 /* JSDocEnumTag */:
+ case 353 /* JSDocReturnTag */:
+ case 354 /* JSDocThisTag */:
+ case 355 /* JSDocTypeTag */:
return emitJSDocSimpleTypedTag(node);
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return emitJSDocTemplateTag(node);
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return emitJSDocTypedefTag(node);
- case 355 /* JSDocSeeTag */:
+ case 358 /* JSDocSeeTag */:
return emitJSDocSeeTag(node);
- case 358 /* NotEmittedStatement */:
- case 362 /* EndOfDeclarationMarker */:
- case 361 /* MergeDeclarationMarker */:
+ case 361 /* NotEmittedStatement */:
+ case 365 /* EndOfDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return;
}
if (isExpression(node)) {
@@ -102633,84 +102867,84 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return emitIdentifier(node);
case 80 /* PrivateIdentifier */:
return emitPrivateIdentifier(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return emitArrayLiteralExpression(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return emitObjectLiteralExpression(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return emitPropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return emitElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return emitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return emitNewExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return emitTaggedTemplateExpression(node);
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return emitTypeAssertionExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return emitParenthesizedExpression(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return emitFunctionExpression(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return emitArrowFunction(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return emitDeleteExpression(node);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return emitTypeOfExpression(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return emitVoidExpression(node);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return emitAwaitExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return emitPrefixUnaryExpression(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return emitPostfixUnaryExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return emitBinaryExpression(node);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return emitConditionalExpression(node);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return emitTemplateExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return emitYieldExpression(node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return emitSpreadElement(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return emitClassExpression(node);
- case 233 /* OmittedExpression */:
+ case 235 /* OmittedExpression */:
return;
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return emitAsExpression(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return emitNonNullExpression(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return emitExpressionWithTypeArguments(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return emitSatisfiesExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return emitMetaProperty(node);
- case 238 /* SyntheticExpression */:
+ case 240 /* SyntheticExpression */:
return Debug.fail("SyntheticExpression should never be printed.");
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return emitJsxElement(node);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return emitJsxSelfClosingElement(node);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return emitJsxFragment(node);
- case 357 /* SyntaxList */:
+ case 360 /* SyntaxList */:
return Debug.fail("SyntaxList should not be printed");
- case 358 /* NotEmittedStatement */:
+ case 361 /* NotEmittedStatement */:
return;
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return emitPartiallyEmittedExpression(node);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return emitCommaList(node);
- case 361 /* MergeDeclarationMarker */:
- case 362 /* EndOfDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return;
- case 363 /* SyntheticReferenceExpression */:
+ case 366 /* SyntheticReferenceExpression */:
return Debug.fail("SyntheticReferenceExpression should not be printed");
}
}
@@ -102761,7 +102995,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitHelpers(node) {
let helpersEmitted = false;
- const bundle = node.kind === 315 /* Bundle */ ? node : void 0;
+ const bundle = node.kind === 318 /* Bundle */ ? node : void 0;
if (bundle && moduleKind === 0 /* None */) {
return;
}
@@ -102832,7 +103066,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
updateOrPushBundleFileTextLike(
pos,
writer.getTextPos(),
- unparsed.kind === 311 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */
+ unparsed.kind === 314 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */
);
}
}
@@ -102863,7 +103097,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitTabStop(hint, node, snippet) {
Debug.assert(
- node.kind === 243 /* EmptyStatement */,
+ node.kind === 245 /* EmptyStatement */,
`A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`
);
Debug.assert(
@@ -102919,7 +103153,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(node.dotDotDotToken);
emitNodeWithWriter(node.name, writeParameter);
emit(node.questionToken);
- if (node.parent && node.parent.kind === 326 /* JSDocFunctionType */ && !node.name) {
+ if (node.parent && node.parent.kind === 329 /* JSDocFunctionType */ && !node.name) {
emit(node.type);
} else {
emitTypeAnnotation(node.type);
@@ -102937,6 +103171,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitTypeAnnotation(node.type);
writeTrailingSemicolon();
}
+ function emitOverloadPropertyDeclaration(node) {
+ emitModifiers(node, node.modifiers);
+ emitNodeWithWriter(node.name, writeProperty);
+ emit(node.questionToken);
+ }
function emitPropertyDeclaration(node) {
emitDecoratorsAndModifiers(node, node.modifiers);
emit(node.name);
@@ -102981,7 +103220,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitAccessorDeclaration(node) {
emitDecoratorsAndModifiers(node, node.modifiers);
- writeKeyword(node.kind === 177 /* GetAccessor */ ? "get" : "set");
+ writeKeyword(node.kind === 179 /* GetAccessor */ ? "get" : "set");
writeSpace();
emit(node.name);
emitSignatureAndBody(node, emitSignatureHead);
@@ -103410,7 +103649,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function shouldEmitWhitespaceBeforeOperand(node) {
const operand = node.operand;
- return operand.kind === 225 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */));
+ return operand.kind === 227 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */));
}
function emitPostfixUnaryExpression(node) {
emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary);
@@ -103606,7 +103845,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (node.elseStatement) {
writeLineOrSpace(node, node.thenStatement, node.elseStatement);
emitTokenWithComment(92 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node);
- if (node.elseStatement.kind === 246 /* IfStatement */) {
+ if (node.elseStatement.kind === 248 /* IfStatement */) {
writeSpace();
emit(node.elseStatement);
} else {
@@ -103667,7 +103906,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);
emitForBinding(node.initializer);
writeSpace();
- emitTokenWithComment(164 /* OfKeyword */, node.initializer.end, writeKeyword, node);
+ emitTokenWithComment(165 /* OfKeyword */, node.initializer.end, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);
@@ -103675,7 +103914,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitForBinding(node) {
if (node !== void 0) {
- if (node.kind === 262 /* VariableDeclarationList */) {
+ if (node.kind === 264 /* VariableDeclarationList */) {
emit(node);
} else {
emitExpression(node);
@@ -103711,7 +103950,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
pos = writeTokenText(token, writer2, pos);
if (isSimilarNode && contextNode.end !== pos) {
- const isJsxExprContext = contextNode.kind === 297 /* JsxExpression */;
+ const isJsxExprContext = contextNode.kind === 300 /* JsxExpression */;
emitTrailingCommentsOfPosition(pos, !isJsxExprContext, isJsxExprContext);
}
return pos;
@@ -103970,6 +104209,25 @@ function createPrinter(printerOptions = {}, handlers = {}) {
decreaseIndent();
}
}
+ function emitOverloadDeclaration(node) {
+ emitDecoratorsAndModifiers(node, node.modifiers);
+ writeKeyword("overload");
+ if (node.name) {
+ writeSpace();
+ emitIdentifierName(node.name);
+ }
+ const indentedFlag = getEmitFlags(node) & 65536 /* Indented */;
+ if (indentedFlag) {
+ increaseIndent();
+ }
+ writeSpace();
+ writePunctuation("{");
+ emitList(node, node.members, 145 /* EnumMembers */);
+ writePunctuation("}");
+ if (indentedFlag) {
+ decreaseIndent();
+ }
+ }
function emitTypeAliasDeclaration(node) {
if (isSendableFunctionOrType(node, true)) {
emitDecorators(node, node.illegalDecorators);
@@ -104367,7 +104625,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
}
if (node.tags) {
- if (node.tags.length === 1 && node.tags[0].kind === 352 /* JSDocTypeTag */ && !node.comment) {
+ if (node.tags.length === 1 && node.tags[0].kind === 355 /* JSDocTypeTag */ && !node.comment) {
writeSpace();
emit(node.tags[0]);
} else {
@@ -104411,7 +104669,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitJSDocTypedefTag(tag) {
emitJSDocTagName(tag.tagName);
if (tag.typeExpression) {
- if (tag.typeExpression.kind === 318 /* JSDocTypeExpression */) {
+ if (tag.typeExpression.kind === 321 /* JSDocTypeExpression */) {
emitJSDocTypeExpression(tag.typeExpression);
} else {
writeSpace();
@@ -104429,7 +104687,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(tag.fullName);
}
emitJSDocComment(tag.comment);
- if (tag.typeExpression && tag.typeExpression.kind === 331 /* JSDocTypeLiteral */) {
+ if (tag.typeExpression && tag.typeExpression.kind === 334 /* JSDocTypeLiteral */) {
emitJSDocTypeLiteral(tag.typeExpression);
}
}
@@ -105245,7 +105503,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile));
}
function skipSynthesizedParentheses(node) {
- while (node.kind === 217 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) {
+ while (node.kind === 219 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) {
node = node.expression;
}
return node;
@@ -105315,84 +105573,84 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (!node)
return;
switch (node.kind) {
- case 242 /* Block */:
+ case 244 /* Block */:
forEach(node.statements, generateNames);
break;
- case 257 /* LabeledStatement */:
- case 255 /* WithStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 259 /* LabeledStatement */:
+ case 257 /* WithStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
generateNames(node.statement);
break;
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
generateNames(node.thenStatement);
generateNames(node.elseStatement);
break;
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
generateNames(node.initializer);
generateNames(node.statement);
break;
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
generateNames(node.caseBlock);
break;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
forEach(node.clauses, generateNames);
break;
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
forEach(node.statements, generateNames);
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
generateNames(node.tryBlock);
generateNames(node.catchClause);
generateNames(node.finallyBlock);
break;
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
generateNames(node.variableDeclaration);
generateNames(node.block);
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
generateNames(node.declarationList);
break;
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
forEach(node.declarations, generateNames);
break;
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
generateNameIfNeeded(node.name);
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
generateNameIfNeeded(node.name);
if (getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) {
forEach(node.parameters, generateNames);
generateNames(node.body);
}
break;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
forEach(node.elements, generateNames);
break;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
generateNames(node.importClause);
break;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
generateNameIfNeeded(node.name);
generateNames(node.namedBindings);
break;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
generateNameIfNeeded(node.name);
break;
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
generateNameIfNeeded(node.name);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
forEach(node.elements, generateNames);
break;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
generateNameIfNeeded(node.propertyName || node.name);
break;
}
@@ -105401,13 +105659,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (!node)
return;
switch (node.kind) {
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
generateNameIfNeeded(node.name);
break;
}
@@ -105581,27 +105839,27 @@ function createPrinter(printerOptions = {}, handlers = {}) {
prefix,
suffix
);
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForModuleOrEnum(node);
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForImportOrExportDeclaration(node);
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 280 /* ExportAssignment */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 283 /* ExportAssignment */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForExportDefault();
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForClassExpression();
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return generateNameForMethodOrAccessor(node, privateName, prefix, suffix);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return makeTempVariableName(TempFlags.Auto, true, privateName, prefix, suffix);
default:
return makeTempVariableName(TempFlags.Auto, false, privateName, prefix, suffix);
@@ -105692,14 +105950,14 @@ function createPrinter(printerOptions = {}, handlers = {}) {
const skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;
if ((pos > 0 || end > 0) && pos !== end) {
if (!skipLeadingComments) {
- emitLeadingComments(pos, node.kind !== 358 /* NotEmittedStatement */);
+ emitLeadingComments(pos, node.kind !== 361 /* NotEmittedStatement */);
}
if (!skipLeadingComments || pos >= 0 && (emitFlags & 512 /* NoLeadingComments */) !== 0) {
containerPos = pos;
}
if (!skipTrailingComments || end >= 0 && (emitFlags & 1024 /* NoTrailingComments */) !== 0) {
containerEnd = end;
- if (node.kind === 262 /* VariableDeclarationList */) {
+ if (node.kind === 264 /* VariableDeclarationList */) {
declarationListContainerEnd = end;
}
}
@@ -105715,7 +105973,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
containerPos = savedContainerPos;
containerEnd = savedContainerEnd;
declarationListContainerEnd = savedDeclarationListContainerEnd;
- if (!skipTrailingComments && node.kind !== 358 /* NotEmittedStatement */) {
+ if (!skipTrailingComments && node.kind !== 361 /* NotEmittedStatement */) {
emitTrailingComments(end);
}
}
@@ -105967,7 +106225,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
} else {
const source = sourceMapRange.source || sourceMapSource;
- if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
+ if (node.kind !== 361 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
}
if (emitFlags & 64 /* NoNestedSourceMaps */) {
@@ -105982,7 +106240,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (emitFlags & 64 /* NoNestedSourceMaps */) {
sourceMapsDisabled = false;
}
- if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
+ if (node.kind !== 361 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
}
}
@@ -108385,89 +108643,89 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
return diagnostics;
function walk(node, parent2) {
switch (parent2.kind) {
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
if (parent2.questionToken === node) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?"));
return "skip";
}
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
- case 261 /* VariableDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 263 /* VariableDeclaration */:
if (parent2.type === node) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files));
return "skip";
}
}
switch (node.kind) {
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
if (node.isTypeOnly) {
diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type"));
return "skip";
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
if (node.isTypeOnly) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type"));
return "skip";
}
break;
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
if (node.isTypeOnly) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, isImportSpecifier(node) ? "import...type" : "export...type"));
return "skip";
}
break;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.import_can_only_be_used_in_TypeScript_files));
return "skip";
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
if (node.isExportEquals) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.export_can_only_be_used_in_TypeScript_files));
return "skip";
}
break;
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
const heritageClause = node;
if (heritageClause.token === 118 /* ImplementsKeyword */) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files));
return "skip";
}
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
const interfaceKeyword = tokenToString(119 /* InterfaceKeyword */);
Debug.assertIsDefined(interfaceKeyword);
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword));
return "skip";
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const moduleKeyword = node.flags & 16 /* Namespace */ ? tokenToString(144 /* NamespaceKeyword */) : tokenToString(143 /* ModuleKeyword */);
Debug.assertIsDefined(moduleKeyword);
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword));
return "skip";
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files));
return "skip";
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
const enumKeyword = Debug.checkDefined(tokenToString(93 /* EnumKeyword */));
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword));
return "skip";
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files));
return "skip";
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files));
return "skip";
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files));
return "skip";
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
Debug.fail();
}
}
@@ -108476,27 +108734,27 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning));
}
switch (parent2.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
if (nodes === parent2.typeParameters) {
diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files));
return "skip";
}
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (nodes === parent2.modifiers) {
- checkModifiers(parent2.modifiers, parent2.kind === 244 /* VariableStatement */);
+ checkModifiers(parent2.modifiers, parent2.kind === 246 /* VariableStatement */);
return "skip";
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (nodes === parent2.modifiers) {
for (const modifier of nodes) {
if (isModifier(modifier) && modifier.kind !== 125 /* StaticKeyword */ && modifier.kind !== 128 /* AccessorKeyword */) {
@@ -108506,18 +108764,18 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
return "skip";
}
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (nodes === parent2.modifiers && some(nodes, isModifier)) {
diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files));
return "skip";
}
break;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 234 /* ExpressionWithTypeArguments */:
- case 288 /* JsxSelfClosingElement */:
- case 289 /* JsxOpeningElement */:
- case 215 /* TaggedTemplateExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 291 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 217 /* TaggedTemplateExpression */:
if (nodes === parent2.typeArguments) {
diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files));
return "skip";
@@ -117866,6 +118124,9 @@ __export(ts_exports3, {
isOptionalTypeNode: () => isOptionalTypeNode,
isOuterExpression: () => isOuterExpression,
isOutermostOptionalChain: () => isOutermostOptionalChain,
+ isOverloadDeclaration: () => isOverloadDeclaration,
+ isOverloadElement: () => isOverloadElement,
+ isOverloadPropertyDeclaration: () => isOverloadPropertyDeclaration,
isOverrideModifier: () => isOverrideModifier,
isPackedArrayLiteral: () => isPackedArrayLiteral,
isParameter: () => isParameter,
@@ -118990,39 +119251,39 @@ var SemanticMeaning = /* @__PURE__ */ ((SemanticMeaning3) => {
})(SemanticMeaning || {});
function getMeaningFromDeclaration(node) {
switch (node.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return isInJSFile(node) && getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */;
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 301 /* CatchClause */:
- case 294 /* JsxAttribute */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 304 /* CatchClause */:
+ case 297 /* JsxAttribute */:
return 1 /* Value */;
- case 167 /* TypeParameter */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 187 /* TypeLiteral */:
+ case 168 /* TypeParameter */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 189 /* TypeLiteral */:
return 2 /* Type */;
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return node.name === void 0 ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */;
- case 308 /* EnumMember */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 311 /* EnumMember */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
return 1 /* Value */ | 2 /* Type */;
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return 2 /* Type */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (isAmbientModule(node)) {
return 4 /* Namespace */ | 1 /* Value */;
} else if (getModuleInstanceState(node) === 1 /* Instantiated */) {
@@ -119030,15 +119291,15 @@ function getMeaningFromDeclaration(node) {
} else {
return 4 /* Namespace */;
}
- case 269 /* EnumDeclaration */:
- case 278 /* NamedImports */:
- case 279 /* ImportSpecifier */:
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
- case 280 /* ExportAssignment */:
- case 281 /* ExportDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 281 /* NamedImports */:
+ case 282 /* ImportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 284 /* ExportDeclaration */:
return 7 /* All */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return 4 /* Namespace */ | 1 /* Value */;
}
return 7 /* All */;
@@ -119046,7 +119307,7 @@ function getMeaningFromDeclaration(node) {
function getMeaningFromLocation(node) {
node = getAdjustedReferenceLocation(node);
const parent2 = node.parent;
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return 1 /* Value */;
} else if (isExportAssignment(parent2) || isExportSpecifier(parent2) || isExternalModuleReference(parent2) || isImportSpecifier(parent2) || isImportClause(parent2) || isImportEqualsDeclaration(parent2) && node === parent2.name) {
return 7 /* All */;
@@ -119070,11 +119331,11 @@ function getMeaningFromLocation(node) {
}
}
function getMeaningFromRightHandSideOfImportEquals(node) {
- const name = node.kind === 165 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0;
- return name && name.parent.kind === 274 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */;
+ const name = node.kind === 166 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0;
+ return name && name.parent.kind === 277 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */;
}
function isInRightSideOfInternalImportEqualsDeclaration(node) {
- while (node.parent.kind === 165 /* QualifiedName */) {
+ while (node.parent.kind === 166 /* QualifiedName */) {
node = node.parent;
}
return isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node;
@@ -119085,26 +119346,26 @@ function isNamespaceReference(node) {
function isQualifiedNameNamespaceReference(node) {
let root = node;
let isLastClause = true;
- if (root.parent.kind === 165 /* QualifiedName */) {
- while (root.parent && root.parent.kind === 165 /* QualifiedName */) {
+ if (root.parent.kind === 166 /* QualifiedName */) {
+ while (root.parent && root.parent.kind === 166 /* QualifiedName */) {
root = root.parent;
}
isLastClause = root.right === node;
}
- return root.parent.kind === 183 /* TypeReference */ && !isLastClause;
+ return root.parent.kind === 185 /* TypeReference */ && !isLastClause;
}
function isPropertyAccessNamespaceReference(node) {
let root = node;
let isLastClause = true;
- if (root.parent.kind === 211 /* PropertyAccessExpression */) {
- while (root.parent && root.parent.kind === 211 /* PropertyAccessExpression */) {
+ if (root.parent.kind === 213 /* PropertyAccessExpression */) {
+ while (root.parent && root.parent.kind === 213 /* PropertyAccessExpression */) {
root = root.parent;
}
isLastClause = root.name === node;
}
- if (!isLastClause && root.parent.kind === 234 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 300 /* HeritageClause */) {
+ if (!isLastClause && root.parent.kind === 236 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 303 /* HeritageClause */) {
const decl = root.parent.parent.parent;
- return (decl.kind === 264 /* ClassDeclaration */ || decl.kind === 265 /* StructDeclaration */) && root.parent.parent.token === 118 /* ImplementsKeyword */ || decl.kind === 267 /* InterfaceDeclaration */ && root.parent.parent.token === 95 /* ExtendsKeyword */;
+ return (decl.kind === 266 /* ClassDeclaration */ || decl.kind === 267 /* StructDeclaration */) && root.parent.parent.token === 118 /* ImplementsKeyword */ || decl.kind === 270 /* InterfaceDeclaration */ && root.parent.parent.token === 95 /* ExtendsKeyword */;
}
return false;
}
@@ -119115,15 +119376,15 @@ function isTypeReference(node) {
switch (node.kind) {
case 109 /* ThisKeyword */:
return !isExpressionNode(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return true;
}
switch (node.parent.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return true;
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return !node.parent.isTypeOf;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return isPartOfTypeNode(node.parent);
}
return false;
@@ -119170,7 +119431,7 @@ function climbPastPropertyOrElementAccess(node) {
}
function getTargetLabel(referenceNode, labelName) {
while (referenceNode) {
- if (referenceNode.kind === 257 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) {
+ if (referenceNode.kind === 259 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) {
return referenceNode.label;
}
referenceNode = referenceNode.parent;
@@ -119220,22 +119481,22 @@ function isNameOfFunctionDeclaration(node) {
}
function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) {
switch (node.parent.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 305 /* PropertyAssignment */:
- case 308 /* EnumMember */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 270 /* ModuleDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 308 /* PropertyAssignment */:
+ case 311 /* EnumMember */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 273 /* ModuleDeclaration */:
return getNameOfDeclaration(node.parent) === node;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return node.parent.argumentExpression === node;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return true;
- case 201 /* LiteralType */:
- return node.parent.parent.kind === 199 /* IndexedAccessType */;
+ case 203 /* LiteralType */:
+ return node.parent.parent.kind === 201 /* IndexedAccessType */;
default:
return false;
}
@@ -119253,86 +119514,86 @@ function getContainerNode(node) {
return void 0;
}
switch (node.kind) {
- case 314 /* SourceFile */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 317 /* SourceFile */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
return node;
}
}
}
function getNodeKind(node) {
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return "module" /* moduleElement */;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return "class" /* classElement */;
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return "struct" /* structElement */;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return "interface" /* interfaceElement */;
- case 268 /* TypeAliasDeclaration */:
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
+ case 271 /* TypeAliasDeclaration */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
return "type" /* typeElement */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return "enum" /* enumElement */;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return getKindOfVariableDeclaration(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getKindOfVariableDeclaration(getRootDeclaration(node));
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return "function" /* functionElement */;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return "getter" /* memberGetAccessorElement */;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return "setter" /* memberSetAccessorElement */;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return "method" /* memberFunctionElement */;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
const { initializer } = node;
return isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */;
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return "property" /* memberVariableElement */;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return "index" /* indexSignatureElement */;
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return "construct" /* constructSignatureElement */;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return "call" /* callSignatureElement */;
- case 176 /* Constructor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 177 /* ClassStaticBlockDeclaration */:
return "constructor" /* constructorImplementationElement */;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return "type parameter" /* typeParameterElement */;
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return "enum member" /* enumMemberElement */;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */;
- case 274 /* ImportEqualsDeclaration */:
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
- case 277 /* NamespaceImport */:
- case 283 /* NamespaceExport */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
+ case 280 /* NamespaceImport */:
+ case 286 /* NamespaceExport */:
return "alias" /* alias */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const kind = getAssignmentDeclarationKind(node);
const { right } = node;
switch (kind) {
@@ -119360,7 +119621,7 @@ function getNodeKind(node) {
}
case 79 /* Identifier */:
return isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
const scriptKind = getNodeKind(node.expression);
return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind;
default:
@@ -119375,7 +119636,7 @@ function isThis(node) {
case 109 /* ThisKeyword */:
return true;
case 79 /* Identifier */:
- return identifierIsThisKeyword(node) && node.parent.kind === 168 /* Parameter */;
+ return identifierIsThisKeyword(node) && node.parent.kind === 169 /* Parameter */;
default:
return false;
}
@@ -119424,42 +119685,42 @@ function isCompletedNode(n, sourceFile) {
return false;
}
switch (n.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 210 /* ObjectLiteralExpression */:
- case 206 /* ObjectBindingPattern */:
- case 187 /* TypeLiteral */:
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
- case 272 /* CaseBlock */:
- case 278 /* NamedImports */:
- case 282 /* NamedExports */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 212 /* ObjectLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 189 /* TypeLiteral */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
+ case 275 /* CaseBlock */:
+ case 281 /* NamedImports */:
+ case 285 /* NamedExports */:
return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return isCompletedNode(n.block, sourceFile);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
if (!n.arguments) {
return true;
}
- case 213 /* CallExpression */:
- case 217 /* ParenthesizedExpression */:
- case 196 /* ParenthesizedType */:
+ case 215 /* CallExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 198 /* ParenthesizedType */:
return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return isCompletedNode(n.type, sourceFile);
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 180 /* ConstructSignature */:
- case 179 /* CallSignature */:
- case 219 /* ArrowFunction */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 182 /* ConstructSignature */:
+ case 181 /* CallSignature */:
+ case 221 /* ArrowFunction */:
if (n.body) {
return isCompletedNode(n.body, sourceFile);
}
@@ -119467,60 +119728,60 @@ function isCompletedNode(n, sourceFile) {
return isCompletedNode(n.type, sourceFile);
}
return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return !!n.body && isCompletedNode(n.body, sourceFile);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
if (n.elseStatement) {
return isCompletedNode(n.elseStatement, sourceFile);
}
return isCompletedNode(n.thenStatement, sourceFile);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile);
- case 209 /* ArrayLiteralExpression */:
- case 207 /* ArrayBindingPattern */:
- case 212 /* ElementAccessExpression */:
- case 166 /* ComputedPropertyName */:
- case 189 /* TupleType */:
+ case 211 /* ArrayLiteralExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 214 /* ElementAccessExpression */:
+ case 167 /* ComputedPropertyName */:
+ case 191 /* TupleType */:
return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile);
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
if (n.type) {
return isCompletedNode(n.type, sourceFile);
}
return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return false;
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 248 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 250 /* WhileStatement */:
return isCompletedNode(n.statement, sourceFile);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return hasChildOfKind(n, 116 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return isCompletedNode(n.exprName, sourceFile);
- case 222 /* TypeOfExpression */:
- case 221 /* DeleteExpression */:
- case 223 /* VoidExpression */:
- case 230 /* YieldExpression */:
- case 231 /* SpreadElement */:
+ case 224 /* TypeOfExpression */:
+ case 223 /* DeleteExpression */:
+ case 225 /* VoidExpression */:
+ case 232 /* YieldExpression */:
+ case 233 /* SpreadElement */:
const unaryWordExpression = n;
return isCompletedNode(unaryWordExpression.expression, sourceFile);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return isCompletedNode(n.template, sourceFile);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
const lastSpan = lastOrUndefined(n.templateSpans);
return isCompletedNode(lastSpan, sourceFile);
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return nodeIsPresent(n.literal);
- case 281 /* ExportDeclaration */:
- case 275 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
return nodeIsPresent(n.moduleSpecifier);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return isCompletedNode(n.operand, sourceFile);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isCompletedNode(n.right, sourceFile);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isCompletedNode(n.whenFalse, sourceFile);
default:
return true;
@@ -119622,14 +119883,14 @@ function getContextualTypeFromParentOrAncestorTypeNode(node, checker) {
function getAdjustedLocationForDeclaration(node, forRename) {
if (!forRename) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return getAdjustedLocationForClass(node);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return getAdjustedLocationForFunction(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return node;
}
}
@@ -119779,7 +120040,7 @@ function getAdjustedLocation(node, forRename) {
if (node.kind === 129 /* AsKeyword */ && isAsExpression(parent2) && isTypeReferenceNode(parent2.type)) {
return parent2.type.typeName;
}
- if (node.kind === 102 /* InKeyword */ && isForInStatement(parent2) || node.kind === 164 /* OfKeyword */ && isForOfStatement(parent2)) {
+ if (node.kind === 102 /* InKeyword */ && isForInStatement(parent2) || node.kind === 165 /* OfKeyword */ && isForOfStatement(parent2)) {
return skipOuterExpressions(parent2.expression);
}
}
@@ -119918,7 +120179,7 @@ function findPrecedingToken(position, sourceFile, startNode2, excludeJsdoc) {
}
}
}
- Debug.assert(startNode2 !== void 0 || n.kind === 314 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n));
+ Debug.assert(startNode2 !== void 0 || n.kind === 317 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n));
const candidate = findRightmostChildNodeWithTokens(children, children.length, sourceFile, n.kind);
return candidate && findRightmostToken(candidate, sourceFile);
}
@@ -119941,7 +120202,7 @@ function findRightmostChildNodeWithTokens(children, exclusiveStartPosition, sour
for (let i = exclusiveStartPosition - 1; i >= 0; i--) {
const child = children[i];
if (isWhiteSpaceOnlyJsxText(child)) {
- if (i === 0 && (parentKind === 11 /* JsxText */ || parentKind === 288 /* JsxSelfClosingElement */)) {
+ if (i === 0 && (parentKind === 11 /* JsxText */ || parentKind === 291 /* JsxSelfClosingElement */)) {
Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");
}
} else if (nodeHasTokens(children[i], sourceFile)) {
@@ -119973,13 +120234,13 @@ function isInsideJsxElementOrAttribute(sourceFile, position) {
if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 11 /* JsxText */) {
return true;
}
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 297 /* JsxExpression */) {
+ if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 300 /* JsxExpression */) {
return true;
}
- if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 297 /* JsxExpression */) {
+ if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 300 /* JsxExpression */) {
return true;
}
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 290 /* JsxClosingElement */) {
+ if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 293 /* JsxClosingElement */) {
return true;
}
return false;
@@ -120007,9 +120268,9 @@ function isInJSXText(sourceFile, position) {
function isInsideJsxElement(sourceFile, position) {
function isInsideJsxElementTraversal(node) {
while (node) {
- if (node.kind >= 288 /* JsxSelfClosingElement */ && node.kind <= 297 /* JsxExpression */ || node.kind === 11 /* JsxText */ || node.kind === 29 /* LessThanToken */ || node.kind === 31 /* GreaterThanToken */ || node.kind === 79 /* Identifier */ || node.kind === 19 /* CloseBraceToken */ || node.kind === 18 /* OpenBraceToken */ || node.kind === 43 /* SlashToken */) {
+ if (node.kind >= 291 /* JsxSelfClosingElement */ && node.kind <= 300 /* JsxExpression */ || node.kind === 11 /* JsxText */ || node.kind === 29 /* LessThanToken */ || node.kind === 31 /* GreaterThanToken */ || node.kind === 79 /* Identifier */ || node.kind === 19 /* CloseBraceToken */ || node.kind === 18 /* OpenBraceToken */ || node.kind === 43 /* SlashToken */) {
node = node.parent;
- } else if (node.kind === 287 /* JsxElement */) {
+ } else if (node.kind === 290 /* JsxElement */) {
if (position > node.getStart(sourceFile))
return true;
node = node.parent;
@@ -120170,15 +120431,15 @@ function getNodeModifiers(node, excludeFlags = 0 /* None */) {
result.push("deprecated" /* deprecatedModifier */);
if (node.flags & 16777216 /* Ambient */)
result.push("declare" /* ambientModifier */);
- if (node.kind === 280 /* ExportAssignment */)
+ if (node.kind === 283 /* ExportAssignment */)
result.push("export" /* exportedModifier */);
return result.length > 0 ? result.join(",") : "" /* none */;
}
function getTypeArgumentOrTypeParameterList(node) {
- if (node.kind === 183 /* TypeReference */ || node.kind === 213 /* CallExpression */) {
+ if (node.kind === 185 /* TypeReference */ || node.kind === 215 /* CallExpression */) {
return node.typeArguments;
}
- if (isFunctionLike(node) || node.kind === 264 /* ClassDeclaration */ || node.kind === 267 /* InterfaceDeclaration */) {
+ if (isFunctionLike(node) || node.kind === 266 /* ClassDeclaration */ || node.kind === 270 /* InterfaceDeclaration */) {
return node.typeParameters;
}
return void 0;
@@ -120213,14 +120474,14 @@ function cloneCompilerOptions(options) {
return result;
}
function isArrayLiteralOrObjectLiteralDestructuringPattern(node) {
- if (node.kind === 209 /* ArrayLiteralExpression */ || node.kind === 210 /* ObjectLiteralExpression */) {
- if (node.parent.kind === 227 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */) {
+ if (node.kind === 211 /* ArrayLiteralExpression */ || node.kind === 212 /* ObjectLiteralExpression */) {
+ if (node.parent.kind === 229 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */) {
return true;
}
- if (node.parent.kind === 251 /* ForOfStatement */ && node.parent.initializer === node) {
+ if (node.parent.kind === 253 /* ForOfStatement */ && node.parent.initializer === node) {
return true;
}
- if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 305 /* PropertyAssignment */ ? node.parent.parent : node.parent)) {
+ if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 308 /* PropertyAssignment */ ? node.parent.parent : node.parent)) {
return true;
}
}
@@ -120324,7 +120585,7 @@ function skipConstraint(type) {
return type.isTypeParameter() ? type.getConstraint() || type : type;
}
function getNameFromPropertyName(name) {
- return name.kind === 166 /* ComputedPropertyName */ ? isStringOrNumericLiteralLike(name.expression) ? name.expression.text : void 0 : isPrivateIdentifier(name) ? idText(name) : getTextOfIdentifierOrLiteral(name);
+ return name.kind === 167 /* ComputedPropertyName */ ? isStringOrNumericLiteralLike(name.expression) ? name.expression.text : void 0 : isPrivateIdentifier(name) ? idText(name) : getTextOfIdentifierOrLiteral(name);
}
function programContainsModules(program) {
return program.getSourceFiles().some((s) => !s.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s) && !!(s.externalModuleIndicator || s.commonJsModuleIndicator));
@@ -120448,7 +120709,7 @@ function findModifier(node, kind) {
}
function insertImports(changes, sourceFile, imports, blankLineBetween) {
const decl = isArray(imports) ? imports[0] : imports;
- const importKindPredicate = decl.kind === 244 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax;
+ const importKindPredicate = decl.kind === 246 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax;
const existingImportStatements = filter(sourceFile.statements, importKindPredicate);
const sortedNewImports = isArray(imports) ? stableSort(imports, ts_OrganizeImports_exports.compareImportsOrRequireStatements) : [imports];
if (!existingImportStatements.length) {
@@ -120989,13 +121250,13 @@ function needsParentheses(expression) {
function getContextualTypeFromParent(node, checker) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return checker.getContextualType(parent2);
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const { left, operatorToken, right } = parent2;
return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node);
}
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
return parent2.expression === node ? getSwitchedType(parent2, checker) : void 0;
default:
return checker.getContextualType(node);
@@ -121021,8 +121282,8 @@ function isStringLiteralOrTemplate(node) {
switch (node.kind) {
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
- case 215 /* TaggedTemplateExpression */:
+ case 231 /* TemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return true;
default:
return false;
@@ -121052,16 +121313,16 @@ function getTypeNodeIfAccessible(type, enclosingScope, program, host) {
return typeIsAccessible ? res : void 0;
}
function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) {
- return kind === 179 /* CallSignature */ || kind === 180 /* ConstructSignature */ || kind === 181 /* IndexSignature */ || kind === 170 /* PropertySignature */ || kind === 173 /* MethodSignature */;
+ return kind === 181 /* CallSignature */ || kind === 182 /* ConstructSignature */ || kind === 183 /* IndexSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */;
}
function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) {
- return kind === 263 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 265 /* FunctionDeclaration */ || kind === 178 /* Constructor */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) {
- return kind === 270 /* ModuleDeclaration */;
+ return kind === 273 /* ModuleDeclaration */;
}
function syntaxRequiresTrailingSemicolonOrASI(kind) {
- return kind === 244 /* VariableStatement */ || kind === 245 /* ExpressionStatement */ || kind === 247 /* DoStatement */ || kind === 252 /* ContinueStatement */ || kind === 253 /* BreakStatement */ || kind === 254 /* ReturnStatement */ || kind === 258 /* ThrowStatement */ || kind === 260 /* DebuggerStatement */ || kind === 171 /* PropertyDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 280 /* ExportAssignment */;
+ return kind === 246 /* VariableStatement */ || kind === 247 /* ExpressionStatement */ || kind === 249 /* DoStatement */ || kind === 254 /* ContinueStatement */ || kind === 255 /* BreakStatement */ || kind === 256 /* ReturnStatement */ || kind === 260 /* ThrowStatement */ || kind === 262 /* DebuggerStatement */ || kind === 172 /* PropertyDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 283 /* ExportAssignment */;
}
var syntaxMayBeASICandidate = or(
syntaxRequiresTrailingCommaOrSemicolonOrASI,
@@ -121091,7 +121352,7 @@ function nodeIsASICandidate(node, sourceFile) {
} else if (!syntaxRequiresTrailingSemicolonOrASI(node.kind)) {
return false;
}
- if (node.kind === 247 /* DoStatement */) {
+ if (node.kind === 249 /* DoStatement */) {
return true;
}
const topNode = findAncestor(node, (ancestor) => !ancestor.parent);
@@ -122253,13 +122514,13 @@ function getSemanticClassifications(typeChecker3, cancellationToken, sourceFile,
}
function checkForClassificationCancellation(cancellationToken, kind) {
switch (kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
}
@@ -122463,46 +122724,46 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
pos = tag.tagName.end;
let commentStart = tag.tagName.end;
switch (tag.kind) {
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
const param = tag;
processJSDocParameterTag(param);
commentStart = param.isNameFirst && ((_a2 = param.typeExpression) == null ? void 0 : _a2.end) || param.name.end;
break;
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
const prop = tag;
commentStart = prop.isNameFirst && ((_b = prop.typeExpression) == null ? void 0 : _b.end) || prop.name.end;
break;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
processJSDocTemplateTag(tag);
pos = tag.end;
commentStart = tag.typeParameters.end;
break;
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
const type = tag;
- commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 318 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart;
+ commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 321 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart;
break;
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
commentStart = tag.typeExpression.end;
break;
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
processElement(tag.typeExpression);
pos = tag.end;
commentStart = tag.typeExpression.end;
break;
- case 351 /* JSDocThisTag */:
- case 348 /* JSDocEnumTag */:
+ case 354 /* JSDocThisTag */:
+ case 351 /* JSDocEnumTag */:
commentStart = tag.typeExpression.end;
break;
- case 350 /* JSDocReturnTag */:
+ case 353 /* JSDocReturnTag */:
processElement(tag.typeExpression);
pos = tag.end;
commentStart = ((_f = tag.typeExpression) == null ? void 0 : _f.end) || commentStart;
break;
- case 355 /* JSDocSeeTag */:
+ case 358 /* JSDocSeeTag */:
commentStart = ((_g = tag.name) == null ? void 0 : _g.end) || commentStart;
break;
- case 337 /* JSDocAugmentsTag */:
- case 338 /* JSDocImplementsTag */:
+ case 340 /* JSDocAugmentsTag */:
+ case 341 /* JSDocImplementsTag */:
commentStart = tag.class.end;
break;
}
@@ -122645,22 +122906,22 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
}
function tryClassifyJsxElementName(token) {
switch (token.parent && token.parent.kind) {
- case 289 /* JsxOpeningElement */:
+ case 292 /* JsxOpeningElement */:
if (token.parent.tagName === token) {
return 19 /* jsxOpenTagName */;
}
break;
- case 290 /* JsxClosingElement */:
+ case 293 /* JsxClosingElement */:
if (token.parent.tagName === token) {
return 20 /* jsxCloseTagName */;
}
break;
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
if (token.parent.tagName === token) {
return 21 /* jsxSelfClosingTagName */;
}
break;
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
if (token.parent.name === token) {
return 22 /* jsxAttribute */;
}
@@ -122681,11 +122942,11 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
if (token) {
const parent2 = token.parent;
if (tokenKind === 63 /* EqualsToken */) {
- if (parent2.kind === 261 /* VariableDeclaration */ || parent2.kind === 171 /* PropertyDeclaration */ || parent2.kind === 168 /* Parameter */ || parent2.kind === 294 /* JsxAttribute */) {
+ if (parent2.kind === 263 /* VariableDeclaration */ || parent2.kind === 172 /* PropertyDeclaration */ || parent2.kind === 169 /* Parameter */ || parent2.kind === 297 /* JsxAttribute */) {
return 5 /* operator */;
}
}
- if (parent2.kind === 227 /* BinaryExpression */ || parent2.kind === 225 /* PrefixUnaryExpression */ || parent2.kind === 226 /* PostfixUnaryExpression */ || parent2.kind === 228 /* ConditionalExpression */) {
+ if (parent2.kind === 229 /* BinaryExpression */ || parent2.kind === 227 /* PrefixUnaryExpression */ || parent2.kind === 228 /* PostfixUnaryExpression */ || parent2.kind === 230 /* ConditionalExpression */) {
return 5 /* operator */;
}
}
@@ -122695,7 +122956,7 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
} else if (tokenKind === 9 /* BigIntLiteral */) {
return 25 /* bigintLiteral */;
} else if (tokenKind === 10 /* StringLiteral */) {
- return token && token.parent.kind === 294 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */;
+ return token && token.parent.kind === 297 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */;
} else if (tokenKind === 13 /* RegularExpressionLiteral */) {
return 6 /* stringLiteral */;
} else if (isTemplateLiteralKind(tokenKind)) {
@@ -122705,32 +122966,32 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
} else if (tokenKind === 79 /* Identifier */) {
if (token) {
switch (token.parent.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
if (token.parent.name === token) {
return 11 /* className */;
}
return;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
if (token.parent.name === token) {
return 15 /* typeParameterName */;
}
return;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
if (token.parent.name === token) {
return 13 /* interfaceName */;
}
return;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (token.parent.name === token) {
return 12 /* enumName */;
}
return;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (token.parent.name === token) {
return 14 /* moduleName */;
}
return;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (token.parent.name === token) {
return isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */;
}
@@ -122873,7 +123134,7 @@ var DocumentHighlights;
let child = throwStatement;
while (child.parent) {
const parent2 = child.parent;
- if (isFunctionBlock(parent2) || parent2.kind === 314 /* SourceFile */) {
+ if (isFunctionBlock(parent2) || parent2.kind === 317 /* SourceFile */) {
return parent2;
}
if (isTryStatement(parent2) && parent2.tryBlock === child && parent2.catchClause) {
@@ -122903,15 +123164,15 @@ var DocumentHighlights;
function getBreakOrContinueOwner(statement) {
return findAncestor(statement, (node) => {
switch (node.kind) {
- case 256 /* SwitchStatement */:
- if (statement.kind === 252 /* ContinueStatement */) {
+ case 258 /* SwitchStatement */:
+ if (statement.kind === 254 /* ContinueStatement */) {
return false;
}
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 248 /* WhileStatement */:
- case 247 /* DoStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 250 /* WhileStatement */:
+ case 249 /* DoStatement */:
return !statement.label || isLabeledBy(node, statement.label.escapedText);
default:
return isFunctionLike(node) && "quit";
@@ -122924,25 +123185,25 @@ var DocumentHighlights;
function getNodesToSearchForModifier(declaration, modifierFlag) {
const container = declaration.parent;
switch (container.kind) {
- case 271 /* ModuleBlock */:
- case 314 /* SourceFile */:
- case 242 /* Block */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 274 /* ModuleBlock */:
+ case 317 /* SourceFile */:
+ case 244 /* Block */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
if (modifierFlag & 256 /* Abstract */ && isClassDeclaration(declaration)) {
return [...declaration.members, declaration];
} else {
return container.statements;
}
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
return [...container.parameters, ...isClassLike(container.parent) ? container.parent.members : []];
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 187 /* TypeLiteral */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 189 /* TypeLiteral */:
const nodes = container.members;
if (modifierFlag & (28 /* AccessibilityModifier */ | 64 /* Readonly */)) {
const constructor = find(container.members, isConstructorDeclaration);
@@ -122953,7 +123214,7 @@ var DocumentHighlights;
return [...nodes, container];
}
return nodes;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return void 0;
default:
Debug.assertNever(container, "Invalid container kind.");
@@ -122969,7 +123230,7 @@ var DocumentHighlights;
function getLoopBreakContinueOccurrences(loopNode) {
const keywords = [];
if (pushKeywordIf(keywords, loopNode.getFirstToken(), 98 /* ForKeyword */, 116 /* WhileKeyword */, 91 /* DoKeyword */)) {
- if (loopNode.kind === 247 /* DoStatement */) {
+ if (loopNode.kind === 249 /* DoStatement */) {
const loopTokens = loopNode.getChildren();
for (let i = loopTokens.length - 1; i >= 0; i--) {
if (pushKeywordIf(keywords, loopTokens[i], 116 /* WhileKeyword */)) {
@@ -122989,13 +123250,13 @@ var DocumentHighlights;
const owner = getBreakOrContinueOwner(breakOrContinueStatement);
if (owner) {
switch (owner.kind) {
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return getLoopBreakContinueOccurrences(owner);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return getSwitchCaseDefaultOccurrences(owner);
}
}
@@ -124371,9 +124632,9 @@ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {
function containsTopLevelCommonjs(sourceFile) {
return sourceFile.statements.some((statement) => {
switch (statement.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return statement.declarationList.declarations.some((decl) => !!decl.initializer && isRequireCall(propertyAccessLeftHandSide(decl.initializer), true));
- case 245 /* ExpressionStatement */: {
+ case 247 /* ExpressionStatement */: {
const { expression } = statement;
if (!isBinaryExpression(expression))
return isRequireCall(expression, true);
@@ -124390,10 +124651,10 @@ function propertyAccessLeftHandSide(node) {
}
function importNameForConvertToDefaultImport(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
const { importClause, moduleSpecifier } = node;
- return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 277 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0;
- case 274 /* ImportEqualsDeclaration */:
+ return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 280 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0;
+ case 277 /* ImportEqualsDeclaration */:
return node.name;
default:
return void 0;
@@ -124457,18 +124718,18 @@ function hasSupportedNumberOfArguments(node) {
}
function isFixablePromiseArgument(arg, checker) {
switch (arg.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
const functionFlags = getFunctionFlags(arg);
if (functionFlags & 1 /* Generator */) {
return false;
}
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true);
case 105 /* NullKeyword */:
return true;
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const symbol = checker.getSymbolAtLocation(arg);
if (!symbol) {
return false;
@@ -124484,24 +124745,24 @@ function getKeyFromNode(exp) {
}
function canBeConvertedToClass(node, checker) {
var _a2, _b, _c, _d;
- if (node.kind === 218 /* FunctionExpression */) {
+ if (node.kind === 220 /* FunctionExpression */) {
if (isVariableDeclaration(node.parent) && ((_a2 = node.symbol.members) == null ? void 0 : _a2.size)) {
return true;
}
const symbol = checker.getSymbolOfExpando(node, false);
return !!(symbol && (((_b = symbol.exports) == null ? void 0 : _b.size) || ((_c = symbol.members) == null ? void 0 : _c.size)));
}
- if (node.kind === 263 /* FunctionDeclaration */) {
+ if (node.kind === 265 /* FunctionDeclaration */) {
return !!((_d = node.symbol.members) == null ? void 0 : _d.size);
}
return false;
}
function canBeConvertedToAsync(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
default:
return false;
@@ -124646,9 +124907,9 @@ function getItemsFromNamedDeclaration(patternMatcher, name, declarations, checke
}
function shouldKeepItem(declaration, checker) {
switch (declaration.kind) {
- case 276 /* ImportClause */:
- case 279 /* ImportSpecifier */:
- case 274 /* ImportEqualsDeclaration */:
+ case 279 /* ImportClause */:
+ case 282 /* ImportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
const importer = checker.getSymbolAtLocation(declaration.name);
const imported = checker.getAliasedSymbol(importer);
return importer.escapedName !== imported.escapedName;
@@ -124658,7 +124919,7 @@ function shouldKeepItem(declaration, checker) {
}
function tryAddSingleDeclarationName(declaration, containers) {
const name = getNameOfDeclaration(declaration);
- return !!name && (pushLiteral(name, containers) || name.kind === 166 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers));
+ return !!name && (pushLiteral(name, containers) || name.kind === 167 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers));
}
function tryAddComputedPropertyName(expression, containers) {
return pushLiteral(expression, containers) || isPropertyAccessExpression(expression) && (containers.push(expression.name.text), true) && tryAddComputedPropertyName(expression.expression, containers);
@@ -124669,7 +124930,7 @@ function pushLiteral(node, containers) {
function getContainers(declaration) {
const containers = [];
const name = getNameOfDeclaration(declaration);
- if (name && name.kind === 166 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) {
+ if (name && name.kind === 167 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) {
return emptyArray;
}
containers.shift();
@@ -124839,7 +125100,7 @@ function addNodeWithRecursiveInitializer(node) {
}
}
function hasNavigationBarName(node) {
- return !hasDynamicName(node) || node.kind !== 227 /* BinaryExpression */ && isPropertyAccessExpression(node.name.expression) && isIdentifier(node.name.expression.expression) && idText(node.name.expression.expression) === "Symbol";
+ return !hasDynamicName(node) || node.kind !== 229 /* BinaryExpression */ && isPropertyAccessExpression(node.name.expression) && isIdentifier(node.name.expression.expression) && idText(node.name.expression.expression) === "Symbol";
}
function addChildrenRecursively(node) {
curCancellationToken.throwIfCancellationRequested();
@@ -124847,7 +125108,7 @@ function addChildrenRecursively(node) {
return;
}
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
const ctr = node;
addNodeWithRecursiveChild(ctr, ctr.body);
for (const param of ctr.parameters) {
@@ -124856,32 +125117,32 @@ function addChildrenRecursively(node) {
}
}
break;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 175 /* MethodSignature */:
if (hasNavigationBarName(node)) {
addNodeWithRecursiveChild(node, node.body);
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (hasNavigationBarName(node)) {
addNodeWithRecursiveInitializer(node);
}
break;
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
if (hasNavigationBarName(node)) {
addLeafNode(node);
}
break;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
const importClause = node;
if (importClause.name) {
addLeafNode(importClause.name);
}
const { namedBindings } = importClause;
if (namedBindings) {
- if (namedBindings.kind === 277 /* NamespaceImport */) {
+ if (namedBindings.kind === 280 /* NamespaceImport */) {
addLeafNode(namedBindings);
} else {
for (const element of namedBindings.elements) {
@@ -124890,16 +125151,16 @@ function addChildrenRecursively(node) {
}
}
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
addNodeWithRecursiveChild(node, node.name);
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
const { expression } = node;
isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node);
break;
- case 208 /* BindingElement */:
- case 305 /* PropertyAssignment */:
- case 261 /* VariableDeclaration */: {
+ case 210 /* BindingElement */:
+ case 308 /* PropertyAssignment */:
+ case 263 /* VariableDeclaration */: {
const child = node;
if (isBindingPattern(child.name)) {
addChildrenRecursively(child.name);
@@ -124908,18 +125169,18 @@ function addChildrenRecursively(node) {
}
break;
}
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
const nameNode = node.name;
if (nameNode && isIdentifier(nameNode)) {
addTrackedEs5Class(nameNode.text);
}
addNodeWithRecursiveChild(node, node.body);
break;
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
addNodeWithRecursiveChild(node, node.body);
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
startNode(node);
for (const member of node.members) {
if (!isComputedProperty(member)) {
@@ -124928,20 +125189,20 @@ function addChildrenRecursively(node) {
}
endNode();
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
startNode(node);
for (const member of node.members) {
addChildrenRecursively(member);
}
endNode();
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
addNodeWithRecursiveChild(node, getInteriorModule(node).body);
break;
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
const expression2 = node.expression;
const child = isObjectLiteralExpression(expression2) || isCallExpression(expression2) ? expression2 : isArrowFunction(expression2) || isFunctionExpression(expression2) ? expression2.body : void 0;
if (child) {
@@ -124953,16 +125214,16 @@ function addChildrenRecursively(node) {
}
break;
}
- case 284 /* ExportSpecifier */:
- case 274 /* ImportEqualsDeclaration */:
- case 181 /* IndexSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 268 /* TypeAliasDeclaration */:
+ case 287 /* ExportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 183 /* IndexSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 271 /* TypeAliasDeclaration */:
addLeafNode(node);
break;
- case 213 /* CallExpression */:
- case 227 /* BinaryExpression */: {
+ case 215 /* CallExpression */:
+ case 229 /* BinaryExpression */: {
const special = getAssignmentDeclarationKind(node);
switch (special) {
case 1 /* ExportsProperty */:
@@ -125172,12 +125433,12 @@ function shouldReallyMerge(a, b, parent2) {
return false;
}
switch (a.kind) {
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return isStatic(a) === isStatic(b);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return areSameModule(a, b) && getFullyQualifiedModuleName(a) === getFullyQualifiedModuleName(b);
default:
return true;
@@ -125194,7 +125455,7 @@ function areSameModule(a, b) {
if (!a.body || !b.body) {
return a.body === b.body;
}
- return a.body.kind === b.body.kind && (a.body.kind !== 270 /* ModuleDeclaration */ || areSameModule(a.body, b.body));
+ return a.body.kind === b.body.kind && (a.body.kind !== 273 /* ModuleDeclaration */ || areSameModule(a.body, b.body));
}
function merge(target, source) {
target.additionalNodes = target.additionalNodes || [];
@@ -125215,7 +125476,7 @@ function compareChildren(child1, child2) {
return compareStringsCaseSensitiveUI(tryGetName(child1.node), tryGetName(child2.node)) || compareValues(navigationBarNodeKind(child1), navigationBarNodeKind(child2));
}
function tryGetName(node) {
- if (node.kind === 270 /* ModuleDeclaration */) {
+ if (node.kind === 273 /* ModuleDeclaration */) {
return getModuleName(node);
}
const declName = getNameOfDeclaration(node);
@@ -125224,16 +125485,16 @@ function tryGetName(node) {
return propertyName && unescapeLeadingUnderscores(propertyName);
}
switch (node.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 232 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
return getFunctionOrClassName(node);
default:
return void 0;
}
}
function getItemName(node, name) {
- if (node.kind === 270 /* ModuleDeclaration */) {
+ if (node.kind === 273 /* ModuleDeclaration */) {
return cleanText(getModuleName(node));
}
if (name) {
@@ -125243,28 +125504,28 @@ function getItemName(node, name) {
}
}
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
const sourceFile = node;
return isExternalModule(sourceFile) ? `"${escapeString(getBaseFileName(removeFileExtension(normalizePath(sourceFile.fileName))))}"` : "";
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
if (getSyntacticModifierFlags(node) & 1024 /* Default */) {
return "default";
}
return getFunctionOrClassName(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return "constructor";
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return "new()";
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return "()";
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return "[]";
default:
return "";
@@ -125289,20 +125550,20 @@ function primaryNavBarMenuItems(root) {
return true;
}
switch (navigationBarNodeKind(item)) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 269 /* EnumDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 314 /* SourceFile */:
- case 268 /* TypeAliasDeclaration */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 317 /* SourceFile */:
+ case 271 /* TypeAliasDeclaration */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
return true;
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return isTopLevelFunctionDeclaration(item);
default:
return false;
@@ -125312,10 +125573,10 @@ function primaryNavBarMenuItems(root) {
return false;
}
switch (navigationBarNodeKind(item2.parent)) {
- case 271 /* ModuleBlock */:
- case 314 /* SourceFile */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
+ case 274 /* ModuleBlock */:
+ case 317 /* SourceFile */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
return true;
default:
return false;
@@ -125374,7 +125635,7 @@ function getModuleName(moduleDeclaration) {
}
function getFullyQualifiedModuleName(moduleDeclaration) {
const result = [getTextOfIdentifierOrLiteral(moduleDeclaration.name)];
- while (moduleDeclaration.body && moduleDeclaration.body.kind === 270 /* ModuleDeclaration */) {
+ while (moduleDeclaration.body && moduleDeclaration.body.kind === 273 /* ModuleDeclaration */) {
moduleDeclaration = moduleDeclaration.body;
result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name));
}
@@ -125384,13 +125645,13 @@ function getInteriorModule(decl) {
return decl.body && isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl;
}
function isComputedProperty(member) {
- return !member.name || member.name.kind === 166 /* ComputedPropertyName */;
+ return !member.name || member.name.kind === 167 /* ComputedPropertyName */;
}
function getNodeSpan(node) {
- return node.kind === 314 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile);
+ return node.kind === 317 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile);
}
function getModifiers2(node) {
- if (node.parent && node.parent.kind === 261 /* VariableDeclaration */) {
+ if (node.parent && node.parent.kind === 263 /* VariableDeclaration */) {
node = node.parent;
}
return getNodeModifiers(node);
@@ -125435,9 +125696,9 @@ function getCalledExpressionName(expr) {
}
function isFunctionOrClassExpression(node) {
switch (node.kind) {
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
return true;
default:
return false;
@@ -125523,8 +125784,8 @@ var NodeObject = class {
if (!children.length) {
return void 0;
}
- const child = find(children, (kid) => kid.kind < 318 /* FirstJSDocNode */ || kid.kind > 356 /* LastJSDocNode */);
- return child.kind < 165 /* FirstNode */ ? child : child.getFirstToken(sourceFile);
+ const child = find(children, (kid) => kid.kind < 321 /* FirstJSDocNode */ || kid.kind > 359 /* LastJSDocNode */);
+ return child.kind < 166 /* FirstNode */ ? child : child.getFirstToken(sourceFile);
}
getLastToken(sourceFile) {
this.assertHasRealPosition();
@@ -125533,7 +125794,7 @@ var NodeObject = class {
if (!child) {
return void 0;
}
- return child.kind < 165 /* FirstNode */ ? child : child.getLastToken(sourceFile);
+ return child.kind < 166 /* FirstNode */ ? child : child.getLastToken(sourceFile);
}
forEachChild(cbNode, cbNodeArray) {
return forEachChild(this, cbNode, cbNodeArray);
@@ -125596,7 +125857,7 @@ function addSyntheticNodes(nodes, pos, end, parent2) {
}
}
function createSyntaxList(nodes, parent2) {
- const list = createNode(357 /* SyntaxList */, nodes.pos, nodes.end, parent2);
+ const list = createNode(360 /* SyntaxList */, nodes.pos, nodes.end, parent2);
list._children = [];
let pos = nodes.pos;
for (const node of nodes) {
@@ -125910,7 +126171,7 @@ function getJsDocTagsOfDeclarations(declarations, checker) {
var _a2;
if (!seenSymbols.has(symbol)) {
seenSymbols.add(symbol);
- if (declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) {
+ if (declaration.kind === 179 /* GetAccessor */ || declaration.kind === 180 /* SetAccessor */) {
return symbol.getContextualJsDocTags(declaration, checker);
}
return ((_a2 = symbol.declarations) == null ? void 0 : _a2.length) === 1 ? symbol.getJsDocTags() : void 0;
@@ -125933,7 +126194,7 @@ function getDocumentationComment(declarations, checker) {
const inheritedDocs = findBaseOfDeclaration(checker, declaration, (symbol) => {
if (!seenSymbols.has(symbol)) {
seenSymbols.add(symbol);
- if (declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) {
+ if (declaration.kind === 179 /* GetAccessor */ || declaration.kind === 180 /* SetAccessor */) {
return symbol.getContextualDocumentationComment(declaration, checker);
}
return symbol.getDocumentationComment(checker);
@@ -125947,7 +126208,7 @@ function getDocumentationComment(declarations, checker) {
}
function findBaseOfDeclaration(checker, declaration, cb) {
var _a2;
- const classOrInterfaceDeclaration = ((_a2 = declaration.parent) == null ? void 0 : _a2.kind) === 176 /* Constructor */ ? declaration.parent.parent : declaration.parent;
+ const classOrInterfaceDeclaration = ((_a2 = declaration.parent) == null ? void 0 : _a2.kind) === 178 /* Constructor */ ? declaration.parent.parent : declaration.parent;
if (!classOrInterfaceDeclaration)
return;
const isStaticMember = hasStaticModifier(declaration);
@@ -125961,7 +126222,7 @@ function findBaseOfDeclaration(checker, declaration, cb) {
var SourceFileObject = class extends NodeObject {
constructor(kind, pos, end) {
super(kind, pos, end);
- this.kind = 314 /* SourceFile */;
+ this.kind = 317 /* SourceFile */;
}
update(newText, textChangeRange) {
return updateSourceFile(this, newText, textChangeRange);
@@ -126017,10 +126278,10 @@ var SourceFileObject = class extends NodeObject {
}
function visit(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
const functionDeclaration = node;
const declarationName = getDeclarationName(functionDeclaration);
if (declarationName) {
@@ -126036,30 +126297,30 @@ var SourceFileObject = class extends NodeObject {
}
forEachChild(node, visit);
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 284 /* ExportSpecifier */:
- case 279 /* ImportSpecifier */:
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 187 /* TypeLiteral */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 287 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 189 /* TypeLiteral */:
addDeclaration(node);
forEachChild(node, visit);
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (!hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) {
break;
}
- case 261 /* VariableDeclaration */:
- case 208 /* BindingElement */: {
+ case 263 /* VariableDeclaration */:
+ case 210 /* BindingElement */: {
const decl = node;
if (isBindingPattern(decl.name)) {
forEachChild(decl.name, visit);
@@ -126069,12 +126330,12 @@ var SourceFileObject = class extends NodeObject {
visit(decl.initializer);
}
}
- case 308 /* EnumMember */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 311 /* EnumMember */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
addDeclaration(node);
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportDeclaration = node;
if (exportDeclaration.exportClause) {
if (isNamedExports(exportDeclaration.exportClause)) {
@@ -126084,14 +126345,14 @@ var SourceFileObject = class extends NodeObject {
}
}
break;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
const importClause = node.importClause;
if (importClause) {
if (importClause.name) {
addDeclaration(importClause.name);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (importClause.namedBindings.kind === 280 /* NamespaceImport */) {
addDeclaration(importClause.namedBindings);
} else {
forEach(importClause.namedBindings.elements, visit);
@@ -126099,7 +126360,7 @@ var SourceFileObject = class extends NodeObject {
}
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (getAssignmentDeclarationKind(node) !== 0 /* None */) {
addDeclaration(node);
}
@@ -126741,15 +127002,15 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
switch (node.kind) {
case 79 /* Identifier */:
return !isLabelName(node) && !isTagName(node) && !isConstTypeReference(node.parent);
- case 211 /* PropertyAccessExpression */:
- case 165 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
return !isInComment(sourceFile, position);
case 109 /* ThisKeyword */:
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 107 /* SuperKeyword */:
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return true;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return isImportMeta(node);
default:
return false;
@@ -126859,15 +127120,15 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
return void 0;
}
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
- case 165 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
case 10 /* StringLiteral */:
case 96 /* FalseKeyword */:
case 111 /* TrueKeyword */:
case 105 /* NullKeyword */:
case 107 /* SuperKeyword */:
case 109 /* ThisKeyword */:
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 79 /* Identifier */:
break;
default:
@@ -126878,7 +127139,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) {
nodeForStartPos = nodeForStartPos.parent;
} else if (isNameOfModuleDeclaration(nodeForStartPos)) {
- if (nodeForStartPos.parent.parent.kind === 270 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) {
+ if (nodeForStartPos.parent.parent.kind === 273 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) {
nodeForStartPos = nodeForStartPos.parent.parent.name;
} else {
break;
@@ -127495,7 +127756,7 @@ function initializeNameTable(sourceFile) {
});
}
function literalIsName(node) {
- return isDeclarationName(node) || node.parent.kind === 286 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node);
+ return isDeclarationName(node) || node.parent.kind === 289 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node);
}
function getContainingObjectLiteralElement(node) {
const element = getContainingObjectLiteralElementWorker(node);
@@ -127506,11 +127767,11 @@ function getContainingObjectLiteralElementWorker(node) {
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
case 8 /* NumericLiteral */:
- if (node.parent.kind === 166 /* ComputedPropertyName */) {
+ if (node.parent.kind === 167 /* ComputedPropertyName */) {
return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : void 0;
}
case 79 /* Identifier */:
- return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.parent.kind === 295 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0;
+ return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 212 /* ObjectLiteralExpression */ || node.parent.parent.kind === 298 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0;
}
return void 0;
}
@@ -127545,7 +127806,7 @@ function getPropertySymbolsFromContextualType(node, checker, contextualType, uni
return discriminatedPropertySymbols;
}
function isArgumentOfElementAccessExpression(node) {
- return node && node.parent && node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.argumentExpression === node;
+ return node && node.parent && node.parent.kind === 214 /* ElementAccessExpression */ && node.parent.argumentExpression === node;
}
function getDefaultLibFilePath(options) {
if (sys) {
@@ -128467,89 +128728,89 @@ function spanInSourceFileAtLocation(sourceFile, position) {
if (node) {
const { parent: parent2 } = node;
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return spanInVariableDeclaration(node.declarationList.declarations[0]);
- case 261 /* VariableDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 263 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return spanInVariableDeclaration(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return spanInParameterDeclaration(node);
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return spanInFunctionDeclaration(node);
- case 242 /* Block */:
+ case 244 /* Block */:
if (isFunctionBlock(node)) {
return spanInFunctionBlock(node);
}
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return spanInBlock(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return spanInBlock(node.block);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return textSpan(node.expression);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return textSpan(node.getChildAt(0), node.expression);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return textSpanEndingAtNextToken(node, node.expression);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return spanInNode(node.statement);
- case 260 /* DebuggerStatement */:
+ case 262 /* DebuggerStatement */:
return textSpan(node.getChildAt(0));
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return textSpanEndingAtNextToken(node, node.expression);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return spanInNode(node.statement);
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
return textSpan(node.getChildAt(0), node.label);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return spanInForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return textSpanEndingAtNextToken(node, node.expression);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return spanInInitializerOfForLike(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return textSpanEndingAtNextToken(node, node.expression);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return spanInNode(node.statements[0]);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return spanInBlock(node.tryBlock);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return textSpan(node, node.expression);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return textSpan(node, node.expression);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return textSpan(node, node.moduleReference);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return textSpan(node, node.moduleSpecifier);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return textSpan(node, node.moduleSpecifier);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (getModuleInstanceState(node) !== 1 /* Instantiated */) {
return void 0;
}
- case 264 /* ClassDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 208 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 210 /* BindingElement */:
return textSpan(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return spanInNode(node.statement);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return spanInNodeArray(parent2.modifiers, node, isDecorator);
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return spanInBindingPattern(node);
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return void 0;
case 26 /* SemicolonToken */:
case 1 /* EndOfFileToken */:
@@ -128577,16 +128838,16 @@ function spanInSourceFileAtLocation(sourceFile, position) {
case 83 /* CatchKeyword */:
case 97 /* FinallyKeyword */:
return spanInNextNode(node);
- case 164 /* OfKeyword */:
+ case 165 /* OfKeyword */:
return spanInOfKeyword(node);
default:
if (isArrayLiteralOrObjectLiteralDestructuringPattern(node)) {
return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node);
}
- if ((node.kind === 79 /* Identifier */ || node.kind === 231 /* SpreadElement */ || node.kind === 305 /* PropertyAssignment */ || node.kind === 306 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) {
+ if ((node.kind === 79 /* Identifier */ || node.kind === 233 /* SpreadElement */ || node.kind === 308 /* PropertyAssignment */ || node.kind === 309 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) {
return textSpan(node);
}
- if (node.kind === 227 /* BinaryExpression */) {
+ if (node.kind === 229 /* BinaryExpression */) {
const { left, operatorToken } = node;
if (isArrayLiteralOrObjectLiteralDestructuringPattern(left)) {
return spanInArrayLiteralOrObjectLiteralDestructuringPattern(
@@ -128602,19 +128863,19 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
if (isExpressionNode(node)) {
switch (parent2.kind) {
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return spanInPreviousNode(node);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return spanInNode(node.parent);
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
return textSpan(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (node.parent.operatorToken.kind === 27 /* CommaToken */) {
return textSpan(node);
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (node.parent.body === node) {
return textSpan(node);
}
@@ -128622,25 +128883,25 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
}
switch (node.parent.kind) {
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (node.parent.name === node && !isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) {
return spanInNode(node.parent.initializer);
}
break;
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
if (node.parent.type === node) {
return spanInNextNode(node.parent.type);
}
break;
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */: {
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */: {
const { initializer, type } = node.parent;
if (initializer === node || type === node || isAssignmentOperator(node.kind)) {
return spanInPreviousNode(node);
}
break;
}
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const { left } = node.parent;
if (isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) {
return spanInPreviousNode(node);
@@ -128663,14 +128924,14 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
}
function spanInVariableDeclaration(variableDeclaration) {
- if (variableDeclaration.parent.parent.kind === 250 /* ForInStatement */) {
+ if (variableDeclaration.parent.parent.kind === 252 /* ForInStatement */) {
return spanInNode(variableDeclaration.parent.parent);
}
const parent2 = variableDeclaration.parent;
if (isBindingPattern(variableDeclaration.name)) {
return spanInBindingPattern(variableDeclaration.name);
}
- if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 1 /* Export */) || parent2.parent.kind === 251 /* ForOfStatement */) {
+ if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 1 /* Export */) || parent2.parent.kind === 253 /* ForOfStatement */) {
return textSpanFromVariableDeclaration(variableDeclaration);
}
if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) {
@@ -128697,7 +128958,7 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
}
function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) {
- return hasSyntacticModifier(functionDeclaration, 1 /* Export */) || functionDeclaration.parent.kind === 264 /* ClassDeclaration */ && functionDeclaration.kind !== 176 /* Constructor */;
+ return hasSyntacticModifier(functionDeclaration, 1 /* Export */) || functionDeclaration.parent.kind === 266 /* ClassDeclaration */ && functionDeclaration.kind !== 178 /* Constructor */;
}
function spanInFunctionDeclaration(functionDeclaration) {
if (!functionDeclaration.body) {
@@ -128717,22 +128978,22 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
function spanInBlock(block) {
switch (block.parent.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (getModuleInstanceState(block.parent) !== 1 /* Instantiated */) {
return void 0;
}
- case 248 /* WhileStatement */:
- case 246 /* IfStatement */:
- case 250 /* ForInStatement */:
+ case 250 /* WhileStatement */:
+ case 248 /* IfStatement */:
+ case 252 /* ForInStatement */:
return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]);
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
return spanInNodeIfStartsOnSameLine(findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]);
}
return spanInNode(block.statements[0]);
}
function spanInInitializerOfForLike(forLikeStatement) {
- if (forLikeStatement.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (forLikeStatement.initializer.kind === 264 /* VariableDeclarationList */) {
const variableDeclarationList = forLikeStatement.initializer;
if (variableDeclarationList.declarations.length > 0) {
return spanInNode(variableDeclarationList.declarations[0]);
@@ -128755,64 +129016,64 @@ function spanInSourceFileAtLocation(sourceFile, position) {
function spanInBindingPattern(bindingPattern) {
const firstBindingElement = forEach(
bindingPattern.elements,
- (element) => element.kind !== 233 /* OmittedExpression */ ? element : void 0
+ (element) => element.kind !== 235 /* OmittedExpression */ ? element : void 0
);
if (firstBindingElement) {
return spanInNode(firstBindingElement);
}
- if (bindingPattern.parent.kind === 208 /* BindingElement */) {
+ if (bindingPattern.parent.kind === 210 /* BindingElement */) {
return textSpan(bindingPattern.parent);
}
return textSpanFromVariableDeclaration(bindingPattern.parent);
}
function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node2) {
- Debug.assert(node2.kind !== 207 /* ArrayBindingPattern */ && node2.kind !== 206 /* ObjectBindingPattern */);
- const elements = node2.kind === 209 /* ArrayLiteralExpression */ ? node2.elements : node2.properties;
+ Debug.assert(node2.kind !== 209 /* ArrayBindingPattern */ && node2.kind !== 208 /* ObjectBindingPattern */);
+ const elements = node2.kind === 211 /* ArrayLiteralExpression */ ? node2.elements : node2.properties;
const firstBindingElement = forEach(
elements,
- (element) => element.kind !== 233 /* OmittedExpression */ ? element : void 0
+ (element) => element.kind !== 235 /* OmittedExpression */ ? element : void 0
);
if (firstBindingElement) {
return spanInNode(firstBindingElement);
}
- return textSpan(node2.parent.kind === 227 /* BinaryExpression */ ? node2.parent : node2);
+ return textSpan(node2.parent.kind === 229 /* BinaryExpression */ ? node2.parent : node2);
}
function spanInOpenBraceToken(node2) {
switch (node2.parent.kind) {
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
const enumDeclaration = node2.parent;
return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile));
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const classDeclaration = node2.parent;
return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile));
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return spanInNodeIfStartsOnSameLine(node2.parent.parent, node2.parent.clauses[0]);
}
return spanInNode(node2.parent);
}
function spanInCloseBraceToken(node2) {
switch (node2.parent.kind) {
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
if (getModuleInstanceState(node2.parent.parent) !== 1 /* Instantiated */) {
return void 0;
}
- case 269 /* EnumDeclaration */:
- case 264 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 266 /* ClassDeclaration */:
return textSpan(node2);
- case 242 /* Block */:
+ case 244 /* Block */:
if (isFunctionBlock(node2.parent)) {
return textSpan(node2);
}
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return spanInNode(lastOrUndefined(node2.parent.statements));
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
const caseBlock = node2.parent;
const lastClause = lastOrUndefined(caseBlock.clauses);
if (lastClause) {
return spanInNode(lastOrUndefined(lastClause.statements));
}
return void 0;
- case 206 /* ObjectBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
const bindingPattern = node2.parent;
return spanInNode(lastOrUndefined(bindingPattern.elements) || bindingPattern);
default:
@@ -128825,7 +129086,7 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
function spanInCloseBracketToken(node2) {
switch (node2.parent.kind) {
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
const bindingPattern = node2.parent;
return textSpan(lastOrUndefined(bindingPattern.elements) || bindingPattern);
default:
@@ -128837,56 +129098,56 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
}
function spanInOpenParenToken(node2) {
- if (node2.parent.kind === 247 /* DoStatement */ || node2.parent.kind === 213 /* CallExpression */ || node2.parent.kind === 214 /* NewExpression */) {
+ if (node2.parent.kind === 249 /* DoStatement */ || node2.parent.kind === 215 /* CallExpression */ || node2.parent.kind === 216 /* NewExpression */) {
return spanInPreviousNode(node2);
}
- if (node2.parent.kind === 217 /* ParenthesizedExpression */) {
+ if (node2.parent.kind === 219 /* ParenthesizedExpression */) {
return spanInNextNode(node2);
}
return spanInNode(node2.parent);
}
function spanInCloseParenToken(node2) {
switch (node2.parent.kind) {
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
- case 248 /* WhileStatement */:
- case 247 /* DoStatement */:
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 250 /* WhileStatement */:
+ case 249 /* DoStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 219 /* ParenthesizedExpression */:
return spanInPreviousNode(node2);
default:
return spanInNode(node2.parent);
}
}
function spanInColonToken(node2) {
- if (isFunctionLike(node2.parent) || node2.parent.kind === 305 /* PropertyAssignment */ || node2.parent.kind === 168 /* Parameter */) {
+ if (isFunctionLike(node2.parent) || node2.parent.kind === 308 /* PropertyAssignment */ || node2.parent.kind === 169 /* Parameter */) {
return spanInPreviousNode(node2);
}
return spanInNode(node2.parent);
}
function spanInGreaterThanOrLessThanToken(node2) {
- if (node2.parent.kind === 216 /* TypeAssertionExpression */) {
+ if (node2.parent.kind === 218 /* TypeAssertionExpression */) {
return spanInNextNode(node2);
}
return spanInNode(node2.parent);
}
function spanInWhileKeyword(node2) {
- if (node2.parent.kind === 247 /* DoStatement */) {
+ if (node2.parent.kind === 249 /* DoStatement */) {
return textSpanEndingAtNextToken(node2, node2.parent.expression);
}
return spanInNode(node2.parent);
}
function spanInOfKeyword(node2) {
- if (node2.parent.kind === 251 /* ForOfStatement */) {
+ if (node2.parent.kind === 253 /* ForOfStatement */) {
return spanInNextNode(node2);
}
return spanInNode(node2.parent);
@@ -128975,17 +129236,17 @@ function getCallHierarchItemContainerName(node) {
return;
}
switch (node.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- if (node.parent.kind === 210 /* ObjectLiteralExpression */) {
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ if (node.parent.kind === 212 /* ObjectLiteralExpression */) {
return (_a2 = getAssignedName(node.parent)) == null ? void 0 : _a2.getText();
}
return (_b = getNameOfDeclaration(node.parent)) == null ? void 0 : _b.getText();
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (isModuleBlock(node.parent) && isIdentifier(node.parent.parent.name)) {
return node.parent.parent.name.getText();
}
@@ -129163,55 +129424,55 @@ function createCallSiteCollector(program, callSites) {
}
switch (node.kind) {
case 79 /* Identifier */:
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return;
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
recordCallSite(node);
return;
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
collect(node.expression);
return;
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
collect(node.name);
collect(node.initializer);
return;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
recordCallSite(node);
collect(node.expression);
forEach(node.arguments, collect);
return;
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
recordCallSite(node);
collect(node.expression);
forEach(node.arguments, collect);
return;
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
recordCallSite(node);
collect(node.tag);
collect(node.template);
return;
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
recordCallSite(node);
collect(node.tagName);
collect(node.attributes);
return;
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
recordCallSite(node);
collect(node.expression);
return;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
recordCallSite(node);
forEachChild(node, collect);
break;
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
collect(node.expression);
return;
}
@@ -129264,26 +129525,26 @@ function collectCallSites(program, node) {
const callSites = [];
const collect = createCallSiteCollector(program, callSites);
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
collectCallSitesOfSourceFile(node, collect);
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
collectCallSitesOfModuleDeclaration(node, collect);
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect);
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
collectCallSitesOfClassLikeDeclaration(node, collect);
break;
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
collectCallSitesOfClassStaticBlockDeclaration(node, collect);
break;
default:
@@ -129384,13 +129645,13 @@ function collectTokens(program, sourceFile, span, collector, cancellationToken)
let inJSXElement = false;
function visit(node) {
switch (node.kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
if (!node || !textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) {
@@ -129530,25 +129791,25 @@ function isRightSideOfQualifiedNameOrPropertyAccess2(node) {
return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node;
}
var tokenFromDeclarationMapping = new Map2([
- [261 /* VariableDeclaration */, 7 /* variable */],
- [168 /* Parameter */, 6 /* parameter */],
- [171 /* PropertyDeclaration */, 9 /* property */],
- [270 /* ModuleDeclaration */, 3 /* namespace */],
- [269 /* EnumDeclaration */, 1 /* enum */],
- [308 /* EnumMember */, 8 /* enumMember */],
- [264 /* ClassDeclaration */, 0 /* class */],
- [174 /* MethodDeclaration */, 11 /* member */],
- [263 /* FunctionDeclaration */, 10 /* function */],
- [218 /* FunctionExpression */, 10 /* function */],
- [173 /* MethodSignature */, 11 /* member */],
- [177 /* GetAccessor */, 9 /* property */],
- [178 /* SetAccessor */, 9 /* property */],
- [170 /* PropertySignature */, 9 /* property */],
- [267 /* InterfaceDeclaration */, 2 /* interface */],
- [268 /* TypeAliasDeclaration */, 5 /* type */],
- [167 /* TypeParameter */, 4 /* typeParameter */],
- [305 /* PropertyAssignment */, 9 /* property */],
- [306 /* ShorthandPropertyAssignment */, 9 /* property */]
+ [263 /* VariableDeclaration */, 7 /* variable */],
+ [169 /* Parameter */, 6 /* parameter */],
+ [172 /* PropertyDeclaration */, 9 /* property */],
+ [273 /* ModuleDeclaration */, 3 /* namespace */],
+ [272 /* EnumDeclaration */, 1 /* enum */],
+ [311 /* EnumMember */, 8 /* enumMember */],
+ [266 /* ClassDeclaration */, 0 /* class */],
+ [176 /* MethodDeclaration */, 11 /* member */],
+ [265 /* FunctionDeclaration */, 10 /* function */],
+ [220 /* FunctionExpression */, 10 /* function */],
+ [175 /* MethodSignature */, 11 /* member */],
+ [179 /* GetAccessor */, 9 /* property */],
+ [180 /* SetAccessor */, 9 /* property */],
+ [171 /* PropertySignature */, 9 /* property */],
+ [270 /* InterfaceDeclaration */, 2 /* interface */],
+ [271 /* TypeAliasDeclaration */, 5 /* type */],
+ [168 /* TypeParameter */, 4 /* typeParameter */],
+ [308 /* PropertyAssignment */, 9 /* property */],
+ [309 /* ShorthandPropertyAssignment */, 9 /* property */]
]);
// src/services/_namespaces/ts.codefix.ts
@@ -129895,7 +130156,7 @@ function findAwaitableInitializers(expression, sourceFile, cancellationToken, pr
}
const declaration = tryCast(symbol.valueDeclaration, isVariableDeclaration);
const variableName = declaration && tryCast(declaration.name, isIdentifier);
- const variableStatement = getAncestor(declaration, 244 /* VariableStatement */);
+ const variableStatement = getAncestor(declaration, 246 /* VariableStatement */);
if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement, 1 /* Export */) || !variableName || !isInsideAwaitableBody(declaration.initializer)) {
isCompleteFix = false;
continue;
@@ -129947,7 +130208,7 @@ function symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, c
return diagnostic && contains(errorCodes3, diagnostic.code) || checker.getTypeAtLocation(errorNode).flags & 1 /* Any */;
}
function isInsideAwaitableBody(node) {
- return node.kind & 32768 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 263 /* FunctionDeclaration */ || ancestor.parent.kind === 218 /* FunctionExpression */ || ancestor.parent.kind === 219 /* ArrowFunction */ || ancestor.parent.kind === 174 /* MethodDeclaration */));
+ return node.kind & 32768 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 265 /* FunctionDeclaration */ || ancestor.parent.kind === 220 /* FunctionExpression */ || ancestor.parent.kind === 221 /* ArrowFunction */ || ancestor.parent.kind === 176 /* MethodDeclaration */));
}
function makeChange3(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) {
if (isForOfStatement(insertionSite.parent) && !insertionSite.parent.awaitModifier) {
@@ -130069,10 +130330,10 @@ function applyChange(changeTracker, initializer, sourceFile, fixedNodes) {
function isPossiblyPartOfDestructuring(node) {
switch (node.kind) {
case 79 /* Identifier */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return true;
default:
return false;
@@ -130085,7 +130346,7 @@ function arrayElementCouldBeVariableDeclaration(expression, checker) {
function isPossiblyPartOfCommaSeperatedInitializer(node) {
switch (node.kind) {
case 79 /* Identifier */:
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
case 27 /* CommaToken */:
return true;
default:
@@ -130127,7 +130388,7 @@ function makeChange5(changeTracker, sourceFile, pos, fixedNodes) {
return;
}
const declaration = token.parent;
- if (declaration.kind === 171 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) {
+ if (declaration.kind === 172 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) {
changeTracker.insertModifierBefore(sourceFile, 137 /* DeclareKeyword */, declaration);
}
}
@@ -130261,7 +130522,7 @@ function addUndefinedToOptionalProperty(changes, toAdd) {
const d = add.valueDeclaration;
if (d && (isPropertySignature(d) || isPropertyDeclaration(d)) && d.type) {
const t = factory.createUnionTypeNode([
- ...d.type.kind === 192 /* UnionType */ ? d.type.types : [d.type],
+ ...d.type.kind === 194 /* UnionType */ ? d.type.types : [d.type],
factory.createTypeReferenceNode("undefined")
]);
changes.replaceNode(d.getSourceFile(), d.type, t);
@@ -130329,24 +130590,24 @@ function doChange(changes, sourceFile, decl) {
}
}
function isDeclarationWithType(node) {
- return isFunctionLikeDeclaration(node) || node.kind === 261 /* VariableDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 171 /* PropertyDeclaration */;
+ return isFunctionLikeDeclaration(node) || node.kind === 263 /* VariableDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 172 /* PropertyDeclaration */;
}
function transformJSDocType(node) {
switch (node.kind) {
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
return factory.createTypeReferenceNode("any", emptyArray);
- case 325 /* JSDocOptionalType */:
+ case 328 /* JSDocOptionalType */:
return transformJSDocOptionalType(node);
- case 324 /* JSDocNonNullableType */:
+ case 327 /* JSDocNonNullableType */:
return transformJSDocType(node.type);
- case 323 /* JSDocNullableType */:
+ case 326 /* JSDocNullableType */:
return transformJSDocNullableType(node);
- case 327 /* JSDocVariadicType */:
+ case 330 /* JSDocVariadicType */:
return transformJSDocVariadicType(node);
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return transformJSDocFunctionType(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return transformJSDocTypeReference(node);
default:
const visited = visitEachChild(node, transformJSDocType, nullTransformationContext);
@@ -130369,7 +130630,7 @@ function transformJSDocFunctionType(node) {
}
function transformJSDocParameter(node) {
const index = node.parent.parameters.indexOf(node);
- const isRest = node.type.kind === 327 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1;
+ const isRest = node.type.kind === 330 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1;
const name = node.name || (isRest ? "rest" : "arg" + index);
const dotdotdot = isRest ? factory.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken;
return factory.createParameterDeclaration(node.modifiers, dotdotdot, name, node.questionToken, visitNode(node.type, transformJSDocType), node.initializer);
@@ -130517,7 +130778,7 @@ function doChange2(changes, sourceFile, position, checker, preferences, compiler
})) {
return;
}
- const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 245 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression;
+ const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 247 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression;
changes.delete(sourceFile, nodeToDelete);
if (!assignmentExpr) {
members.push(factory.createPropertyDeclaration(
@@ -130587,7 +130848,7 @@ function doChange2(changes, sourceFile, position, checker, preferences, compiler
function createArrowFunctionExpressionMember(members2, arrowFunction, name) {
const arrowFunctionBody = arrowFunction.body;
let bodyBlock;
- if (arrowFunctionBody.kind === 242 /* Block */) {
+ if (arrowFunctionBody.kind === 244 /* Block */) {
bodyBlock = arrowFunctionBody;
} else {
bodyBlock = factory.createBlock([factory.createReturnStatement(arrowFunctionBody)]);
@@ -131034,7 +131295,7 @@ function transformCallbackArgument(func, hasContinuation, continuationArgName, i
switch (func.kind) {
case 105 /* NullKeyword */:
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
case 79 /* Identifier */:
if (!inputArgName) {
break;
@@ -131054,8 +131315,8 @@ function transformCallbackArgument(func, hasContinuation, continuationArgName, i
continuationArgName.types.push(transformer.checker.getAwaitedType(returnType) || returnType);
}
return varDeclOrAssignment;
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */: {
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */: {
const funcBody = func.body;
const returnType2 = (_a2 = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) == null ? void 0 : _a2.getReturnType();
if (isBlock(funcBody)) {
@@ -131269,10 +131530,10 @@ function fixImportOfModuleExports(importingFile, exportingFile, changes, quotePr
}
const importNode = importFromModuleSpecifier(moduleSpecifier);
switch (importNode.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
changes.replaceNode(importingFile, importNode, makeImport(importNode.name, void 0, moduleSpecifier, quotePreference));
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isRequireCall(importNode, false)) {
changes.replaceNode(importingFile, importNode, factory.createPropertyAccessExpression(getSynthesizedDeepClone(importNode), "default"));
}
@@ -131331,19 +131592,19 @@ function forEachExportReference(sourceFile, cb) {
}
function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference) {
switch (statement.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference);
return false;
- case 245 /* ExpressionStatement */: {
+ case 247 /* ExpressionStatement */: {
const { expression } = statement;
switch (expression.kind) {
- case 213 /* CallExpression */: {
+ case 215 /* CallExpression */: {
if (isRequireCall(expression, true)) {
changes.replaceNode(sourceFile, statement, makeImport(void 0, void 0, expression.arguments[0], quotePreference));
}
return false;
}
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const { operatorToken } = expression;
return operatorToken.kind === 63 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports, useSitesToUnqualify);
}
@@ -131385,8 +131646,8 @@ function convertVariableStatement(sourceFile, statement, changes, checker, ident
}
function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) {
switch (name.kind) {
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */: {
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */: {
const tmp = makeUniqueName(propertyName, identifiers);
return convertedImports([
makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference),
@@ -131425,14 +131686,14 @@ function convertAssignment(sourceFile, checker, assignment, changes, exports, us
function tryChangeModuleExportsObject(object, useSitesToUnqualify) {
const statements = mapAllOrFail(object.properties, (prop) => {
switch (prop.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return void 0;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return !isIdentifier(prop.name) ? void 0 : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return !isIdentifier(prop.name) ? void 0 : functionExpressionToDeclaration(prop.name.text, [factory.createToken(94 /* ExportKeyword */)], prop, useSitesToUnqualify);
default:
Debug.assertNever(prop, `Convert to ES6 got invalid prop kind ${prop.kind}`);
@@ -131487,15 +131748,15 @@ function convertExportsPropertyAssignment({ left, right, parent: parent2 }, sour
function convertExportsDotXEquals_replaceNode(name, exported, useSitesToUnqualify) {
const modifiers = [factory.createToken(94 /* ExportKeyword */)];
switch (exported.kind) {
- case 218 /* FunctionExpression */: {
+ case 220 /* FunctionExpression */: {
const { name: expressionName } = exported;
if (expressionName && expressionName.text !== name) {
return exportConst();
}
}
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return functionExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return classExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify);
default:
return exportConst();
@@ -131510,7 +131771,7 @@ function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) {
}
return isArray(nodeOrNodes) ? getSynthesizedDeepClonesWithReplacements(nodeOrNodes, true, replaceNode) : getSynthesizedDeepCloneWithReplacements(nodeOrNodes, true, replaceNode);
function replaceNode(original) {
- if (original.kind === 211 /* PropertyAccessExpression */) {
+ if (original.kind === 213 /* PropertyAccessExpression */) {
const replacement = useSitesToUnqualify.get(original);
useSitesToUnqualify.delete(original);
return replacement;
@@ -131519,13 +131780,13 @@ function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) {
}
function convertSingleImport(name, moduleSpecifier, checker, identifiers, target, quotePreference) {
switch (name.kind) {
- case 206 /* ObjectBindingPattern */: {
+ case 208 /* ObjectBindingPattern */: {
const importSpecifiers = mapAllOrFail(name.elements, (e) => e.dotDotDotToken || e.initializer || e.propertyName && !isIdentifier(e.propertyName) || !isIdentifier(e.name) ? void 0 : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text));
if (importSpecifiers) {
return convertedImports([makeImport(void 0, importSpecifiers, moduleSpecifier, quotePreference)]);
}
}
- case 207 /* ArrayBindingPattern */: {
+ case 209 /* ArrayBindingPattern */: {
const tmp = makeUniqueName(moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers);
return convertedImports([
makeImport(factory.createIdentifier(tmp), void 0, moduleSpecifier, quotePreference),
@@ -131596,11 +131857,11 @@ function forEachFreeIdentifier(node, cb) {
function isFreeIdentifier(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return parent2.name !== node;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return parent2.propertyName !== node;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return parent2.propertyName !== node;
default:
return true;
@@ -132270,11 +132531,11 @@ function tryUseExistingNamespaceImport(existingImports, symbolName2, position, c
function getTargetModuleFromNamespaceLikeImport(declaration, checker) {
var _a2;
switch (declaration.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return checker.resolveExternalModuleName(declaration.initializer.arguments[0]);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return checker.getAliasedSymbol(declaration.symbol);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
const namespaceImport = tryCast((_a2 = declaration.importClause) == null ? void 0 : _a2.namedBindings, isNamespaceImport);
return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol);
default:
@@ -132284,11 +132545,11 @@ function getTargetModuleFromNamespaceLikeImport(declaration, checker) {
function getNamespaceLikeImportText(declaration) {
var _a2, _b, _c;
switch (declaration.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return (_a2 = tryCast(declaration.name, isIdentifier)) == null ? void 0 : _a2.text;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return declaration.name.text;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return (_c = tryCast((_b = declaration.importClause) == null ? void 0 : _b.namedBindings, isNamespaceImport)) == null ? void 0 : _c.name.text;
default:
return Debug.assertNever(declaration);
@@ -132308,11 +132569,11 @@ function getAddAsTypeOnly(isValidTypeOnlyUseSite, isForNewImportDeclaration, sym
}
function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, compilerOptions) {
return firstDefined(existingImports, ({ declaration, importKind, symbol, targetFlags }) => {
- if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 274 /* ImportEqualsDeclaration */) {
+ if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 277 /* ImportEqualsDeclaration */) {
return void 0;
}
- if (declaration.kind === 261 /* VariableDeclaration */) {
- return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 206 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0;
+ if (declaration.kind === 263 /* VariableDeclaration */) {
+ return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 208 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0;
}
const { importClause } = declaration;
if (!importClause || !isStringLiteralLike(declaration.moduleSpecifier))
@@ -132323,7 +132584,7 @@ function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker
const addAsTypeOnly = getAddAsTypeOnly(isValidTypeOnlyUseSite, false, symbol, targetFlags, checker, compilerOptions);
if (importKind === 1 /* Default */ && (name || addAsTypeOnly === 2 /* Required */ && namedBindings))
return void 0;
- if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 277 /* NamespaceImport */)
+ if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 280 /* NamespaceImport */)
return void 0;
return {
kind: 2 /* AddToExisting */,
@@ -132343,7 +132604,7 @@ function createExistingImportMap(checker, importingFile, compilerOptions) {
if (moduleSymbol) {
(importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i.parent);
}
- } else if (i.kind === 275 /* ImportDeclaration */ || i.kind === 274 /* ImportEqualsDeclaration */) {
+ } else if (i.kind === 278 /* ImportDeclaration */ || i.kind === 277 /* ImportEqualsDeclaration */) {
const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier);
if (moduleSymbol) {
(importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i);
@@ -132684,7 +132945,7 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy
case 4 /* PromoteTypeOnly */: {
const { typeOnlyAliasDeclaration } = fix;
const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, compilerOptions, sourceFile);
- return promotedDeclaration.kind === 279 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
+ return promotedDeclaration.kind === 282 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
}
default:
return Debug.assertNever(fix, `Unexpected fix kind ${fix.kind}`);
@@ -132692,12 +132953,12 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy
}
function getModuleSpecifierText(promotedDeclaration) {
var _a2, _b;
- return promotedDeclaration.kind === 274 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text;
+ return promotedDeclaration.kind === 277 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text;
}
function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile) {
const convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules;
switch (aliasDeclaration.kind) {
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
if (aliasDeclaration.isTypeOnly) {
if (aliasDeclaration.parent.elements.length > 1 && ts_OrganizeImports_exports.importSpecifiersAreSorted(aliasDeclaration.parent.elements)) {
changes.delete(sourceFile, aliasDeclaration);
@@ -132713,13 +132974,13 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF
promoteImportClause(aliasDeclaration.parent.parent);
return aliasDeclaration.parent.parent;
}
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
promoteImportClause(aliasDeclaration);
return aliasDeclaration;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
promoteImportClause(aliasDeclaration.parent);
return aliasDeclaration.parent;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
changes.deleteRange(sourceFile, aliasDeclaration.getChildAt(1));
return aliasDeclaration;
default:
@@ -132730,7 +132991,7 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF
if (convertExistingToTypeOnly) {
const namedImports = tryCast(importClause.namedBindings, isNamedImports);
if (namedImports && namedImports.elements.length > 1) {
- if (ts_OrganizeImports_exports.importSpecifiersAreSorted(namedImports.elements) && aliasDeclaration.kind === 279 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) {
+ if (ts_OrganizeImports_exports.importSpecifiersAreSorted(namedImports.elements) && aliasDeclaration.kind === 282 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) {
changes.delete(sourceFile, aliasDeclaration);
changes.insertImportSpecifierAtIndex(sourceFile, aliasDeclaration, namedImports, 0);
}
@@ -132745,7 +133006,7 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF
}
function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, compilerOptions) {
var _a2;
- if (clause.kind === 206 /* ObjectBindingPattern */) {
+ if (clause.kind === 208 /* ObjectBindingPattern */) {
if (defaultImport) {
addElementToBindingPattern(clause, defaultImport.name, "default");
}
@@ -133143,13 +133404,13 @@ function doRemoveOverrideModifierChange(changeTracker, sourceFile, pos) {
}
function isClassElementLikeHasJSDoc(node) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return isParameterPropertyDeclaration(node, node.parent);
default:
return false;
@@ -133407,7 +133668,7 @@ registerCodeFix({
});
function getNamedTupleMember(sourceFile, pos) {
const token = getTokenAtPosition(sourceFile, pos);
- return findAncestor(token, (t) => t.kind === 202 /* NamedTupleMember */);
+ return findAncestor(token, (t) => t.kind === 204 /* NamedTupleMember */);
}
function doChange8(changes, sourceFile, namedTupleMember) {
if (!namedTupleMember) {
@@ -133416,10 +133677,10 @@ function doChange8(changes, sourceFile, namedTupleMember) {
let unwrappedType = namedTupleMember.type;
let sawOptional = false;
let sawRest = false;
- while (unwrappedType.kind === 190 /* OptionalType */ || unwrappedType.kind === 191 /* RestType */ || unwrappedType.kind === 196 /* ParenthesizedType */) {
- if (unwrappedType.kind === 190 /* OptionalType */) {
+ while (unwrappedType.kind === 192 /* OptionalType */ || unwrappedType.kind === 193 /* RestType */ || unwrappedType.kind === 198 /* ParenthesizedType */) {
+ if (unwrappedType.kind === 192 /* OptionalType */) {
sawOptional = true;
- } else if (unwrappedType.kind === 191 /* RestType */) {
+ } else if (unwrappedType.kind === 193 /* RestType */) {
sawRest = true;
}
unwrappedType = unwrappedType.type;
@@ -133721,19 +133982,19 @@ function getInfo6(checker, sourceFile, position, errorCode) {
}
function getVariableLikeInitializer(declaration) {
switch (declaration.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 171 /* PropertyDeclaration */:
- case 305 /* PropertyAssignment */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 172 /* PropertyDeclaration */:
+ case 308 /* PropertyAssignment */:
return declaration.initializer;
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return declaration.initializer && (isJsxExpression(declaration.initializer) ? declaration.initializer.expression : void 0);
- case 306 /* ShorthandPropertyAssignment */:
- case 170 /* PropertySignature */:
- case 308 /* EnumMember */:
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 171 /* PropertySignature */:
+ case 311 /* EnumMember */:
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
return void 0;
}
}
@@ -133966,7 +134227,7 @@ function createActionForAddMissingMemberInJavascriptFile(context, { parentDeclar
function addMissingMemberInJs(changeTracker, sourceFile, classDeclaration, token, makeStatic) {
const tokenName = token.text;
if (makeStatic) {
- if (classDeclaration.kind === 232 /* ClassExpression */) {
+ if (classDeclaration.kind === 234 /* ClassExpression */) {
return;
}
const className = classDeclaration.name.getText();
@@ -134015,7 +134276,7 @@ function createActionsForAddMissingMemberInTypeScriptFile(context, { parentDecla
}
function getTypeNode2(checker, node, token) {
let typeNode;
- if (token.parent.parent.kind === 227 /* BinaryExpression */) {
+ if (token.parent.parent.kind === 229 /* BinaryExpression */) {
const binaryExpression = token.parent.parent;
const otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left;
const widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression)));
@@ -134081,7 +134342,7 @@ function getActionsForMissingMethodDeclaration(context, info) {
}
function addMethodDeclaration(context, changes, callExpression, name, modifierFlags, parentDeclaration, sourceFile) {
const importAdder = createImportAdder(sourceFile, context.program, context.preferences, context.host);
- const kind = isClassLike(parentDeclaration) ? 174 /* MethodDeclaration */ : 173 /* MethodSignature */;
+ const kind = isClassLike(parentDeclaration) ? 176 /* MethodDeclaration */ : 175 /* MethodSignature */;
const signatureDeclaration = createSignatureDeclarationFromCallExpression(kind, context, importAdder, callExpression, name, modifierFlags, parentDeclaration);
const containingMethodDeclaration = tryGetContainingMethodDeclaration(parentDeclaration, callExpression);
if (containingMethodDeclaration) {
@@ -134110,7 +134371,7 @@ function addEnumMemberDeclaration(changes, checker, { token, parentDeclaration }
function addFunctionDeclaration(changes, context, info) {
const quotePreference = getQuotePreference(context.sourceFile, context.preferences);
const importAdder = createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
- const functionDeclaration = info.kind === 2 /* Function */ ? createSignatureDeclarationFromCallExpression(263 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature(263 /* FunctionDeclaration */, context, quotePreference, info.signature, createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference), info.token, void 0, void 0, void 0, importAdder);
+ const functionDeclaration = info.kind === 2 /* Function */ ? createSignatureDeclarationFromCallExpression(265 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature(265 /* FunctionDeclaration */, context, quotePreference, info.signature, createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference), info.token, void 0, void 0, void 0, importAdder);
if (functionDeclaration === void 0) {
Debug.fail("fixMissingFunctionDeclaration codefix got unexpected error.");
}
@@ -134210,7 +134471,7 @@ function tryGetValueFromType(context, checker, importAdder, quotePreference, typ
if (signature === void 0)
return createUndefined();
const func = createSignatureDeclarationFromSignature(
- 218 /* FunctionExpression */,
+ 220 /* FunctionExpression */,
context,
quotePreference,
signature[0],
@@ -134871,7 +135132,7 @@ registerCodeFix({
const importDeclaration = getImportDeclaration(context.sourceFile, context.program, context.span.start);
if (!importDeclaration)
return;
- const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => importDeclaration.kind === 279 /* ImportSpecifier */ && doNamespaceImportChange(t, context.sourceFile, importDeclaration, context.program));
+ const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => importDeclaration.kind === 282 /* ImportSpecifier */ && doNamespaceImportChange(t, context.sourceFile, importDeclaration, context.program));
const typeOnlyChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => doTypeOnlyImportChange(t, context.sourceFile, importDeclaration, context.program));
let actions2;
if (namespaceChanges.length) {
@@ -134886,18 +135147,18 @@ registerCodeFix({
});
function getImportDeclaration(sourceFile, program, start2) {
const identifier = tryCast(getTokenAtPosition(sourceFile, start2), isIdentifier);
- if (!identifier || identifier.parent.kind !== 183 /* TypeReference */)
+ if (!identifier || identifier.parent.kind !== 185 /* TypeReference */)
return;
const checker = program.getTypeChecker();
const symbol = checker.getSymbolAtLocation(identifier);
return find((symbol == null ? void 0 : symbol.declarations) || emptyArray, or(isImportClause, isImportSpecifier, isImportEqualsDeclaration));
}
function doTypeOnlyImportChange(changes, sourceFile, importDeclaration, program) {
- if (importDeclaration.kind === 274 /* ImportEqualsDeclaration */) {
+ if (importDeclaration.kind === 277 /* ImportEqualsDeclaration */) {
changes.insertModifierBefore(sourceFile, 155 /* TypeKeyword */, importDeclaration.name);
return;
}
- const importClause = importDeclaration.kind === 276 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent;
+ const importClause = importDeclaration.kind === 279 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent;
if (importClause.name && importClause.namedBindings) {
return;
}
@@ -135055,7 +135316,7 @@ function deleteTypeParameters(changes, sourceFile, token) {
changes.delete(sourceFile, Debug.checkDefined(cast(token.parent, isDeclarationWithTypeParameterChildren).typeParameters, "The type parameter to delete should exist"));
}
function isImport(token) {
- return token.kind === 101 /* ImportKeyword */ || token.kind === 79 /* Identifier */ && (token.parent.kind === 279 /* ImportSpecifier */ || token.parent.kind === 276 /* ImportClause */);
+ return token.kind === 101 /* ImportKeyword */ || token.kind === 79 /* Identifier */ && (token.parent.kind === 282 /* ImportSpecifier */ || token.parent.kind === 279 /* ImportClause */);
}
function tryGetFullImport(token) {
return token.kind === 101 /* ImportKeyword */ ? tryCast(token.parent, isImportDeclaration) : void 0;
@@ -135064,7 +135325,7 @@ function canDeleteEntireVariableStatement(sourceFile, token) {
return isVariableDeclarationList(token.parent) && first(token.parent.getChildren(sourceFile)) === token;
}
function deleteEntireVariableStatement(changes, sourceFile, node) {
- changes.delete(sourceFile, node.parent.kind === 244 /* VariableStatement */ ? node.parent : node);
+ changes.delete(sourceFile, node.parent.kind === 246 /* VariableStatement */ ? node.parent : node);
}
function deleteDestructuringElements(changes, sourceFile, node) {
forEach(node.elements, (n) => changes.delete(sourceFile, n));
@@ -135088,14 +135349,14 @@ function tryPrefixDeclaration(changes, errorCode, sourceFile, token) {
}
function canPrefix(token) {
switch (token.parent.kind) {
- case 168 /* Parameter */:
- case 167 /* TypeParameter */:
+ case 169 /* Parameter */:
+ case 168 /* TypeParameter */:
return true;
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
const varDecl = token.parent;
switch (varDecl.parent.parent.kind) {
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
return true;
}
}
@@ -135144,8 +135405,8 @@ function isNotProvidedArguments(parameter, checker, sourceFiles) {
function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll) {
const { parent: parent2 } = parameter;
switch (parent2.kind) {
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
const index = parent2.parameters.indexOf(parameter);
const referent = isMethodDeclaration(parent2) ? parent2.name : parent2;
const entries = ts_FindAllReferences_exports.Core.getReferencedSymbolsForNode(parent2.pos, referent, program, sourceFiles, cancellationToken);
@@ -135163,18 +135424,18 @@ function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program
}
}
return true;
- case 263 /* FunctionDeclaration */: {
+ case 265 /* FunctionDeclaration */: {
if (parent2.name && isCallbackLike(checker, sourceFile, parent2.name)) {
return isLastParameter(parent2, parameter, isFixAll);
}
return true;
}
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return isLastParameter(parent2, parameter, isFixAll);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return false;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return true;
default:
return Debug.failBadSyntaxKind(parent2);
@@ -135224,7 +135485,7 @@ function doChange18(changes, sourceFile, start2, length2, errorCode) {
const container = (isBlock(statement.parent) ? statement.parent : statement).parent;
if (!isBlock(statement.parent) || statement === first(statement.parent.statements)) {
switch (container.kind) {
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
if (container.elseStatement) {
if (isBlock(statement.parent)) {
break;
@@ -135233,8 +135494,8 @@ function doChange18(changes, sourceFile, start2, length2, errorCode) {
}
return;
}
- case 248 /* WhileStatement */:
- case 249 /* ForStatement */:
+ case 250 /* WhileStatement */:
+ case 251 /* ForStatement */:
changes.delete(sourceFile, container);
return;
}
@@ -135293,7 +135554,7 @@ registerCodeFix({
const { typeNode, type } = info;
const original = typeNode.getText(sourceFile);
const actions2 = [fix(type, fixIdPlain, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)];
- if (typeNode.kind === 323 /* JSDocNullableType */) {
+ if (typeNode.kind === 326 /* JSDocNullableType */) {
actions2.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types));
}
return actions2;
@@ -135311,7 +135572,7 @@ registerCodeFix({
if (!info)
return;
const { typeNode, type } = info;
- const fixedType = typeNode.kind === 323 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
+ const fixedType = typeNode.kind === 326 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
doChange20(changes, sourceFile, typeNode, fixedType, checker);
});
}
@@ -135326,22 +135587,22 @@ function getInfo11(sourceFile, pos, checker) {
}
function isTypeContainer(node) {
switch (node.kind) {
- case 235 /* AsExpression */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 263 /* FunctionDeclaration */:
- case 177 /* GetAccessor */:
- case 181 /* IndexSignature */:
- case 200 /* MappedType */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 178 /* SetAccessor */:
- case 268 /* TypeAliasDeclaration */:
- case 216 /* TypeAssertionExpression */:
- case 261 /* VariableDeclaration */:
+ case 237 /* AsExpression */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 179 /* GetAccessor */:
+ case 183 /* IndexSignature */:
+ case 202 /* MappedType */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 180 /* SetAccessor */:
+ case 271 /* TypeAliasDeclaration */:
+ case 218 /* TypeAssertionExpression */:
+ case 263 /* VariableDeclaration */:
return true;
default:
return false;
@@ -135432,14 +135693,14 @@ function getNodes3(sourceFile, start2) {
}
let insertBefore;
switch (containingFunction.kind) {
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
insertBefore = containingFunction.name;
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
insertBefore = findChildOfKind(containingFunction, 99 /* FunctionKeyword */, sourceFile);
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
const kind = containingFunction.typeParameters ? 29 /* LessThanToken */ : 20 /* OpenParenToken */;
insertBefore = findChildOfKind(containingFunction, kind, sourceFile) || first(containingFunction.parameters);
break;
@@ -135734,7 +135995,7 @@ function annotateSetAccessor(changes, importAdder, sourceFile, setAccessorDeclar
function annotate(changes, importAdder, sourceFile, declaration, type, program, host) {
const typeNode = getTypeNodeIfAccessible(type, declaration, program, host);
if (typeNode) {
- if (isInJSFile(sourceFile) && declaration.kind !== 170 /* PropertySignature */) {
+ if (isInJSFile(sourceFile) && declaration.kind !== 171 /* PropertySignature */) {
const parent2 = isVariableDeclaration(declaration) ? tryCast(declaration.parent.parent, isVariableStatement) : declaration;
if (!parent2) {
return;
@@ -135810,17 +136071,17 @@ function inferTypeForParametersFromUsage(func, sourceFile, program, cancellation
function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) {
let searchToken;
switch (containingFunction.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
searchToken = findChildOfKind(containingFunction, 136 /* ConstructorKeyword */, sourceFile);
break;
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
const parent2 = containingFunction.parent;
searchToken = (isVariableDeclaration(parent2) || isPropertyDeclaration(parent2)) && isIdentifier(parent2.name) ? parent2.name : containingFunction.name;
break;
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
searchToken = containingFunction.name;
break;
}
@@ -135955,44 +136216,44 @@ function inferTypeFromReferences(program, references, cancellationToken) {
node = node.parent;
}
switch (node.parent.kind) {
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
inferTypeFromExpressionStatement(node, usage);
break;
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
usage.isNumber = true;
break;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
inferTypeFromPrefixUnaryExpression(node.parent, usage);
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
inferTypeFromBinaryExpression(node, node.parent, usage);
break;
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
inferTypeFromSwitchStatementLabel(node.parent, usage);
break;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
if (node.parent.expression === node) {
inferTypeFromCallExpression(node.parent, usage);
} else {
inferTypeFromContextualType(node, usage);
}
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
inferTypeFromPropertyAccessExpression(node.parent, usage);
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
inferTypeFromPropertyElementExpression(node.parent, node, usage);
break;
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
inferTypeFromPropertyAssignment(node.parent, usage);
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
inferTypeFromPropertyDeclaration(node.parent, usage);
break;
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
const { name, initializer } = node.parent;
if (node === name) {
if (initializer) {
@@ -136089,7 +136350,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
break;
case 56 /* BarBarToken */:
case 60 /* QuestionQuestionToken */:
- if (node === parent2.left && (node.parent.parent.kind === 261 /* VariableDeclaration */ || isAssignmentExpression(node.parent.parent, true))) {
+ if (node === parent2.left && (node.parent.parent.kind === 263 /* VariableDeclaration */ || isAssignmentExpression(node.parent.parent, true))) {
addCandidateType(usage, checker.getTypeAtLocation(parent2.right));
}
break;
@@ -136113,7 +136374,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
}
}
calculateUsageOfNode(parent2, call.return_);
- if (parent2.kind === 213 /* CallExpression */) {
+ if (parent2.kind === 215 /* CallExpression */) {
(usage.calls || (usage.calls = [])).push(call);
} else {
(usage.constructs || (usage.constructs = [])).push(call);
@@ -136532,7 +136793,7 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
const declaration = declarations == null ? void 0 : declarations[0];
const checker = context.program.getTypeChecker();
const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions());
- const kind = (_a2 = declaration == null ? void 0 : declaration.kind) != null ? _a2 : 170 /* PropertySignature */;
+ const kind = (_a2 = declaration == null ? void 0 : declaration.kind) != null ? _a2 : 171 /* PropertySignature */;
const declarationName = getSynthesizedDeepClone(getNameOfDeclaration(declaration), false);
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
let modifierFlags = effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
@@ -136545,8 +136806,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
const ambient = !!(enclosingDeclaration.flags & 16777216 /* Ambient */) || isAmbient;
const quotePreference = getQuotePreference(sourceFile, preferences);
switch (kind) {
- case 170 /* PropertySignature */:
- case 171 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
const flags = quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : void 0;
let typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context));
if (importAdder) {
@@ -136564,8 +136825,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
void 0
));
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */: {
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */: {
Debug.assertIsDefined(declarations);
let typeNode2 = checker.typeToTypeNode(type, enclosingDeclaration, void 0, getNoopSymbolTrackerWithResolver(context));
const allAccessors = getAllAccessorDeclarations(declarations, declaration);
@@ -136600,8 +136861,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
}
break;
}
- case 173 /* MethodSignature */:
- case 174 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
Debug.assertIsDefined(declarations);
const signatures = type.isUnion() ? flatMap(type.types, (t) => t.getCallSignatures()) : type.getCallSignatures();
if (!some(signatures)) {
@@ -136628,7 +136889,7 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
break;
}
function outputMethod(quotePreference2, signature, modifiers2, name, body2) {
- const method = createSignatureDeclarationFromSignature(174 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder);
+ const method = createSignatureDeclarationFromSignature(176 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder);
if (method)
addClassElement(method);
}
@@ -136754,7 +137015,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder
const parameters = createDummyParameters(args.length, names, argumentTypeNodes, void 0, isJs);
const type = isJs || contextualType === void 0 ? void 0 : checker.typeToTypeNode(contextualType, contextNode, void 0, tracker);
switch (kind) {
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return factory.createMethodDeclaration(
modifiers,
asteriskToken,
@@ -136765,7 +137026,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder
type,
createStubbedMethodBody(quotePreference)
);
- case 173 /* MethodSignature */:
+ case 175 /* MethodSignature */:
return factory.createMethodSignature(
modifiers,
name,
@@ -136774,7 +137035,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder
parameters,
type === void 0 ? factory.createKeywordTypeNode(159 /* UnknownKeyword */) : type
);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return factory.createFunctionDeclaration(
modifiers,
asteriskToken,
@@ -137128,7 +137389,7 @@ function getAccessorConvertiblePropertyAtPosition(file, program, start2, end, co
isStatic: hasStaticModifier(declaration),
isReadonly: hasEffectiveReadonlyModifier(declaration),
type: getDeclarationType(declaration, program),
- container: declaration.kind === 168 /* Parameter */ ? declaration.parent.parent : declaration.parent,
+ container: declaration.kind === 169 /* Parameter */ ? declaration.parent.parent : declaration.parent,
originalName: declaration.name.text,
declaration,
fieldName,
@@ -137276,7 +137537,7 @@ registerCodeFix({
});
function getActionsForUsageOfInvalidImport(context) {
const sourceFile = context.sourceFile;
- const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 213 /* CallExpression */ : 214 /* NewExpression */;
+ const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 215 /* CallExpression */ : 216 /* NewExpression */;
const node = findAncestor(getTokenAtPosition(sourceFile, context.span.start), (a) => a.kind === targetKind);
if (!node) {
return [];
@@ -137599,7 +137860,7 @@ registerCodeFix({
function getImportTypeNode(sourceFile, pos) {
const token = getTokenAtPosition(sourceFile, pos);
Debug.assert(token.kind === 101 /* ImportKeyword */, "This token should be an ImportKeyword");
- Debug.assert(token.parent.kind === 205 /* ImportType */, "Token parent should be an ImportType");
+ Debug.assert(token.parent.kind === 207 /* ImportType */, "Token parent should be an ImportType");
return token.parent;
}
function doChange28(changes, sourceFile, importType) {
@@ -138376,12 +138637,12 @@ function isMemberCompletionKind(kind) {
function getJsxClosingTagCompletion(location2, sourceFile) {
const jsxClosingElement = findAncestor(location2, (node) => {
switch (node.kind) {
- case 290 /* JsxClosingElement */:
+ case 293 /* JsxClosingElement */:
return true;
case 43 /* SlashToken */:
case 31 /* GreaterThanToken */:
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return false;
default:
return "quit";
@@ -138700,10 +138961,10 @@ function createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, pro
const quotePreference = getQuotePreference(sourceFile, preferences);
const builderFlags = 33554432 /* OmitThisParameter */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0 /* None */);
switch (declaration.kind) {
- case 170 /* PropertySignature */:
- case 171 /* PropertyDeclaration */:
- case 173 /* MethodSignature */:
- case 174 /* MethodDeclaration */: {
+ case 171 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 175 /* MethodSignature */:
+ case 176 /* MethodDeclaration */: {
let effectiveType = type.flags & 1048576 /* Union */ && type.types.length < 10 ? checker.getUnionType(type.types, 2 /* Subtype */) : type;
if (effectiveType.flags & 1048576 /* Union */) {
const functionTypes = filter(effectiveType.types, (type2) => checker.getSignaturesOfType(type2, 0 /* Call */).length > 0);
@@ -139223,11 +139484,11 @@ function getContextualType(previousToken, position, sourceFile, checker) {
return getContextualTypeFromParent(previousToken, checker);
case 63 /* EqualsToken */:
switch (parent2.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return checker.getContextualType(parent2.initializer);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return checker.getTypeAtLocation(parent2.left);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return checker.getContextualTypeForJsxAttribute(parent2);
default:
return void 0;
@@ -139252,7 +139513,7 @@ function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) {
}
function isModuleSymbol(symbol) {
var _a2;
- return !!((_a2 = symbol.declarations) == null ? void 0 : _a2.some((d) => d.kind === 314 /* SourceFile */));
+ return !!((_a2 = symbol.declarations) == null ? void 0 : _a2.some((d) => d.kind === 317 /* SourceFile */));
}
function getCompletionData(program, log, sourceFile, compilerOptions, position, preferences, detailsEntryId, host, formatContext, cancellationToken) {
var _a2;
@@ -139286,7 +139547,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const typeExpression = tryGetTypeExpressionFromTag(tag);
if (typeExpression) {
currentToken = getTokenAtPosition(sourceFile, position);
- if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 356 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) {
+ if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 359 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) {
insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression);
}
}
@@ -139344,7 +139605,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
isRightOfDot = contextToken.kind === 24 /* DotToken */;
isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
propertyAccessToConvert = parent2;
node = propertyAccessToConvert.expression;
const leftmostAccessExpression = getLeftmostAccessExpression(propertyAccessToConvert);
@@ -139355,16 +139616,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return void 0;
}
break;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
node = parent2.left;
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
node = parent2.name;
break;
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
node = parent2;
break;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
node = parent2.getFirstToken(sourceFile);
Debug.assert(node.kind === 101 /* ImportKeyword */ || node.kind === 104 /* NewKeyword */);
break;
@@ -139372,51 +139633,51 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return void 0;
}
} else if (!importStatementCompletion) {
- if (parent2 && parent2.kind === 211 /* PropertyAccessExpression */) {
+ if (parent2 && parent2.kind === 213 /* PropertyAccessExpression */) {
contextToken = parent2;
parent2 = parent2.parent;
}
if (currentToken.parent === location2) {
switch (currentToken.kind) {
case 31 /* GreaterThanToken */:
- if (currentToken.parent.kind === 287 /* JsxElement */ || currentToken.parent.kind === 289 /* JsxOpeningElement */) {
+ if (currentToken.parent.kind === 290 /* JsxElement */ || currentToken.parent.kind === 292 /* JsxOpeningElement */) {
location2 = currentToken;
}
break;
case 43 /* SlashToken */:
- if (currentToken.parent.kind === 288 /* JsxSelfClosingElement */) {
+ if (currentToken.parent.kind === 291 /* JsxSelfClosingElement */) {
location2 = currentToken;
}
break;
}
}
switch (parent2.kind) {
- case 290 /* JsxClosingElement */:
+ case 293 /* JsxClosingElement */:
if (contextToken.kind === 43 /* SlashToken */) {
isStartingCloseTag = true;
location2 = contextToken;
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (!binaryExpressionMayBeOpenTag(parent2)) {
break;
}
- case 288 /* JsxSelfClosingElement */:
- case 287 /* JsxElement */:
- case 289 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 290 /* JsxElement */:
+ case 292 /* JsxOpeningElement */:
isJsxIdentifierExpected = true;
if (contextToken.kind === 29 /* LessThanToken */) {
isRightOfOpenTag = true;
location2 = contextToken;
}
break;
- case 297 /* JsxExpression */:
- case 296 /* JsxSpreadAttribute */:
+ case 300 /* JsxExpression */:
+ case 299 /* JsxSpreadAttribute */:
if (previousToken.kind === 19 /* CloseBraceToken */ && currentToken.kind === 31 /* GreaterThanToken */) {
isJsxIdentifierExpected = true;
}
break;
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
if (parent2.initializer === previousToken && previousToken.end < position) {
isJsxIdentifierExpected = true;
break;
@@ -139520,13 +139781,13 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
};
function isTagWithTypeExpression(tag) {
switch (tag.kind) {
- case 349 /* JSDocParameterTag */:
- case 356 /* JSDocPropertyTag */:
- case 350 /* JSDocReturnTag */:
- case 352 /* JSDocTypeTag */:
- case 354 /* JSDocTypedefTag */:
+ case 352 /* JSDocParameterTag */:
+ case 359 /* JSDocPropertyTag */:
+ case 353 /* JSDocReturnTag */:
+ case 355 /* JSDocTypeTag */:
+ case 357 /* JSDocTypedefTag */:
return true;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return !!tag.constraint;
default:
return false;
@@ -139535,7 +139796,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
function tryGetTypeExpressionFromTag(tag) {
if (isTagWithTypeExpression(tag)) {
const typeExpression = isJSDocTemplateTag(tag) ? tag.constraint : tag.typeExpression;
- return typeExpression && typeExpression.kind === 318 /* JSDocTypeExpression */ ? typeExpression : void 0;
+ return typeExpression && typeExpression.kind === 321 /* JSDocTypeExpression */ ? typeExpression : void 0;
}
return void 0;
}
@@ -139565,7 +139826,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
symbols.push(exportedSymbol);
}
}
- if (!isTypeLocation && symbol.declarations && symbol.declarations.some((d) => d.kind !== 314 /* SourceFile */ && d.kind !== 270 /* ModuleDeclaration */ && d.kind !== 269 /* EnumDeclaration */)) {
+ if (!isTypeLocation && symbol.declarations && symbol.declarations.some((d) => d.kind !== 317 /* SourceFile */ && d.kind !== 273 /* ModuleDeclaration */ && d.kind !== 272 /* EnumDeclaration */)) {
let type = typeChecker3.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType();
let insertQuestionDot = false;
if (type.isNullableType()) {
@@ -139604,7 +139865,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
if (isRightOfQuestionDot && some(type.getCallSignatures())) {
isNewIdentifierLocation = true;
}
- const propertyAccess = node.kind === 205 /* ImportType */ ? node : node.parent;
+ const propertyAccess = node.kind === 207 /* ImportType */ ? node : node.parent;
if (inCheckedFile) {
const typeSymbols = type.getApparentProperties();
for (const symbol of typeSymbols) {
@@ -139840,7 +140101,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
}
}
}
- if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 314 /* SourceFile */) {
+ if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 317 /* SourceFile */) {
const thisType = typeChecker3.tryGetThisTypeAt(scopeNode, false, isClassLike(scopeNode.parent) ? scopeNode : void 0);
if (thisType && !isProbablyGlobalType(thisType, sourceFile, typeChecker3)) {
for (const symbol of getPropertiesForCompletion(thisType, typeChecker3)) {
@@ -139870,10 +140131,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
}
function isSnippetScope(scopeNode) {
switch (scopeNode.kind) {
- case 314 /* SourceFile */:
- case 229 /* TemplateExpression */:
- case 297 /* JsxExpression */:
- case 242 /* Block */:
+ case 317 /* SourceFile */:
+ case 231 /* TemplateExpression */:
+ case 300 /* JsxExpression */:
+ case 244 /* Block */:
return true;
default:
return isStatement(scopeNode);
@@ -139883,24 +140144,24 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return insideJsDocTagTypeExpression || !!importStatementCompletion && isTypeOnlyImportOrExportDeclaration(location2.parent) || !isContextTokenValueLocation(contextToken) && (isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker3) || isPartOfTypeNode(location2) || isContextTokenTypeLocation(contextToken));
}
function isContextTokenValueLocation(contextToken2) {
- return contextToken2 && (contextToken2.kind === 113 /* TypeOfKeyword */ && (contextToken2.parent.kind === 186 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 130 /* AssertsKeyword */ && contextToken2.parent.kind === 182 /* TypePredicate */);
+ return contextToken2 && (contextToken2.kind === 113 /* TypeOfKeyword */ && (contextToken2.parent.kind === 188 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 130 /* AssertsKeyword */ && contextToken2.parent.kind === 184 /* TypePredicate */);
}
function isContextTokenTypeLocation(contextToken2) {
if (contextToken2) {
const parentKind = contextToken2.parent.kind;
switch (contextToken2.kind) {
case 58 /* ColonToken */:
- return parentKind === 171 /* PropertyDeclaration */ || parentKind === 170 /* PropertySignature */ || parentKind === 168 /* Parameter */ || parentKind === 261 /* VariableDeclaration */ || isFunctionLikeKind(parentKind);
+ return parentKind === 172 /* PropertyDeclaration */ || parentKind === 171 /* PropertySignature */ || parentKind === 169 /* Parameter */ || parentKind === 263 /* VariableDeclaration */ || isFunctionLikeKind(parentKind);
case 63 /* EqualsToken */:
- return parentKind === 268 /* TypeAliasDeclaration */;
+ return parentKind === 271 /* TypeAliasDeclaration */;
case 129 /* AsKeyword */:
- return parentKind === 235 /* AsExpression */;
+ return parentKind === 237 /* AsExpression */;
case 29 /* LessThanToken */:
- return parentKind === 183 /* TypeReference */ || parentKind === 216 /* TypeAssertionExpression */;
+ return parentKind === 185 /* TypeReference */ || parentKind === 218 /* TypeAssertionExpression */;
case 95 /* ExtendsKeyword */:
- return parentKind === 167 /* TypeParameter */;
+ return parentKind === 168 /* TypeParameter */;
case 151 /* SatisfiesKeyword */:
- return parentKind === 239 /* SatisfiesExpression */;
+ return parentKind === 241 /* SatisfiesExpression */;
}
}
return false;
@@ -140075,14 +140336,14 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return true;
}
if (contextToken2.kind === 31 /* GreaterThanToken */ && contextToken2.parent) {
- if (location2 === contextToken2.parent && (location2.kind === 289 /* JsxOpeningElement */ || location2.kind === 288 /* JsxSelfClosingElement */)) {
+ if (location2 === contextToken2.parent && (location2.kind === 292 /* JsxOpeningElement */ || location2.kind === 291 /* JsxSelfClosingElement */)) {
return false;
}
- if (contextToken2.parent.kind === 289 /* JsxOpeningElement */) {
- return location2.parent.kind !== 289 /* JsxOpeningElement */;
+ if (contextToken2.parent.kind === 292 /* JsxOpeningElement */) {
+ return location2.parent.kind !== 292 /* JsxOpeningElement */;
}
- if (contextToken2.parent.kind === 290 /* JsxClosingElement */ || contextToken2.parent.kind === 288 /* JsxSelfClosingElement */) {
- return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 287 /* JsxElement */;
+ if (contextToken2.parent.kind === 293 /* JsxClosingElement */ || contextToken2.parent.kind === 291 /* JsxSelfClosingElement */) {
+ return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 290 /* JsxElement */;
}
}
return false;
@@ -140093,29 +140354,29 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const tokenKind = keywordForNode(contextToken);
switch (tokenKind) {
case 27 /* CommaToken */:
- return containingNodeKind === 213 /* CallExpression */ || containingNodeKind === 176 /* Constructor */ || containingNodeKind === 214 /* NewExpression */ || containingNodeKind === 209 /* ArrayLiteralExpression */ || containingNodeKind === 227 /* BinaryExpression */ || containingNodeKind === 184 /* FunctionType */ || containingNodeKind === 210 /* ObjectLiteralExpression */;
+ return containingNodeKind === 215 /* CallExpression */ || containingNodeKind === 178 /* Constructor */ || containingNodeKind === 216 /* NewExpression */ || containingNodeKind === 211 /* ArrayLiteralExpression */ || containingNodeKind === 229 /* BinaryExpression */ || containingNodeKind === 186 /* FunctionType */ || containingNodeKind === 212 /* ObjectLiteralExpression */;
case 20 /* OpenParenToken */:
- return containingNodeKind === 213 /* CallExpression */ || containingNodeKind === 176 /* Constructor */ || containingNodeKind === 214 /* NewExpression */ || containingNodeKind === 217 /* ParenthesizedExpression */ || containingNodeKind === 196 /* ParenthesizedType */;
+ return containingNodeKind === 215 /* CallExpression */ || containingNodeKind === 178 /* Constructor */ || containingNodeKind === 216 /* NewExpression */ || containingNodeKind === 219 /* ParenthesizedExpression */ || containingNodeKind === 198 /* ParenthesizedType */;
case 22 /* OpenBracketToken */:
- return containingNodeKind === 209 /* ArrayLiteralExpression */ || containingNodeKind === 181 /* IndexSignature */ || containingNodeKind === 166 /* ComputedPropertyName */;
+ return containingNodeKind === 211 /* ArrayLiteralExpression */ || containingNodeKind === 183 /* IndexSignature */ || containingNodeKind === 167 /* ComputedPropertyName */;
case 143 /* ModuleKeyword */:
case 144 /* NamespaceKeyword */:
case 101 /* ImportKeyword */:
return true;
case 24 /* DotToken */:
- return containingNodeKind === 270 /* ModuleDeclaration */;
+ return containingNodeKind === 273 /* ModuleDeclaration */;
case 18 /* OpenBraceToken */:
- return containingNodeKind === 264 /* ClassDeclaration */ || containingNodeKind === 265 /* StructDeclaration */ || containingNodeKind === 210 /* ObjectLiteralExpression */;
+ return containingNodeKind === 266 /* ClassDeclaration */ || containingNodeKind === 267 /* StructDeclaration */ || containingNodeKind === 212 /* ObjectLiteralExpression */;
case 63 /* EqualsToken */:
- return containingNodeKind === 261 /* VariableDeclaration */ || containingNodeKind === 227 /* BinaryExpression */;
+ return containingNodeKind === 263 /* VariableDeclaration */ || containingNodeKind === 229 /* BinaryExpression */;
case 15 /* TemplateHead */:
- return containingNodeKind === 229 /* TemplateExpression */;
+ return containingNodeKind === 231 /* TemplateExpression */;
case 16 /* TemplateMiddle */:
- return containingNodeKind === 240 /* TemplateSpan */;
+ return containingNodeKind === 242 /* TemplateSpan */;
case 133 /* AsyncKeyword */:
- return containingNodeKind === 174 /* MethodDeclaration */ || containingNodeKind === 306 /* ShorthandPropertyAssignment */;
+ return containingNodeKind === 176 /* MethodDeclaration */ || containingNodeKind === 309 /* ShorthandPropertyAssignment */;
case 41 /* AsteriskToken */:
- return containingNodeKind === 174 /* MethodDeclaration */;
+ return containingNodeKind === 176 /* MethodDeclaration */;
}
if (isClassMemberCompletionKeyword(tokenKind)) {
return true;
@@ -140153,7 +140414,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
completionKind = 0 /* ObjectPropertyDeclaration */;
let typeMembers;
let existingMembers;
- if (objectLikeContainer.kind === 210 /* ObjectLiteralExpression */) {
+ if (objectLikeContainer.kind === 212 /* ObjectLiteralExpression */) {
const instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker3);
if (instantiatedType === void 0) {
if (objectLikeContainer.flags & 33554432 /* InWithStatement */) {
@@ -140175,16 +140436,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
}
}
} else {
- Debug.assert(objectLikeContainer.kind === 206 /* ObjectBindingPattern */);
+ Debug.assert(objectLikeContainer.kind === 208 /* ObjectBindingPattern */);
isNewIdentifierLocation = false;
const rootDeclaration = getRootDeclaration(objectLikeContainer.parent);
if (!isVariableLike(rootDeclaration))
return Debug.fail("Root declaration is not variable-like.");
- let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 251 /* ForOfStatement */;
- if (!canGetType && rootDeclaration.kind === 168 /* Parameter */) {
+ let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 253 /* ForOfStatement */;
+ if (!canGetType && rootDeclaration.kind === 169 /* Parameter */) {
if (isExpression(rootDeclaration.parent)) {
canGetType = !!typeChecker3.getContextualType(rootDeclaration.parent);
- } else if (rootDeclaration.parent.kind === 174 /* MethodDeclaration */ || rootDeclaration.parent.kind === 178 /* SetAccessor */) {
+ } else if (rootDeclaration.parent.kind === 176 /* MethodDeclaration */ || rootDeclaration.parent.kind === 180 /* SetAccessor */) {
canGetType = isExpression(rootDeclaration.parent.parent) && !!typeChecker3.getContextualType(rootDeclaration.parent.parent);
}
}
@@ -140202,7 +140463,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const filteredMembers = filterObjectMembersList(typeMembers, Debug.checkDefined(existingMembers));
symbols = concatenate(symbols, filteredMembers);
setSortTextToOptionalMember();
- if (objectLikeContainer.kind === 210 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) {
+ if (objectLikeContainer.kind === 212 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) {
transformObjectLiteralMembersSortText(symbolsStartIndex);
collectObjectLiteralMethodSymbols(filteredMembers, objectLikeContainer);
}
@@ -140218,10 +140479,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
if (!isTypeKeywordTokenOrIdentifier(contextToken)) {
keywordFilters = 8 /* TypeKeyword */;
}
- const { moduleSpecifier } = namedImportsOrExports.kind === 278 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent;
+ const { moduleSpecifier } = namedImportsOrExports.kind === 281 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent;
if (!moduleSpecifier) {
isNewIdentifierLocation = true;
- return namedImportsOrExports.kind === 278 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */;
+ return namedImportsOrExports.kind === 281 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */;
}
const moduleSpecifierSymbol = typeChecker3.getSymbolAtLocation(moduleSpecifier);
if (!moduleSpecifierSymbol) {
@@ -140336,31 +140597,31 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
case 30 /* LessThanSlashToken */:
case 43 /* SlashToken */:
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */:
- case 295 /* JsxAttributes */:
- case 294 /* JsxAttribute */:
- case 296 /* JsxSpreadAttribute */:
- if (parent2 && (parent2.kind === 288 /* JsxSelfClosingElement */ || parent2.kind === 289 /* JsxOpeningElement */)) {
+ case 213 /* PropertyAccessExpression */:
+ case 298 /* JsxAttributes */:
+ case 297 /* JsxAttribute */:
+ case 299 /* JsxSpreadAttribute */:
+ if (parent2 && (parent2.kind === 291 /* JsxSelfClosingElement */ || parent2.kind === 292 /* JsxOpeningElement */)) {
if (contextToken2.kind === 31 /* GreaterThanToken */) {
const precedingToken = findPrecedingToken(contextToken2.pos, sourceFile, void 0);
if (!parent2.typeArguments || precedingToken && precedingToken.kind === 43 /* SlashToken */)
break;
}
return parent2;
- } else if (parent2.kind === 294 /* JsxAttribute */) {
+ } else if (parent2.kind === 297 /* JsxAttribute */) {
return parent2.parent.parent;
}
break;
case 10 /* StringLiteral */:
- if (parent2 && (parent2.kind === 294 /* JsxAttribute */ || parent2.kind === 296 /* JsxSpreadAttribute */)) {
+ if (parent2 && (parent2.kind === 297 /* JsxAttribute */ || parent2.kind === 299 /* JsxSpreadAttribute */)) {
return parent2.parent.parent;
}
break;
case 19 /* CloseBraceToken */:
- if (parent2 && parent2.kind === 297 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 294 /* JsxAttribute */) {
+ if (parent2 && parent2.kind === 300 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 297 /* JsxAttribute */) {
return parent2.parent.parent.parent;
}
- if (parent2 && parent2.kind === 296 /* JsxSpreadAttribute */) {
+ if (parent2 && parent2.kind === 299 /* JsxSpreadAttribute */) {
return parent2.parent.parent;
}
break;
@@ -140373,34 +140634,34 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const containingNodeKind = parent2.kind;
switch (contextToken2.kind) {
case 27 /* CommaToken */:
- return containingNodeKind === 261 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 244 /* VariableStatement */ || containingNodeKind === 269 /* EnumDeclaration */ || isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 267 /* InterfaceDeclaration */ || containingNodeKind === 207 /* ArrayBindingPattern */ || containingNodeKind === 268 /* TypeAliasDeclaration */ || isClassLike(parent2) && !!parent2.typeParameters && parent2.typeParameters.end >= contextToken2.pos;
+ return containingNodeKind === 263 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 246 /* VariableStatement */ || containingNodeKind === 272 /* EnumDeclaration */ || isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 270 /* InterfaceDeclaration */ || containingNodeKind === 209 /* ArrayBindingPattern */ || containingNodeKind === 271 /* TypeAliasDeclaration */ || isClassLike(parent2) && !!parent2.typeParameters && parent2.typeParameters.end >= contextToken2.pos;
case 24 /* DotToken */:
- return containingNodeKind === 207 /* ArrayBindingPattern */;
+ return containingNodeKind === 209 /* ArrayBindingPattern */;
case 58 /* ColonToken */:
- return containingNodeKind === 208 /* BindingElement */;
+ return containingNodeKind === 210 /* BindingElement */;
case 22 /* OpenBracketToken */:
- return containingNodeKind === 207 /* ArrayBindingPattern */;
+ return containingNodeKind === 209 /* ArrayBindingPattern */;
case 20 /* OpenParenToken */:
- return containingNodeKind === 301 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind);
+ return containingNodeKind === 304 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind);
case 18 /* OpenBraceToken */:
- return containingNodeKind === 269 /* EnumDeclaration */;
+ return containingNodeKind === 272 /* EnumDeclaration */;
case 29 /* LessThanToken */:
- return containingNodeKind === 264 /* ClassDeclaration */ || containingNodeKind === 232 /* ClassExpression */ || containingNodeKind === 267 /* InterfaceDeclaration */ || containingNodeKind === 268 /* TypeAliasDeclaration */ || isFunctionLikeKind(containingNodeKind);
+ return containingNodeKind === 266 /* ClassDeclaration */ || containingNodeKind === 234 /* ClassExpression */ || containingNodeKind === 270 /* InterfaceDeclaration */ || containingNodeKind === 271 /* TypeAliasDeclaration */ || isFunctionLikeKind(containingNodeKind);
case 125 /* StaticKeyword */:
- return containingNodeKind === 171 /* PropertyDeclaration */ && !isClassLike(parent2.parent);
+ return containingNodeKind === 172 /* PropertyDeclaration */ && !isClassLike(parent2.parent);
case 25 /* DotDotDotToken */:
- return containingNodeKind === 168 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 207 /* ArrayBindingPattern */;
+ return containingNodeKind === 169 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 209 /* ArrayBindingPattern */;
case 124 /* PublicKeyword */:
case 122 /* PrivateKeyword */:
case 123 /* ProtectedKeyword */:
- return containingNodeKind === 168 /* Parameter */ && !isConstructorDeclaration(parent2.parent);
+ return containingNodeKind === 169 /* Parameter */ && !isConstructorDeclaration(parent2.parent);
case 129 /* AsKeyword */:
- return containingNodeKind === 279 /* ImportSpecifier */ || containingNodeKind === 284 /* ExportSpecifier */ || containingNodeKind === 277 /* NamespaceImport */;
+ return containingNodeKind === 282 /* ImportSpecifier */ || containingNodeKind === 287 /* ExportSpecifier */ || containingNodeKind === 280 /* NamespaceImport */;
case 138 /* GetKeyword */:
case 152 /* SetKeyword */:
return !isFromObjectTypeDeclaration(contextToken2);
case 79 /* Identifier */:
- if (containingNodeKind === 279 /* ImportSpecifier */ && contextToken2 === parent2.name && contextToken2.text === "type") {
+ if (containingNodeKind === 282 /* ImportSpecifier */ && contextToken2 === parent2.name && contextToken2.text === "type") {
return false;
}
break;
@@ -140416,7 +140677,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
case 139 /* InferKeyword */:
return true;
case 155 /* TypeKeyword */:
- return containingNodeKind !== 279 /* ImportSpecifier */;
+ return containingNodeKind !== 282 /* ImportSpecifier */;
case 41 /* AsteriskToken */:
return isFunctionLike(contextToken2.parent) && !isMethodDeclaration(contextToken2.parent);
}
@@ -140451,7 +140712,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
if (ancestorClassLike && contextToken2 === previousToken && isPreviousPropertyDeclarationTerminated(contextToken2, position)) {
return false;
}
- const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 171 /* PropertyDeclaration */);
+ const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 172 /* PropertyDeclaration */);
if (ancestorPropertyDeclaraion && contextToken2 !== previousToken && isClassLike(previousToken.parent.parent) && position <= previousToken.end) {
if (isPreviousPropertyDeclarationTerminated(contextToken2, previousToken.end)) {
return false;
@@ -140465,7 +140726,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return contextToken2.kind !== 63 /* EqualsToken */ && (contextToken2.kind === 26 /* SemicolonToken */ || !positionsAreOnSameLine(contextToken2.end, position2, sourceFile));
}
function isFunctionLikeButNotConstructor(kind) {
- return isFunctionLikeKind(kind) && kind !== 176 /* Constructor */;
+ return isFunctionLikeKind(kind) && kind !== 178 /* Constructor */;
}
function isDotOfNumericLiteral(contextToken2) {
if (contextToken2.kind === 8 /* NumericLiteral */) {
@@ -140475,7 +140736,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return false;
}
function isVariableDeclarationListButNotTypeArgument(node2) {
- return node2.parent.kind === 262 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker3);
+ return node2.parent.kind === 264 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker3);
}
function filterObjectMembersList(contextualMemberSymbols, existingMembers) {
if (existingMembers.length === 0) {
@@ -140484,7 +140745,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const membersDeclaredBySpreadAssignment = new Set2();
const existingMemberNames = new Set2();
for (const m of existingMembers) {
- if (m.kind !== 305 /* PropertyAssignment */ && m.kind !== 306 /* ShorthandPropertyAssignment */ && m.kind !== 208 /* BindingElement */ && m.kind !== 174 /* MethodDeclaration */ && m.kind !== 177 /* GetAccessor */ && m.kind !== 178 /* SetAccessor */ && m.kind !== 307 /* SpreadAssignment */) {
+ if (m.kind !== 308 /* PropertyAssignment */ && m.kind !== 309 /* ShorthandPropertyAssignment */ && m.kind !== 210 /* BindingElement */ && m.kind !== 176 /* MethodDeclaration */ && m.kind !== 179 /* GetAccessor */ && m.kind !== 180 /* SetAccessor */ && m.kind !== 310 /* SpreadAssignment */) {
continue;
}
if (isCurrentlyEditingNode(m)) {
@@ -140563,7 +140824,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
function filterClassMembersList(baseSymbols, existingMembers, currentClassElementModifierFlags) {
const existingMemberNames = new Set2();
for (const m of existingMembers) {
- if (m.kind !== 171 /* PropertyDeclaration */ && m.kind !== 174 /* MethodDeclaration */ && m.kind !== 177 /* GetAccessor */ && m.kind !== 178 /* SetAccessor */) {
+ if (m.kind !== 172 /* PropertyDeclaration */ && m.kind !== 176 /* MethodDeclaration */ && m.kind !== 179 /* GetAccessor */ && m.kind !== 180 /* SetAccessor */) {
continue;
}
if (isCurrentlyEditingNode(m)) {
@@ -140589,7 +140850,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
if (isCurrentlyEditingNode(attr)) {
continue;
}
- if (attr.kind === 294 /* JsxAttribute */) {
+ if (attr.kind === 297 /* JsxAttribute */) {
seenNames.add(attr.name.escapedText);
} else if (isJsxSpreadAttribute(attr)) {
setMembersDeclaredBySpreadAssignment(attr, membersDeclaredBySpreadAssignment);
@@ -140669,7 +140930,7 @@ function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, js
var _keywordCompletions = [];
var allKeywordsCompletions = memoize(() => {
const res = [];
- for (let i = 81 /* FirstKeyword */; i <= 164 /* LastKeyword */; i++) {
+ for (let i = 81 /* FirstKeyword */; i <= 165 /* LastKeyword */; i++) {
res.push({
name: tokenToString(i),
kind: "keyword" /* keyword */,
@@ -140815,7 +141076,7 @@ function getPropertiesForCompletion(type, checker) {
}
function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location2, position) {
switch (location2.kind) {
- case 357 /* SyntaxList */:
+ case 360 /* SyntaxList */:
return tryCast(location2.parent, isObjectTypeDeclaration);
case 1 /* EndOfFileToken */:
const cls = tryCast(lastOrUndefined(cast(location2.parent, isSourceFile).statements), isObjectTypeDeclaration);
@@ -140874,7 +141135,7 @@ function tryGetTypeLiteralNode(node) {
case 26 /* SemicolonToken */:
case 27 /* CommaToken */:
case 79 /* Identifier */:
- if (parent2.kind === 170 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) {
+ if (parent2.kind === 171 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) {
return parent2.parent;
}
break;
@@ -140891,11 +141152,11 @@ function getConstraintOfTypeArgumentProperty(node, checker) {
if (!t)
return void 0;
switch (node.kind) {
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
return checker.getTypeOfPropertyOfContextualType(t, node.symbol.escapedName);
- case 193 /* IntersectionType */:
- case 187 /* TypeLiteral */:
- case 192 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 189 /* TypeLiteral */:
+ case 194 /* UnionType */:
return t;
}
}
@@ -140918,7 +141179,7 @@ function isValidTrigger(sourceFile, triggerCharacter, contextToken, position) {
case "/":
return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 43 /* SlashToken */ && isJsxClosingElement(contextToken.parent));
case " ":
- return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 314 /* SourceFile */;
+ return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 317 /* SourceFile */;
default:
return Debug.assertNever(triggerCharacter);
}
@@ -141014,8 +141275,8 @@ function getSingleLineReplacementSpanForImportCompletionNode(node) {
if (rangeIsOnSingleLine(top, sourceFile)) {
return createTextSpanFromNode(top, sourceFile);
}
- Debug.assert(top.kind !== 101 /* ImportKeyword */ && top.kind !== 279 /* ImportSpecifier */);
- const potentialSplitPoint = top.kind === 275 /* ImportDeclaration */ ? (_c = getPotentiallyInvalidImportSpecifier((_b = top.importClause) == null ? void 0 : _b.namedBindings)) != null ? _c : top.moduleSpecifier : top.moduleReference;
+ Debug.assert(top.kind !== 101 /* ImportKeyword */ && top.kind !== 282 /* ImportSpecifier */);
+ const potentialSplitPoint = top.kind === 278 /* ImportDeclaration */ ? (_c = getPotentiallyInvalidImportSpecifier((_b = top.importClause) == null ? void 0 : _b.namedBindings)) != null ? _c : top.moduleSpecifier : top.moduleReference;
const withoutModuleSpecifier = {
pos: top.getFirstToken().getStart(),
end: potentialSplitPoint.pos
@@ -141258,26 +141519,26 @@ var StringLiteralCompletionKind = /* @__PURE__ */ ((StringLiteralCompletionKind2
function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker3, compilerOptions, host, preferences) {
const parent2 = walkUpParentheses(node.parent);
switch (parent2.kind) {
- case 201 /* LiteralType */: {
+ case 203 /* LiteralType */: {
const grandParent = walkUpParentheses(parent2.parent);
switch (grandParent.kind) {
- case 234 /* ExpressionWithTypeArguments */:
- case 183 /* TypeReference */: {
+ case 236 /* ExpressionWithTypeArguments */:
+ case 185 /* TypeReference */: {
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
if (typeArgument) {
return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker3.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };
}
return void 0;
}
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
const { indexType, objectType } = grandParent;
if (!rangeContainsPosition(indexType, position)) {
return void 0;
}
return stringLiteralCompletionsFromProperties(typeChecker3.getTypeFromTypeNode(objectType));
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker3, preferences) };
- case 192 /* UnionType */: {
+ case 194 /* UnionType */: {
if (!isTypeReferenceNode(grandParent.parent)) {
return void 0;
}
@@ -141289,28 +141550,28 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
return void 0;
}
}
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) {
return stringLiteralCompletionsForObjectLiteral(typeChecker3, parent2.parent);
}
return fromContextualType();
- case 212 /* ElementAccessExpression */: {
+ case 214 /* ElementAccessExpression */: {
const { expression, argumentExpression } = parent2;
if (node === skipParentheses(argumentExpression)) {
return stringLiteralCompletionsFromProperties(typeChecker3.getTypeAtLocation(expression));
}
return void 0;
}
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 294 /* JsxAttribute */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 297 /* JsxAttribute */:
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
- const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 294 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
+ const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 297 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker3) || fromContextualType();
}
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 286 /* ExternalModuleReference */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 289 /* ExternalModuleReference */:
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker3, preferences) };
default:
return fromContextualType();
@@ -141321,9 +141582,9 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
}
function walkUpParentheses(node) {
switch (node.kind) {
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return walkUpParenthesizedTypes(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return walkUpParenthesizedExpressions(node);
default:
return node;
@@ -141901,14 +142162,14 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
if (cancellationToken)
cancellationToken.throwIfCancellationRequested();
switch (direct.kind) {
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isImportCall(direct)) {
handleImportCall(direct);
break;
}
if (!isAvailableThroughGlobal) {
const parent2 = direct.parent;
- if (exportKind === 2 /* ExportEquals */ && parent2.kind === 261 /* VariableDeclaration */) {
+ if (exportKind === 2 /* ExportEquals */ && parent2.kind === 263 /* VariableDeclaration */) {
const { name } = parent2;
if (name.kind === 79 /* Identifier */) {
directImports.push(name);
@@ -141919,28 +142180,28 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
break;
case 79 /* Identifier */:
break;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
handleNamespaceImport(direct, direct.name, hasSyntacticModifier(direct, 1 /* Export */), false);
break;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
directImports.push(direct);
const namedBindings = direct.importClause && direct.importClause.namedBindings;
- if (namedBindings && namedBindings.kind === 277 /* NamespaceImport */) {
+ if (namedBindings && namedBindings.kind === 280 /* NamespaceImport */) {
handleNamespaceImport(direct, namedBindings.name, false, true);
} else if (!isAvailableThroughGlobal && isDefaultImport(direct)) {
addIndirectUser(getSourceFileLikeForImportDeclaration(direct));
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
if (!direct.exportClause) {
handleDirectImports(getContainingModuleSymbol(direct, checker));
- } else if (direct.exportClause.kind === 283 /* NamespaceExport */) {
+ } else if (direct.exportClause.kind === 286 /* NamespaceExport */) {
addIndirectUser(getSourceFileLikeForImportDeclaration(direct), true);
} else {
directImports.push(direct);
}
break;
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported2(direct)) {
addIndirectUser(direct.getSourceFile(), true);
}
@@ -141969,7 +142230,7 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
directImports.push(importDeclaration);
} else if (!isAvailableThroughGlobal) {
const sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration);
- Debug.assert(sourceFileLike.kind === 314 /* SourceFile */ || sourceFileLike.kind === 270 /* ModuleDeclaration */);
+ Debug.assert(sourceFileLike.kind === 317 /* SourceFile */ || sourceFileLike.kind === 273 /* ModuleDeclaration */);
if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) {
addIndirectUser(sourceFileLike, true);
} else {
@@ -142015,7 +142276,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
}
return { importSearches, singleReferences };
function handleImport(decl) {
- if (decl.kind === 274 /* ImportEqualsDeclaration */) {
+ if (decl.kind === 277 /* ImportEqualsDeclaration */) {
if (isExternalModuleImportEquals(decl)) {
handleNamespaceImportLike(decl.name);
}
@@ -142025,7 +142286,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
handleNamespaceImportLike(decl);
return;
}
- if (decl.kind === 205 /* ImportType */) {
+ if (decl.kind === 207 /* ImportType */) {
if (decl.qualifier) {
const firstIdentifier = getFirstIdentifier(decl.qualifier);
if (firstIdentifier.escapedText === symbolName(exportSymbol)) {
@@ -142039,7 +142300,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) {
return;
}
- if (decl.kind === 281 /* ExportDeclaration */) {
+ if (decl.kind === 284 /* ExportDeclaration */) {
if (decl.exportClause && isNamedExports(decl.exportClause)) {
searchForNamedImport(decl.exportClause);
}
@@ -142048,10 +142309,10 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
const { name, namedBindings } = decl.importClause || { name: void 0, namedBindings: void 0 };
if (namedBindings) {
switch (namedBindings.kind) {
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
handleNamespaceImportLike(namedBindings.name);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) {
searchForNamedImport(namedBindings);
}
@@ -142085,7 +142346,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
addSearch(name, checker.getSymbolAtLocation(name));
}
} else {
- const localSymbol = element.kind === 284 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name);
+ const localSymbol = element.kind === 287 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name);
addSearch(name, localSymbol);
}
}
@@ -142108,7 +142369,7 @@ function findModuleReferences(program, sourceFiles, searchModuleSymbol) {
const checker = program.getTypeChecker();
for (const referencingFile of sourceFiles) {
const searchSourceFile = searchModuleSymbol.valueDeclaration;
- if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 314 /* SourceFile */) {
+ if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 317 /* SourceFile */) {
for (const ref of referencingFile.referencedFiles) {
if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) {
refs.push({ kind: "reference", referencingFile, ref });
@@ -142150,7 +142411,7 @@ function getDirectImportsMap(sourceFiles, checker, cancellationToken) {
return map2;
}
function forEachPossibleImportOrExportStatement(sourceFileLike, action) {
- return forEach(sourceFileLike.kind === 314 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action));
+ return forEach(sourceFileLike.kind === 317 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action));
}
function forEachImport(sourceFile, action) {
if (sourceFile.externalModuleIndicator || sourceFile.imports !== void 0) {
@@ -142160,15 +142421,15 @@ function forEachImport(sourceFile, action) {
} else {
forEachPossibleImportOrExportStatement(sourceFile, (statement) => {
switch (statement.kind) {
- case 281 /* ExportDeclaration */:
- case 275 /* ImportDeclaration */: {
+ case 284 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */: {
const decl = statement;
if (decl.moduleSpecifier && isStringLiteral(decl.moduleSpecifier)) {
action(decl, decl.moduleSpecifier);
}
break;
}
- case 274 /* ImportEqualsDeclaration */: {
+ case 277 /* ImportEqualsDeclaration */: {
const decl = statement;
if (isExternalModuleImportEquals(decl)) {
action(decl, decl.moduleReference.expression);
@@ -142186,7 +142447,7 @@ function getImportOrExportSymbol(node, symbol, checker, comingFromExport) {
const { parent: parent2 } = node;
const grandparent = parent2.parent;
if (symbol.exportSymbol) {
- if (parent2.kind === 211 /* PropertyAccessExpression */) {
+ if (parent2.kind === 213 /* PropertyAccessExpression */) {
return ((_a2 = symbol.declarations) == null ? void 0 : _a2.some((d) => d === parent2)) && isBinaryExpression(grandparent) ? getSpecialPropertyExport(grandparent, false) : void 0;
} else {
return exportInfo(symbol.exportSymbol, getExportKindForDeclaration(parent2));
@@ -142290,15 +142551,15 @@ function getExportNode(parent2, node) {
function isNodeImport(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return parent2.name === node && isExternalModuleImportEquals(parent2);
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return !parent2.propertyName;
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
Debug.assert(parent2.name === node);
return true;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(parent2.parent.parent);
default:
return false;
@@ -142329,21 +142590,21 @@ function getContainingModuleSymbol(importer, checker) {
return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol);
}
function getSourceFileLikeForImportDeclaration(node) {
- if (node.kind === 213 /* CallExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
return node.getSourceFile();
}
const { parent: parent2 } = node;
- if (parent2.kind === 314 /* SourceFile */) {
+ if (parent2.kind === 317 /* SourceFile */) {
return parent2;
}
- Debug.assert(parent2.kind === 271 /* ModuleBlock */);
+ Debug.assert(parent2.kind === 274 /* ModuleBlock */);
return cast(parent2.parent, isAmbientModuleDeclaration);
}
function isAmbientModuleDeclaration(node) {
- return node.kind === 270 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */;
+ return node.kind === 273 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */;
}
function isExternalModuleImportEquals(eq) {
- return eq.moduleReference.kind === 286 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */;
+ return eq.moduleReference.kind === 289 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */;
}
// src/services/findAllReferences.ts
@@ -142413,28 +142674,28 @@ function getContextNode(node) {
if (!node)
return void 0;
switch (node.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return !isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : isVariableStatement(node.parent.parent) ? node.parent.parent : isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getContextNode(node.parent.parent);
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return node.parent.parent.parent;
- case 284 /* ExportSpecifier */:
- case 277 /* NamespaceImport */:
+ case 287 /* ExportSpecifier */:
+ case 280 /* NamespaceImport */:
return node.parent.parent;
- case 276 /* ImportClause */:
- case 283 /* NamespaceExport */:
+ case 279 /* ImportClause */:
+ case 286 /* NamespaceExport */:
return node.parent;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isExpressionStatement(node.parent) ? node.parent : node;
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
return {
start: node.initializer,
end: node.expression
};
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(
findAncestor(
node.parent,
@@ -142476,7 +142737,7 @@ function getImplementationsAtPosition(program, cancellationToken, sourceFiles, s
const node = getTouchingPropertyName(sourceFile, position);
let referenceEntries;
const entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position);
- if (node.parent.kind === 211 /* PropertyAccessExpression */ || node.parent.kind === 208 /* BindingElement */ || node.parent.kind === 212 /* ElementAccessExpression */ || node.kind === 107 /* SuperKeyword */) {
+ if (node.parent.kind === 213 /* PropertyAccessExpression */ || node.parent.kind === 210 /* BindingElement */ || node.parent.kind === 214 /* ElementAccessExpression */ || node.kind === 107 /* SuperKeyword */) {
referenceEntries = entries && [...entries];
} else if (entries) {
const queue = createQueue(entries);
@@ -142497,11 +142758,11 @@ function getImplementationsAtPosition(program, cancellationToken, sourceFiles, s
return map(referenceEntries, (entry) => toImplementationLocation(entry, checker));
}
function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return void 0;
}
const checker = program.getTypeChecker();
- if (node.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.parent.kind === 309 /* ShorthandPropertyAssignment */) {
const result = [];
Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, (node2) => result.push(nodeEntry(node2)));
return result;
@@ -142692,12 +142953,12 @@ function implementationKindDisplayParts(node, checker) {
const symbol = checker.getSymbolAtLocation(isDeclaration(node) && node.name ? node.name : node);
if (symbol) {
return getDefinitionKindAndDisplayParts(symbol, checker, node);
- } else if (node.kind === 210 /* ObjectLiteralExpression */) {
+ } else if (node.kind === 212 /* ObjectLiteralExpression */) {
return {
kind: "interface" /* interfaceElement */,
displayParts: [punctuationPart(20 /* OpenParenToken */), textPart("object literal"), punctuationPart(21 /* CloseParenToken */)]
};
- } else if (node.kind === 232 /* ClassExpression */) {
+ } else if (node.kind === 234 /* ClassExpression */) {
return {
kind: "local class" /* localClassElement */,
displayParts: [punctuationPart(20 /* OpenParenToken */), textPart("anonymous local class"), punctuationPart(21 /* CloseParenToken */)]
@@ -142755,47 +143016,47 @@ function declarationIsWriteAccess(decl) {
if (!!(decl.flags & 16777216 /* Ambient */))
return true;
switch (decl.kind) {
- case 227 /* BinaryExpression */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 229 /* BinaryExpression */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
case 89 /* DefaultKeyword */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 284 /* ExportSpecifier */:
- case 276 /* ImportClause */:
- case 274 /* ImportEqualsDeclaration */:
- case 279 /* ImportSpecifier */:
- case 267 /* InterfaceDeclaration */:
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
- case 294 /* JsxAttribute */:
- case 270 /* ModuleDeclaration */:
- case 273 /* NamespaceExportDeclaration */:
- case 277 /* NamespaceImport */:
- case 283 /* NamespaceExport */:
- case 168 /* Parameter */:
- case 306 /* ShorthandPropertyAssignment */:
- case 268 /* TypeAliasDeclaration */:
- case 167 /* TypeParameter */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 287 /* ExportSpecifier */:
+ case 279 /* ImportClause */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 282 /* ImportSpecifier */:
+ case 270 /* InterfaceDeclaration */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 297 /* JsxAttribute */:
+ case 273 /* ModuleDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
+ case 280 /* NamespaceImport */:
+ case 286 /* NamespaceExport */:
+ case 169 /* Parameter */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 271 /* TypeAliasDeclaration */:
+ case 168 /* TypeParameter */:
return true;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return !isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return !!decl.body;
- case 261 /* VariableDeclaration */:
- case 171 /* PropertyDeclaration */:
+ case 263 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
return !!decl.initializer || isCatchClause(decl.parent);
- case 173 /* MethodSignature */:
- case 170 /* PropertySignature */:
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */:
+ case 175 /* MethodSignature */:
+ case 171 /* PropertySignature */:
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
return false;
default:
return Debug.failBadSyntaxKind(decl);
@@ -142984,9 +143245,9 @@ var Core;
if (symbol.declarations) {
for (const decl of symbol.declarations) {
switch (decl.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (sourceFilesSet.has(decl.getSourceFile().fileName)) {
references.push(nodeEntry(decl.name));
}
@@ -143076,7 +143337,7 @@ var Core;
}
function getSpecialSearchKind(node) {
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
case 136 /* ConstructorKeyword */:
return SpecialSearchKind.Constructor;
case 79 /* Identifier */:
@@ -143252,7 +143513,7 @@ var Core;
}
function getSymbolScope(symbol) {
const { declarations, flags, parent: parent2, valueDeclaration } = symbol;
- if (valueDeclaration && (valueDeclaration.kind === 218 /* FunctionExpression */ || valueDeclaration.kind === 232 /* ClassExpression */)) {
+ if (valueDeclaration && (valueDeclaration.kind === 220 /* FunctionExpression */ || valueDeclaration.kind === 234 /* ClassExpression */)) {
return valueDeclaration;
}
if (!declarations) {
@@ -143261,7 +143522,7 @@ var Core;
if (flags & (4 /* Property */ | 8192 /* Method */)) {
const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d, 8 /* Private */) || isPrivateIdentifierClassElementDeclaration(d));
if (privateDeclaration) {
- return getAncestor(privateDeclaration, 264 /* ClassDeclaration */);
+ return getAncestor(privateDeclaration, 266 /* ClassDeclaration */);
}
return void 0;
}
@@ -143278,7 +143539,7 @@ var Core;
if (scope && scope !== container) {
return void 0;
}
- if (!container || container.kind === 314 /* SourceFile */ && !isExternalOrCommonJsModule(container)) {
+ if (!container || container.kind === 317 /* SourceFile */ && !isExternalOrCommonJsModule(container)) {
return void 0;
}
scope = container;
@@ -143485,7 +143746,7 @@ var Core;
default:
Debug.assertNever(state.specialSearchKind);
}
- if (isInJSFile(referenceLocation) && referenceLocation.parent.kind === 208 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(referenceLocation.parent.parent.parent)) {
+ if (isInJSFile(referenceLocation) && referenceLocation.parent.kind === 210 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(referenceLocation.parent.parent.parent)) {
referenceSymbol = referenceLocation.parent.symbol;
if (!referenceSymbol)
return;
@@ -143622,14 +143883,14 @@ var Core;
if (constructorSymbol && constructorSymbol.declarations) {
for (const decl of constructorSymbol.declarations) {
const ctrKeyword = findChildOfKind(decl, 136 /* ConstructorKeyword */, sourceFile);
- Debug.assert(decl.kind === 176 /* Constructor */ && !!ctrKeyword);
+ Debug.assert(decl.kind === 178 /* Constructor */ && !!ctrKeyword);
addNode(ctrKeyword);
}
}
if (classSymbol.exports) {
classSymbol.exports.forEach((member) => {
const decl = member.valueDeclaration;
- if (decl && decl.kind === 174 /* MethodDeclaration */) {
+ if (decl && decl.kind === 176 /* MethodDeclaration */) {
const body = decl.body;
if (body) {
forEachDescendantOfKind(body, 109 /* ThisKeyword */, (thisKeyword) => {
@@ -143651,7 +143912,7 @@ var Core;
return;
}
for (const decl of constructor.declarations) {
- Debug.assert(decl.kind === 176 /* Constructor */);
+ Debug.assert(decl.kind === 178 /* Constructor */);
const body = decl.body;
if (body) {
forEachDescendantOfKind(body, 107 /* SuperKeyword */, (node) => {
@@ -143680,7 +143941,7 @@ var Core;
if (refNode.kind !== 79 /* Identifier */) {
return;
}
- if (refNode.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (refNode.parent.kind === 309 /* ShorthandPropertyAssignment */) {
getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2);
}
const containingClass = getContainingClassIfInHeritageClause(refNode);
@@ -143695,7 +143956,7 @@ var Core;
addIfImplementation(typeHavingNode.initializer);
} else if (isFunctionLike(typeHavingNode) && typeHavingNode.body) {
const body = typeHavingNode.body;
- if (body.kind === 242 /* Block */) {
+ if (body.kind === 244 /* Block */) {
forEachReturnStatement(body, (returnStatement) => {
if (returnStatement.expression)
addIfImplementation(returnStatement.expression);
@@ -143717,13 +143978,13 @@ var Core;
}
function isImplementationExpression(node) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isImplementationExpression(node.expression);
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 232 /* ClassExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 234 /* ClassExpression */:
+ case 211 /* ArrayLiteralExpression */:
return true;
default:
return false;
@@ -143753,13 +144014,13 @@ var Core;
}
let staticFlag = 32 /* Static */;
switch (searchSpaceNode.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
staticFlag &= getSyntacticModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
@@ -143777,38 +144038,38 @@ var Core;
return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references }];
}
function isParameterName(node) {
- return node.kind === 79 /* Identifier */ && node.parent.kind === 168 /* Parameter */ && node.parent.name === node;
+ return node.kind === 79 /* Identifier */ && node.parent.kind === 169 /* Parameter */ && node.parent.name === node;
}
function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) {
let searchSpaceNode = getThisContainer(thisOrSuperKeyword, false);
let staticFlag = 32 /* Static */;
switch (searchSpaceNode.kind) {
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isObjectLiteralMethod(searchSpaceNode)) {
staticFlag &= getSyntacticModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
}
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
staticFlag &= getSyntacticModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) {
return void 0;
}
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
break;
default:
return void 0;
}
- const references = flatMap(searchSpaceNode.kind === 314 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => {
+ const references = flatMap(searchSpaceNode.kind === 317 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => {
cancellationToken.throwIfCancellationRequested();
return getPossibleSymbolReferenceNodes(sourceFile, "this", isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter((node) => {
if (!isThis(node)) {
@@ -143816,19 +144077,19 @@ var Core;
}
const container = getThisContainer(node, false);
switch (searchSpaceNode.kind) {
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
return searchSpaceNode.symbol === container.symbol;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol;
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 210 /* ObjectLiteralExpression */:
- case 265 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 212 /* ObjectLiteralExpression */:
+ case 267 /* StructDeclaration */:
return container.parent && searchSpaceNode.symbol === container.parent.symbol && isStatic(container) === !!staticFlag;
- case 314 /* SourceFile */:
- return container.kind === 314 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node);
+ case 317 /* SourceFile */:
+ return container.kind === 317 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node);
}
});
}).map((n) => nodeEntry(n));
@@ -143916,7 +144177,7 @@ var Core;
Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */));
return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]);
}
- const exportSpecifier = getDeclarationOfKind(symbol, 284 /* ExportSpecifier */);
+ const exportSpecifier = getDeclarationOfKind(symbol, 287 /* ExportSpecifier */);
if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) {
const localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier);
if (localSymbol) {
@@ -143944,7 +144205,7 @@ var Core;
return firstDefined(checker.getRootSymbols(sym), (rootSymbol) => cbSymbol(sym, rootSymbol, void 0, kind) || (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */) && allowBaseTypes(rootSymbol) ? getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, (base) => cbSymbol(sym, rootSymbol, base, kind)) : void 0));
}
function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol2, checker2) {
- const bindingElement = getDeclarationOfKind(symbol2, 208 /* BindingElement */);
+ const bindingElement = getDeclarationOfKind(symbol2, 210 /* BindingElement */);
if (bindingElement && isObjectBindingElementWithoutPropertyName(bindingElement)) {
return getPropertySymbolFromBindingElement(checker2, bindingElement);
}
@@ -144122,9 +144383,9 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
}
if (searchOtherFilesOnly && every(symbol.declarations, (d) => d.getSourceFile().fileName === sourceFile.fileName))
return void 0;
- if (parent2.kind === 213 /* CallExpression */ || parent2.kind === 220 /* EtsComponentExpression */ && isCalledStructDeclaration(symbol.getDeclarations())) {
+ if (parent2.kind === 215 /* CallExpression */ || parent2.kind === 222 /* EtsComponentExpression */ && isCalledStructDeclaration(symbol.getDeclarations())) {
const declarations = symbol.getDeclarations();
- if ((declarations == null ? void 0 : declarations.length) && declarations[0].kind === 265 /* StructDeclaration */) {
+ if ((declarations == null ? void 0 : declarations.length) && declarations[0].kind === 267 /* StructDeclaration */) {
return getDefinitionFromSymbol(typeChecker3, symbol, node);
}
}
@@ -144144,7 +144405,7 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
return node.kind === 107 /* SuperKeyword */ ? [sigInfo, ...defs] : [...defs, sigInfo];
}
}
- if (node.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.parent.kind === 309 /* ShorthandPropertyAssignment */) {
const shorthandSymbol = typeChecker3.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
const definitions = (shorthandSymbol == null ? void 0 : shorthandSymbol.declarations) ? shorthandSymbol.declarations.map((decl) => createDefinitionInfo(decl, typeChecker3, shorthandSymbol, node, false, failedAliasResolution)) : emptyArray;
return concatenate(definitions, getDefinitionFromObjectLiteralElement(typeChecker3, node) || emptyArray);
@@ -144292,7 +144553,7 @@ function shouldSkipAlias(node, declaration) {
if (node.parent === declaration) {
return true;
}
- if (declaration.kind === 277 /* NamespaceImport */) {
+ if (declaration.kind === 280 /* NamespaceImport */) {
return false;
}
return true;
@@ -144370,19 +144631,19 @@ function isDefinitionVisible(checker, declaration) {
if (hasInitializer(declaration.parent) && declaration.parent.initializer === declaration)
return isDefinitionVisible(checker, declaration.parent);
switch (declaration.kind) {
- case 171 /* PropertyDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
if (hasEffectiveModifier(declaration, 8 /* Private */))
return false;
- case 176 /* Constructor */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 210 /* ObjectLiteralExpression */:
- case 232 /* ClassExpression */:
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 212 /* ObjectLiteralExpression */:
+ case 234 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
return isDefinitionVisible(checker, declaration.parent);
default:
return false;
@@ -144417,9 +144678,9 @@ function tryGetSignatureDeclaration(typeChecker3, node) {
}
function isConstructorLike(node) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 178 /* Constructor */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
return true;
default:
return false;
@@ -144456,14 +144717,14 @@ function provideInlayHints(context) {
return;
}
switch (node.kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 219 /* ArrowFunction */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
if (!textSpanIntersectsWith(span, node.pos, node.getFullWidth())) {
@@ -144603,7 +144864,7 @@ function provideInlayHints(context) {
}
function isHintableLiteral(node) {
switch (node.kind) {
- case 225 /* PrefixUnaryExpression */: {
+ case 227 /* PrefixUnaryExpression */: {
const operand = node.operand;
return isLiteralExpression(operand) || isIdentifier(operand) && isInfinityOrNaNString(operand.escapedText);
}
@@ -144611,7 +144872,7 @@ function provideInlayHints(context) {
case 96 /* FalseKeyword */:
case 105 /* NullKeyword */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return true;
case 79 /* Identifier */: {
const name = node.escapedText;
@@ -144811,8 +145072,8 @@ function getJsDocCommentsFromDeclarations(declarations, checker) {
const parts = [];
forEachUnique(declarations, (declaration) => {
for (const jsdoc of getCommentHavingNodes(declaration)) {
- const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 336 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc"));
- if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 354 /* JSDocTypedefTag */ && declaration.kind !== 347 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 354 /* JSDocTypedefTag */ || t.kind === 347 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 349 /* JSDocParameterTag */ || t.kind === 350 /* JSDocReturnTag */)) {
+ const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 339 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc"));
+ if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 357 /* JSDocTypedefTag */ && declaration.kind !== 350 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 357 /* JSDocTypedefTag */ || t.kind === 350 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 352 /* JSDocParameterTag */ || t.kind === 353 /* JSDocReturnTag */)) {
continue;
}
let newparts = jsdoc.comment ? getDisplayPartsFromComment(jsdoc.comment, checker) : [];
@@ -144831,11 +145092,11 @@ function isIdenticalListOfDisplayParts(parts1, parts2) {
}
function getCommentHavingNodes(declaration) {
switch (declaration.kind) {
- case 349 /* JSDocParameterTag */:
- case 356 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
+ case 359 /* JSDocPropertyTag */:
return [declaration];
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
return [declaration, declaration.parent];
default:
return getJSDocCommentsAndTags(declaration);
@@ -144845,7 +145106,7 @@ function getJsDocTagsFromDeclarations(declarations, checker) {
const infos = [];
forEachUnique(declarations, (declaration) => {
const tags = getJSDocTags(declaration);
- if (tags.some((t) => t.kind === 354 /* JSDocTypedefTag */ || t.kind === 347 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 349 /* JSDocParameterTag */ || t.kind === 350 /* JSDocReturnTag */)) {
+ if (tags.some((t) => t.kind === 357 /* JSDocTypedefTag */ || t.kind === 350 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 352 /* JSDocParameterTag */ || t.kind === 353 /* JSDocReturnTag */)) {
return;
}
for (const tag of tags) {
@@ -144860,18 +145121,18 @@ function getDisplayPartsFromComment(comment, checker) {
}
return flatMap(
comment,
- (node) => node.kind === 330 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker)
+ (node) => node.kind === 333 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker)
);
}
function getCommentDisplayParts(tag, checker) {
const { comment, kind } = tag;
const namePart = getTagNameDisplayPart(kind);
switch (kind) {
- case 338 /* JSDocImplementsTag */:
+ case 341 /* JSDocImplementsTag */:
return withNode(tag.class);
- case 337 /* JSDocAugmentsTag */:
+ case 340 /* JSDocAugmentsTag */:
return withNode(tag.class);
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
const templateTag = tag;
const displayParts = [];
if (templateTag.constraint) {
@@ -144893,13 +145154,13 @@ function getCommentDisplayParts(tag, checker) {
displayParts.push(...[spacePart(), ...getDisplayPartsFromComment(comment, checker)]);
}
return displayParts;
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return withNode(tag.typeExpression);
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */:
- case 355 /* JSDocSeeTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
+ case 358 /* JSDocSeeTag */:
const { name } = tag;
return name ? withNode(name) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker);
default:
@@ -144922,14 +145183,14 @@ function getCommentDisplayParts(tag, checker) {
}
function getTagNameDisplayPart(kind) {
switch (kind) {
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
return parameterNamePart;
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
return propertyNamePart;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return typeParameterNamePart;
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
return typeAliasNamePart;
default:
return textPart;
@@ -145054,47 +145315,47 @@ function getCommentOwnerInfo(tokenAtPos, options) {
}
function getCommentOwnerInfoWorker(commentOwner, options) {
switch (commentOwner.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 173 /* MethodSignature */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 175 /* MethodSignature */:
+ case 221 /* ArrowFunction */:
const host = commentOwner;
return { commentOwner, parameters: host.parameters, hasReturn: hasReturn(host, options) };
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getCommentOwnerInfoWorker(commentOwner.initializer, options);
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 268 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 271 /* TypeAliasDeclaration */:
return { commentOwner };
- case 170 /* PropertySignature */: {
+ case 171 /* PropertySignature */: {
const host2 = commentOwner;
return host2.type && isFunctionTypeNode(host2.type) ? { commentOwner, parameters: host2.type.parameters, hasReturn: hasReturn(host2.type, options) } : { commentOwner };
}
- case 244 /* VariableStatement */: {
+ case 246 /* VariableStatement */: {
const varStatement = commentOwner;
const varDeclarations = varStatement.declarationList.declarations;
const host2 = varDeclarations.length === 1 && varDeclarations[0].initializer ? getRightHandSideOfAssignment(varDeclarations[0].initializer) : void 0;
return host2 ? { commentOwner, parameters: host2.parameters, hasReturn: hasReturn(host2, options) } : { commentOwner };
}
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return "quit";
- case 270 /* ModuleDeclaration */:
- return commentOwner.parent.kind === 270 /* ModuleDeclaration */ ? void 0 : { commentOwner };
- case 245 /* ExpressionStatement */:
+ case 273 /* ModuleDeclaration */:
+ return commentOwner.parent.kind === 273 /* ModuleDeclaration */ ? void 0 : { commentOwner };
+ case 247 /* ExpressionStatement */:
return getCommentOwnerInfoWorker(commentOwner.expression, options);
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const be = commentOwner;
if (getAssignmentDeclarationKind(be) === 0 /* None */) {
return "quit";
}
return isFunctionLike(be.right) ? { commentOwner, parameters: be.right.parameters, hasReturn: hasReturn(be.right, options) } : { commentOwner };
}
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
const init = commentOwner.initializer;
if (init && (isFunctionExpression(init) || isArrowFunction(init))) {
return { commentOwner, parameters: init.parameters, hasReturn: hasReturn(init, options) };
@@ -145105,14 +145366,14 @@ function hasReturn(node, options) {
return !!(options == null ? void 0 : options.generateReturnInDocTemplate) && (isFunctionTypeNode(node) || isArrowFunction(node) && isExpression(node.body) || isFunctionLikeDeclaration(node) && node.body && isBlock(node.body) && !!forEachReturnStatement(node.body, (n) => n));
}
function getRightHandSideOfAssignment(rightHandSide) {
- while (rightHandSide.kind === 217 /* ParenthesizedExpression */) {
+ while (rightHandSide.kind === 219 /* ParenthesizedExpression */) {
rightHandSide = rightHandSide.expression;
}
switch (rightHandSide.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return rightHandSide;
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return find(rightHandSide.members, isConstructorDeclaration);
}
}
@@ -145436,11 +145697,11 @@ function compareIdentifiers(s1, s2) {
function getModuleSpecifierExpression(declaration) {
var _a2;
switch (declaration.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return (_a2 = tryCast(declaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return declaration.moduleSpecifier;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return declaration.declarationList.declarations[0].initializer.arguments[0];
}
}
@@ -145467,19 +145728,19 @@ function compareImportKind(s1, s2) {
function getImportKindOrder(s1) {
var _a2;
switch (s1.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
if (!s1.importClause)
return 0;
if (s1.importClause.isTypeOnly)
return 1;
- if (((_a2 = s1.importClause.namedBindings) == null ? void 0 : _a2.kind) === 277 /* NamespaceImport */)
+ if (((_a2 = s1.importClause.namedBindings) == null ? void 0 : _a2.kind) === 280 /* NamespaceImport */)
return 2;
if (s1.importClause.name)
return 3;
return 4;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return 5;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return 6;
}
}
@@ -145653,21 +145914,21 @@ function createOutliningSpanFromBounds(pos, end, kind) {
}
function getOutliningSpanForNode(n, sourceFile) {
switch (n.kind) {
- case 242 /* Block */:
+ case 244 /* Block */:
if (isFunctionLike(n.parent)) {
return functionSpan(n.parent, n, sourceFile);
}
switch (n.parent.kind) {
- case 247 /* DoStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 249 /* ForStatement */:
- case 246 /* IfStatement */:
- case 248 /* WhileStatement */:
- case 255 /* WithStatement */:
- case 301 /* CatchClause */:
+ case 249 /* DoStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 248 /* IfStatement */:
+ case 250 /* WhileStatement */:
+ case 257 /* WithStatement */:
+ case 304 /* CatchClause */:
return spanForNode(n.parent);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
const tryStatement = n.parent;
if (tryStatement.tryBlock === n) {
return spanForNode(n.parent);
@@ -145679,43 +145940,43 @@ function getOutliningSpanForNode(n, sourceFile) {
default:
return createOutliningSpan(createTextSpanFromNode(n, sourceFile), "code" /* Code */);
}
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return spanForNode(n.parent);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 272 /* CaseBlock */:
- case 187 /* TypeLiteral */:
- case 206 /* ObjectBindingPattern */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 275 /* CaseBlock */:
+ case 189 /* TypeLiteral */:
+ case 208 /* ObjectBindingPattern */:
return spanForNode(n);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
return spanForNode(n, false, !isTupleTypeNode(n.parent), 22 /* OpenBracketToken */);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return spanForNodeArray(n.statements);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return spanForObjectOrArrayLiteral(n);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */);
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return spanForJSXElement(n);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return spanForJSXFragment(n);
- case 288 /* JsxSelfClosingElement */:
- case 289 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
return spanForJSXAttributes(n.attributes);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
case 14 /* NoSubstitutionTemplateLiteral */:
return spanForTemplateLiteral(n);
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return spanForNode(n, false, !isBindingElement(n.parent), 22 /* OpenBracketToken */);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return spanForArrowFunction(n);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return spanForCallExpression(n);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return spanForParenthesizedExpression(n);
}
function spanForCallExpression(node) {
@@ -145780,7 +146041,7 @@ function getOutliningSpanForNode(n, sourceFile) {
function functionSpan(node, body, sourceFile) {
const openToken = tryGetFunctionOpenToken(node, body, sourceFile);
const closeToken = findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile);
- return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, node.kind !== 219 /* ArrowFunction */);
+ return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, node.kind !== 221 /* ArrowFunction */);
}
function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse = false, useFullStart = true) {
const textSpan = createTextSpanFromBounds(useFullStart ? openToken.getFullStart() : openToken.getStart(sourceFile), closeToken.getEnd());
@@ -145894,18 +146155,18 @@ function getInfo19(context, considerPartialSpans = true) {
}
const noSymbolError = (id) => isIdentifier(id) && checker.getSymbolAtLocation(id) ? void 0 : { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_named_export) };
switch (exportNode.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 270 /* ModuleDeclaration */: {
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 273 /* ModuleDeclaration */: {
const node = exportNode;
if (!node.name)
return void 0;
return noSymbolError(node.name) || { exportNode: node, exportName: node.name, wasDefault, exportingModuleSymbol };
}
- case 244 /* VariableStatement */: {
+ case 246 /* VariableStatement */: {
const vs = exportNode;
if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) {
return void 0;
@@ -145916,7 +146177,7 @@ function getInfo19(context, considerPartialSpans = true) {
Debug.assert(!wasDefault, "Can't have a default flag here");
return noSymbolError(decl.name) || { exportNode: vs, exportName: decl.name, wasDefault, exportingModuleSymbol };
}
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
const node = exportNode;
if (node.isExportEquals)
return void 0;
@@ -145942,20 +146203,20 @@ function changeExport(exportingSourceFile, { wasDefault, exportNode, exportName
} else {
const exportKeyword = Debug.checkDefined(findModifier(exportNode, 94 /* ExportKeyword */), "Should find an export keyword in modifier list");
switch (exportNode.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
changes.insertNodeAfter(exportingSourceFile, exportKeyword, factory.createToken(89 /* DefaultKeyword */));
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
const decl = first(exportNode.declarationList.declarations);
if (!ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) {
changes.replaceNode(exportingSourceFile, exportNode, factory.createExportDefault(Debug.checkDefined(decl.initializer, "Initializer was previously known to be present")));
break;
}
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 273 /* ModuleDeclaration */:
changes.deleteModifier(exportingSourceFile, exportKeyword);
changes.insertNodeAfter(exportingSourceFile, exportNode, factory.createExportDefault(factory.createIdentifier(exportName.text)));
break;
@@ -145981,23 +146242,23 @@ function changeImports(program, { wasDefault, exportName, exportingModuleSymbol
function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) {
const { parent: parent2 } = ref;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
changes.replaceNode(importingSourceFile, ref, factory.createIdentifier(exportName));
break;
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */: {
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */: {
const spec = parent2;
changes.replaceNode(importingSourceFile, spec, makeImportSpecifier2(exportName, spec.name.text));
break;
}
- case 276 /* ImportClause */: {
+ case 279 /* ImportClause */: {
const clause = parent2;
Debug.assert(clause.name === ref, "Import clause name should match provided ref");
const spec = makeImportSpecifier2(exportName, ref.text);
const { namedBindings } = clause;
if (!namedBindings) {
changes.replaceNode(importingSourceFile, ref, factory.createNamedImports([spec]));
- } else if (namedBindings.kind === 277 /* NamespaceImport */) {
+ } else if (namedBindings.kind === 280 /* NamespaceImport */) {
changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) });
const quotePreference = isStringLiteral(clause.parent.moduleSpecifier) ? quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */;
const newImport = makeImport(void 0, [makeImportSpecifier2(exportName, ref.text)], clause.parent.moduleSpecifier, quotePreference);
@@ -146008,7 +146269,7 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam
}
break;
}
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
const importTypeNode = parent2;
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.assertions, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf));
break;
@@ -146019,10 +146280,10 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam
function changeNamedToDefaultImport(importingSourceFile, ref, changes) {
const parent2 = ref.parent;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
changes.replaceNode(importingSourceFile, ref, factory.createIdentifier("default"));
break;
- case 279 /* ImportSpecifier */: {
+ case 282 /* ImportSpecifier */: {
const defaultImport = factory.createIdentifier(parent2.name.text);
if (parent2.parent.elements.length === 1) {
changes.replaceNode(importingSourceFile, parent2.parent, defaultImport);
@@ -146032,7 +146293,7 @@ function changeNamedToDefaultImport(importingSourceFile, ref, changes) {
}
break;
}
- case 284 /* ExportSpecifier */: {
+ case 287 /* ExportSpecifier */: {
changes.replaceNode(importingSourceFile, parent2, makeExportSpecifier("default", parent2.name.text));
break;
}
@@ -146122,7 +146383,7 @@ function getImportConversionInfo(context, considerPartialSpans = true) {
if (!importClause.namedBindings) {
return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_namespace_import_or_named_imports) };
}
- if (importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (importClause.namedBindings.kind === 280 /* NamespaceImport */) {
return { convertTo: 0 /* Named */, import: importClause.namedBindings };
}
const shouldUseDefault = getShouldUseDefault(context.program, importClause);
@@ -146543,11 +146804,11 @@ function isAllowedStatementToMove(statement) {
}
function isPureImport(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return true;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return !hasSyntacticModifier(node, 1 /* Export */);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return node.declarationList.declarations.every((d) => !!d.initializer && isRequireCall(d.initializer, true));
default:
return false;
@@ -146636,11 +146897,11 @@ function updateImportsInOtherFiles(changes, program, oldFile, movedSymbols, newM
}
function getNamespaceLikeImport(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 277 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0;
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 280 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0;
+ case 277 /* ImportEqualsDeclaration */:
return node.name;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return tryCast(node.name, isIdentifier);
default:
return Debug.assertNever(node, `Unexpected node kind ${node.kind}`);
@@ -146670,23 +146931,23 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie
const newNamespaceId = factory.createIdentifier(newNamespaceName);
const newModuleString = factory.createStringLiteral(newModuleSpecifier);
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return factory.createImportDeclaration(
void 0,
factory.createImportClause(false, void 0, factory.createNamespaceImport(newNamespaceId)),
newModuleString,
void 0
);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return factory.createImportEqualsDeclaration(void 0, false, newNamespaceId, factory.createExternalModuleReference(newModuleString));
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return factory.createVariableDeclaration(newNamespaceId, void 0, void 0, createRequireCall(newModuleString));
default:
return Debug.assertNever(node, `Unexpected node kind ${node.kind}`);
}
}
function moduleSpecifierFromImport(i) {
- return i.kind === 275 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 274 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0];
+ return i.kind === 278 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 277 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0];
}
function forEachImportInStatement(statement, cb) {
if (isImportDeclaration(statement)) {
@@ -146745,15 +147006,15 @@ function addExports(sourceFile, toMove, needExport, useEs6Exports) {
}
function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) {
switch (importDecl.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused);
break;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
if (isUnused(importDecl.name)) {
changes.delete(sourceFile, importDecl);
}
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused);
break;
default:
@@ -146765,7 +147026,7 @@ function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnu
return;
const { name, namedBindings } = importDecl.importClause;
const defaultUnused = !name || isUnused(name);
- const namedBindingsUnused = !namedBindings || (namedBindings.kind === 277 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name)));
+ const namedBindingsUnused = !namedBindings || (namedBindings.kind === 280 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name)));
if (defaultUnused && namedBindingsUnused) {
changes.delete(sourceFile, importDecl);
} else {
@@ -146779,7 +147040,7 @@ function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnu
importDecl.importClause,
factory.updateImportClause(importDecl.importClause, importDecl.importClause.isTypeOnly, name, void 0)
);
- } else if (namedBindings.kind === 278 /* NamedImports */) {
+ } else if (namedBindings.kind === 281 /* NamedImports */) {
for (const element of namedBindings.elements) {
if (isUnused(element.name))
changes.delete(sourceFile, element);
@@ -146803,9 +147064,9 @@ function deleteUnusedImportsInVariableDeclaration(sourceFile, varDecl, changes,
}
}
break;
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
break;
- case 206 /* ObjectBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
if (name.elements.every((e) => isIdentifier(e.name) && isUnused(e.name))) {
changes.delete(
sourceFile,
@@ -146920,14 +147181,14 @@ function getUsageInfo(oldFile, toMove, checker) {
}
function isInImport(decl) {
switch (decl.kind) {
- case 274 /* ImportEqualsDeclaration */:
- case 279 /* ImportSpecifier */:
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 282 /* ImportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
return true;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return isVariableDeclarationInImport(decl);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent);
default:
return false;
@@ -146938,7 +147199,7 @@ function isVariableDeclarationInImport(decl) {
}
function filterImport(i, moduleSpecifier, keep) {
switch (i.kind) {
- case 275 /* ImportDeclaration */: {
+ case 278 /* ImportDeclaration */: {
const clause = i.importClause;
if (!clause)
return void 0;
@@ -146946,9 +147207,9 @@ function filterImport(i, moduleSpecifier, keep) {
const namedBindings = clause.namedBindings && filterNamedBindings(clause.namedBindings, keep);
return defaultImport || namedBindings ? factory.createImportDeclaration(void 0, factory.createImportClause(false, defaultImport, namedBindings), moduleSpecifier, void 0) : void 0;
}
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return keep(i.name) ? i : void 0;
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
const name = filterBindingName(i.name, keep);
return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : void 0;
}
@@ -146957,7 +147218,7 @@ function filterImport(i, moduleSpecifier, keep) {
}
}
function filterNamedBindings(namedBindings, keep) {
- if (namedBindings.kind === 277 /* NamespaceImport */) {
+ if (namedBindings.kind === 280 /* NamespaceImport */) {
return keep(namedBindings.name) ? namedBindings : void 0;
} else {
const newElements = namedBindings.elements.filter((e) => keep(e.name));
@@ -146968,9 +147229,9 @@ function filterBindingName(name, keep) {
switch (name.kind) {
case 79 /* Identifier */:
return keep(name) ? name : void 0;
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return name;
- case 206 /* ObjectBindingPattern */: {
+ case 208 /* ObjectBindingPattern */: {
const newElements = name.elements.filter((prop) => prop.propertyName || !isIdentifier(prop.name) || keep(prop.name));
return newElements.length ? factory.createObjectBindingPattern(newElements) : void 0;
}
@@ -147027,13 +147288,13 @@ function isTopLevelDeclarationStatement(node) {
}
function isNonVariableTopLevelDeclaration(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return true;
default:
return false;
@@ -147041,17 +147302,17 @@ function isNonVariableTopLevelDeclaration(node) {
}
function forEachTopLevelDeclaration(statement, cb) {
switch (statement.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return cb(statement);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return firstDefined(statement.declarationList.declarations, (decl) => forEachTopLevelDeclarationInBindingName(decl.name, cb));
- case 245 /* ExpressionStatement */: {
+ case 247 /* ExpressionStatement */: {
const { expression } = statement;
return isBinaryExpression(expression) && getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) : void 0;
}
@@ -147061,8 +147322,8 @@ function forEachTopLevelDeclarationInBindingName(name, cb) {
switch (name.kind) {
case 79 /* Identifier */:
return cb(cast(name.parent, (x) => isVariableDeclaration(x) || isBindingElement(x)));
- case 207 /* ArrayBindingPattern */:
- case 206 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
return firstDefined(name.elements, (em) => isOmittedExpression(em) ? void 0 : forEachTopLevelDeclarationInBindingName(em.name, cb));
default:
return Debug.assertNever(name, `Unexpected name kind ${name.kind}`);
@@ -147073,9 +147334,9 @@ function nameOfTopLevelDeclaration(d) {
}
function getTopLevelDeclarationStatement(d) {
switch (d.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return d.parent.parent;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getTopLevelDeclarationStatement(
cast(d.parent.parent, (p) => isVariableDeclaration(p) || isBindingElement(p))
);
@@ -147108,24 +147369,24 @@ function addExport(decl, useEs6Exports) {
function addEs6Export(d) {
const modifiers = canHaveModifiers(d) ? concatenate([factory.createModifier(94 /* ExportKeyword */)], getModifiers(d)) : void 0;
switch (d.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return factory.updateFunctionDeclaration(d, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const decorators = canHaveDecorators(d) ? getDecorators(d) : void 0;
return factory.updateClassDeclaration(d, concatenate(decorators, modifiers), d.name, d.typeParameters, d.heritageClauses, d.members);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return factory.updateVariableStatement(d, modifiers, d.declarationList);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return factory.updateModuleDeclaration(d, modifiers, d.name, d.body);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return factory.updateEnumDeclaration(d, modifiers, d.name, d.members);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return factory.updateTypeAliasDeclaration(d, modifiers, d.name, d.typeParameters, d.type);
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return factory.updateInterfaceDeclaration(d, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return factory.updateImportEqualsDeclaration(d, modifiers, d.isTypeOnly, d.name, d.moduleReference);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return Debug.fail();
default:
return Debug.assertNever(d, `Unexpected declaration kind ${d.kind}`);
@@ -147136,18 +147397,18 @@ function addCommonjsExport(decl) {
}
function getNamesToExportInCommonJS(decl) {
switch (decl.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
return [decl.name.text];
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return mapDefined(decl.declarationList.declarations, (d) => isIdentifier(d.name) ? d.name.text : void 0);
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return emptyArray;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return Debug.fail("Can't export an ExpressionStatement");
default:
return Debug.assertNever(decl, `Unexpected decl kind ${decl.kind}`);
@@ -147199,7 +147460,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
const lastDeclaration = signatureDecls[signatureDecls.length - 1];
let updated = lastDeclaration;
switch (lastDeclaration.kind) {
- case 173 /* MethodSignature */: {
+ case 175 /* MethodSignature */: {
updated = factory.updateMethodSignature(
lastDeclaration,
lastDeclaration.modifiers,
@@ -147211,7 +147472,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 174 /* MethodDeclaration */: {
+ case 176 /* MethodDeclaration */: {
updated = factory.updateMethodDeclaration(
lastDeclaration,
lastDeclaration.modifiers,
@@ -147225,7 +147486,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 179 /* CallSignature */: {
+ case 181 /* CallSignature */: {
updated = factory.updateCallSignature(
lastDeclaration,
lastDeclaration.typeParameters,
@@ -147234,7 +147495,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 176 /* Constructor */: {
+ case 178 /* Constructor */: {
updated = factory.updateConstructorDeclaration(
lastDeclaration,
lastDeclaration.modifiers,
@@ -147243,7 +147504,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 180 /* ConstructSignature */: {
+ case 182 /* ConstructSignature */: {
updated = factory.updateConstructSignature(
lastDeclaration,
lastDeclaration.typeParameters,
@@ -147252,7 +147513,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 263 /* FunctionDeclaration */: {
+ case 265 /* FunctionDeclaration */: {
updated = factory.updateFunctionDeclaration(
lastDeclaration,
lastDeclaration.modifiers,
@@ -147323,12 +147584,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
}
function isConvertableSignatureDeclaration(d) {
switch (d.kind) {
- case 173 /* MethodSignature */:
- case 174 /* MethodDeclaration */:
- case 179 /* CallSignature */:
- case 176 /* Constructor */:
- case 180 /* ConstructSignature */:
- case 263 /* FunctionDeclaration */:
+ case 175 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 181 /* CallSignature */:
+ case 178 /* Constructor */:
+ case 182 /* ConstructSignature */:
+ case 265 /* FunctionDeclaration */:
return true;
}
return false;
@@ -147875,14 +148136,14 @@ function entryToFunctionCall(entry) {
const functionReference = entry.node;
const parent2 = functionReference.parent;
switch (parent2.kind) {
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
const callOrNewExpression = tryCast(parent2, isCallOrNewExpression);
if (callOrNewExpression && callOrNewExpression.expression === functionReference) {
return callOrNewExpression;
}
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression);
if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) {
const callOrNewExpression2 = tryCast(propertyAccessExpression.parent, isCallOrNewExpression);
@@ -147891,7 +148152,7 @@ function entryToFunctionCall(entry) {
}
}
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const elementAccessExpression = tryCast(parent2, isElementAccessExpression);
if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) {
const callOrNewExpression2 = tryCast(elementAccessExpression.parent, isCallOrNewExpression);
@@ -147909,13 +148170,13 @@ function entryToAccessExpression(entry) {
const reference = entry.node;
const parent2 = reference.parent;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression);
if (propertyAccessExpression && propertyAccessExpression.expression === reference) {
return propertyAccessExpression;
}
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const elementAccessExpression = tryCast(parent2, isElementAccessExpression);
if (elementAccessExpression && elementAccessExpression.expression === reference) {
return elementAccessExpression;
@@ -147957,22 +148218,22 @@ function isValidFunctionDeclaration(functionDeclaration, checker) {
if (!isValidParameterNodeArray(functionDeclaration.parameters, checker))
return false;
switch (functionDeclaration.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
if (isObjectLiteralExpression(functionDeclaration.parent)) {
const contextualSymbol = getSymbolForContextualType(functionDeclaration.name, checker);
return ((_a2 = contextualSymbol == null ? void 0 : contextualSymbol.declarations) == null ? void 0 : _a2.length) === 1 && isSingleImplementation(functionDeclaration, checker);
}
return isSingleImplementation(functionDeclaration, checker);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
if (isClassDeclaration(functionDeclaration.parent)) {
return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker);
} else {
return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker);
}
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return isValidVariableDeclaration(functionDeclaration.parent);
}
return false;
@@ -148132,7 +148393,7 @@ function getParameterName(paramDeclaration) {
}
function getClassNames(constructorDeclaration) {
switch (constructorDeclaration.parent.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const classDeclaration = constructorDeclaration.parent;
if (classDeclaration.name)
return [classDeclaration.name];
@@ -148141,7 +148402,7 @@ function getClassNames(constructorDeclaration) {
"Nameless class declaration should be a default export"
);
return [defaultModifier];
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
const classExpression = constructorDeclaration.parent;
const variableDeclaration = constructorDeclaration.parent.parent;
const className = classExpression.name;
@@ -148152,7 +148413,7 @@ function getClassNames(constructorDeclaration) {
}
function getFunctionNames(functionDeclaration) {
switch (functionDeclaration.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (functionDeclaration.name)
return [functionDeclaration.name];
const defaultModifier = Debug.checkDefined(
@@ -148160,21 +148421,21 @@ function getFunctionNames(functionDeclaration) {
"Nameless function declaration should be a default export"
);
return [defaultModifier];
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return [functionDeclaration.name];
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
const ctrKeyword = Debug.checkDefined(
findChildOfKind(functionDeclaration, 136 /* ConstructorKeyword */, functionDeclaration.getSourceFile()),
"Constructor declaration should have constructor keyword"
);
- if (functionDeclaration.parent.kind === 232 /* ClassExpression */) {
+ if (functionDeclaration.parent.kind === 234 /* ClassExpression */) {
const variableDeclaration = functionDeclaration.parent.parent;
return [variableDeclaration.name, ctrKeyword];
}
return [ctrKeyword];
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return [functionDeclaration.parent.name];
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
if (functionDeclaration.name)
return [functionDeclaration.name, functionDeclaration.parent.name];
return [functionDeclaration.parent.name];
@@ -148257,11 +148518,11 @@ function isNotEqualsOperator(node) {
function getParentBinaryExpression(expr) {
const container = findAncestor(expr.parent, (n) => {
switch (n.kind) {
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return false;
- case 229 /* TemplateExpression */:
- case 227 /* BinaryExpression */:
+ case 231 /* TemplateExpression */:
+ case 229 /* BinaryExpression */:
return !(isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent));
default:
return "quit";
@@ -148881,18 +149142,18 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
function checkForStaticContext(nodeToCheck, containingClass) {
let current = nodeToCheck;
while (current !== containingClass) {
- if (current.kind === 171 /* PropertyDeclaration */) {
+ if (current.kind === 172 /* PropertyDeclaration */) {
if (isStatic(current)) {
rangeFacts |= 32 /* InStaticRegion */;
}
break;
- } else if (current.kind === 168 /* Parameter */) {
+ } else if (current.kind === 169 /* Parameter */) {
const ctorOrMethod = getContainingFunction(current);
- if (ctorOrMethod.kind === 176 /* Constructor */) {
+ if (ctorOrMethod.kind === 178 /* Constructor */) {
rangeFacts |= 32 /* InStaticRegion */;
}
break;
- } else if (current.kind === 174 /* MethodDeclaration */) {
+ } else if (current.kind === 176 /* MethodDeclaration */) {
if (isStatic(current)) {
rangeFacts |= 32 /* InStaticRegion */;
}
@@ -148926,7 +149187,7 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
visit(nodeToCheck);
if (rangeFacts & 8 /* UsesThis */) {
const container = getThisContainer(nodeToCheck, false);
- if (container.kind === 263 /* FunctionDeclaration */ || container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ || container.kind === 218 /* FunctionExpression */) {
+ if (container.kind === 265 /* FunctionDeclaration */ || container.kind === 176 /* MethodDeclaration */ && container.parent.kind === 212 /* ObjectLiteralExpression */ || container.kind === 220 /* FunctionExpression */) {
rangeFacts |= 16 /* UsesThisInFunction */;
}
}
@@ -148936,21 +149197,21 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
return true;
}
if (isDeclaration(node2)) {
- const declaringNode = node2.kind === 261 /* VariableDeclaration */ ? node2.parent.parent : node2;
+ const declaringNode = node2.kind === 263 /* VariableDeclaration */ ? node2.parent.parent : node2;
if (hasSyntacticModifier(declaringNode, 1 /* Export */)) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity));
return true;
}
}
switch (node2.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractImport));
return true;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity));
return true;
case 107 /* SuperKeyword */:
- if (node2.parent.kind === 213 /* CallExpression */) {
+ if (node2.parent.kind === 215 /* CallExpression */) {
const containingClass2 = getContainingClass(node2);
if (containingClass2 === void 0 || containingClass2.pos < span.start || containingClass2.end >= span.start + span.length) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractSuper));
@@ -148961,7 +149222,7 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
thisNode = node2;
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
forEachChild(node2, function check(n) {
if (isThis(n)) {
rangeFacts |= 8 /* UsesThis */;
@@ -148972,34 +149233,34 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
forEachChild(n, check);
}
});
- case 264 /* ClassDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (isSourceFile(node2.parent) && node2.parent.externalModuleIndicator === void 0) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.functionWillNotBeVisibleInTheNewScope));
}
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return false;
}
const savedPermittedJumps = permittedJumps;
switch (node2.kind) {
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
permittedJumps &= ~4 /* Return */;
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
permittedJumps = 0 /* None */;
break;
- case 242 /* Block */:
- if (node2.parent && node2.parent.kind === 259 /* TryStatement */ && node2.parent.finallyBlock === node2) {
+ case 244 /* Block */:
+ if (node2.parent && node2.parent.kind === 261 /* TryStatement */ && node2.parent.finallyBlock === node2) {
permittedJumps = 4 /* Return */;
}
break;
- case 299 /* DefaultClause */:
- case 298 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 301 /* CaseClause */:
permittedJumps |= 1 /* Break */;
break;
default:
@@ -149009,39 +149270,39 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
break;
}
switch (node2.kind) {
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 109 /* ThisKeyword */:
rangeFacts |= 8 /* UsesThis */;
thisNode = node2;
break;
- case 257 /* LabeledStatement */: {
+ case 259 /* LabeledStatement */: {
const label = node2.label;
(seenLabels || (seenLabels = [])).push(label.escapedText);
forEachChild(node2, visit);
seenLabels.pop();
break;
}
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */: {
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */: {
const label = node2.label;
if (label) {
if (!contains(seenLabels, label.escapedText)) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange));
}
} else {
- if (!(permittedJumps & (node2.kind === 253 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) {
+ if (!(permittedJumps & (node2.kind === 255 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements));
}
}
break;
}
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
rangeFacts |= 4 /* IsAsyncFunction */;
break;
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
rangeFacts |= 2 /* IsGenerator */;
break;
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
if (permittedJumps & 4 /* Return */) {
rangeFacts |= 1 /* HasReturn */;
} else {
@@ -149091,12 +149352,12 @@ function collectEnclosingScopes(range) {
const scopes = [];
while (true) {
current = current.parent;
- if (current.kind === 168 /* Parameter */) {
+ if (current.kind === 169 /* Parameter */) {
current = findAncestor(current, (parent2) => isFunctionLikeDeclaration(parent2)).parent;
}
if (isScope(current)) {
scopes.push(current);
- if (current.kind === 314 /* SourceFile */) {
+ if (current.kind === 317 /* SourceFile */) {
return scopes;
}
}
@@ -149172,28 +149433,28 @@ function getDescriptionForConstantInScope(scope) {
}
function getDescriptionForFunctionLikeDeclaration(scope) {
switch (scope.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return "constructor";
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
return scope.name ? `function '${scope.name.text}'` : ANONYMOUS;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return "arrow function";
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return `method '${scope.name.getText()}'`;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return `'get ${scope.name.getText()}'`;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return `'set ${scope.name.getText()}'`;
default:
throw Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`);
}
}
function getDescriptionForClassLikeDeclaration(scope) {
- return scope.kind === 264 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression";
+ return scope.kind === 266 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression";
}
function getDescriptionForModuleLikeDeclaration(scope) {
- return scope.kind === 271 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? SpecialScope.Module : SpecialScope.Global;
+ return scope.kind === 274 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? SpecialScope.Module : SpecialScope.Global;
}
var SpecialScope = /* @__PURE__ */ ((SpecialScope2) => {
SpecialScope2[SpecialScope2["Module"] = 0] = "Module";
@@ -149489,7 +149750,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont
changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration);
const localReference = factory.createIdentifier(localNameText);
changeTracker.replaceNode(context.file, node, localReference);
- } else if (node.parent.kind === 245 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) {
+ } else if (node.parent.kind === 247 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) {
const newVariableStatement = factory.createVariableStatement(
void 0,
factory.createVariableDeclarationList([newVariableDeclaration], 2 /* Const */)
@@ -149506,7 +149767,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont
} else {
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, false);
}
- if (node.parent.kind === 245 /* ExpressionStatement */) {
+ if (node.parent.kind === 247 /* ExpressionStatement */) {
changeTracker.delete(context.file, node.parent);
} else {
let localReference = factory.createIdentifier(localNameText);
@@ -150027,27 +150288,27 @@ function getExtractableParent(node) {
function isExtractableExpression(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return false;
}
switch (node.kind) {
case 10 /* StringLiteral */:
- return parent2.kind !== 275 /* ImportDeclaration */ && parent2.kind !== 279 /* ImportSpecifier */;
- case 231 /* SpreadElement */:
- case 206 /* ObjectBindingPattern */:
- case 208 /* BindingElement */:
+ return parent2.kind !== 278 /* ImportDeclaration */ && parent2.kind !== 282 /* ImportSpecifier */;
+ case 233 /* SpreadElement */:
+ case 208 /* ObjectBindingPattern */:
+ case 210 /* BindingElement */:
return false;
case 79 /* Identifier */:
- return parent2.kind !== 208 /* BindingElement */ && parent2.kind !== 279 /* ImportSpecifier */ && parent2.kind !== 284 /* ExportSpecifier */;
+ return parent2.kind !== 210 /* BindingElement */ && parent2.kind !== 282 /* ImportSpecifier */ && parent2.kind !== 287 /* ExportSpecifier */;
}
return true;
}
function isBlockLike(node) {
switch (node.kind) {
- case 242 /* Block */:
- case 314 /* SourceFile */:
- case 271 /* ModuleBlock */:
- case 298 /* CaseClause */:
+ case 244 /* Block */:
+ case 317 /* SourceFile */:
+ case 274 /* ModuleBlock */:
+ case 301 /* CaseClause */:
return true;
default:
return false;
@@ -150187,10 +150448,10 @@ function getInfo21(context) {
}
function isConvertibleDeclaration(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
return true;
default:
return false;
@@ -150258,7 +150519,7 @@ function getRenameInfoForNode(node, typeChecker3, sourceFile, program, preferenc
return getRenameInfoError(wouldRenameNodeModules);
}
const kind = ts_SymbolDisplay_exports.getSymbolKind(typeChecker3, symbol, node);
- const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 166 /* ComputedPropertyName */ ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0;
+ const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0;
const displayName = specifierName || typeChecker3.symbolToString(symbol);
const fullDisplayName = specifierName || typeChecker3.getFullyQualifiedName(symbol);
return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker3, symbol), node, sourceFile);
@@ -150521,10 +150782,10 @@ function getImmediatelyContainingArgumentInfo(node, position, sourceFile) {
return getArgumentListInfoForTemplate(parent2, 0, sourceFile);
}
return void 0;
- } else if (isTemplateHead(node) && parent2.parent.kind === 215 /* TaggedTemplateExpression */) {
+ } else if (isTemplateHead(node) && parent2.parent.kind === 217 /* TaggedTemplateExpression */) {
const templateExpression = parent2;
const tagExpression = templateExpression.parent;
- Debug.assert(templateExpression.kind === 229 /* TemplateExpression */);
+ Debug.assert(templateExpression.kind === 231 /* TemplateExpression */);
const argumentIndex = isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1;
return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile);
} else if (isTemplateSpan(parent2) && isTaggedTemplateExpression(parent2.parent.parent)) {
@@ -150586,17 +150847,17 @@ function getContextualSignatureLocationInfo(startingToken, sourceFile, position,
return void 0;
const { parent: parent2 } = startingToken;
switch (parent2.kind) {
- case 217 /* ParenthesizedExpression */:
- case 174 /* MethodDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 219 /* ParenthesizedExpression */:
+ case 176 /* MethodDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
const info = getArgumentOrParameterListInfo(startingToken, position, sourceFile);
if (!info)
return void 0;
const { argumentIndex, argumentCount, argumentsSpan } = info;
const contextualType = isMethodDeclaration(parent2) ? checker.getContextualTypeForObjectLiteralElement(parent2) : checker.getContextualType(parent2);
return contextualType && { contextualType, argumentIndex, argumentCount, argumentsSpan };
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const highestBinary = getHighestBinary(parent2);
const contextualType2 = checker.getContextualType(highestBinary);
const argumentIndex2 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1;
@@ -150662,7 +150923,7 @@ function getApplicableSpanForTaggedTemplate(taggedTemplate, sourceFile) {
const template = taggedTemplate.template;
const applicableSpanStart = template.getStart();
let applicableSpanEnd = template.getEnd();
- if (template.kind === 229 /* TemplateExpression */) {
+ if (template.kind === 231 /* TemplateExpression */) {
const lastSpan = last(template.templateSpans);
if (lastSpan.literal.getFullWidth() === 0) {
applicableSpanEnd = skipTrivia(sourceFile.text, applicableSpanEnd, false);
@@ -150929,7 +151190,7 @@ function getSelectionChildren(node) {
const groupedWithPlusMinusTokens = groupChildren(children, (child) => child === node.readonlyToken || child.kind === 147 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */);
const groupedWithBrackets = groupChildren(
groupedWithPlusMinusTokens,
- ({ kind }) => kind === 22 /* OpenBracketToken */ || kind === 167 /* TypeParameter */ || kind === 23 /* CloseBracketToken */
+ ({ kind }) => kind === 22 /* OpenBracketToken */ || kind === 168 /* TypeParameter */ || kind === 23 /* CloseBracketToken */
);
return [
openBraceToken,
@@ -150939,7 +151200,7 @@ function getSelectionChildren(node) {
}
if (isPropertySignature(node)) {
const children = groupChildren(node.getChildren(), (child) => child === node.name || contains(node.modifiers, child));
- const firstJSDocChild = ((_a2 = children[0]) == null ? void 0 : _a2.kind) === 329 /* JSDoc */ ? children[0] : void 0;
+ const firstJSDocChild = ((_a2 = children[0]) == null ? void 0 : _a2.kind) === 332 /* JSDoc */ ? children[0] : void 0;
const withJSDocSeparated = firstJSDocChild ? children.slice(1) : children;
const splittedChildren = splitChildren(withJSDocSeparated, ({ kind }) => kind === 58 /* ColonToken */);
return firstJSDocChild ? [firstJSDocChild, createSyntaxList2(splittedChildren)] : splittedChildren;
@@ -151000,19 +151261,19 @@ function createSyntaxList2(children) {
}
function isListOpener(token) {
const kind = token && token.kind;
- return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ || kind === 289 /* JsxOpeningElement */;
+ return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ || kind === 292 /* JsxOpeningElement */;
}
function isListCloser(token) {
const kind = token && token.kind;
- return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ || kind === 290 /* JsxClosingElement */;
+ return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ || kind === 293 /* JsxClosingElement */;
}
function getEndPos(sourceFile, node) {
switch (node.kind) {
- case 349 /* JSDocParameterTag */:
- case 347 /* JSDocCallbackTag */:
- case 356 /* JSDocPropertyTag */:
- case 354 /* JSDocTypedefTag */:
- case 351 /* JSDocThisTag */:
+ case 352 /* JSDocParameterTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 359 /* JSDocPropertyTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 354 /* JSDocThisTag */:
return sourceFile.getLineEndOfPosition(node.getStart());
default:
return node.getEnd();
@@ -151036,7 +151297,7 @@ function getSymbolKind(typeChecker3, symbol, location2) {
}
const flags = getCombinedLocalAndExportSymbolFlags(symbol);
if (flags & 32 /* Class */) {
- return getDeclarationOfKind(symbol, 232 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */;
+ return getDeclarationOfKind(symbol, 234 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */;
}
if (flags & 384 /* Enum */)
return "enum" /* enumElement */;
@@ -151162,13 +151423,13 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
const declaration = find(symbol.declarations, (declaration2) => declaration2.name === location2);
if (declaration) {
switch (declaration.kind) {
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
symbolKind = "getter" /* memberGetAccessorElement */;
break;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
symbolKind = "setter" /* memberSetAccessorElement */;
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
symbolKind = "accessor" /* memberAccessorVariableElement */;
break;
default:
@@ -151180,7 +151441,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
let signature;
type = isThisExpression ? typeChecker3.getTypeAtLocation(location2) : typeChecker3.getTypeOfSymbolAtLocation(symbol, location2);
- if (location2.parent && location2.parent.kind === 211 /* PropertyAccessExpression */) {
+ if (location2.parent && location2.parent.kind === 213 /* PropertyAccessExpression */) {
const right = location2.parent.name;
if (right === location2 || right && right.getFullWidth() === 0) {
location2 = location2.parent;
@@ -151196,7 +151457,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
if (callExpressionLike) {
signature = typeChecker3.getResolvedSignature(callExpressionLike);
- const useConstructSignatures = callExpressionLike.kind === 214 /* NewExpression */ || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 107 /* SuperKeyword */;
+ const useConstructSignatures = callExpressionLike.kind === 216 /* NewExpression */ || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 107 /* SuperKeyword */;
const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
if (signature && !contains(allSignatures, signature.target) && !contains(allSignatures, signature)) {
signature = allSignatures.length ? allSignatures[0] : void 0;
@@ -151251,21 +151512,21 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
hasAddedSymbolInfo = true;
hasMultipleSignatures = allSignatures.length > 1;
}
- } else if (isNameOfFunctionDeclaration(location2) && !(symbolFlags & 98304 /* Accessor */) || location2.kind === 136 /* ConstructorKeyword */ && location2.parent.kind === 176 /* Constructor */) {
+ } else if (isNameOfFunctionDeclaration(location2) && !(symbolFlags & 98304 /* Accessor */) || location2.kind === 136 /* ConstructorKeyword */ && location2.parent.kind === 178 /* Constructor */) {
const functionDeclaration = location2.parent;
const locationIsSymbolDeclaration = symbol.declarations && find(symbol.declarations, (declaration) => declaration === (location2.kind === 136 /* ConstructorKeyword */ ? functionDeclaration.parent : functionDeclaration));
if (locationIsSymbolDeclaration) {
- const allSignatures = functionDeclaration.kind === 176 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
+ const allSignatures = functionDeclaration.kind === 178 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
if (!typeChecker3.isImplementationOfOverload(functionDeclaration)) {
signature = typeChecker3.getSignatureFromDeclaration(functionDeclaration);
} else {
signature = allSignatures[0];
}
- if (functionDeclaration.kind === 176 /* Constructor */) {
+ if (functionDeclaration.kind === 178 /* Constructor */) {
symbolKind = "constructor" /* constructorImplementationElement */;
addPrefixForAnyFunctionOrVar(type.symbol, symbolKind);
} else {
- addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 179 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind);
+ addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 181 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind);
}
if (signature) {
addSignatureDisplayParts(signature, allSignatures);
@@ -151277,9 +151538,9 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) {
addAliasPrefixIfNecessary();
- if (getDeclarationOfKind(symbol, 232 /* ClassExpression */)) {
+ if (getDeclarationOfKind(symbol, 234 /* ClassExpression */)) {
pushSymbolKind("local class" /* localClassElement */);
- } else if (getDeclarationOfKind(symbol, 265 /* StructDeclaration */)) {
+ } else if (getDeclarationOfKind(symbol, 267 /* StructDeclaration */)) {
displayParts.push(keywordPart(85 /* StructKeyword */));
} else {
displayParts.push(keywordPart(84 /* ClassKeyword */));
@@ -151318,7 +151579,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
if (symbolFlags & 1536 /* Module */ && !isThisExpression) {
prefixNextMeaning();
- const declaration = getDeclarationOfKind(symbol, 270 /* ModuleDeclaration */);
+ const declaration = getDeclarationOfKind(symbol, 273 /* ModuleDeclaration */);
const isNamespace = declaration && declaration.name && declaration.name.kind === 79 /* Identifier */;
displayParts.push(keywordPart(isNamespace ? 144 /* NamespaceKeyword */ : 143 /* ModuleKeyword */));
displayParts.push(spacePart());
@@ -151336,7 +151597,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
addFullSymbolName(symbol.parent, enclosingDeclaration);
writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration);
} else {
- const decl = getDeclarationOfKind(symbol, 167 /* TypeParameter */);
+ const decl = getDeclarationOfKind(symbol, 168 /* TypeParameter */);
if (decl === void 0)
return Debug.fail();
const declaration = decl.parent;
@@ -151344,14 +151605,14 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
if (isFunctionLikeKind(declaration.kind)) {
addInPrefix();
const signature = typeChecker3.getSignatureFromDeclaration(declaration);
- if (declaration.kind === 180 /* ConstructSignature */) {
+ if (declaration.kind === 182 /* ConstructSignature */) {
displayParts.push(keywordPart(104 /* NewKeyword */));
displayParts.push(spacePart());
- } else if (declaration.kind !== 179 /* CallSignature */ && declaration.name) {
+ } else if (declaration.kind !== 181 /* CallSignature */ && declaration.name) {
addFullSymbolName(declaration.symbol);
}
addRange(displayParts, signatureToDisplayParts(typeChecker3, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */));
- } else if (declaration.kind === 268 /* TypeAliasDeclaration */) {
+ } else if (declaration.kind === 271 /* TypeAliasDeclaration */) {
addInPrefix();
displayParts.push(keywordPart(155 /* TypeKeyword */));
displayParts.push(spacePart());
@@ -151365,7 +151626,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
symbolKind = "enum member" /* enumMemberElement */;
addPrefixForAnyFunctionOrVar(symbol, "enum member");
const declaration = (_a2 = symbol.declarations) == null ? void 0 : _a2[0];
- if ((declaration == null ? void 0 : declaration.kind) === 308 /* EnumMember */) {
+ if ((declaration == null ? void 0 : declaration.kind) === 311 /* EnumMember */) {
const constantValue = typeChecker3.getConstantValue(declaration);
if (constantValue !== void 0) {
displayParts.push(spacePart());
@@ -151409,17 +151670,17 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
if (symbol.declarations) {
switch (symbol.declarations[0].kind) {
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
displayParts.push(keywordPart(94 /* ExportKeyword */));
displayParts.push(spacePart());
displayParts.push(keywordPart(144 /* NamespaceKeyword */));
break;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
displayParts.push(keywordPart(94 /* ExportKeyword */));
displayParts.push(spacePart());
displayParts.push(keywordPart(symbol.declarations[0].isExportEquals ? 63 /* EqualsToken */ : 89 /* DefaultKeyword */));
break;
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
displayParts.push(keywordPart(94 /* ExportKeyword */));
break;
default:
@@ -151429,7 +151690,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
displayParts.push(spacePart());
addFullSymbolName(symbol);
forEach(symbol.declarations, (declaration) => {
- if (declaration.kind === 274 /* ImportEqualsDeclaration */) {
+ if (declaration.kind === 277 /* ImportEqualsDeclaration */) {
const importEqualsDeclaration = declaration;
if (isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) {
displayParts.push(spacePart());
@@ -151497,9 +151758,9 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
documentation = symbol.getContextualDocumentationComment(enclosingDeclaration, typeChecker3);
}
if (documentation.length === 0 && symbolFlags & 4 /* Property */) {
- if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 314 /* SourceFile */)) {
+ if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 317 /* SourceFile */)) {
for (const declaration of symbol.declarations) {
- if (!declaration.parent || declaration.parent.kind !== 227 /* BinaryExpression */) {
+ if (!declaration.parent || declaration.parent.kind !== 229 /* BinaryExpression */) {
continue;
}
const rhsSymbol = typeChecker3.getSymbolAtLocation(declaration.parent.right);
@@ -151650,14 +151911,14 @@ function isLocalVariableOrFunction(symbol) {
return false;
}
return forEach(symbol.declarations, (declaration) => {
- if (declaration.kind === 218 /* FunctionExpression */) {
+ if (declaration.kind === 220 /* FunctionExpression */) {
return true;
}
- if (declaration.kind !== 261 /* VariableDeclaration */ && declaration.kind !== 263 /* FunctionDeclaration */) {
+ if (declaration.kind !== 263 /* VariableDeclaration */ && declaration.kind !== 265 /* FunctionDeclaration */) {
return false;
}
for (let parent2 = declaration.parent; !isFunctionBlock(parent2); parent2 = parent2.parent) {
- if (parent2.kind === 314 /* SourceFile */ || parent2.kind === 271 /* ModuleBlock */) {
+ if (parent2.kind === 317 /* SourceFile */ || parent2.kind === 274 /* ModuleBlock */) {
return false;
}
}
@@ -151815,7 +152076,7 @@ function getAdjustedEndPosition(sourceFile, node, options) {
return newEnd !== end && (trailingTriviaOption === 2 /* Include */ || isLineBreak(sourceFile.text.charCodeAt(newEnd - 1))) ? newEnd : end;
}
function isSeparator(node, candidate) {
- return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 210 /* ObjectLiteralExpression */);
+ return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 212 /* ObjectLiteralExpression */);
}
function isThisTypeAnnotatable(containingFunction) {
return isFunctionExpression(containingFunction) || isFunctionDeclaration(containingFunction);
@@ -152012,7 +152273,7 @@ var ChangeTracker = class {
endNode2 = first(node.parameters);
}
} else {
- endNode2 = (_a2 = node.kind === 261 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) != null ? _a2 : node.name;
+ endNode2 = (_a2 = node.kind === 263 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) != null ? _a2 : node.name;
}
this.insertNodeAt(sourceFile, endNode2.end, type, { prefix: ": " });
return true;
@@ -152154,19 +152415,19 @@ ${options.prefix}` : "\n" : options.prefix
}
getInsertNodeAfterOptionsWorker(node) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 273 /* ModuleDeclaration */:
return { prefix: this.newLineCharacter, suffix: this.newLineCharacter };
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
case 10 /* StringLiteral */:
case 79 /* Identifier */:
return { prefix: ", " };
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return { suffix: "," + this.newLineCharacter };
case 94 /* ExportKeyword */:
return { prefix: " " };
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return {};
default:
Debug.assert(isStatement(node) || isClassOrTypeElement(node));
@@ -152175,7 +152436,7 @@ ${options.prefix}` : "\n" : options.prefix
}
insertName(sourceFile, node, name) {
Debug.assert(!node.name);
- if (node.kind === 219 /* ArrowFunction */) {
+ if (node.kind === 221 /* ArrowFunction */) {
const arrow = findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile);
const lparen = findChildOfKind(node, 20 /* OpenParenToken */, sourceFile);
if (lparen) {
@@ -152185,12 +152446,12 @@ ${options.prefix}` : "\n" : options.prefix
this.insertText(sourceFile, first(node.parameters).getStart(sourceFile), `function ${name}(`);
this.replaceRange(sourceFile, arrow, factory.createToken(21 /* CloseParenToken */));
}
- if (node.body.kind !== 242 /* Block */) {
+ if (node.body.kind !== 244 /* Block */) {
this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [factory.createToken(18 /* OpenBraceToken */), factory.createToken(106 /* ReturnKeyword */)], { joiner: " ", suffix: " " });
this.insertNodesAt(sourceFile, node.body.end, [factory.createToken(26 /* SemicolonToken */), factory.createToken(19 /* CloseBraceToken */)], { joiner: " " });
}
} else {
- const pos = findChildOfKind(node, node.kind === 218 /* FunctionExpression */ ? 99 /* FunctionKeyword */ : 84 /* ClassKeyword */, sourceFile).end;
+ const pos = findChildOfKind(node, node.kind === 220 /* FunctionExpression */ ? 99 /* FunctionKeyword */ : 84 /* ClassKeyword */, sourceFile).end;
this.insertNodeAt(sourceFile, pos, factory.createIdentifier(name), { prefix: " " });
}
}
@@ -152311,10 +152572,10 @@ ${options.prefix}` : "\n" : options.prefix
}
};
function updateJSDocHost(parent2) {
- if (parent2.kind !== 219 /* ArrowFunction */) {
+ if (parent2.kind !== 221 /* ArrowFunction */) {
return parent2;
}
- const jsDocNode = parent2.parent.kind === 171 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent;
+ const jsDocNode = parent2.parent.kind === 172 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent;
jsDocNode.jsDoc = parent2.jsDoc;
jsDocNode.jsDocCache = parent2.jsDocCache;
return jsDocNode;
@@ -152324,14 +152585,14 @@ function tryMergeJsdocTags(oldTag, newTag) {
return void 0;
}
switch (oldTag.kind) {
- case 349 /* JSDocParameterTag */: {
+ case 352 /* JSDocParameterTag */: {
const oldParam = oldTag;
const newParam = newTag;
return isIdentifier(oldParam.name) && isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? factory.createJSDocParameterTag(void 0, newParam.name, false, newParam.typeExpression, newParam.isNameFirst, oldParam.comment) : void 0;
}
- case 350 /* JSDocReturnTag */:
+ case 353 /* JSDocReturnTag */:
return factory.createJSDocReturnTag(void 0, newTag.typeExpression, oldTag.comment);
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return factory.createJSDocTypeTag(void 0, newTag.typeExpression, oldTag.comment);
}
}
@@ -152712,13 +152973,13 @@ function isValidLocationToAddComment(sourceFile, position) {
return !isInComment(sourceFile, position) && !isInString(sourceFile, position) && !isInTemplateString(sourceFile, position) && !isInJSXText(sourceFile, position);
}
function needSemicolonBetween(a, b) {
- return (isPropertySignature(a) || isPropertyDeclaration(a)) && isClassOrTypeElement(b) && b.name.kind === 166 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b);
+ return (isPropertySignature(a) || isPropertyDeclaration(a)) && isClassOrTypeElement(b) && b.name.kind === 167 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b);
}
var deleteDeclaration;
((_deleteDeclaration) => {
function deleteDeclaration2(changes, deletedNodesInLists, sourceFile, node) {
switch (node.kind) {
- case 168 /* Parameter */: {
+ case 169 /* Parameter */: {
const oldFunction = node.parent;
if (isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && !findChildOfKind(oldFunction, 20 /* OpenParenToken */, sourceFile)) {
changes.replaceNodeWithText(sourceFile, node, "()");
@@ -152727,29 +152988,29 @@ var deleteDeclaration;
}
break;
}
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
const isFirstImport = sourceFile.imports.length && node === first(sourceFile.imports).parent || node === find(sourceFile.statements, isAnyImportSyntax);
deleteNode(changes, sourceFile, node, {
leadingTriviaOption: isFirstImport ? 0 /* Exclude */ : hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */
});
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
const pattern = node.parent;
- const preserveComma = pattern.kind === 207 /* ArrayBindingPattern */ && node !== last(pattern.elements);
+ const preserveComma = pattern.kind === 209 /* ArrayBindingPattern */ && node !== last(pattern.elements);
if (preserveComma) {
deleteNode(changes, sourceFile, node);
} else {
deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);
}
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node);
break;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);
break;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
const namedImports = node.parent;
if (namedImports.elements.length === 1) {
deleteImportBinding(changes, sourceFile, namedImports);
@@ -152757,7 +153018,7 @@ var deleteDeclaration;
deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);
}
break;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
deleteImportBinding(changes, sourceFile, node);
break;
case 26 /* SemicolonToken */:
@@ -152766,9 +153027,9 @@ var deleteDeclaration;
case 99 /* FunctionKeyword */:
deleteNode(changes, sourceFile, node, { leadingTriviaOption: 0 /* Exclude */ });
break;
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 265 /* FunctionDeclaration */:
deleteNode(changes, sourceFile, node, { leadingTriviaOption: hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */ });
break;
default:
@@ -152803,13 +153064,13 @@ var deleteDeclaration;
const previousToken = Debug.checkDefined(getTokenAtPosition(sourceFile, node.pos - 1));
changes.deleteRange(sourceFile, { pos: previousToken.getStart(sourceFile), end: node.end });
} else {
- const importDecl = getAncestor(node, 275 /* ImportDeclaration */);
+ const importDecl = getAncestor(node, 278 /* ImportDeclaration */);
deleteNode(changes, sourceFile, importDecl);
}
}
function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) {
const { parent: parent2 } = node;
- if (parent2.kind === 301 /* CatchClause */) {
+ if (parent2.kind === 304 /* CatchClause */) {
changes.deleteNodeRange(sourceFile, findChildOfKind(parent2, 20 /* OpenParenToken */, sourceFile), findChildOfKind(parent2, 21 /* CloseParenToken */, sourceFile));
return;
}
@@ -152819,14 +153080,14 @@ var deleteDeclaration;
}
const gp = parent2.parent;
switch (gp.kind) {
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
changes.replaceNode(sourceFile, node, factory.createObjectLiteralExpression());
break;
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
deleteNode(changes, sourceFile, parent2);
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
deleteNode(changes, sourceFile, gp, { leadingTriviaOption: hasJSDocNodes(gp) ? 2 /* JSDoc */ : 3 /* StartLine */ });
break;
default:
@@ -153028,10 +153289,10 @@ function getFormattingScanner(text, languageVariant, startPos, endPos, cb) {
function shouldRescanJsxIdentifier(node) {
if (node.parent) {
switch (node.parent.kind) {
- case 294 /* JsxAttribute */:
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 297 /* JsxAttribute */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return isKeyword(node.kind) || node.kind === 79 /* Identifier */;
}
}
@@ -153198,7 +153459,7 @@ var RuleFlags = /* @__PURE__ */ ((RuleFlags2) => {
// src/services/formatting/rules.ts
function getAllRules() {
const allTokens = [];
- for (let token = 0 /* FirstToken */; token <= 164 /* LastToken */; token++) {
+ for (let token = 0 /* FirstToken */; token <= 165 /* LastToken */; token++) {
if (token !== 1 /* EndOfFileToken */) {
allTokens.push(token);
}
@@ -153209,9 +153470,9 @@ function getAllRules() {
const anyToken = { tokens: allTokens, isSpecific: false };
const anyTokenIncludingMultilineComments = tokenRangeFrom([...allTokens, 3 /* MultiLineCommentTrivia */]);
const anyTokenIncludingEOF = tokenRangeFrom([...allTokens, 1 /* EndOfFileToken */]);
- const keywords = tokenRangeFromRange(81 /* FirstKeyword */, 164 /* LastKeyword */);
+ const keywords = tokenRangeFromRange(81 /* FirstKeyword */, 165 /* LastKeyword */);
const binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 78 /* LastBinaryOperator */);
- const binaryKeywordOperators = [102 /* InKeyword */, 103 /* InstanceOfKeyword */, 164 /* OfKeyword */, 129 /* AsKeyword */, 141 /* IsKeyword */];
+ const binaryKeywordOperators = [102 /* InKeyword */, 103 /* InstanceOfKeyword */, 165 /* OfKeyword */, 129 /* AsKeyword */, 141 /* IsKeyword */];
const unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */];
const unaryPrefixExpressions = [
8 /* NumericLiteral */,
@@ -153484,40 +153745,40 @@ function isOptionEnabledOrUndefined(optionName) {
return (context) => !context.options || !hasProperty(context.options, optionName) || !!context.options[optionName];
}
function isForContext(context) {
- return context.contextNode.kind === 249 /* ForStatement */;
+ return context.contextNode.kind === 251 /* ForStatement */;
}
function isNotForContext(context) {
return !isForContext(context);
}
function isBinaryOpContext(context) {
switch (context.contextNode.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return context.contextNode.operatorToken.kind !== 27 /* CommaToken */;
- case 228 /* ConditionalExpression */:
- case 194 /* ConditionalType */:
- case 235 /* AsExpression */:
- case 284 /* ExportSpecifier */:
- case 279 /* ImportSpecifier */:
- case 182 /* TypePredicate */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 239 /* SatisfiesExpression */:
+ case 230 /* ConditionalExpression */:
+ case 196 /* ConditionalType */:
+ case 237 /* AsExpression */:
+ case 287 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 184 /* TypePredicate */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 241 /* SatisfiesExpression */:
return true;
- case 208 /* BindingElement */:
- case 268 /* TypeAliasDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 280 /* ExportAssignment */:
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 308 /* EnumMember */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 210 /* BindingElement */:
+ case 271 /* TypeAliasDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 311 /* EnumMember */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return context.currentTokenSpan.kind === 63 /* EqualsToken */ || context.nextTokenSpan.kind === 63 /* EqualsToken */;
- case 250 /* ForInStatement */:
- case 167 /* TypeParameter */:
+ case 252 /* ForInStatement */:
+ case 168 /* TypeParameter */:
return context.currentTokenSpan.kind === 102 /* InKeyword */ || context.nextTokenSpan.kind === 102 /* InKeyword */ || context.currentTokenSpan.kind === 63 /* EqualsToken */ || context.nextTokenSpan.kind === 63 /* EqualsToken */;
- case 251 /* ForOfStatement */:
- return context.currentTokenSpan.kind === 164 /* OfKeyword */ || context.nextTokenSpan.kind === 164 /* OfKeyword */;
+ case 253 /* ForOfStatement */:
+ return context.currentTokenSpan.kind === 165 /* OfKeyword */ || context.nextTokenSpan.kind === 165 /* OfKeyword */;
}
return false;
}
@@ -153529,16 +153790,16 @@ function isNotTypeAnnotationContext(context) {
}
function isTypeAnnotationContext(context) {
const contextKind = context.contextNode.kind;
- return contextKind === 171 /* PropertyDeclaration */ || contextKind === 170 /* PropertySignature */ || contextKind === 168 /* Parameter */ || contextKind === 261 /* VariableDeclaration */ || isFunctionLikeKind(contextKind);
+ return contextKind === 172 /* PropertyDeclaration */ || contextKind === 171 /* PropertySignature */ || contextKind === 169 /* Parameter */ || contextKind === 263 /* VariableDeclaration */ || isFunctionLikeKind(contextKind);
}
function isConditionalOperatorContext(context) {
- return context.contextNode.kind === 228 /* ConditionalExpression */ || context.contextNode.kind === 194 /* ConditionalType */;
+ return context.contextNode.kind === 230 /* ConditionalExpression */ || context.contextNode.kind === 196 /* ConditionalType */;
}
function isSameLineTokenOrBeforeBlockContext(context) {
return context.TokensAreOnSameLine() || isBeforeBlockContext(context);
}
function isBraceWrappedContext(context) {
- return context.contextNode.kind === 206 /* ObjectBindingPattern */ || context.contextNode.kind === 200 /* MappedType */ || isSingleLineBlockContext(context);
+ return context.contextNode.kind === 208 /* ObjectBindingPattern */ || context.contextNode.kind === 202 /* MappedType */ || isSingleLineBlockContext(context);
}
function isBeforeMultilineBlockContext(context) {
return isBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine());
@@ -153560,26 +153821,26 @@ function nodeIsBlockContext(node) {
return true;
}
switch (node.kind) {
- case 242 /* Block */:
- case 272 /* CaseBlock */:
- case 210 /* ObjectLiteralExpression */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 275 /* CaseBlock */:
+ case 212 /* ObjectLiteralExpression */:
+ case 274 /* ModuleBlock */:
return true;
}
return false;
}
function isFunctionDeclContext(context) {
switch (context.contextNode.kind) {
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 179 /* CallSignature */:
- case 218 /* FunctionExpression */:
- case 176 /* Constructor */:
- case 219 /* ArrowFunction */:
- case 267 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 181 /* CallSignature */:
+ case 220 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 221 /* ArrowFunction */:
+ case 270 /* InterfaceDeclaration */:
return true;
}
return false;
@@ -153588,41 +153849,41 @@ function isNotFunctionDeclContext(context) {
return !isFunctionDeclContext(context);
}
function isFunctionDeclarationOrFunctionExpressionContext(context) {
- return context.contextNode.kind === 263 /* FunctionDeclaration */ || context.contextNode.kind === 218 /* FunctionExpression */;
+ return context.contextNode.kind === 265 /* FunctionDeclaration */ || context.contextNode.kind === 220 /* FunctionExpression */;
}
function isTypeScriptDeclWithBlockContext(context) {
return nodeIsTypeScriptDeclWithBlockContext(context.contextNode);
}
function nodeIsTypeScriptDeclWithBlockContext(node) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 187 /* TypeLiteral */:
- case 270 /* ModuleDeclaration */:
- case 281 /* ExportDeclaration */:
- case 282 /* NamedExports */:
- case 275 /* ImportDeclaration */:
- case 278 /* NamedImports */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 189 /* TypeLiteral */:
+ case 273 /* ModuleDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 285 /* NamedExports */:
+ case 278 /* ImportDeclaration */:
+ case 281 /* NamedImports */:
return true;
}
return false;
}
function isAfterCodeBlockContext(context) {
switch (context.currentTokenParent.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 301 /* CatchClause */:
- case 271 /* ModuleBlock */:
- case 256 /* SwitchStatement */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 304 /* CatchClause */:
+ case 274 /* ModuleBlock */:
+ case 258 /* SwitchStatement */:
return true;
- case 242 /* Block */: {
+ case 244 /* Block */: {
const blockParent = context.currentTokenParent.parent;
- if (!blockParent || blockParent.kind !== 219 /* ArrowFunction */ && blockParent.kind !== 218 /* FunctionExpression */) {
+ if (!blockParent || blockParent.kind !== 221 /* ArrowFunction */ && blockParent.kind !== 220 /* FunctionExpression */) {
return true;
}
}
@@ -153631,29 +153892,29 @@ function isAfterCodeBlockContext(context) {
}
function isControlDeclContext(context) {
switch (context.contextNode.kind) {
- case 246 /* IfStatement */:
- case 256 /* SwitchStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 248 /* WhileStatement */:
- case 259 /* TryStatement */:
- case 247 /* DoStatement */:
- case 255 /* WithStatement */:
- case 301 /* CatchClause */:
+ case 248 /* IfStatement */:
+ case 258 /* SwitchStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 250 /* WhileStatement */:
+ case 261 /* TryStatement */:
+ case 249 /* DoStatement */:
+ case 257 /* WithStatement */:
+ case 304 /* CatchClause */:
return true;
default:
return false;
}
}
function isObjectContext(context) {
- return context.contextNode.kind === 210 /* ObjectLiteralExpression */;
+ return context.contextNode.kind === 212 /* ObjectLiteralExpression */;
}
function isFunctionCallContext(context) {
- return context.contextNode.kind === 213 /* CallExpression */;
+ return context.contextNode.kind === 215 /* CallExpression */;
}
function isNewContext(context) {
- return context.contextNode.kind === 214 /* NewExpression */;
+ return context.contextNode.kind === 216 /* NewExpression */;
}
function isFunctionCallOrNewContext(context) {
return isFunctionCallContext(context) || isNewContext(context);
@@ -153668,10 +153929,10 @@ function isNextTokenNotCloseParen(context) {
return context.nextTokenSpan.kind !== 21 /* CloseParenToken */;
}
function isArrowFunctionContext(context) {
- return context.contextNode.kind === 219 /* ArrowFunction */;
+ return context.contextNode.kind === 221 /* ArrowFunction */;
}
function isImportTypeContext(context) {
- return context.contextNode.kind === 205 /* ImportType */;
+ return context.contextNode.kind === 207 /* ImportType */;
}
function isNonJsxSameLineTokenContext(context) {
return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */;
@@ -153680,19 +153941,19 @@ function isNonJsxTextContext(context) {
return context.contextNode.kind !== 11 /* JsxText */;
}
function isNonJsxElementOrFragmentContext(context) {
- return context.contextNode.kind !== 287 /* JsxElement */ && context.contextNode.kind !== 291 /* JsxFragment */;
+ return context.contextNode.kind !== 290 /* JsxElement */ && context.contextNode.kind !== 294 /* JsxFragment */;
}
function isJsxExpressionContext(context) {
- return context.contextNode.kind === 297 /* JsxExpression */ || context.contextNode.kind === 296 /* JsxSpreadAttribute */;
+ return context.contextNode.kind === 300 /* JsxExpression */ || context.contextNode.kind === 299 /* JsxSpreadAttribute */;
}
function isNextTokenParentJsxAttribute(context) {
- return context.nextTokenParent.kind === 294 /* JsxAttribute */;
+ return context.nextTokenParent.kind === 297 /* JsxAttribute */;
}
function isJsxAttributeContext(context) {
- return context.contextNode.kind === 294 /* JsxAttribute */;
+ return context.contextNode.kind === 297 /* JsxAttribute */;
}
function isJsxSelfClosingElementContext(context) {
- return context.contextNode.kind === 288 /* JsxSelfClosingElement */;
+ return context.contextNode.kind === 291 /* JsxSelfClosingElement */;
}
function isNotBeforeBlockInFunctionDeclarationContext(context) {
return !isFunctionDeclContext(context) && !isBeforeBlockContext(context);
@@ -153704,45 +153965,45 @@ function nodeIsInDecoratorContext(node) {
while (node && isExpression(node)) {
node = node.parent;
}
- return node && node.kind === 169 /* Decorator */;
+ return node && node.kind === 170 /* Decorator */;
}
function isStartOfVariableDeclarationList(context) {
- return context.currentTokenParent.kind === 262 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos;
+ return context.currentTokenParent.kind === 264 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos;
}
function isNotFormatOnEnter(context) {
return context.formattingRequestKind !== 2 /* FormatOnEnter */;
}
function isModuleDeclContext(context) {
- return context.contextNode.kind === 270 /* ModuleDeclaration */;
+ return context.contextNode.kind === 273 /* ModuleDeclaration */;
}
function isObjectTypeContext(context) {
- return context.contextNode.kind === 187 /* TypeLiteral */;
+ return context.contextNode.kind === 189 /* TypeLiteral */;
}
function isConstructorSignatureContext(context) {
- return context.contextNode.kind === 180 /* ConstructSignature */;
+ return context.contextNode.kind === 182 /* ConstructSignature */;
}
function isTypeArgumentOrParameterOrAssertion(token, parent2) {
if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) {
return false;
}
switch (parent2.kind) {
- case 183 /* TypeReference */:
- case 216 /* TypeAssertionExpression */:
- case 268 /* TypeAliasDeclaration */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 234 /* ExpressionWithTypeArguments */:
+ case 185 /* TypeReference */:
+ case 218 /* TypeAssertionExpression */:
+ case 271 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
return true;
default:
return false;
@@ -153752,28 +154013,28 @@ function isTypeArgumentOrParameterOrAssertionContext(context) {
return isTypeArgumentOrParameterOrAssertion(context.currentTokenSpan, context.currentTokenParent) || isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent);
}
function isTypeAssertionContext(context) {
- return context.contextNode.kind === 216 /* TypeAssertionExpression */;
+ return context.contextNode.kind === 218 /* TypeAssertionExpression */;
}
function isVoidOpContext(context) {
- return context.currentTokenSpan.kind === 115 /* VoidKeyword */ && context.currentTokenParent.kind === 223 /* VoidExpression */;
+ return context.currentTokenSpan.kind === 115 /* VoidKeyword */ && context.currentTokenParent.kind === 225 /* VoidExpression */;
}
function isYieldOrYieldStarWithOperand(context) {
- return context.contextNode.kind === 230 /* YieldExpression */ && context.contextNode.expression !== void 0;
+ return context.contextNode.kind === 232 /* YieldExpression */ && context.contextNode.expression !== void 0;
}
function isNonNullAssertionContext(context) {
- return context.contextNode.kind === 236 /* NonNullExpression */;
+ return context.contextNode.kind === 238 /* NonNullExpression */;
}
function isNotStatementConditionContext(context) {
return !isStatementConditionContext(context);
}
function isStatementConditionContext(context) {
switch (context.contextNode.kind) {
- case 246 /* IfStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 248 /* IfStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return true;
default:
return false;
@@ -153799,16 +154060,16 @@ function isSemicolonDeletionContext(context) {
if (startLine === endLine) {
return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */;
}
- if (nextTokenKind === 241 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) {
+ if (nextTokenKind === 243 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) {
return false;
}
- if (context.contextNode.kind === 267 /* InterfaceDeclaration */ || context.contextNode.kind === 268 /* TypeAliasDeclaration */) {
+ if (context.contextNode.kind === 270 /* InterfaceDeclaration */ || context.contextNode.kind === 271 /* TypeAliasDeclaration */) {
return !isPropertySignature(context.currentTokenParent) || !!context.currentTokenParent.type || nextTokenKind !== 20 /* OpenParenToken */;
}
if (isPropertyDeclaration(context.currentTokenParent)) {
return !context.currentTokenParent.initializer;
}
- return context.currentTokenParent.kind !== 249 /* ForStatement */ && context.currentTokenParent.kind !== 243 /* EmptyStatement */ && context.currentTokenParent.kind !== 241 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ && nextTokenKind !== 40 /* MinusToken */ && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ && nextTokenKind !== 229 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */;
+ return context.currentTokenParent.kind !== 251 /* ForStatement */ && context.currentTokenParent.kind !== 245 /* EmptyStatement */ && context.currentTokenParent.kind !== 243 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ && nextTokenKind !== 40 /* MinusToken */ && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ && nextTokenKind !== 231 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */;
}
function isSemicolonInsertionContext(context) {
return positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile);
@@ -153883,12 +154144,12 @@ function buildMap(rules) {
return map2;
}
function getRuleBucketIndex(row, column) {
- Debug.assert(row <= 164 /* LastKeyword */ && column <= 164 /* LastKeyword */, "Must compute formatting context from tokens");
+ Debug.assert(row <= 165 /* LastKeyword */ && column <= 165 /* LastKeyword */, "Must compute formatting context from tokens");
return row * mapRowLength + column;
}
var maskBitSize = 5;
var mask = 31;
-var mapRowLength = 164 /* LastToken */ + 1;
+var mapRowLength = 165 /* LastToken */ + 1;
var RulesPosition = ((RulesPosition2) => {
RulesPosition2[RulesPosition2["StopRulesSpecific"] = 0] = "StopRulesSpecific";
RulesPosition2[RulesPosition2["StopRulesAny"] = maskBitSize * 1] = "StopRulesAny";
@@ -153994,18 +154255,18 @@ function findOutermostNodeWithinListLevel(node) {
}
function isListElement(parent2, node) {
switch (parent2.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return rangeContainsRange(parent2.members, node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const body = parent2.body;
- return !!body && body.kind === 271 /* ModuleBlock */ && rangeContainsRange(body.statements, node);
- case 314 /* SourceFile */:
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
+ return !!body && body.kind === 274 /* ModuleBlock */ && rangeContainsRange(body.statements, node);
+ case 317 /* SourceFile */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
return rangeContainsRange(parent2.statements, node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return rangeContainsRange(parent2.block.statements, node);
}
return false;
@@ -154219,26 +154480,26 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
return modifier.kind;
}
switch (node.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return 84 /* ClassKeyword */;
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return 85 /* StructKeyword */;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return 119 /* InterfaceKeyword */;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return 99 /* FunctionKeyword */;
- case 269 /* EnumDeclaration */:
- return 269 /* EnumDeclaration */;
- case 177 /* GetAccessor */:
+ case 272 /* EnumDeclaration */:
+ return 272 /* EnumDeclaration */;
+ case 179 /* GetAccessor */:
return 138 /* GetKeyword */;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return 152 /* SetKeyword */;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
if (node.asteriskToken) {
return 41 /* AsteriskToken */;
}
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
const name = getNameOfDeclaration(node);
if (name) {
return name.kind;
@@ -154278,15 +154539,15 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
case 43 /* SlashToken */:
case 31 /* GreaterThanToken */:
switch (container.kind) {
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return false;
}
break;
case 22 /* OpenBracketToken */:
case 23 /* CloseBracketToken */:
- if (container.kind !== 200 /* MappedType */) {
+ if (container.kind !== 202 /* MappedType */) {
return false;
}
break;
@@ -154370,11 +154631,11 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
return inheritedIndentation;
}
}
- const effectiveParentStartLine = child.kind === 169 /* Decorator */ ? childStartLine : undecoratedParentStartLine;
+ const effectiveParentStartLine = child.kind === 170 /* Decorator */ ? childStartLine : undecoratedParentStartLine;
const childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine);
processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta);
childContextNode = node;
- if (isFirstListItem && parent2.kind === 209 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) {
+ if (isFirstListItem && parent2.kind === 211 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) {
inheritedIndentation = childIndentation.indentation;
}
return inheritedIndentation;
@@ -154747,50 +155008,50 @@ function getRangeOfEnclosingComment(sourceFile, position, precedingToken, tokenA
}
function getOpenTokenForList(node, list) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 219 /* ArrowFunction */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 221 /* ArrowFunction */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
if (node.typeParameters === list) {
return 29 /* LessThanToken */;
} else if (node.parameters === list) {
return 20 /* OpenParenToken */;
}
break;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
if (node.typeArguments === list) {
return 29 /* LessThanToken */;
} else if (node.arguments === list) {
return 20 /* OpenParenToken */;
}
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
if (node.typeParameters === list) {
return 29 /* LessThanToken */;
}
break;
- case 183 /* TypeReference */:
- case 215 /* TaggedTemplateExpression */:
- case 186 /* TypeQuery */:
- case 234 /* ExpressionWithTypeArguments */:
- case 205 /* ImportType */:
+ case 185 /* TypeReference */:
+ case 217 /* TaggedTemplateExpression */:
+ case 188 /* TypeQuery */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 207 /* ImportType */:
if (node.typeArguments === list) {
return 29 /* LessThanToken */;
}
break;
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return 18 /* OpenBraceToken */;
}
return 0 /* Unknown */;
@@ -154873,11 +155134,11 @@ var SmartIndenter;
}
const lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line;
const currentToken = getTokenAtPosition(sourceFile, position);
- const isObjectLiteral = currentToken.kind === 18 /* OpenBraceToken */ && currentToken.parent.kind === 210 /* ObjectLiteralExpression */;
+ const isObjectLiteral = currentToken.kind === 18 /* OpenBraceToken */ && currentToken.parent.kind === 212 /* ObjectLiteralExpression */;
if (options.indentStyle === 1 /* Block */ || isObjectLiteral) {
return getBlockIndent(sourceFile, position, options);
}
- if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 227 /* BinaryExpression */) {
+ if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 229 /* BinaryExpression */) {
const actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options);
if (actualIndentation !== -1 /* Unknown */) {
return actualIndentation;
@@ -154885,7 +155146,7 @@ var SmartIndenter;
}
const containerList = getListByPosition(position, precedingToken.parent, sourceFile);
if (containerList && !rangeContainsRange(containerList, precedingToken)) {
- const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].indexOf(currentToken.parent.kind) !== -1;
+ const useTheSameBaseIndentation = [220 /* FunctionExpression */, 221 /* ArrowFunction */].indexOf(currentToken.parent.kind) !== -1;
const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize;
return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize;
}
@@ -154994,7 +155255,7 @@ var SmartIndenter;
}
}
function getActualIndentationForNode(current, parent2, currentLineAndChar, parentAndChildShareLine, sourceFile, options) {
- const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 314 /* SourceFile */ || !parentAndChildShareLine);
+ const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 317 /* SourceFile */ || !parentAndChildShareLine);
if (!useActualIndentation) {
return -1 /* Unknown */;
}
@@ -155032,7 +155293,7 @@ var SmartIndenter;
}
SmartIndenter2.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled;
function childStartsOnTheSameLineWithElseInIfStatement(parent2, child, childStartLine, sourceFile) {
- if (parent2.kind === 246 /* IfStatement */ && parent2.elseStatement === child) {
+ if (parent2.kind === 248 /* IfStatement */ && parent2.elseStatement === child) {
const elseKeyword = findChildOfKind(parent2, 92 /* ElseKeyword */, sourceFile);
Debug.assert(elseKeyword !== void 0);
const elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line;
@@ -155083,43 +155344,43 @@ var SmartIndenter;
}
function getListByRange(start2, end, node, sourceFile) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return getList(node.typeArguments);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return getList(node.properties);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return getList(node.elements);
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return getList(node.members);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 176 /* Constructor */:
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 178 /* Constructor */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
return getList(node.typeParameters) || getList(node.parameters);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return getList(node.parameters);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 353 /* JSDocTemplateTag */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 356 /* JSDocTemplateTag */:
return getList(node.typeParameters);
- case 214 /* NewExpression */:
- case 213 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 215 /* CallExpression */:
return getList(node.typeArguments) || getList(node.arguments);
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return getList(node.declarations);
- case 278 /* NamedImports */:
- case 282 /* NamedExports */:
+ case 281 /* NamedImports */:
+ case 285 /* NamedExports */:
return getList(node.elements);
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return getList(node.elements);
}
function getList(list) {
@@ -155142,7 +155403,7 @@ var SmartIndenter;
return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options);
}
function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) {
- if (node.parent && node.parent.kind === 262 /* VariableDeclarationList */) {
+ if (node.parent && node.parent.kind === 264 /* VariableDeclarationList */) {
return -1 /* Unknown */;
}
const containingList = getContainingList(node, sourceFile);
@@ -155203,96 +155464,96 @@ var SmartIndenter;
function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) {
const childKind = child ? child.kind : 0 /* Unknown */;
switch (parent2.kind) {
- case 245 /* ExpressionStatement */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 209 /* ArrayLiteralExpression */:
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
- case 210 /* ObjectLiteralExpression */:
- case 187 /* TypeLiteral */:
- case 200 /* MappedType */:
- case 189 /* TupleType */:
- case 272 /* CaseBlock */:
- case 299 /* DefaultClause */:
- case 298 /* CaseClause */:
- case 217 /* ParenthesizedExpression */:
- case 211 /* PropertyAccessExpression */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 244 /* VariableStatement */:
- case 280 /* ExportAssignment */:
- case 254 /* ReturnStatement */:
- case 228 /* ConditionalExpression */:
- case 207 /* ArrayBindingPattern */:
- case 206 /* ObjectBindingPattern */:
- case 289 /* JsxOpeningElement */:
- case 292 /* JsxOpeningFragment */:
- case 288 /* JsxSelfClosingElement */:
- case 297 /* JsxExpression */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 168 /* Parameter */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 196 /* ParenthesizedType */:
- case 215 /* TaggedTemplateExpression */:
- case 224 /* AwaitExpression */:
- case 282 /* NamedExports */:
- case 278 /* NamedImports */:
- case 284 /* ExportSpecifier */:
- case 279 /* ImportSpecifier */:
- case 171 /* PropertyDeclaration */:
+ case 247 /* ExpressionStatement */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 211 /* ArrayLiteralExpression */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
+ case 212 /* ObjectLiteralExpression */:
+ case 189 /* TypeLiteral */:
+ case 202 /* MappedType */:
+ case 191 /* TupleType */:
+ case 275 /* CaseBlock */:
+ case 302 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 219 /* ParenthesizedExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 246 /* VariableStatement */:
+ case 283 /* ExportAssignment */:
+ case 256 /* ReturnStatement */:
+ case 230 /* ConditionalExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 292 /* JsxOpeningElement */:
+ case 295 /* JsxOpeningFragment */:
+ case 291 /* JsxSelfClosingElement */:
+ case 300 /* JsxExpression */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 169 /* Parameter */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 198 /* ParenthesizedType */:
+ case 217 /* TaggedTemplateExpression */:
+ case 226 /* AwaitExpression */:
+ case 285 /* NamedExports */:
+ case 281 /* NamedImports */:
+ case 287 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 172 /* PropertyDeclaration */:
return true;
- case 261 /* VariableDeclaration */:
- case 305 /* PropertyAssignment */:
- case 227 /* BinaryExpression */:
- if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 210 /* ObjectLiteralExpression */) {
+ case 263 /* VariableDeclaration */:
+ case 308 /* PropertyAssignment */:
+ case 229 /* BinaryExpression */:
+ if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 212 /* ObjectLiteralExpression */) {
return rangeIsOnOneLine(sourceFile, child);
}
- if (parent2.kind === 227 /* BinaryExpression */ && sourceFile && child && childKind === 287 /* JsxElement */) {
+ if (parent2.kind === 229 /* BinaryExpression */ && sourceFile && child && childKind === 290 /* JsxElement */) {
const parentStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, parent2.pos)).line;
const childStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, child.pos)).line;
return parentStartLine !== childStartLine;
}
- if (parent2.kind !== 227 /* BinaryExpression */) {
+ if (parent2.kind !== 229 /* BinaryExpression */) {
return true;
}
break;
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 249 /* ForStatement */:
- case 246 /* IfStatement */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- return childKind !== 242 /* Block */;
- case 219 /* ArrowFunction */:
- if (sourceFile && childKind === 217 /* ParenthesizedExpression */) {
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 248 /* IfStatement */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ return childKind !== 244 /* Block */;
+ case 221 /* ArrowFunction */:
+ if (sourceFile && childKind === 219 /* ParenthesizedExpression */) {
return rangeIsOnOneLine(sourceFile, child);
}
- return childKind !== 242 /* Block */;
- case 281 /* ExportDeclaration */:
- return childKind !== 282 /* NamedExports */;
- case 275 /* ImportDeclaration */:
- return childKind !== 276 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 278 /* NamedImports */;
- case 287 /* JsxElement */:
- return childKind !== 290 /* JsxClosingElement */;
- case 291 /* JsxFragment */:
- return childKind !== 293 /* JsxClosingFragment */;
- case 193 /* IntersectionType */:
- case 192 /* UnionType */:
- if (childKind === 187 /* TypeLiteral */ || childKind === 189 /* TupleType */) {
+ return childKind !== 244 /* Block */;
+ case 284 /* ExportDeclaration */:
+ return childKind !== 285 /* NamedExports */;
+ case 278 /* ImportDeclaration */:
+ return childKind !== 279 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 281 /* NamedImports */;
+ case 290 /* JsxElement */:
+ return childKind !== 293 /* JsxClosingElement */;
+ case 294 /* JsxFragment */:
+ return childKind !== 296 /* JsxClosingFragment */;
+ case 195 /* IntersectionType */:
+ case 194 /* UnionType */:
+ if (childKind === 189 /* TypeLiteral */ || childKind === 191 /* TupleType */) {
return false;
}
break;
@@ -155302,11 +155563,11 @@ var SmartIndenter;
SmartIndenter2.nodeWillIndentChild = nodeWillIndentChild;
function isControlFlowEndingStatement(kind, parent2) {
switch (kind) {
- case 254 /* ReturnStatement */:
- case 258 /* ThrowStatement */:
- case 252 /* ContinueStatement */:
- case 253 /* BreakStatement */:
- return parent2.kind !== 242 /* Block */;
+ case 256 /* ReturnStatement */:
+ case 260 /* ThrowStatement */:
+ case 254 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ return parent2.kind !== 244 /* Block */;
default:
return false;
}
@@ -155855,7 +156116,7 @@ var createLogicalNot = Debug.deprecate(function createLogicalNot2(operand) {
}, factoryDeprecation);
var createNode2 = Debug.deprecate(function createNode3(kind, pos = 0, end = 0) {
return setTextRangePosEnd(
- kind === 314 /* SourceFile */ ? parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 79 /* Identifier */ ? parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 80 /* PrivateIdentifier */ ? parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !isNodeKind(kind) ? parseBaseNodeFactory.createBaseTokenNode(kind) : parseBaseNodeFactory.createBaseNode(kind),
+ kind === 317 /* SourceFile */ ? parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 79 /* Identifier */ ? parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 80 /* PrivateIdentifier */ ? parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !isNodeKind(kind) ? parseBaseNodeFactory.createBaseTokenNode(kind) : parseBaseNodeFactory.createBaseNode(kind),
pos,
end
);
@@ -155869,7 +156130,7 @@ var getMutableClone = Debug.deprecate(function getMutableClone2(node) {
// src/deprecatedCompat/4.0/renamedNodeTests.ts
var isTypeAssertion = Debug.deprecate(function isTypeAssertion2(node) {
- return node.kind === 216 /* TypeAssertionExpression */;
+ return node.kind === 218 /* TypeAssertionExpression */;
}, {
since: "4.0",
warnAfter: "4.1",
@@ -163958,7 +164219,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
}
const initialNode = getTouchingPropertyName(program.getSourceFile(file), position);
const symbol = program.getTypeChecker().getSymbolAtLocation(initialNode);
- const importSpecifier = symbol && getDeclarationOfKind(symbol, 279 /* ImportSpecifier */);
+ const importSpecifier = symbol && getDeclarationOfKind(symbol, 282 /* ImportSpecifier */);
if (!importSpecifier)
return void 0;
const nameToSearch = ((_a3 = importSpecifier.propertyName) == null ? void 0 : _a3.text) || importSpecifier.name.text;
@@ -166750,7 +167011,7 @@ function unwrapParenthesizedType(tsType) {
function findParentIf(asExpr) {
let node = asExpr.parent;
while (node) {
- if (node.kind === 246 /* IfStatement */) {
+ if (node.kind === 248 /* IfStatement */) {
return node;
}
node = node.parent;
@@ -166826,14 +167087,14 @@ function clearTrueSymbolAtLocationCache() {
trueSymbolAtLocationCache.clear();
}
function isTypeDeclSyntaxKind(kind) {
- return isStructDeclarationKind(kind) || kind === 269 /* EnumDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */;
+ return isStructDeclarationKind(kind) || kind === 272 /* EnumDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */;
}
function symbolHasDuplicateName(symbol, tsDeclKind) {
const symbolDecls = symbol == null ? void 0 : symbol.getDeclarations();
if (symbolDecls) {
for (const symDecl of symbolDecls) {
const declKind = symDecl.kind;
- const isNamespaceTypeCollision = isTypeDeclSyntaxKind(declKind) && tsDeclKind === 270 /* ModuleDeclaration */ || isTypeDeclSyntaxKind(tsDeclKind) && declKind === 270 /* ModuleDeclaration */;
+ const isNamespaceTypeCollision = isTypeDeclSyntaxKind(declKind) && tsDeclKind === 273 /* ModuleDeclaration */ || isTypeDeclSyntaxKind(tsDeclKind) && declKind === 273 /* ModuleDeclaration */;
if (declKind !== 79 /* Identifier */ && declKind !== tsDeclKind && !isNamespaceTypeCollision)
return true;
}
@@ -166945,12 +167206,12 @@ function isCompileTimeExpression(tsExpr) {
return isCompileTimeExpression(tsExpr.expression);
}
switch (tsExpr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return isPrefixUnaryExprValidEnumMemberInit(tsExpr);
- case 217 /* ParenthesizedExpression */:
- case 227 /* BinaryExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 229 /* BinaryExpression */:
return isBinaryExprValidEnumMemberInit(tsExpr);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isConditionalExprValidEnumMemberInit(tsExpr);
case 79 /* Identifier */:
return isIdentifierValidEnumMemberInit(tsExpr);
@@ -166958,7 +167219,7 @@ function isCompileTimeExpression(tsExpr) {
return true;
case 10 /* StringLiteral */:
return true;
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const propertyAccess = tsExpr;
if (isNumberConstantValue(propertyAccess)) {
return true;
@@ -166989,7 +167250,7 @@ function isConditionalExprValidEnumMemberInit(tsExpr) {
function isIdentifierValidEnumMemberInit(tsExpr) {
const tsSymbol = typeChecker.getSymbolAtLocation(tsExpr);
const tsDecl = getDeclaration2(tsSymbol);
- return !!tsDecl && (isVarDeclaration(tsDecl) && isConst(tsDecl.parent) || tsDecl.kind === 308 /* EnumMember */);
+ return !!tsDecl && (isVarDeclaration(tsDecl) && isConst(tsDecl.parent) || tsDecl.kind === 311 /* EnumMember */);
}
function isUnaryOpAllowedForEnumMemberInit(tsPrefixUnaryOp) {
return tsPrefixUnaryOp === 39 /* PlusToken */ || tsPrefixUnaryOp === 40 /* MinusToken */ || tsPrefixUnaryOp === 54 /* TildeToken */;
@@ -167166,7 +167427,7 @@ function validateObjectLiteralType(type) {
return type !== void 0 && type.isClassOrInterface() && hasDefaultCtor(type) && !hasReadonlyFields(type) && !isAbstractClass(type);
}
function isStructDeclarationKind(kind) {
- return kind === 265 /* StructDeclaration */;
+ return kind === 267 /* StructDeclaration */;
}
function isStructDeclaration2(node) {
return isStructDeclarationKind(node.kind);
@@ -167335,7 +167596,7 @@ function validateFields(type, objectLiteral) {
return true;
}
function isSupportedTypeNodeKind(kind) {
- return kind !== 132 /* AnyKeyword */ && kind !== 159 /* UnknownKeyword */ && kind !== 154 /* SymbolKeyword */ && kind !== 199 /* IndexedAccessType */ && kind !== 194 /* ConditionalType */ && kind !== 200 /* MappedType */ && kind !== 195 /* InferType */;
+ return kind !== 132 /* AnyKeyword */ && kind !== 159 /* UnknownKeyword */ && kind !== 154 /* SymbolKeyword */ && kind !== 201 /* IndexedAccessType */ && kind !== 196 /* ConditionalType */ && kind !== 202 /* MappedType */ && kind !== 197 /* InferType */;
}
function isSupportedType(typeNode) {
if (isParenthesizedTypeNode(typeNode))
@@ -168336,28 +168597,28 @@ LinterConfig.terminalTokens = new Set2([
LinterConfig.incrementOnlyTokens = new Map2([
[132 /* AnyKeyword */, 0 /* AnyType */],
[154 /* SymbolKeyword */, 1 /* SymbolType */],
- [197 /* ThisType */, 56 /* ThisType */],
- [186 /* TypeQuery */, 6 /* TypeQuery */],
- [221 /* DeleteExpression */, 33 /* DeleteOperator */],
+ [199 /* ThisType */, 56 /* ThisType */],
+ [188 /* TypeQuery */, 6 /* TypeQuery */],
+ [223 /* DeleteExpression */, 33 /* DeleteOperator */],
[13 /* RegularExpressionLiteral */, 7 /* RegexLiteral */],
- [182 /* TypePredicate */, 8 /* IsOperator */],
- [230 /* YieldExpression */, 10 /* YieldExpression */],
- [181 /* IndexSignature */, 14 /* IndexMember */],
- [255 /* WithStatement */, 15 /* WithStatement */],
- [199 /* IndexedAccessType */, 17 /* IndexedAccessType */],
+ [184 /* TypePredicate */, 8 /* IsOperator */],
+ [232 /* YieldExpression */, 10 /* YieldExpression */],
+ [183 /* IndexSignature */, 14 /* IndexMember */],
+ [257 /* WithStatement */, 15 /* WithStatement */],
+ [201 /* IndexedAccessType */, 17 /* IndexedAccessType */],
[159 /* UnknownKeyword */, 18 /* UnknownType */],
[102 /* InKeyword */, 20 /* InOperator */],
- [179 /* CallSignature */, 39 /* CallSignature */],
- [193 /* IntersectionType */, 23 /* IntersectionType */],
- [187 /* TypeLiteral */, 24 /* ObjectTypeLiteral */],
- [185 /* ConstructorType */, 38 /* ConstructorFuncs */],
+ [181 /* CallSignature */, 39 /* CallSignature */],
+ [195 /* IntersectionType */, 23 /* IntersectionType */],
+ [189 /* TypeLiteral */, 24 /* ObjectTypeLiteral */],
+ [187 /* ConstructorType */, 38 /* ConstructorFuncs */],
[80 /* PrivateIdentifier */, 41 /* PrivateIdentifier */],
- [194 /* ConditionalType */, 43 /* ConditionalType */],
- [200 /* MappedType */, 44 /* MappedType */],
- [287 /* JsxElement */, 51 /* JsxElement */],
- [288 /* JsxSelfClosingElement */, 51 /* JsxElement */],
- [274 /* ImportEqualsDeclaration */, 61 /* ImportAssignment */],
- [273 /* NamespaceExportDeclaration */, 67 /* UMDModuleDefinition */]
+ [196 /* ConditionalType */, 43 /* ConditionalType */],
+ [202 /* MappedType */, 44 /* MappedType */],
+ [290 /* JsxElement */, 51 /* JsxElement */],
+ [291 /* JsxSelfClosingElement */, 51 /* JsxElement */],
+ [277 /* ImportEqualsDeclaration */, 61 /* ImportAssignment */],
+ [276 /* NamespaceExportDeclaration */, 67 /* UMDModuleDefinition */]
]);
// src/linter/ArkTSLinter_1_0/TypeScriptLinter.ts
@@ -168366,53 +168627,53 @@ var _TypeScriptLinter = class {
this.sourceFile = sourceFile;
this.tscStrictDiagnostics = tscStrictDiagnostics;
this.handlersMap = new Map2([
- [210 /* ObjectLiteralExpression */, this.handleObjectLiteralExpression],
- [209 /* ArrayLiteralExpression */, this.handleArrayLiteralExpression],
- [168 /* Parameter */, this.handleParameter],
- [269 /* EnumDeclaration */, this.handleEnumDeclaration],
- [267 /* InterfaceDeclaration */, this.handleInterfaceDeclaration],
- [258 /* ThrowStatement */, this.handleThrowStatement],
- [276 /* ImportClause */, this.handleImportClause],
- [249 /* ForStatement */, this.handleForStatement],
- [250 /* ForInStatement */, this.handleForInStatement],
- [251 /* ForOfStatement */, this.handleForOfStatement],
- [275 /* ImportDeclaration */, this.handleImportDeclaration],
- [211 /* PropertyAccessExpression */, this.handlePropertyAccessExpression],
- [171 /* PropertyDeclaration */, this.handlePropertyAssignmentOrDeclaration],
- [305 /* PropertyAssignment */, this.handlePropertyAssignmentOrDeclaration],
- [218 /* FunctionExpression */, this.handleFunctionExpression],
- [219 /* ArrowFunction */, this.handleArrowFunction],
- [232 /* ClassExpression */, this.handleClassExpression],
- [301 /* CatchClause */, this.handleCatchClause],
- [263 /* FunctionDeclaration */, this.handleFunctionDeclaration],
- [225 /* PrefixUnaryExpression */, this.handlePrefixUnaryExpression],
- [227 /* BinaryExpression */, this.handleBinaryExpression],
- [262 /* VariableDeclarationList */, this.handleVariableDeclarationList],
- [261 /* VariableDeclaration */, this.handleVariableDeclaration],
- [264 /* ClassDeclaration */, this.handleClassDeclaration],
- [270 /* ModuleDeclaration */, this.handleModuleDeclaration],
- [268 /* TypeAliasDeclaration */, this.handleTypeAliasDeclaration],
- [279 /* ImportSpecifier */, this.handleImportSpecifier],
- [277 /* NamespaceImport */, this.handleNamespaceImport],
- [216 /* TypeAssertionExpression */, this.handleTypeAssertionExpression],
- [174 /* MethodDeclaration */, this.handleMethodDeclaration],
+ [212 /* ObjectLiteralExpression */, this.handleObjectLiteralExpression],
+ [211 /* ArrayLiteralExpression */, this.handleArrayLiteralExpression],
+ [169 /* Parameter */, this.handleParameter],
+ [272 /* EnumDeclaration */, this.handleEnumDeclaration],
+ [270 /* InterfaceDeclaration */, this.handleInterfaceDeclaration],
+ [260 /* ThrowStatement */, this.handleThrowStatement],
+ [279 /* ImportClause */, this.handleImportClause],
+ [251 /* ForStatement */, this.handleForStatement],
+ [252 /* ForInStatement */, this.handleForInStatement],
+ [253 /* ForOfStatement */, this.handleForOfStatement],
+ [278 /* ImportDeclaration */, this.handleImportDeclaration],
+ [213 /* PropertyAccessExpression */, this.handlePropertyAccessExpression],
+ [172 /* PropertyDeclaration */, this.handlePropertyAssignmentOrDeclaration],
+ [308 /* PropertyAssignment */, this.handlePropertyAssignmentOrDeclaration],
+ [220 /* FunctionExpression */, this.handleFunctionExpression],
+ [221 /* ArrowFunction */, this.handleArrowFunction],
+ [234 /* ClassExpression */, this.handleClassExpression],
+ [304 /* CatchClause */, this.handleCatchClause],
+ [265 /* FunctionDeclaration */, this.handleFunctionDeclaration],
+ [227 /* PrefixUnaryExpression */, this.handlePrefixUnaryExpression],
+ [229 /* BinaryExpression */, this.handleBinaryExpression],
+ [264 /* VariableDeclarationList */, this.handleVariableDeclarationList],
+ [263 /* VariableDeclaration */, this.handleVariableDeclaration],
+ [266 /* ClassDeclaration */, this.handleClassDeclaration],
+ [273 /* ModuleDeclaration */, this.handleModuleDeclaration],
+ [271 /* TypeAliasDeclaration */, this.handleTypeAliasDeclaration],
+ [282 /* ImportSpecifier */, this.handleImportSpecifier],
+ [280 /* NamespaceImport */, this.handleNamespaceImport],
+ [218 /* TypeAssertionExpression */, this.handleTypeAssertionExpression],
+ [176 /* MethodDeclaration */, this.handleMethodDeclaration],
[79 /* Identifier */, this.handleIdentifier],
- [212 /* ElementAccessExpression */, this.handleElementAccessExpression],
- [308 /* EnumMember */, this.handleEnumMember],
- [183 /* TypeReference */, this.handleTypeReference],
- [280 /* ExportAssignment */, this.handleExportAssignment],
- [213 /* CallExpression */, this.handleCallExpression],
- [237 /* MetaProperty */, this.handleMetaProperty],
- [214 /* NewExpression */, this.handleNewExpression],
- [235 /* AsExpression */, this.handleAsExpression],
- [231 /* SpreadElement */, this.handleSpreadOp],
- [307 /* SpreadAssignment */, this.handleSpreadOp],
- [177 /* GetAccessor */, this.handleGetAccessor],
- [178 /* SetAccessor */, this.handleSetAccessor],
- [180 /* ConstructSignature */, this.handleConstructSignature],
- [234 /* ExpressionWithTypeArguments */, this.handleExpressionWithTypeArguments],
- [166 /* ComputedPropertyName */, this.handleComputedPropertyName],
- [175 /* ClassStaticBlockDeclaration */, this.handleClassStaticBlockDeclaration]
+ [214 /* ElementAccessExpression */, this.handleElementAccessExpression],
+ [311 /* EnumMember */, this.handleEnumMember],
+ [185 /* TypeReference */, this.handleTypeReference],
+ [283 /* ExportAssignment */, this.handleExportAssignment],
+ [215 /* CallExpression */, this.handleCallExpression],
+ [239 /* MetaProperty */, this.handleMetaProperty],
+ [216 /* NewExpression */, this.handleNewExpression],
+ [237 /* AsExpression */, this.handleAsExpression],
+ [233 /* SpreadElement */, this.handleSpreadOp],
+ [310 /* SpreadAssignment */, this.handleSpreadOp],
+ [179 /* GetAccessor */, this.handleGetAccessor],
+ [180 /* SetAccessor */, this.handleSetAccessor],
+ [182 /* ConstructSignature */, this.handleConstructSignature],
+ [236 /* ExpressionWithTypeArguments */, this.handleExpressionWithTypeArguments],
+ [167 /* ComputedPropertyName */, this.handleComputedPropertyName],
+ [177 /* ClassStaticBlockDeclaration */, this.handleClassStaticBlockDeclaration]
]);
this.validatedTypesSet = new Set2();
_TypeScriptLinter.tsTypeChecker = tsProgram.getLinterTypeChecker();
@@ -168641,28 +168902,28 @@ var _TypeScriptLinter = class {
if (!p.declarations)
continue;
const decl = p.declarations[0];
- if (decl.kind === 173 /* MethodSignature */) {
+ if (decl.kind === 175 /* MethodSignature */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 174 /* MethodDeclaration */) {
+ } else if (decl.kind === 176 /* MethodDeclaration */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 171 /* PropertyDeclaration */) {
+ } else if (decl.kind === 172 /* PropertyDeclaration */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 170 /* PropertySignature */) {
+ } else if (decl.kind === 171 /* PropertySignature */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
@@ -168690,7 +168951,7 @@ var _TypeScriptLinter = class {
let noContextTypeForArrayLiteral = false;
const arrayLitElements = arrayLitNode.elements;
for (const element of arrayLitElements) {
- if (element.kind === 210 /* ObjectLiteralExpression */) {
+ if (element.kind === 212 /* ObjectLiteralExpression */) {
const objectLiteralType = _TypeScriptLinter.tsTypeChecker.getContextualType(element);
if (!isDynamicLiteralInitializer(arrayLitNode) && !isExpressionAssignableToType(objectLiteralType, element)) {
noContextTypeForArrayLiteral = true;
@@ -168725,7 +168986,7 @@ var _TypeScriptLinter = class {
return;
let enumDeclCount = 0;
for (const decl of enumDecls) {
- if (decl.kind === 269 /* EnumDeclaration */)
+ if (decl.kind === 272 /* EnumDeclaration */)
enumDeclCount++;
}
if (enumDeclCount > 1)
@@ -168738,7 +168999,7 @@ var _TypeScriptLinter = class {
if (iDecls) {
let iDeclCount = 0;
for (const decl of iDecls) {
- if (decl.kind === 267 /* InterfaceDeclaration */)
+ if (decl.kind === 270 /* InterfaceDeclaration */)
iDeclCount++;
}
if (iDeclCount > 1)
@@ -169084,11 +169345,11 @@ var _TypeScriptLinter = class {
} else if (tsBinaryExpr.operatorToken.kind === 27 /* CommaToken */) {
let tsExprNode = tsBinaryExpr;
let tsParentNode = tsExprNode.parent;
- while (tsParentNode && tsParentNode.kind === 227 /* BinaryExpression */) {
+ while (tsParentNode && tsParentNode.kind === 229 /* BinaryExpression */) {
tsExprNode = tsParentNode;
tsParentNode = tsExprNode.parent;
}
- if (tsParentNode && tsParentNode.kind === 249 /* ForStatement */) {
+ if (tsParentNode && tsParentNode.kind === 251 /* ForStatement */) {
const tsForNode = tsParentNode;
if (tsExprNode === tsForNode.initializer || tsExprNode === tsForNode.incrementor)
return;
@@ -169227,15 +169488,15 @@ var _TypeScriptLinter = class {
if (isModuleBlock(tsModuleBody)) {
for (const tsModuleStmt of tsModuleBody.statements) {
switch (tsModuleStmt.kind) {
- case 244 /* VariableStatement */:
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 246 /* VariableStatement */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 284 /* ExportDeclaration */:
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
break;
default:
this.incrementCounters(tsModuleStmt, 47 /* NonDeclarationInNamespace */);
@@ -169357,7 +169618,7 @@ var _TypeScriptLinter = class {
handleRestrictedValues(tsIdentifier, tsIdentSym) {
const illegalValues = 128 /* ConstEnum */ | 256 /* RegularEnum */ | 512 /* ValueModule */ | 32 /* Class */;
if ((tsIdentSym.flags & 512 /* ValueModule */) !== 0) {
- if (!!tsIdentSym && symbolHasDuplicateName(tsIdentSym, 270 /* ModuleDeclaration */)) {
+ if (!!tsIdentSym && symbolHasDuplicateName(tsIdentSym, 273 /* ModuleDeclaration */)) {
return;
}
}
@@ -169483,7 +169744,7 @@ var _TypeScriptLinter = class {
}
handleGenericCallWithNoTypeArgs(callLikeExpr, callSignature) {
var _a2, _b;
- const tsSyntaxKind = isNewExpression(callLikeExpr) ? 176 /* Constructor */ : 263 /* FunctionDeclaration */;
+ const tsSyntaxKind = isNewExpression(callLikeExpr) ? 178 /* Constructor */ : 265 /* FunctionDeclaration */;
const signDecl = _TypeScriptLinter.tsTypeChecker.signatureToSignatureDeclaration(
callSignature,
tsSyntaxKind,
@@ -169676,10 +169937,10 @@ var _TypeScriptLinter = class {
}
handleConstructSignature(node) {
switch (node.parent.kind) {
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
this.incrementCounters(node, 36 /* ConstructorType */);
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
this.incrementCounters(node, 37 /* ConstructorIface */);
break;
default:
@@ -171004,13 +171265,13 @@ var SENDABLE_DECORATOR = "Sendable";
var SENDABLE_INTERFACE = "ISendable";
var PROMISE = "Promise";
var SENDABLE_DECORATOR_NODES = [
- 264 /* ClassDeclaration */,
- 263 /* FunctionDeclaration */,
- 268 /* TypeAliasDeclaration */
+ 266 /* ClassDeclaration */,
+ 265 /* FunctionDeclaration */,
+ 271 /* TypeAliasDeclaration */
];
var SENDABLE_CLOSURE_DECLS = [
- 264 /* ClassDeclaration */,
- 263 /* FunctionDeclaration */
+ 266 /* ClassDeclaration */,
+ 265 /* FunctionDeclaration */
];
var ARKTS_COLLECTIONS_D_ETS = "@arkts.collections.d.ets";
var COLLECTIONS_NAMESPACE = "collections";
@@ -171096,7 +171357,7 @@ function getInstanceofUnsupportedHighlightRange(nodeOrComment) {
return getKeywordHighlightRange(nodeOrComment.operatorToken, "instanceof");
}
function getConstAssertionHighlightRange(nodeOrComment) {
- if (nodeOrComment.kind === 235 /* AsExpression */) {
+ if (nodeOrComment.kind === 237 /* AsExpression */) {
return [
nodeOrComment.expression.getEnd() + 1,
nodeOrComment.type.getStart() - 1
@@ -171109,11 +171370,11 @@ function getConstAssertionHighlightRange(nodeOrComment) {
}
function getLimitedReturnTypeInferenceHighlightRange(nodeOrComment) {
let node;
- if (nodeOrComment.kind === 218 /* FunctionExpression */) {
+ if (nodeOrComment.kind === 220 /* FunctionExpression */) {
node = nodeOrComment.type;
- } else if (nodeOrComment.kind === 263 /* FunctionDeclaration */) {
+ } else if (nodeOrComment.kind === 265 /* FunctionDeclaration */) {
node = nodeOrComment.name;
- } else if (nodeOrComment.kind === 174 /* MethodDeclaration */) {
+ } else if (nodeOrComment.kind === 176 /* MethodDeclaration */) {
node = nodeOrComment.name;
}
if (node !== void 0) {
@@ -171212,7 +171473,7 @@ function unwrapParenthesizedType2(tsType) {
function findParentIf2(asExpr) {
let node = asExpr.parent;
while (node) {
- if (node.kind === 246 /* IfStatement */) {
+ if (node.kind === 248 /* IfStatement */) {
return node;
}
node = node.parent;
@@ -171290,14 +171551,14 @@ function clearTrueSymbolAtLocationCache2() {
trueSymbolAtLocationCache2.clear();
}
function isTypeDeclSyntaxKind2(kind) {
- return isStructDeclarationKind2(kind) || kind === 269 /* EnumDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */;
+ return isStructDeclarationKind2(kind) || kind === 272 /* EnumDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */;
}
function symbolHasDuplicateName2(symbol, tsDeclKind) {
const symbolDecls = symbol == null ? void 0 : symbol.getDeclarations();
if (symbolDecls) {
for (const symDecl of symbolDecls) {
const declKind = symDecl.kind;
- const isNamespaceTypeCollision = isTypeDeclSyntaxKind2(declKind) && tsDeclKind === 270 /* ModuleDeclaration */ || isTypeDeclSyntaxKind2(tsDeclKind) && declKind === 270 /* ModuleDeclaration */;
+ const isNamespaceTypeCollision = isTypeDeclSyntaxKind2(declKind) && tsDeclKind === 273 /* ModuleDeclaration */ || isTypeDeclSyntaxKind2(tsDeclKind) && declKind === 273 /* ModuleDeclaration */;
if (declKind !== 79 /* Identifier */ && declKind !== tsDeclKind && !isNamespaceTypeCollision)
return true;
}
@@ -171460,12 +171721,12 @@ function isCompileTimeExpression2(tsExpr) {
return isCompileTimeExpression2(tsExpr.expression);
}
switch (tsExpr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return isPrefixUnaryExprValidEnumMemberInit2(tsExpr);
- case 217 /* ParenthesizedExpression */:
- case 227 /* BinaryExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 229 /* BinaryExpression */:
return isBinaryExprValidEnumMemberInit2(tsExpr);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isConditionalExprValidEnumMemberInit2(tsExpr);
case 79 /* Identifier */:
return isIdentifierValidEnumMemberInit2(tsExpr);
@@ -171473,7 +171734,7 @@ function isCompileTimeExpression2(tsExpr) {
return true;
case 10 /* StringLiteral */:
return true;
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const propertyAccess = tsExpr;
if (isNumberConstantValue2(propertyAccess)) {
return true;
@@ -171504,7 +171765,7 @@ function isConditionalExprValidEnumMemberInit2(tsExpr) {
function isIdentifierValidEnumMemberInit2(tsExpr) {
const tsSymbol = typeChecker2.getSymbolAtLocation(tsExpr);
const tsDecl = getDeclaration3(tsSymbol);
- return !!tsDecl && (isVarDeclaration2(tsDecl) && isConst2(tsDecl.parent) || tsDecl.kind === 308 /* EnumMember */);
+ return !!tsDecl && (isVarDeclaration2(tsDecl) && isConst2(tsDecl.parent) || tsDecl.kind === 311 /* EnumMember */);
}
function isUnaryOpAllowedForEnumMemberInit2(tsPrefixUnaryOp) {
return tsPrefixUnaryOp === 39 /* PlusToken */ || tsPrefixUnaryOp === 40 /* MinusToken */ || tsPrefixUnaryOp === 54 /* TildeToken */;
@@ -171747,7 +172008,7 @@ function validateObjectLiteralType2(type) {
return type !== void 0 && type.isClassOrInterface() && hasDefaultCtor2(type) && !hasReadonlyFields2(type) && !isAbstractClass2(type);
}
function isStructDeclarationKind2(kind) {
- return kind === 265 /* StructDeclaration */;
+ return kind === 267 /* StructDeclaration */;
}
function isStructDeclaration3(node) {
return isStructDeclarationKind2(node.kind);
@@ -171884,7 +172145,7 @@ function validateField(type, prop) {
return true;
}
function isSupportedTypeNodeKind2(kind) {
- return kind !== 132 /* AnyKeyword */ && kind !== 159 /* UnknownKeyword */ && kind !== 154 /* SymbolKeyword */ && kind !== 199 /* IndexedAccessType */ && kind !== 194 /* ConditionalType */ && kind !== 200 /* MappedType */ && kind !== 195 /* InferType */;
+ return kind !== 132 /* AnyKeyword */ && kind !== 159 /* UnknownKeyword */ && kind !== 154 /* SymbolKeyword */ && kind !== 201 /* IndexedAccessType */ && kind !== 196 /* ConditionalType */ && kind !== 202 /* MappedType */ && kind !== 197 /* InferType */;
}
function isSupportedType2(typeNode) {
if (isParenthesizedTypeNode(typeNode))
@@ -172652,7 +172913,7 @@ function getDecoratorsIfInSendableClass(declaration) {
return getDecorators(declaration);
}
function getClassNodeFromDeclaration(declaration) {
- if (declaration.kind === 168 /* Parameter */) {
+ if (declaration.kind === 169 /* Parameter */) {
return isClassDeclaration(declaration.parent.parent) ? declaration.parent.parent : void 0;
}
return isClassDeclaration(declaration.parent) ? declaration.parent : void 0;
@@ -173228,26 +173489,26 @@ LinterConfig2.terminalTokens = new Set2([
LinterConfig2.incrementOnlyTokens = new Map2([
[132 /* AnyKeyword */, 0 /* AnyType */],
[154 /* SymbolKeyword */, 1 /* SymbolType */],
- [197 /* ThisType */, 53 /* ThisType */],
- [186 /* TypeQuery */, 6 /* TypeQuery */],
- [221 /* DeleteExpression */, 30 /* DeleteOperator */],
- [182 /* TypePredicate */, 7 /* IsOperator */],
- [230 /* YieldExpression */, 9 /* YieldExpression */],
- [255 /* WithStatement */, 14 /* WithStatement */],
- [199 /* IndexedAccessType */, 16 /* IndexedAccessType */],
+ [199 /* ThisType */, 53 /* ThisType */],
+ [188 /* TypeQuery */, 6 /* TypeQuery */],
+ [223 /* DeleteExpression */, 30 /* DeleteOperator */],
+ [184 /* TypePredicate */, 7 /* IsOperator */],
+ [232 /* YieldExpression */, 9 /* YieldExpression */],
+ [257 /* WithStatement */, 14 /* WithStatement */],
+ [201 /* IndexedAccessType */, 16 /* IndexedAccessType */],
[159 /* UnknownKeyword */, 17 /* UnknownType */],
- [179 /* CallSignature */, 36 /* CallSignature */],
- [193 /* IntersectionType */, 21 /* IntersectionType */],
- [187 /* TypeLiteral */, 22 /* ObjectTypeLiteral */],
- [185 /* ConstructorType */, 35 /* ConstructorFuncs */],
+ [181 /* CallSignature */, 36 /* CallSignature */],
+ [195 /* IntersectionType */, 21 /* IntersectionType */],
+ [189 /* TypeLiteral */, 22 /* ObjectTypeLiteral */],
+ [187 /* ConstructorType */, 35 /* ConstructorFuncs */],
[80 /* PrivateIdentifier */, 38 /* PrivateIdentifier */],
- [194 /* ConditionalType */, 40 /* ConditionalType */],
- [200 /* MappedType */, 41 /* MappedType */],
- [287 /* JsxElement */, 48 /* JsxElement */],
- [288 /* JsxSelfClosingElement */, 48 /* JsxElement */],
- [274 /* ImportEqualsDeclaration */, 57 /* ImportAssignment */],
- [273 /* NamespaceExportDeclaration */, 63 /* UMDModuleDefinition */],
- [232 /* ClassExpression */, 25 /* ClassExpression */]
+ [196 /* ConditionalType */, 40 /* ConditionalType */],
+ [202 /* MappedType */, 41 /* MappedType */],
+ [290 /* JsxElement */, 48 /* JsxElement */],
+ [291 /* JsxSelfClosingElement */, 48 /* JsxElement */],
+ [277 /* ImportEqualsDeclaration */, 57 /* ImportAssignment */],
+ [276 /* NamespaceExportDeclaration */, 63 /* UMDModuleDefinition */],
+ [234 /* ClassExpression */, 25 /* ClassExpression */]
]);
// src/linter/ArkTSLinter_1_1/TypeScriptLinter.ts
@@ -173259,60 +173520,60 @@ var _TypeScriptLinter2 = class {
this.compatibleSdkVersion = 12;
this.mixCompile = false;
this.handlersMap = new Map2([
- [210 /* ObjectLiteralExpression */, { handler: this.handleObjectLiteralExpression, name: "handleObjectLiteralExpression" }],
- [209 /* ArrayLiteralExpression */, { handler: this.handleArrayLiteralExpression, name: "handleArrayLiteralExpression" }],
- [168 /* Parameter */, { handler: this.handleParameter, name: "handleParameter" }],
- [269 /* EnumDeclaration */, { handler: this.handleEnumDeclaration, name: "handleEnumDeclaration" }],
- [267 /* InterfaceDeclaration */, { handler: this.handleInterfaceDeclaration, name: "handleInterfaceDeclaration" }],
- [258 /* ThrowStatement */, { handler: this.handleThrowStatement, name: "handleThrowStatement" }],
- [276 /* ImportClause */, { handler: this.handleImportClause, name: "handleImportClause" }],
- [249 /* ForStatement */, { handler: this.handleForStatement, name: "handleForStatement" }],
- [250 /* ForInStatement */, { handler: this.handleForInStatement, name: "handleForInStatement" }],
- [251 /* ForOfStatement */, { handler: this.handleForOfStatement, name: "handleForOfStatement" }],
- [275 /* ImportDeclaration */, { handler: this.handleImportDeclaration, name: "handleImportDeclaration" }],
- [211 /* PropertyAccessExpression */, { handler: this.handlePropertyAccessExpression, name: "handlePropertyAccessExpression" }],
- [171 /* PropertyDeclaration */, { handler: this.handlePropertyDeclaration, name: "handlePropertyDeclaration" }],
- [305 /* PropertyAssignment */, { handler: this.handlePropertyAssignment, name: "handlePropertyAssignment" }],
- [170 /* PropertySignature */, { handler: this.handlePropertySignature, name: "handlePropertySignature" }],
- [218 /* FunctionExpression */, { handler: this.handleFunctionExpression, name: "handleFunctionExpression" }],
- [219 /* ArrowFunction */, { handler: this.handleArrowFunction, name: "handleArrowFunction" }],
- [301 /* CatchClause */, { handler: this.handleCatchClause, name: "handleCatchClause" }],
- [263 /* FunctionDeclaration */, { handler: this.handleFunctionDeclaration, name: "handleFunctionDeclaration" }],
- [225 /* PrefixUnaryExpression */, { handler: this.handlePrefixUnaryExpression, name: "handlePrefixUnaryExpression" }],
- [227 /* BinaryExpression */, { handler: this.handleBinaryExpression, name: "handleBinaryExpression" }],
- [262 /* VariableDeclarationList */, { handler: this.handleVariableDeclarationList, name: "handleVariableDeclarationList" }],
- [261 /* VariableDeclaration */, { handler: this.handleVariableDeclaration, name: "handleVariableDeclaration" }],
- [264 /* ClassDeclaration */, { handler: this.handleClassDeclaration, name: "handleClassDeclaration" }],
- [270 /* ModuleDeclaration */, { handler: this.handleModuleDeclaration, name: "handleModuleDeclaration" }],
- [268 /* TypeAliasDeclaration */, { handler: this.handleTypeAliasDeclaration, name: "handleTypeAliasDeclaration" }],
- [279 /* ImportSpecifier */, { handler: this.handleImportSpecifier, name: "handleImportSpecifier" }],
- [277 /* NamespaceImport */, { handler: this.handleNamespaceImport, name: "handleNamespaceImport" }],
- [216 /* TypeAssertionExpression */, { handler: this.handleTypeAssertionExpression, name: "handleTypeAssertionExpression" }],
- [174 /* MethodDeclaration */, { handler: this.handleMethodDeclaration, name: "handleMethodDeclaration" }],
- [173 /* MethodSignature */, { handler: this.handleMethodSignature, name: "handleMethodSignature" }],
+ [212 /* ObjectLiteralExpression */, { handler: this.handleObjectLiteralExpression, name: "handleObjectLiteralExpression" }],
+ [211 /* ArrayLiteralExpression */, { handler: this.handleArrayLiteralExpression, name: "handleArrayLiteralExpression" }],
+ [169 /* Parameter */, { handler: this.handleParameter, name: "handleParameter" }],
+ [272 /* EnumDeclaration */, { handler: this.handleEnumDeclaration, name: "handleEnumDeclaration" }],
+ [270 /* InterfaceDeclaration */, { handler: this.handleInterfaceDeclaration, name: "handleInterfaceDeclaration" }],
+ [260 /* ThrowStatement */, { handler: this.handleThrowStatement, name: "handleThrowStatement" }],
+ [279 /* ImportClause */, { handler: this.handleImportClause, name: "handleImportClause" }],
+ [251 /* ForStatement */, { handler: this.handleForStatement, name: "handleForStatement" }],
+ [252 /* ForInStatement */, { handler: this.handleForInStatement, name: "handleForInStatement" }],
+ [253 /* ForOfStatement */, { handler: this.handleForOfStatement, name: "handleForOfStatement" }],
+ [278 /* ImportDeclaration */, { handler: this.handleImportDeclaration, name: "handleImportDeclaration" }],
+ [213 /* PropertyAccessExpression */, { handler: this.handlePropertyAccessExpression, name: "handlePropertyAccessExpression" }],
+ [172 /* PropertyDeclaration */, { handler: this.handlePropertyDeclaration, name: "handlePropertyDeclaration" }],
+ [308 /* PropertyAssignment */, { handler: this.handlePropertyAssignment, name: "handlePropertyAssignment" }],
+ [171 /* PropertySignature */, { handler: this.handlePropertySignature, name: "handlePropertySignature" }],
+ [220 /* FunctionExpression */, { handler: this.handleFunctionExpression, name: "handleFunctionExpression" }],
+ [221 /* ArrowFunction */, { handler: this.handleArrowFunction, name: "handleArrowFunction" }],
+ [304 /* CatchClause */, { handler: this.handleCatchClause, name: "handleCatchClause" }],
+ [265 /* FunctionDeclaration */, { handler: this.handleFunctionDeclaration, name: "handleFunctionDeclaration" }],
+ [227 /* PrefixUnaryExpression */, { handler: this.handlePrefixUnaryExpression, name: "handlePrefixUnaryExpression" }],
+ [229 /* BinaryExpression */, { handler: this.handleBinaryExpression, name: "handleBinaryExpression" }],
+ [264 /* VariableDeclarationList */, { handler: this.handleVariableDeclarationList, name: "handleVariableDeclarationList" }],
+ [263 /* VariableDeclaration */, { handler: this.handleVariableDeclaration, name: "handleVariableDeclaration" }],
+ [266 /* ClassDeclaration */, { handler: this.handleClassDeclaration, name: "handleClassDeclaration" }],
+ [273 /* ModuleDeclaration */, { handler: this.handleModuleDeclaration, name: "handleModuleDeclaration" }],
+ [271 /* TypeAliasDeclaration */, { handler: this.handleTypeAliasDeclaration, name: "handleTypeAliasDeclaration" }],
+ [282 /* ImportSpecifier */, { handler: this.handleImportSpecifier, name: "handleImportSpecifier" }],
+ [280 /* NamespaceImport */, { handler: this.handleNamespaceImport, name: "handleNamespaceImport" }],
+ [218 /* TypeAssertionExpression */, { handler: this.handleTypeAssertionExpression, name: "handleTypeAssertionExpression" }],
+ [176 /* MethodDeclaration */, { handler: this.handleMethodDeclaration, name: "handleMethodDeclaration" }],
+ [175 /* MethodSignature */, { handler: this.handleMethodSignature, name: "handleMethodSignature" }],
[79 /* Identifier */, { handler: this.handleIdentifier, name: "handleIdentifier" }],
- [212 /* ElementAccessExpression */, { handler: this.handleElementAccessExpression, name: "handleElementAccessExpression" }],
- [308 /* EnumMember */, { handler: this.handleEnumMember, name: "handleEnumMember" }],
- [183 /* TypeReference */, { handler: this.handleTypeReference, name: "handleTypeReference" }],
- [280 /* ExportAssignment */, { handler: this.handleExportAssignment, name: "handleExportAssignment" }],
- [213 /* CallExpression */, { handler: this.handleCallExpression, name: "handleCallExpression" }],
- [237 /* MetaProperty */, { handler: this.handleMetaProperty, name: "handleMetaProperty" }],
- [214 /* NewExpression */, { handler: this.handleNewExpression, name: "handleNewExpression" }],
- [235 /* AsExpression */, { handler: this.handleAsExpression, name: "handleAsExpression" }],
- [231 /* SpreadElement */, { handler: this.handleSpreadOp, name: "handleSpreadOp" }],
- [307 /* SpreadAssignment */, { handler: this.handleSpreadOp, name: "handleSpreadOp" }],
- [177 /* GetAccessor */, { handler: this.handleGetAccessor, name: "handleGetAccessor" }],
- [178 /* SetAccessor */, { handler: this.handleSetAccessor, name: "handleSetAccessor" }],
- [180 /* ConstructSignature */, { handler: this.handleConstructSignature, name: "handleConstructSignature" }],
- [234 /* ExpressionWithTypeArguments */, { handler: this.handleExpressionWithTypeArguments, name: "handleExpressionWithTypeArguments" }],
- [166 /* ComputedPropertyName */, { handler: this.handleComputedPropertyName, name: "handleComputedPropertyName" }],
- [220 /* EtsComponentExpression */, { handler: this.handleEtsComponentExpression, name: "handleEtsComponentExpression" }],
- [175 /* ClassStaticBlockDeclaration */, { handler: this.handleClassStaticBlockDeclaration, name: "handleClassStaticBlockDeclaration" }],
- [181 /* IndexSignature */, { handler: this.handleIndexSignature, name: "handleIndexSignature" }],
+ [214 /* ElementAccessExpression */, { handler: this.handleElementAccessExpression, name: "handleElementAccessExpression" }],
+ [311 /* EnumMember */, { handler: this.handleEnumMember, name: "handleEnumMember" }],
+ [185 /* TypeReference */, { handler: this.handleTypeReference, name: "handleTypeReference" }],
+ [283 /* ExportAssignment */, { handler: this.handleExportAssignment, name: "handleExportAssignment" }],
+ [215 /* CallExpression */, { handler: this.handleCallExpression, name: "handleCallExpression" }],
+ [239 /* MetaProperty */, { handler: this.handleMetaProperty, name: "handleMetaProperty" }],
+ [216 /* NewExpression */, { handler: this.handleNewExpression, name: "handleNewExpression" }],
+ [237 /* AsExpression */, { handler: this.handleAsExpression, name: "handleAsExpression" }],
+ [233 /* SpreadElement */, { handler: this.handleSpreadOp, name: "handleSpreadOp" }],
+ [310 /* SpreadAssignment */, { handler: this.handleSpreadOp, name: "handleSpreadOp" }],
+ [179 /* GetAccessor */, { handler: this.handleGetAccessor, name: "handleGetAccessor" }],
+ [180 /* SetAccessor */, { handler: this.handleSetAccessor, name: "handleSetAccessor" }],
+ [182 /* ConstructSignature */, { handler: this.handleConstructSignature, name: "handleConstructSignature" }],
+ [236 /* ExpressionWithTypeArguments */, { handler: this.handleExpressionWithTypeArguments, name: "handleExpressionWithTypeArguments" }],
+ [167 /* ComputedPropertyName */, { handler: this.handleComputedPropertyName, name: "handleComputedPropertyName" }],
+ [222 /* EtsComponentExpression */, { handler: this.handleEtsComponentExpression, name: "handleEtsComponentExpression" }],
+ [177 /* ClassStaticBlockDeclaration */, { handler: this.handleClassStaticBlockDeclaration, name: "handleClassStaticBlockDeclaration" }],
+ [183 /* IndexSignature */, { handler: this.handleIndexSignature, name: "handleIndexSignature" }],
[94 /* ExportKeyword */, { handler: this.handleExportKeyword, name: "handleExportKeyword" }],
- [281 /* ExportDeclaration */, { handler: this.handleExportDeclaration, name: "handleExportDeclaration" }],
- [254 /* ReturnStatement */, { handler: this.handleReturnStatement, name: "handleReturnStatement" }],
- [169 /* Decorator */, { handler: this.handleDecorator, name: "handleDecorator" }]
+ [284 /* ExportDeclaration */, { handler: this.handleExportDeclaration, name: "handleExportDeclaration" }],
+ [256 /* ReturnStatement */, { handler: this.handleReturnStatement, name: "handleReturnStatement" }],
+ [170 /* Decorator */, { handler: this.handleDecorator, name: "handleDecorator" }]
]);
this.validatedTypesSet = new Set2();
_TypeScriptLinter2.tsTypeChecker = tsProgram.getLinterTypeChecker();
@@ -173570,28 +173831,28 @@ var _TypeScriptLinter2 = class {
if (!p.declarations)
continue;
const decl = p.declarations[0];
- if (decl.kind === 173 /* MethodSignature */) {
+ if (decl.kind === 175 /* MethodSignature */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 174 /* MethodDeclaration */) {
+ } else if (decl.kind === 176 /* MethodDeclaration */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 171 /* PropertyDeclaration */) {
+ } else if (decl.kind === 172 /* PropertyDeclaration */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 170 /* PropertySignature */) {
+ } else if (decl.kind === 171 /* PropertySignature */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
@@ -173682,7 +173943,7 @@ var _TypeScriptLinter2 = class {
const arrayLitElements = arrayLitNode.elements;
for (const element of arrayLitElements) {
const elementContextType = _TypeScriptLinter2.tsTypeChecker.getContextualType(element);
- if (element.kind === 210 /* ObjectLiteralExpression */) {
+ if (element.kind === 212 /* ObjectLiteralExpression */) {
if (!isDynamicLiteralInitializer2(arrayLitNode) && !isObjectLiteralAssignable2(elementContextType, element)) {
noContextTypeForArrayLiteral = true;
break;
@@ -173722,7 +173983,7 @@ var _TypeScriptLinter2 = class {
return;
let enumDeclCount = 0;
for (const decl of enumDecls) {
- if (decl.kind === 269 /* EnumDeclaration */)
+ if (decl.kind === 272 /* EnumDeclaration */)
enumDeclCount++;
}
if (enumDeclCount > 1)
@@ -173735,7 +173996,7 @@ var _TypeScriptLinter2 = class {
if (iDecls) {
let iDeclCount = 0;
for (const decl of iDecls) {
- if (decl.kind === 267 /* InterfaceDeclaration */)
+ if (decl.kind === 270 /* InterfaceDeclaration */)
iDeclCount++;
}
if (iDeclCount > 1)
@@ -174187,11 +174448,11 @@ var _TypeScriptLinter2 = class {
} else if (tsBinaryExpr.operatorToken.kind === 27 /* CommaToken */) {
let tsExprNode = tsBinaryExpr;
let tsParentNode = tsExprNode.parent;
- while (tsParentNode && tsParentNode.kind === 227 /* BinaryExpression */) {
+ while (tsParentNode && tsParentNode.kind === 229 /* BinaryExpression */) {
tsExprNode = tsParentNode;
tsParentNode = tsExprNode.parent;
}
- if (tsParentNode && tsParentNode.kind === 249 /* ForStatement */) {
+ if (tsParentNode && tsParentNode.kind === 251 /* ForStatement */) {
const tsForNode = tsParentNode;
if (tsExprNode === tsForNode.initializer || tsExprNode === tsForNode.incrementor)
return;
@@ -174456,15 +174717,15 @@ var _TypeScriptLinter2 = class {
if (isModuleBlock(tsModuleBody)) {
for (const tsModuleStmt of tsModuleBody.statements) {
switch (tsModuleStmt.kind) {
- case 244 /* VariableStatement */:
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 246 /* VariableStatement */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 284 /* ExportDeclaration */:
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
break;
default:
this.incrementCounters(tsModuleStmt, 44 /* NonDeclarationInNamespace */);
@@ -174591,7 +174852,7 @@ var _TypeScriptLinter2 = class {
handleRestrictedValues(tsIdentifier, tsIdentSym) {
const illegalValues = 128 /* ConstEnum */ | 256 /* RegularEnum */ | 512 /* ValueModule */ | 32 /* Class */;
if ((tsIdentSym.flags & 512 /* ValueModule */) !== 0) {
- if (!!tsIdentSym && symbolHasDuplicateName2(tsIdentSym, 270 /* ModuleDeclaration */)) {
+ if (!!tsIdentSym && symbolHasDuplicateName2(tsIdentSym, 273 /* ModuleDeclaration */)) {
return;
}
}
@@ -174887,25 +175148,25 @@ var _TypeScriptLinter2 = class {
}
isEsObjectPossiblyAllowed(typeRef) {
switch (typeRef.parent.kind) {
- case 261 /* VariableDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
- case 184 /* FunctionType */:
- case 170 /* PropertySignature */:
- case 188 /* ArrayType */:
- case 214 /* NewExpression */:
+ case 263 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
+ case 186 /* FunctionType */:
+ case 171 /* PropertySignature */:
+ case 190 /* ArrayType */:
+ case 216 /* NewExpression */:
return true;
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
return this.isObjectLiteralFromFunc(typeRef.parent);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
const promiseType = typeRef.parent;
if (promiseType.typeName.getText() === PROMISE) {
return this.isObjectLiteralFromFunc(typeRef.parent.parent, true);
}
return true;
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return !isObjectLiteralExpression(typeRef.parent.expression);
default:
return false;
@@ -174984,10 +175245,10 @@ var _TypeScriptLinter2 = class {
}
handleConstructSignature(node) {
switch (node.parent.kind) {
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
this.incrementCounters(node, 33 /* ConstructorType */);
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
this.incrementCounters(node, 34 /* ConstructorIface */);
break;
default:
@@ -175064,9 +175325,9 @@ var _TypeScriptLinter2 = class {
if (decl.exclamationToken === void 0) {
return;
}
- if (decl.kind === 171 /* PropertyDeclaration */) {
+ if (decl.kind === 172 /* PropertyDeclaration */) {
const parentDecl = decl.parent;
- if (parentDecl.kind === 264 /* ClassDeclaration */ && hasSendableDecorator(parentDecl)) {
+ if (parentDecl.kind === 266 /* ClassDeclaration */ && hasSendableDecorator(parentDecl)) {
this.incrementCounters(decl, 82 /* SendableDefiniteAssignment */);
return;
}
@@ -175197,28 +175458,28 @@ var _TypeScriptLinter2 = class {
return;
}
switch (parentNode.kind) {
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (isConstEnum(parentNode.symbol)) {
break;
} else {
this.incrementCounters((_a2 = parentNode.name) != null ? _a2 : parentNode, 90 /* SharedModuleExports */);
}
return;
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
if (!isShareableType(_TypeScriptLinter2.tsTypeChecker.getTypeAtLocation(parentNode))) {
this.incrementCounters((_b = parentNode.name) != null ? _b : parentNode, 90 /* SharedModuleExports */);
}
return;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
for (const variableDeclaration of parentNode.declarationList.declarations) {
if (!isShareableEntity(variableDeclaration.name)) {
this.incrementCounters(variableDeclaration.name, 90 /* SharedModuleExports */);
}
}
return;
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
if (!isShareableEntity(parentNode)) {
this.incrementCounters(parentNode, 108 /* SharedModuleExportsWarning */);
}
@@ -175327,15 +175588,15 @@ var _InteropTypescriptLinter = class {
this.D_ETS = ".d.ets";
this.ETS = ".ets";
this.handlersMap = new Map2([
- [275 /* ImportDeclaration */, this.handleImportDeclaration],
- [267 /* InterfaceDeclaration */, this.handleInterfaceDeclaration],
- [264 /* ClassDeclaration */, this.handleClassDeclaration],
- [214 /* NewExpression */, this.handleNewExpression],
- [210 /* ObjectLiteralExpression */, this.handleObjectLiteralExpression],
- [209 /* ArrayLiteralExpression */, this.handleArrayLiteralExpression],
- [235 /* AsExpression */, this.handleAsExpression],
- [281 /* ExportDeclaration */, this.handleExportDeclaration],
- [280 /* ExportAssignment */, this.handleExportAssignment]
+ [278 /* ImportDeclaration */, this.handleImportDeclaration],
+ [270 /* InterfaceDeclaration */, this.handleInterfaceDeclaration],
+ [266 /* ClassDeclaration */, this.handleClassDeclaration],
+ [216 /* NewExpression */, this.handleNewExpression],
+ [212 /* ObjectLiteralExpression */, this.handleObjectLiteralExpression],
+ [211 /* ArrayLiteralExpression */, this.handleArrayLiteralExpression],
+ [237 /* AsExpression */, this.handleAsExpression],
+ [284 /* ExportDeclaration */, this.handleExportDeclaration],
+ [283 /* ExportAssignment */, this.handleExportAssignment]
]);
_InteropTypescriptLinter.tsTypeChecker = tsProgram.getLinterTypeChecker();
_InteropTypescriptLinter.etsLoaderPath = tsProgram.getCompilerOptions().etsLoaderPath;
@@ -178599,6 +178860,9 @@ if (typeof process !== "undefined") {
isOptionalTypeNode,
isOuterExpression,
isOutermostOptionalChain,
+ isOverloadDeclaration,
+ isOverloadElement,
+ isOverloadPropertyDeclaration,
isOverrideModifier,
isPackedArrayLiteral,
isParameter,
diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts
index 5711cdb107..075460b20c 100644
--- a/lib/tsserverlibrary.d.ts
+++ b/lib/tsserverlibrary.d.ts
@@ -4313,209 +4313,212 @@ declare namespace ts {
GlobalKeyword = 161,
BigIntKeyword = 162,
OverrideKeyword = 163,
- OfKeyword = 164,
- QualifiedName = 165,
- ComputedPropertyName = 166,
- TypeParameter = 167,
- Parameter = 168,
- Decorator = 169,
- PropertySignature = 170,
- PropertyDeclaration = 171,
- AnnotationPropertyDeclaration = 172,
- MethodSignature = 173,
- MethodDeclaration = 174,
- ClassStaticBlockDeclaration = 175,
- Constructor = 176,
- GetAccessor = 177,
- SetAccessor = 178,
- CallSignature = 179,
- ConstructSignature = 180,
- IndexSignature = 181,
- TypePredicate = 182,
- TypeReference = 183,
- FunctionType = 184,
- ConstructorType = 185,
- TypeQuery = 186,
- TypeLiteral = 187,
- ArrayType = 188,
- TupleType = 189,
- OptionalType = 190,
- RestType = 191,
- UnionType = 192,
- IntersectionType = 193,
- ConditionalType = 194,
- InferType = 195,
- ParenthesizedType = 196,
- ThisType = 197,
- TypeOperator = 198,
- IndexedAccessType = 199,
- MappedType = 200,
- LiteralType = 201,
- NamedTupleMember = 202,
- TemplateLiteralType = 203,
- TemplateLiteralTypeSpan = 204,
- ImportType = 205,
- ObjectBindingPattern = 206,
- ArrayBindingPattern = 207,
- BindingElement = 208,
- ArrayLiteralExpression = 209,
- ObjectLiteralExpression = 210,
- PropertyAccessExpression = 211,
- ElementAccessExpression = 212,
- CallExpression = 213,
- NewExpression = 214,
- TaggedTemplateExpression = 215,
- TypeAssertionExpression = 216,
- ParenthesizedExpression = 217,
- FunctionExpression = 218,
- ArrowFunction = 219,
- EtsComponentExpression = 220,
- DeleteExpression = 221,
- TypeOfExpression = 222,
- VoidExpression = 223,
- AwaitExpression = 224,
- PrefixUnaryExpression = 225,
- PostfixUnaryExpression = 226,
- BinaryExpression = 227,
- ConditionalExpression = 228,
- TemplateExpression = 229,
- YieldExpression = 230,
- SpreadElement = 231,
- ClassExpression = 232,
- OmittedExpression = 233,
- ExpressionWithTypeArguments = 234,
- AsExpression = 235,
- NonNullExpression = 236,
- MetaProperty = 237,
- SyntheticExpression = 238,
- SatisfiesExpression = 239,
- TemplateSpan = 240,
- SemicolonClassElement = 241,
- Block = 242,
- EmptyStatement = 243,
- VariableStatement = 244,
- ExpressionStatement = 245,
- IfStatement = 246,
- DoStatement = 247,
- WhileStatement = 248,
- ForStatement = 249,
- ForInStatement = 250,
- ForOfStatement = 251,
- ContinueStatement = 252,
- BreakStatement = 253,
- ReturnStatement = 254,
- WithStatement = 255,
- SwitchStatement = 256,
- LabeledStatement = 257,
- ThrowStatement = 258,
- TryStatement = 259,
- DebuggerStatement = 260,
- VariableDeclaration = 261,
- VariableDeclarationList = 262,
- FunctionDeclaration = 263,
- ClassDeclaration = 264,
- StructDeclaration = 265,
- AnnotationDeclaration = 266,
- InterfaceDeclaration = 267,
- TypeAliasDeclaration = 268,
- EnumDeclaration = 269,
- ModuleDeclaration = 270,
- ModuleBlock = 271,
- CaseBlock = 272,
- NamespaceExportDeclaration = 273,
- ImportEqualsDeclaration = 274,
- ImportDeclaration = 275,
- ImportClause = 276,
- NamespaceImport = 277,
- NamedImports = 278,
- ImportSpecifier = 279,
- ExportAssignment = 280,
- ExportDeclaration = 281,
- NamedExports = 282,
- NamespaceExport = 283,
- ExportSpecifier = 284,
- MissingDeclaration = 285,
- ExternalModuleReference = 286,
- JsxElement = 287,
- JsxSelfClosingElement = 288,
- JsxOpeningElement = 289,
- JsxClosingElement = 290,
- JsxFragment = 291,
- JsxOpeningFragment = 292,
- JsxClosingFragment = 293,
- JsxAttribute = 294,
- JsxAttributes = 295,
- JsxSpreadAttribute = 296,
- JsxExpression = 297,
- CaseClause = 298,
- DefaultClause = 299,
- HeritageClause = 300,
- CatchClause = 301,
- AssertClause = 302,
- AssertEntry = 303,
- ImportTypeAssertionContainer = 304,
- PropertyAssignment = 305,
- ShorthandPropertyAssignment = 306,
- SpreadAssignment = 307,
- EnumMember = 308,
- UnparsedPrologue = 309,
- UnparsedPrepend = 310,
- UnparsedText = 311,
- UnparsedInternalText = 312,
- UnparsedSyntheticReference = 313,
- SourceFile = 314,
- Bundle = 315,
- UnparsedSource = 316,
- InputFiles = 317,
- JSDocTypeExpression = 318,
- JSDocNameReference = 319,
- JSDocMemberName = 320,
- JSDocAllType = 321,
- JSDocUnknownType = 322,
- JSDocNullableType = 323,
- JSDocNonNullableType = 324,
- JSDocOptionalType = 325,
- JSDocFunctionType = 326,
- JSDocVariadicType = 327,
- JSDocNamepathType = 328,
- JSDoc = 329,
+ OverloadKeyword = 164,
+ OfKeyword = 165,
+ QualifiedName = 166,
+ ComputedPropertyName = 167,
+ TypeParameter = 168,
+ Parameter = 169,
+ Decorator = 170,
+ PropertySignature = 171,
+ PropertyDeclaration = 172,
+ AnnotationPropertyDeclaration = 173,
+ OverloadPropertyDeclaration = 174,
+ MethodSignature = 175,
+ MethodDeclaration = 176,
+ ClassStaticBlockDeclaration = 177,
+ Constructor = 178,
+ GetAccessor = 179,
+ SetAccessor = 180,
+ CallSignature = 181,
+ ConstructSignature = 182,
+ IndexSignature = 183,
+ TypePredicate = 184,
+ TypeReference = 185,
+ FunctionType = 186,
+ ConstructorType = 187,
+ TypeQuery = 188,
+ TypeLiteral = 189,
+ ArrayType = 190,
+ TupleType = 191,
+ OptionalType = 192,
+ RestType = 193,
+ UnionType = 194,
+ IntersectionType = 195,
+ ConditionalType = 196,
+ InferType = 197,
+ ParenthesizedType = 198,
+ ThisType = 199,
+ TypeOperator = 200,
+ IndexedAccessType = 201,
+ MappedType = 202,
+ LiteralType = 203,
+ NamedTupleMember = 204,
+ TemplateLiteralType = 205,
+ TemplateLiteralTypeSpan = 206,
+ ImportType = 207,
+ ObjectBindingPattern = 208,
+ ArrayBindingPattern = 209,
+ BindingElement = 210,
+ ArrayLiteralExpression = 211,
+ ObjectLiteralExpression = 212,
+ PropertyAccessExpression = 213,
+ ElementAccessExpression = 214,
+ CallExpression = 215,
+ NewExpression = 216,
+ TaggedTemplateExpression = 217,
+ TypeAssertionExpression = 218,
+ ParenthesizedExpression = 219,
+ FunctionExpression = 220,
+ ArrowFunction = 221,
+ EtsComponentExpression = 222,
+ DeleteExpression = 223,
+ TypeOfExpression = 224,
+ VoidExpression = 225,
+ AwaitExpression = 226,
+ PrefixUnaryExpression = 227,
+ PostfixUnaryExpression = 228,
+ BinaryExpression = 229,
+ ConditionalExpression = 230,
+ TemplateExpression = 231,
+ YieldExpression = 232,
+ SpreadElement = 233,
+ ClassExpression = 234,
+ OmittedExpression = 235,
+ ExpressionWithTypeArguments = 236,
+ AsExpression = 237,
+ NonNullExpression = 238,
+ MetaProperty = 239,
+ SyntheticExpression = 240,
+ SatisfiesExpression = 241,
+ TemplateSpan = 242,
+ SemicolonClassElement = 243,
+ Block = 244,
+ EmptyStatement = 245,
+ VariableStatement = 246,
+ ExpressionStatement = 247,
+ IfStatement = 248,
+ DoStatement = 249,
+ WhileStatement = 250,
+ ForStatement = 251,
+ ForInStatement = 252,
+ ForOfStatement = 253,
+ ContinueStatement = 254,
+ BreakStatement = 255,
+ ReturnStatement = 256,
+ WithStatement = 257,
+ SwitchStatement = 258,
+ LabeledStatement = 259,
+ ThrowStatement = 260,
+ TryStatement = 261,
+ DebuggerStatement = 262,
+ VariableDeclaration = 263,
+ VariableDeclarationList = 264,
+ FunctionDeclaration = 265,
+ ClassDeclaration = 266,
+ StructDeclaration = 267,
+ AnnotationDeclaration = 268,
+ OverloadDeclaration = 269,
+ InterfaceDeclaration = 270,
+ TypeAliasDeclaration = 271,
+ EnumDeclaration = 272,
+ ModuleDeclaration = 273,
+ ModuleBlock = 274,
+ CaseBlock = 275,
+ NamespaceExportDeclaration = 276,
+ ImportEqualsDeclaration = 277,
+ ImportDeclaration = 278,
+ ImportClause = 279,
+ NamespaceImport = 280,
+ NamedImports = 281,
+ ImportSpecifier = 282,
+ ExportAssignment = 283,
+ ExportDeclaration = 284,
+ NamedExports = 285,
+ NamespaceExport = 286,
+ ExportSpecifier = 287,
+ MissingDeclaration = 288,
+ ExternalModuleReference = 289,
+ JsxElement = 290,
+ JsxSelfClosingElement = 291,
+ JsxOpeningElement = 292,
+ JsxClosingElement = 293,
+ JsxFragment = 294,
+ JsxOpeningFragment = 295,
+ JsxClosingFragment = 296,
+ JsxAttribute = 297,
+ JsxAttributes = 298,
+ JsxSpreadAttribute = 299,
+ JsxExpression = 300,
+ CaseClause = 301,
+ DefaultClause = 302,
+ HeritageClause = 303,
+ CatchClause = 304,
+ AssertClause = 305,
+ AssertEntry = 306,
+ ImportTypeAssertionContainer = 307,
+ PropertyAssignment = 308,
+ ShorthandPropertyAssignment = 309,
+ SpreadAssignment = 310,
+ EnumMember = 311,
+ UnparsedPrologue = 312,
+ UnparsedPrepend = 313,
+ UnparsedText = 314,
+ UnparsedInternalText = 315,
+ UnparsedSyntheticReference = 316,
+ SourceFile = 317,
+ Bundle = 318,
+ UnparsedSource = 319,
+ InputFiles = 320,
+ JSDocTypeExpression = 321,
+ JSDocNameReference = 322,
+ JSDocMemberName = 323,
+ JSDocAllType = 324,
+ JSDocUnknownType = 325,
+ JSDocNullableType = 326,
+ JSDocNonNullableType = 327,
+ JSDocOptionalType = 328,
+ JSDocFunctionType = 329,
+ JSDocVariadicType = 330,
+ JSDocNamepathType = 331,
+ JSDoc = 332,
/** @deprecated Use SyntaxKind.JSDoc */
- JSDocComment = 329,
- JSDocText = 330,
- JSDocTypeLiteral = 331,
- JSDocSignature = 332,
- JSDocLink = 333,
- JSDocLinkCode = 334,
- JSDocLinkPlain = 335,
- JSDocTag = 336,
- JSDocAugmentsTag = 337,
- JSDocImplementsTag = 338,
- JSDocAuthorTag = 339,
- JSDocDeprecatedTag = 340,
- JSDocClassTag = 341,
- JSDocPublicTag = 342,
- JSDocPrivateTag = 343,
- JSDocProtectedTag = 344,
- JSDocReadonlyTag = 345,
- JSDocOverrideTag = 346,
- JSDocCallbackTag = 347,
- JSDocEnumTag = 348,
- JSDocParameterTag = 349,
- JSDocReturnTag = 350,
- JSDocThisTag = 351,
- JSDocTypeTag = 352,
- JSDocTemplateTag = 353,
- JSDocTypedefTag = 354,
- JSDocSeeTag = 355,
- JSDocPropertyTag = 356,
- SyntaxList = 357,
- NotEmittedStatement = 358,
- PartiallyEmittedExpression = 359,
- CommaListExpression = 360,
- MergeDeclarationMarker = 361,
- EndOfDeclarationMarker = 362,
- SyntheticReferenceExpression = 363,
- Count = 364,
+ JSDocComment = 332,
+ JSDocText = 333,
+ JSDocTypeLiteral = 334,
+ JSDocSignature = 335,
+ JSDocLink = 336,
+ JSDocLinkCode = 337,
+ JSDocLinkPlain = 338,
+ JSDocTag = 339,
+ JSDocAugmentsTag = 340,
+ JSDocImplementsTag = 341,
+ JSDocAuthorTag = 342,
+ JSDocDeprecatedTag = 343,
+ JSDocClassTag = 344,
+ JSDocPublicTag = 345,
+ JSDocPrivateTag = 346,
+ JSDocProtectedTag = 347,
+ JSDocReadonlyTag = 348,
+ JSDocOverrideTag = 349,
+ JSDocCallbackTag = 350,
+ JSDocEnumTag = 351,
+ JSDocParameterTag = 352,
+ JSDocReturnTag = 353,
+ JSDocThisTag = 354,
+ JSDocTypeTag = 355,
+ JSDocTemplateTag = 356,
+ JSDocTypedefTag = 357,
+ JSDocSeeTag = 358,
+ JSDocPropertyTag = 359,
+ SyntaxList = 360,
+ NotEmittedStatement = 361,
+ PartiallyEmittedExpression = 362,
+ CommaListExpression = 363,
+ MergeDeclarationMarker = 364,
+ EndOfDeclarationMarker = 365,
+ SyntheticReferenceExpression = 366,
+ Count = 367,
FirstAssignment = 63,
LastAssignment = 78,
FirstCompoundAssignment = 64,
@@ -4523,15 +4526,15 @@ declare namespace ts {
FirstReservedWord = 81,
LastReservedWord = 117,
FirstKeyword = 81,
- LastKeyword = 164,
+ LastKeyword = 165,
FirstFutureReservedWord = 118,
LastFutureReservedWord = 126,
- FirstTypeNode = 182,
- LastTypeNode = 205,
+ FirstTypeNode = 184,
+ LastTypeNode = 207,
FirstPunctuation = 18,
LastPunctuation = 78,
FirstToken = 0,
- LastToken = 164,
+ LastToken = 165,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 8,
@@ -4540,19 +4543,19 @@ declare namespace ts {
LastTemplateToken = 17,
FirstBinaryOperator = 29,
LastBinaryOperator = 78,
- FirstStatement = 244,
- LastStatement = 260,
- FirstNode = 165,
- FirstJSDocNode = 318,
- LastJSDocNode = 356,
- FirstJSDocTagNode = 336,
- LastJSDocTagNode = 356
+ FirstStatement = 246,
+ LastStatement = 262,
+ FirstNode = 166,
+ FirstJSDocNode = 321,
+ LastJSDocNode = 359,
+ FirstJSDocTagNode = 339,
+ LastJSDocTagNode = 359
}
type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia;
type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;
type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail;
type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken;
- type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.StructKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.LazyKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
+ type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.StructKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.OverloadKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.LazyKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword;
type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword;
type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
@@ -4693,14 +4696,14 @@ declare namespace ts {
}
interface JSDocContainer {
}
- type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AnnotationPropertyDeclaration | AnnotationDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | CaseClause | EndOfFileToken;
- type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | AnnotationPropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
+ type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AnnotationPropertyDeclaration | OverloadPropertyDeclaration | AnnotationDeclaration | OverloadDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | CaseClause | EndOfFileToken;
+ type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | AnnotationPropertyDeclaration | OverloadPropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | EnumMember;
type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration;
type HasIllegalDecorators = PropertyAssignment | ShorthandPropertyAssignment | FunctionDeclaration | ConstructorDeclaration | IndexSignatureDeclaration | ClassStaticBlockDeclaration | MissingDeclaration | VariableStatement | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportDeclaration | ExportAssignment;
- type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration;
+ type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
interface NodeArray extends ReadonlyArray, ReadonlyTextRange {
readonly hasTrailingComma: boolean;
}
@@ -4941,7 +4944,7 @@ declare namespace ts {
readonly parent: ObjectLiteralExpression;
readonly expression: Expression;
}
- type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
+ type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | OverloadPropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
interface PropertyLikeDeclaration extends NamedDeclaration {
readonly name: PropertyName;
}
@@ -5733,7 +5736,7 @@ declare namespace ts {
type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer {
- readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression | SyntaxKind.StructDeclaration | SyntaxKind.AnnotationDeclaration;
+ readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression | SyntaxKind.StructDeclaration | SyntaxKind.AnnotationDeclaration | SyntaxKind.OverloadDeclaration;
readonly name?: Identifier;
readonly typeParameters?: NodeArray;
readonly heritageClauses?: NodeArray;
@@ -5757,6 +5760,12 @@ declare namespace ts {
readonly name: Identifier;
readonly members: NodeArray;
}
+ interface OverloadDeclaration extends DeclarationStatement {
+ readonly kind: SyntaxKind.OverloadDeclaration;
+ readonly modifiers?: NodeArray;
+ readonly name: Identifier;
+ readonly members: NodeArray;
+ }
interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression {
readonly kind: SyntaxKind.ClassExpression;
readonly modifiers?: NodeArray;
@@ -5770,6 +5779,16 @@ declare namespace ts {
_annnotationElementBrand: any;
readonly name: PropertyName;
}
+ interface OverloadElement extends NamedDeclaration {
+ readonly name: PropertyName;
+ }
+ interface OverloadPropertyDeclaration extends OverloadElement, JSDocContainer {
+ readonly kind: SyntaxKind.OverloadPropertyDeclaration;
+ readonly modifiers?: NodeArray;
+ readonly name: PropertyName;
+ readonly questionToken?: QuestionToken;
+ readonly type?: TypeNode;
+ }
interface TypeElement extends NamedDeclaration {
_typeElementBrand: any;
readonly name?: PropertyName;
@@ -7895,6 +7914,8 @@ declare namespace ts {
updatePropertyDeclaration(node: PropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
createAnnotationPropertyDeclaration(name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
updateAnnotationPropertyDeclaration(node: AnnotationPropertyDeclaration, name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
+ createOverloadPropertyDeclaration(modifiers: readonly ModifierLike[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
+ updateOverloadPropertyDeclaration(node: OverloadPropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature;
createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
@@ -8094,6 +8115,8 @@ declare namespace ts {
updateStructDeclaration(node: StructDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): StructDeclaration;
createAnnotationDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, members: readonly AnnotationElement[]): AnnotationDeclaration;
updateAnnotationDeclaration(node: AnnotationDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly AnnotationElement[]): AnnotationDeclaration;
+ createOverloadDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
+ updateOverloadDeclaration(node: OverloadDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
@@ -9274,6 +9297,7 @@ declare namespace ts {
function isBindingName(node: Node): node is BindingName;
function isFunctionLike(node: Node | undefined): node is SignatureDeclaration;
function isAnnotationElement(node: Node): node is AnnotationElement;
+ function isOverloadElement(node: Node): node is OverloadElement;
function isClassElement(node: Node): node is ClassElement;
function isClassLike(node: Node): node is ClassLikeDeclaration;
function isStruct(node: Node): node is StructDeclaration;
@@ -9444,6 +9468,7 @@ declare namespace ts {
function isDecorator(node: Node): node is Decorator;
function isAnnotation(node: Node): node is Annotation;
function isPropertySignature(node: Node): node is PropertySignature;
+ function isOverloadPropertyDeclaration(node: Node): node is OverloadPropertyDeclaration;
function isPropertyDeclaration(node: Node): node is PropertyDeclaration;
function isAnnotationPropertyDeclaration(node: Node): node is AnnotationPropertyDeclaration;
function isMethodSignature(node: Node): node is MethodSignature;
@@ -9542,6 +9567,7 @@ declare namespace ts {
function isClassDeclaration(node: Node): node is ClassDeclaration;
function isStructDeclaration(node: Node): node is StructDeclaration;
function isAnnotationDeclaration(node: Node): node is AnnotationDeclaration;
+ function isOverloadDeclaration(node: Node): node is OverloadDeclaration;
function isInterfaceDeclaration(node: Node): node is InterfaceDeclaration;
function isTypeAliasDeclaration(node: Node): node is TypeAliasDeclaration;
function isEnumDeclaration(node: Node): node is EnumDeclaration;
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index 1a47397c89..20404e72bb 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -1828,6 +1828,9 @@ __export(tsserverlibrary_exports, {
isOptionalTypeNode: () => isOptionalTypeNode,
isOuterExpression: () => isOuterExpression,
isOutermostOptionalChain: () => isOutermostOptionalChain,
+ isOverloadDeclaration: () => isOverloadDeclaration,
+ isOverloadElement: () => isOverloadElement,
+ isOverloadPropertyDeclaration: () => isOverloadPropertyDeclaration,
isOverrideModifier: () => isOverrideModifier,
isPackedArrayLiteral: () => isPackedArrayLiteral,
isParameter: () => isParameter,
@@ -6464,208 +6467,211 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
SyntaxKind5[SyntaxKind5["GlobalKeyword"] = 161] = "GlobalKeyword";
SyntaxKind5[SyntaxKind5["BigIntKeyword"] = 162] = "BigIntKeyword";
SyntaxKind5[SyntaxKind5["OverrideKeyword"] = 163] = "OverrideKeyword";
- SyntaxKind5[SyntaxKind5["OfKeyword"] = 164] = "OfKeyword";
- SyntaxKind5[SyntaxKind5["QualifiedName"] = 165] = "QualifiedName";
- SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 166] = "ComputedPropertyName";
- SyntaxKind5[SyntaxKind5["TypeParameter"] = 167] = "TypeParameter";
- SyntaxKind5[SyntaxKind5["Parameter"] = 168] = "Parameter";
- SyntaxKind5[SyntaxKind5["Decorator"] = 169] = "Decorator";
- SyntaxKind5[SyntaxKind5["PropertySignature"] = 170] = "PropertySignature";
- SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 171] = "PropertyDeclaration";
- SyntaxKind5[SyntaxKind5["AnnotationPropertyDeclaration"] = 172] = "AnnotationPropertyDeclaration";
- SyntaxKind5[SyntaxKind5["MethodSignature"] = 173] = "MethodSignature";
- SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 174] = "MethodDeclaration";
- SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 175] = "ClassStaticBlockDeclaration";
- SyntaxKind5[SyntaxKind5["Constructor"] = 176] = "Constructor";
- SyntaxKind5[SyntaxKind5["GetAccessor"] = 177] = "GetAccessor";
- SyntaxKind5[SyntaxKind5["SetAccessor"] = 178] = "SetAccessor";
- SyntaxKind5[SyntaxKind5["CallSignature"] = 179] = "CallSignature";
- SyntaxKind5[SyntaxKind5["ConstructSignature"] = 180] = "ConstructSignature";
- SyntaxKind5[SyntaxKind5["IndexSignature"] = 181] = "IndexSignature";
- SyntaxKind5[SyntaxKind5["TypePredicate"] = 182] = "TypePredicate";
- SyntaxKind5[SyntaxKind5["TypeReference"] = 183] = "TypeReference";
- SyntaxKind5[SyntaxKind5["FunctionType"] = 184] = "FunctionType";
- SyntaxKind5[SyntaxKind5["ConstructorType"] = 185] = "ConstructorType";
- SyntaxKind5[SyntaxKind5["TypeQuery"] = 186] = "TypeQuery";
- SyntaxKind5[SyntaxKind5["TypeLiteral"] = 187] = "TypeLiteral";
- SyntaxKind5[SyntaxKind5["ArrayType"] = 188] = "ArrayType";
- SyntaxKind5[SyntaxKind5["TupleType"] = 189] = "TupleType";
- SyntaxKind5[SyntaxKind5["OptionalType"] = 190] = "OptionalType";
- SyntaxKind5[SyntaxKind5["RestType"] = 191] = "RestType";
- SyntaxKind5[SyntaxKind5["UnionType"] = 192] = "UnionType";
- SyntaxKind5[SyntaxKind5["IntersectionType"] = 193] = "IntersectionType";
- SyntaxKind5[SyntaxKind5["ConditionalType"] = 194] = "ConditionalType";
- SyntaxKind5[SyntaxKind5["InferType"] = 195] = "InferType";
- SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 196] = "ParenthesizedType";
- SyntaxKind5[SyntaxKind5["ThisType"] = 197] = "ThisType";
- SyntaxKind5[SyntaxKind5["TypeOperator"] = 198] = "TypeOperator";
- SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 199] = "IndexedAccessType";
- SyntaxKind5[SyntaxKind5["MappedType"] = 200] = "MappedType";
- SyntaxKind5[SyntaxKind5["LiteralType"] = 201] = "LiteralType";
- SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 202] = "NamedTupleMember";
- SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 203] = "TemplateLiteralType";
- SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 204] = "TemplateLiteralTypeSpan";
- SyntaxKind5[SyntaxKind5["ImportType"] = 205] = "ImportType";
- SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 206] = "ObjectBindingPattern";
- SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 207] = "ArrayBindingPattern";
- SyntaxKind5[SyntaxKind5["BindingElement"] = 208] = "BindingElement";
- SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 209] = "ArrayLiteralExpression";
- SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 210] = "ObjectLiteralExpression";
- SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 211] = "PropertyAccessExpression";
- SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 212] = "ElementAccessExpression";
- SyntaxKind5[SyntaxKind5["CallExpression"] = 213] = "CallExpression";
- SyntaxKind5[SyntaxKind5["NewExpression"] = 214] = "NewExpression";
- SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 215] = "TaggedTemplateExpression";
- SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 216] = "TypeAssertionExpression";
- SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 217] = "ParenthesizedExpression";
- SyntaxKind5[SyntaxKind5["FunctionExpression"] = 218] = "FunctionExpression";
- SyntaxKind5[SyntaxKind5["ArrowFunction"] = 219] = "ArrowFunction";
- SyntaxKind5[SyntaxKind5["EtsComponentExpression"] = 220] = "EtsComponentExpression";
- SyntaxKind5[SyntaxKind5["DeleteExpression"] = 221] = "DeleteExpression";
- SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 222] = "TypeOfExpression";
- SyntaxKind5[SyntaxKind5["VoidExpression"] = 223] = "VoidExpression";
- SyntaxKind5[SyntaxKind5["AwaitExpression"] = 224] = "AwaitExpression";
- SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 225] = "PrefixUnaryExpression";
- SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 226] = "PostfixUnaryExpression";
- SyntaxKind5[SyntaxKind5["BinaryExpression"] = 227] = "BinaryExpression";
- SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 228] = "ConditionalExpression";
- SyntaxKind5[SyntaxKind5["TemplateExpression"] = 229] = "TemplateExpression";
- SyntaxKind5[SyntaxKind5["YieldExpression"] = 230] = "YieldExpression";
- SyntaxKind5[SyntaxKind5["SpreadElement"] = 231] = "SpreadElement";
- SyntaxKind5[SyntaxKind5["ClassExpression"] = 232] = "ClassExpression";
- SyntaxKind5[SyntaxKind5["OmittedExpression"] = 233] = "OmittedExpression";
- SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 234] = "ExpressionWithTypeArguments";
- SyntaxKind5[SyntaxKind5["AsExpression"] = 235] = "AsExpression";
- SyntaxKind5[SyntaxKind5["NonNullExpression"] = 236] = "NonNullExpression";
- SyntaxKind5[SyntaxKind5["MetaProperty"] = 237] = "MetaProperty";
- SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 238] = "SyntheticExpression";
- SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 239] = "SatisfiesExpression";
- SyntaxKind5[SyntaxKind5["TemplateSpan"] = 240] = "TemplateSpan";
- SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 241] = "SemicolonClassElement";
- SyntaxKind5[SyntaxKind5["Block"] = 242] = "Block";
- SyntaxKind5[SyntaxKind5["EmptyStatement"] = 243] = "EmptyStatement";
- SyntaxKind5[SyntaxKind5["VariableStatement"] = 244] = "VariableStatement";
- SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 245] = "ExpressionStatement";
- SyntaxKind5[SyntaxKind5["IfStatement"] = 246] = "IfStatement";
- SyntaxKind5[SyntaxKind5["DoStatement"] = 247] = "DoStatement";
- SyntaxKind5[SyntaxKind5["WhileStatement"] = 248] = "WhileStatement";
- SyntaxKind5[SyntaxKind5["ForStatement"] = 249] = "ForStatement";
- SyntaxKind5[SyntaxKind5["ForInStatement"] = 250] = "ForInStatement";
- SyntaxKind5[SyntaxKind5["ForOfStatement"] = 251] = "ForOfStatement";
- SyntaxKind5[SyntaxKind5["ContinueStatement"] = 252] = "ContinueStatement";
- SyntaxKind5[SyntaxKind5["BreakStatement"] = 253] = "BreakStatement";
- SyntaxKind5[SyntaxKind5["ReturnStatement"] = 254] = "ReturnStatement";
- SyntaxKind5[SyntaxKind5["WithStatement"] = 255] = "WithStatement";
- SyntaxKind5[SyntaxKind5["SwitchStatement"] = 256] = "SwitchStatement";
- SyntaxKind5[SyntaxKind5["LabeledStatement"] = 257] = "LabeledStatement";
- SyntaxKind5[SyntaxKind5["ThrowStatement"] = 258] = "ThrowStatement";
- SyntaxKind5[SyntaxKind5["TryStatement"] = 259] = "TryStatement";
- SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 260] = "DebuggerStatement";
- SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 261] = "VariableDeclaration";
- SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 262] = "VariableDeclarationList";
- SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 263] = "FunctionDeclaration";
- SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 264] = "ClassDeclaration";
- SyntaxKind5[SyntaxKind5["StructDeclaration"] = 265] = "StructDeclaration";
- SyntaxKind5[SyntaxKind5["AnnotationDeclaration"] = 266] = "AnnotationDeclaration";
- SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 267] = "InterfaceDeclaration";
- SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 268] = "TypeAliasDeclaration";
- SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 269] = "EnumDeclaration";
- SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 270] = "ModuleDeclaration";
- SyntaxKind5[SyntaxKind5["ModuleBlock"] = 271] = "ModuleBlock";
- SyntaxKind5[SyntaxKind5["CaseBlock"] = 272] = "CaseBlock";
- SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 273] = "NamespaceExportDeclaration";
- SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 274] = "ImportEqualsDeclaration";
- SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 275] = "ImportDeclaration";
- SyntaxKind5[SyntaxKind5["ImportClause"] = 276] = "ImportClause";
- SyntaxKind5[SyntaxKind5["NamespaceImport"] = 277] = "NamespaceImport";
- SyntaxKind5[SyntaxKind5["NamedImports"] = 278] = "NamedImports";
- SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 279] = "ImportSpecifier";
- SyntaxKind5[SyntaxKind5["ExportAssignment"] = 280] = "ExportAssignment";
- SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 281] = "ExportDeclaration";
- SyntaxKind5[SyntaxKind5["NamedExports"] = 282] = "NamedExports";
- SyntaxKind5[SyntaxKind5["NamespaceExport"] = 283] = "NamespaceExport";
- SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 284] = "ExportSpecifier";
- SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 285] = "MissingDeclaration";
- SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 286] = "ExternalModuleReference";
- SyntaxKind5[SyntaxKind5["JsxElement"] = 287] = "JsxElement";
- SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 288] = "JsxSelfClosingElement";
- SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 289] = "JsxOpeningElement";
- SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 290] = "JsxClosingElement";
- SyntaxKind5[SyntaxKind5["JsxFragment"] = 291] = "JsxFragment";
- SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 292] = "JsxOpeningFragment";
- SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 293] = "JsxClosingFragment";
- SyntaxKind5[SyntaxKind5["JsxAttribute"] = 294] = "JsxAttribute";
- SyntaxKind5[SyntaxKind5["JsxAttributes"] = 295] = "JsxAttributes";
- SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 296] = "JsxSpreadAttribute";
- SyntaxKind5[SyntaxKind5["JsxExpression"] = 297] = "JsxExpression";
- SyntaxKind5[SyntaxKind5["CaseClause"] = 298] = "CaseClause";
- SyntaxKind5[SyntaxKind5["DefaultClause"] = 299] = "DefaultClause";
- SyntaxKind5[SyntaxKind5["HeritageClause"] = 300] = "HeritageClause";
- SyntaxKind5[SyntaxKind5["CatchClause"] = 301] = "CatchClause";
- SyntaxKind5[SyntaxKind5["AssertClause"] = 302] = "AssertClause";
- SyntaxKind5[SyntaxKind5["AssertEntry"] = 303] = "AssertEntry";
- SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 304] = "ImportTypeAssertionContainer";
- SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 305] = "PropertyAssignment";
- SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 306] = "ShorthandPropertyAssignment";
- SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 307] = "SpreadAssignment";
- SyntaxKind5[SyntaxKind5["EnumMember"] = 308] = "EnumMember";
- SyntaxKind5[SyntaxKind5["UnparsedPrologue"] = 309] = "UnparsedPrologue";
- SyntaxKind5[SyntaxKind5["UnparsedPrepend"] = 310] = "UnparsedPrepend";
- SyntaxKind5[SyntaxKind5["UnparsedText"] = 311] = "UnparsedText";
- SyntaxKind5[SyntaxKind5["UnparsedInternalText"] = 312] = "UnparsedInternalText";
- SyntaxKind5[SyntaxKind5["UnparsedSyntheticReference"] = 313] = "UnparsedSyntheticReference";
- SyntaxKind5[SyntaxKind5["SourceFile"] = 314] = "SourceFile";
- SyntaxKind5[SyntaxKind5["Bundle"] = 315] = "Bundle";
- SyntaxKind5[SyntaxKind5["UnparsedSource"] = 316] = "UnparsedSource";
- SyntaxKind5[SyntaxKind5["InputFiles"] = 317] = "InputFiles";
- SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 318] = "JSDocTypeExpression";
- SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 319] = "JSDocNameReference";
- SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 320] = "JSDocMemberName";
- SyntaxKind5[SyntaxKind5["JSDocAllType"] = 321] = "JSDocAllType";
- SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 322] = "JSDocUnknownType";
- SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 323] = "JSDocNullableType";
- SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 324] = "JSDocNonNullableType";
- SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 325] = "JSDocOptionalType";
- SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 326] = "JSDocFunctionType";
- SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 327] = "JSDocVariadicType";
- SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 328] = "JSDocNamepathType";
- SyntaxKind5[SyntaxKind5["JSDoc"] = 329] = "JSDoc";
- SyntaxKind5[SyntaxKind5["JSDocComment"] = 329 /* JSDoc */] = "JSDocComment";
- SyntaxKind5[SyntaxKind5["JSDocText"] = 330] = "JSDocText";
- SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 331] = "JSDocTypeLiteral";
- SyntaxKind5[SyntaxKind5["JSDocSignature"] = 332] = "JSDocSignature";
- SyntaxKind5[SyntaxKind5["JSDocLink"] = 333] = "JSDocLink";
- SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 334] = "JSDocLinkCode";
- SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 335] = "JSDocLinkPlain";
- SyntaxKind5[SyntaxKind5["JSDocTag"] = 336] = "JSDocTag";
- SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 337] = "JSDocAugmentsTag";
- SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 338] = "JSDocImplementsTag";
- SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 339] = "JSDocAuthorTag";
- SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 340] = "JSDocDeprecatedTag";
- SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 341] = "JSDocClassTag";
- SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 342] = "JSDocPublicTag";
- SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 343] = "JSDocPrivateTag";
- SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 344] = "JSDocProtectedTag";
- SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 345] = "JSDocReadonlyTag";
- SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 346] = "JSDocOverrideTag";
- SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 347] = "JSDocCallbackTag";
- SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 348] = "JSDocEnumTag";
- SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 349] = "JSDocParameterTag";
- SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 350] = "JSDocReturnTag";
- SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 351] = "JSDocThisTag";
- SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 352] = "JSDocTypeTag";
- SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 353] = "JSDocTemplateTag";
- SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 354] = "JSDocTypedefTag";
- SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 355] = "JSDocSeeTag";
- SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 356] = "JSDocPropertyTag";
- SyntaxKind5[SyntaxKind5["SyntaxList"] = 357] = "SyntaxList";
- SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 358] = "NotEmittedStatement";
- SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 359] = "PartiallyEmittedExpression";
- SyntaxKind5[SyntaxKind5["CommaListExpression"] = 360] = "CommaListExpression";
- SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 361] = "MergeDeclarationMarker";
- SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 362] = "EndOfDeclarationMarker";
- SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 363] = "SyntheticReferenceExpression";
- SyntaxKind5[SyntaxKind5["Count"] = 364] = "Count";
+ SyntaxKind5[SyntaxKind5["OverloadKeyword"] = 164] = "OverloadKeyword";
+ SyntaxKind5[SyntaxKind5["OfKeyword"] = 165] = "OfKeyword";
+ SyntaxKind5[SyntaxKind5["QualifiedName"] = 166] = "QualifiedName";
+ SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 167] = "ComputedPropertyName";
+ SyntaxKind5[SyntaxKind5["TypeParameter"] = 168] = "TypeParameter";
+ SyntaxKind5[SyntaxKind5["Parameter"] = 169] = "Parameter";
+ SyntaxKind5[SyntaxKind5["Decorator"] = 170] = "Decorator";
+ SyntaxKind5[SyntaxKind5["PropertySignature"] = 171] = "PropertySignature";
+ SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 172] = "PropertyDeclaration";
+ SyntaxKind5[SyntaxKind5["AnnotationPropertyDeclaration"] = 173] = "AnnotationPropertyDeclaration";
+ SyntaxKind5[SyntaxKind5["OverloadPropertyDeclaration"] = 174] = "OverloadPropertyDeclaration";
+ SyntaxKind5[SyntaxKind5["MethodSignature"] = 175] = "MethodSignature";
+ SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 176] = "MethodDeclaration";
+ SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 177] = "ClassStaticBlockDeclaration";
+ SyntaxKind5[SyntaxKind5["Constructor"] = 178] = "Constructor";
+ SyntaxKind5[SyntaxKind5["GetAccessor"] = 179] = "GetAccessor";
+ SyntaxKind5[SyntaxKind5["SetAccessor"] = 180] = "SetAccessor";
+ SyntaxKind5[SyntaxKind5["CallSignature"] = 181] = "CallSignature";
+ SyntaxKind5[SyntaxKind5["ConstructSignature"] = 182] = "ConstructSignature";
+ SyntaxKind5[SyntaxKind5["IndexSignature"] = 183] = "IndexSignature";
+ SyntaxKind5[SyntaxKind5["TypePredicate"] = 184] = "TypePredicate";
+ SyntaxKind5[SyntaxKind5["TypeReference"] = 185] = "TypeReference";
+ SyntaxKind5[SyntaxKind5["FunctionType"] = 186] = "FunctionType";
+ SyntaxKind5[SyntaxKind5["ConstructorType"] = 187] = "ConstructorType";
+ SyntaxKind5[SyntaxKind5["TypeQuery"] = 188] = "TypeQuery";
+ SyntaxKind5[SyntaxKind5["TypeLiteral"] = 189] = "TypeLiteral";
+ SyntaxKind5[SyntaxKind5["ArrayType"] = 190] = "ArrayType";
+ SyntaxKind5[SyntaxKind5["TupleType"] = 191] = "TupleType";
+ SyntaxKind5[SyntaxKind5["OptionalType"] = 192] = "OptionalType";
+ SyntaxKind5[SyntaxKind5["RestType"] = 193] = "RestType";
+ SyntaxKind5[SyntaxKind5["UnionType"] = 194] = "UnionType";
+ SyntaxKind5[SyntaxKind5["IntersectionType"] = 195] = "IntersectionType";
+ SyntaxKind5[SyntaxKind5["ConditionalType"] = 196] = "ConditionalType";
+ SyntaxKind5[SyntaxKind5["InferType"] = 197] = "InferType";
+ SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 198] = "ParenthesizedType";
+ SyntaxKind5[SyntaxKind5["ThisType"] = 199] = "ThisType";
+ SyntaxKind5[SyntaxKind5["TypeOperator"] = 200] = "TypeOperator";
+ SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 201] = "IndexedAccessType";
+ SyntaxKind5[SyntaxKind5["MappedType"] = 202] = "MappedType";
+ SyntaxKind5[SyntaxKind5["LiteralType"] = 203] = "LiteralType";
+ SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 204] = "NamedTupleMember";
+ SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 205] = "TemplateLiteralType";
+ SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 206] = "TemplateLiteralTypeSpan";
+ SyntaxKind5[SyntaxKind5["ImportType"] = 207] = "ImportType";
+ SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 208] = "ObjectBindingPattern";
+ SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 209] = "ArrayBindingPattern";
+ SyntaxKind5[SyntaxKind5["BindingElement"] = 210] = "BindingElement";
+ SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 211] = "ArrayLiteralExpression";
+ SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 212] = "ObjectLiteralExpression";
+ SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 213] = "PropertyAccessExpression";
+ SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 214] = "ElementAccessExpression";
+ SyntaxKind5[SyntaxKind5["CallExpression"] = 215] = "CallExpression";
+ SyntaxKind5[SyntaxKind5["NewExpression"] = 216] = "NewExpression";
+ SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 217] = "TaggedTemplateExpression";
+ SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 218] = "TypeAssertionExpression";
+ SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 219] = "ParenthesizedExpression";
+ SyntaxKind5[SyntaxKind5["FunctionExpression"] = 220] = "FunctionExpression";
+ SyntaxKind5[SyntaxKind5["ArrowFunction"] = 221] = "ArrowFunction";
+ SyntaxKind5[SyntaxKind5["EtsComponentExpression"] = 222] = "EtsComponentExpression";
+ SyntaxKind5[SyntaxKind5["DeleteExpression"] = 223] = "DeleteExpression";
+ SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 224] = "TypeOfExpression";
+ SyntaxKind5[SyntaxKind5["VoidExpression"] = 225] = "VoidExpression";
+ SyntaxKind5[SyntaxKind5["AwaitExpression"] = 226] = "AwaitExpression";
+ SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 227] = "PrefixUnaryExpression";
+ SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 228] = "PostfixUnaryExpression";
+ SyntaxKind5[SyntaxKind5["BinaryExpression"] = 229] = "BinaryExpression";
+ SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 230] = "ConditionalExpression";
+ SyntaxKind5[SyntaxKind5["TemplateExpression"] = 231] = "TemplateExpression";
+ SyntaxKind5[SyntaxKind5["YieldExpression"] = 232] = "YieldExpression";
+ SyntaxKind5[SyntaxKind5["SpreadElement"] = 233] = "SpreadElement";
+ SyntaxKind5[SyntaxKind5["ClassExpression"] = 234] = "ClassExpression";
+ SyntaxKind5[SyntaxKind5["OmittedExpression"] = 235] = "OmittedExpression";
+ SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 236] = "ExpressionWithTypeArguments";
+ SyntaxKind5[SyntaxKind5["AsExpression"] = 237] = "AsExpression";
+ SyntaxKind5[SyntaxKind5["NonNullExpression"] = 238] = "NonNullExpression";
+ SyntaxKind5[SyntaxKind5["MetaProperty"] = 239] = "MetaProperty";
+ SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 240] = "SyntheticExpression";
+ SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 241] = "SatisfiesExpression";
+ SyntaxKind5[SyntaxKind5["TemplateSpan"] = 242] = "TemplateSpan";
+ SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 243] = "SemicolonClassElement";
+ SyntaxKind5[SyntaxKind5["Block"] = 244] = "Block";
+ SyntaxKind5[SyntaxKind5["EmptyStatement"] = 245] = "EmptyStatement";
+ SyntaxKind5[SyntaxKind5["VariableStatement"] = 246] = "VariableStatement";
+ SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 247] = "ExpressionStatement";
+ SyntaxKind5[SyntaxKind5["IfStatement"] = 248] = "IfStatement";
+ SyntaxKind5[SyntaxKind5["DoStatement"] = 249] = "DoStatement";
+ SyntaxKind5[SyntaxKind5["WhileStatement"] = 250] = "WhileStatement";
+ SyntaxKind5[SyntaxKind5["ForStatement"] = 251] = "ForStatement";
+ SyntaxKind5[SyntaxKind5["ForInStatement"] = 252] = "ForInStatement";
+ SyntaxKind5[SyntaxKind5["ForOfStatement"] = 253] = "ForOfStatement";
+ SyntaxKind5[SyntaxKind5["ContinueStatement"] = 254] = "ContinueStatement";
+ SyntaxKind5[SyntaxKind5["BreakStatement"] = 255] = "BreakStatement";
+ SyntaxKind5[SyntaxKind5["ReturnStatement"] = 256] = "ReturnStatement";
+ SyntaxKind5[SyntaxKind5["WithStatement"] = 257] = "WithStatement";
+ SyntaxKind5[SyntaxKind5["SwitchStatement"] = 258] = "SwitchStatement";
+ SyntaxKind5[SyntaxKind5["LabeledStatement"] = 259] = "LabeledStatement";
+ SyntaxKind5[SyntaxKind5["ThrowStatement"] = 260] = "ThrowStatement";
+ SyntaxKind5[SyntaxKind5["TryStatement"] = 261] = "TryStatement";
+ SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 262] = "DebuggerStatement";
+ SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 263] = "VariableDeclaration";
+ SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 264] = "VariableDeclarationList";
+ SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 265] = "FunctionDeclaration";
+ SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 266] = "ClassDeclaration";
+ SyntaxKind5[SyntaxKind5["StructDeclaration"] = 267] = "StructDeclaration";
+ SyntaxKind5[SyntaxKind5["AnnotationDeclaration"] = 268] = "AnnotationDeclaration";
+ SyntaxKind5[SyntaxKind5["OverloadDeclaration"] = 269] = "OverloadDeclaration";
+ SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 270] = "InterfaceDeclaration";
+ SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 271] = "TypeAliasDeclaration";
+ SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 272] = "EnumDeclaration";
+ SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 273] = "ModuleDeclaration";
+ SyntaxKind5[SyntaxKind5["ModuleBlock"] = 274] = "ModuleBlock";
+ SyntaxKind5[SyntaxKind5["CaseBlock"] = 275] = "CaseBlock";
+ SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 276] = "NamespaceExportDeclaration";
+ SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 277] = "ImportEqualsDeclaration";
+ SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 278] = "ImportDeclaration";
+ SyntaxKind5[SyntaxKind5["ImportClause"] = 279] = "ImportClause";
+ SyntaxKind5[SyntaxKind5["NamespaceImport"] = 280] = "NamespaceImport";
+ SyntaxKind5[SyntaxKind5["NamedImports"] = 281] = "NamedImports";
+ SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 282] = "ImportSpecifier";
+ SyntaxKind5[SyntaxKind5["ExportAssignment"] = 283] = "ExportAssignment";
+ SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 284] = "ExportDeclaration";
+ SyntaxKind5[SyntaxKind5["NamedExports"] = 285] = "NamedExports";
+ SyntaxKind5[SyntaxKind5["NamespaceExport"] = 286] = "NamespaceExport";
+ SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 287] = "ExportSpecifier";
+ SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 288] = "MissingDeclaration";
+ SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 289] = "ExternalModuleReference";
+ SyntaxKind5[SyntaxKind5["JsxElement"] = 290] = "JsxElement";
+ SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 291] = "JsxSelfClosingElement";
+ SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 292] = "JsxOpeningElement";
+ SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 293] = "JsxClosingElement";
+ SyntaxKind5[SyntaxKind5["JsxFragment"] = 294] = "JsxFragment";
+ SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 295] = "JsxOpeningFragment";
+ SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 296] = "JsxClosingFragment";
+ SyntaxKind5[SyntaxKind5["JsxAttribute"] = 297] = "JsxAttribute";
+ SyntaxKind5[SyntaxKind5["JsxAttributes"] = 298] = "JsxAttributes";
+ SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 299] = "JsxSpreadAttribute";
+ SyntaxKind5[SyntaxKind5["JsxExpression"] = 300] = "JsxExpression";
+ SyntaxKind5[SyntaxKind5["CaseClause"] = 301] = "CaseClause";
+ SyntaxKind5[SyntaxKind5["DefaultClause"] = 302] = "DefaultClause";
+ SyntaxKind5[SyntaxKind5["HeritageClause"] = 303] = "HeritageClause";
+ SyntaxKind5[SyntaxKind5["CatchClause"] = 304] = "CatchClause";
+ SyntaxKind5[SyntaxKind5["AssertClause"] = 305] = "AssertClause";
+ SyntaxKind5[SyntaxKind5["AssertEntry"] = 306] = "AssertEntry";
+ SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 307] = "ImportTypeAssertionContainer";
+ SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 308] = "PropertyAssignment";
+ SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 309] = "ShorthandPropertyAssignment";
+ SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 310] = "SpreadAssignment";
+ SyntaxKind5[SyntaxKind5["EnumMember"] = 311] = "EnumMember";
+ SyntaxKind5[SyntaxKind5["UnparsedPrologue"] = 312] = "UnparsedPrologue";
+ SyntaxKind5[SyntaxKind5["UnparsedPrepend"] = 313] = "UnparsedPrepend";
+ SyntaxKind5[SyntaxKind5["UnparsedText"] = 314] = "UnparsedText";
+ SyntaxKind5[SyntaxKind5["UnparsedInternalText"] = 315] = "UnparsedInternalText";
+ SyntaxKind5[SyntaxKind5["UnparsedSyntheticReference"] = 316] = "UnparsedSyntheticReference";
+ SyntaxKind5[SyntaxKind5["SourceFile"] = 317] = "SourceFile";
+ SyntaxKind5[SyntaxKind5["Bundle"] = 318] = "Bundle";
+ SyntaxKind5[SyntaxKind5["UnparsedSource"] = 319] = "UnparsedSource";
+ SyntaxKind5[SyntaxKind5["InputFiles"] = 320] = "InputFiles";
+ SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 321] = "JSDocTypeExpression";
+ SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 322] = "JSDocNameReference";
+ SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 323] = "JSDocMemberName";
+ SyntaxKind5[SyntaxKind5["JSDocAllType"] = 324] = "JSDocAllType";
+ SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 325] = "JSDocUnknownType";
+ SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 326] = "JSDocNullableType";
+ SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 327] = "JSDocNonNullableType";
+ SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 328] = "JSDocOptionalType";
+ SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 329] = "JSDocFunctionType";
+ SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 330] = "JSDocVariadicType";
+ SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 331] = "JSDocNamepathType";
+ SyntaxKind5[SyntaxKind5["JSDoc"] = 332] = "JSDoc";
+ SyntaxKind5[SyntaxKind5["JSDocComment"] = 332 /* JSDoc */] = "JSDocComment";
+ SyntaxKind5[SyntaxKind5["JSDocText"] = 333] = "JSDocText";
+ SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 334] = "JSDocTypeLiteral";
+ SyntaxKind5[SyntaxKind5["JSDocSignature"] = 335] = "JSDocSignature";
+ SyntaxKind5[SyntaxKind5["JSDocLink"] = 336] = "JSDocLink";
+ SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 337] = "JSDocLinkCode";
+ SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 338] = "JSDocLinkPlain";
+ SyntaxKind5[SyntaxKind5["JSDocTag"] = 339] = "JSDocTag";
+ SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 340] = "JSDocAugmentsTag";
+ SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 341] = "JSDocImplementsTag";
+ SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 342] = "JSDocAuthorTag";
+ SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 343] = "JSDocDeprecatedTag";
+ SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 344] = "JSDocClassTag";
+ SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 345] = "JSDocPublicTag";
+ SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 346] = "JSDocPrivateTag";
+ SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 347] = "JSDocProtectedTag";
+ SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 348] = "JSDocReadonlyTag";
+ SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 349] = "JSDocOverrideTag";
+ SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 350] = "JSDocCallbackTag";
+ SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 351] = "JSDocEnumTag";
+ SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 352] = "JSDocParameterTag";
+ SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 353] = "JSDocReturnTag";
+ SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 354] = "JSDocThisTag";
+ SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 355] = "JSDocTypeTag";
+ SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 356] = "JSDocTemplateTag";
+ SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 357] = "JSDocTypedefTag";
+ SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 358] = "JSDocSeeTag";
+ SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 359] = "JSDocPropertyTag";
+ SyntaxKind5[SyntaxKind5["SyntaxList"] = 360] = "SyntaxList";
+ SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 361] = "NotEmittedStatement";
+ SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 362] = "PartiallyEmittedExpression";
+ SyntaxKind5[SyntaxKind5["CommaListExpression"] = 363] = "CommaListExpression";
+ SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 364] = "MergeDeclarationMarker";
+ SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 365] = "EndOfDeclarationMarker";
+ SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 366] = "SyntheticReferenceExpression";
+ SyntaxKind5[SyntaxKind5["Count"] = 367] = "Count";
SyntaxKind5[SyntaxKind5["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
SyntaxKind5[SyntaxKind5["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -6673,15 +6679,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
SyntaxKind5[SyntaxKind5["FirstReservedWord"] = 81 /* BreakKeyword */] = "FirstReservedWord";
SyntaxKind5[SyntaxKind5["LastReservedWord"] = 117 /* WithKeyword */] = "LastReservedWord";
SyntaxKind5[SyntaxKind5["FirstKeyword"] = 81 /* BreakKeyword */] = "FirstKeyword";
- SyntaxKind5[SyntaxKind5["LastKeyword"] = 164 /* OfKeyword */] = "LastKeyword";
+ SyntaxKind5[SyntaxKind5["LastKeyword"] = 165 /* OfKeyword */] = "LastKeyword";
SyntaxKind5[SyntaxKind5["FirstFutureReservedWord"] = 118 /* ImplementsKeyword */] = "FirstFutureReservedWord";
SyntaxKind5[SyntaxKind5["LastFutureReservedWord"] = 126 /* YieldKeyword */] = "LastFutureReservedWord";
- SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 182 /* TypePredicate */] = "FirstTypeNode";
- SyntaxKind5[SyntaxKind5["LastTypeNode"] = 205 /* ImportType */] = "LastTypeNode";
+ SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 184 /* TypePredicate */] = "FirstTypeNode";
+ SyntaxKind5[SyntaxKind5["LastTypeNode"] = 207 /* ImportType */] = "LastTypeNode";
SyntaxKind5[SyntaxKind5["FirstPunctuation"] = 18 /* OpenBraceToken */] = "FirstPunctuation";
SyntaxKind5[SyntaxKind5["LastPunctuation"] = 78 /* CaretEqualsToken */] = "LastPunctuation";
SyntaxKind5[SyntaxKind5["FirstToken"] = 0 /* Unknown */] = "FirstToken";
- SyntaxKind5[SyntaxKind5["LastToken"] = 164 /* LastKeyword */] = "LastToken";
+ SyntaxKind5[SyntaxKind5["LastToken"] = 165 /* LastKeyword */] = "LastToken";
SyntaxKind5[SyntaxKind5["FirstTriviaToken"] = 2 /* SingleLineCommentTrivia */] = "FirstTriviaToken";
SyntaxKind5[SyntaxKind5["LastTriviaToken"] = 7 /* ConflictMarkerTrivia */] = "LastTriviaToken";
SyntaxKind5[SyntaxKind5["FirstLiteralToken"] = 8 /* NumericLiteral */] = "FirstLiteralToken";
@@ -6690,15 +6696,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
SyntaxKind5[SyntaxKind5["LastTemplateToken"] = 17 /* TemplateTail */] = "LastTemplateToken";
SyntaxKind5[SyntaxKind5["FirstBinaryOperator"] = 29 /* LessThanToken */] = "FirstBinaryOperator";
SyntaxKind5[SyntaxKind5["LastBinaryOperator"] = 78 /* CaretEqualsToken */] = "LastBinaryOperator";
- SyntaxKind5[SyntaxKind5["FirstStatement"] = 244 /* VariableStatement */] = "FirstStatement";
- SyntaxKind5[SyntaxKind5["LastStatement"] = 260 /* DebuggerStatement */] = "LastStatement";
- SyntaxKind5[SyntaxKind5["FirstNode"] = 165 /* QualifiedName */] = "FirstNode";
- SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 318 /* JSDocTypeExpression */] = "FirstJSDocNode";
- SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 356 /* JSDocPropertyTag */] = "LastJSDocNode";
- SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 336 /* JSDocTag */] = "FirstJSDocTagNode";
- SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 356 /* JSDocPropertyTag */] = "LastJSDocTagNode";
+ SyntaxKind5[SyntaxKind5["FirstStatement"] = 246 /* VariableStatement */] = "FirstStatement";
+ SyntaxKind5[SyntaxKind5["LastStatement"] = 262 /* DebuggerStatement */] = "LastStatement";
+ SyntaxKind5[SyntaxKind5["FirstNode"] = 166 /* QualifiedName */] = "FirstNode";
+ SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 321 /* JSDocTypeExpression */] = "FirstJSDocNode";
+ SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 359 /* JSDocPropertyTag */] = "LastJSDocNode";
+ SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 339 /* JSDocTag */] = "FirstJSDocTagNode";
+ SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 359 /* JSDocPropertyTag */] = "LastJSDocTagNode";
SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 127 /* AbstractKeyword */] = "FirstContextualKeyword";
- SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 164 /* OfKeyword */] = "LastContextualKeyword";
+ SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword";
return SyntaxKind5;
})(SyntaxKind || {});
var NodeFlags = /* @__PURE__ */ ((NodeFlags4) => {
@@ -11715,6 +11721,7 @@ var textToKeywordObj = {
protected: 123 /* ProtectedKeyword */,
public: 124 /* PublicKeyword */,
override: 163 /* OverrideKeyword */,
+ overload: 164 /* OverloadKeyword */,
out: 146 /* OutKeyword */,
readonly: 147 /* ReadonlyKeyword */,
require: 148 /* RequireKeyword */,
@@ -11745,7 +11752,7 @@ var textToKeywordObj = {
yield: 126 /* YieldKeyword */,
async: 133 /* AsyncKeyword */,
await: 134 /* AwaitKeyword */,
- of: 164 /* OfKeyword */
+ of: 165 /* OfKeyword */
};
var textToKeyword = new Map2(getEntries(textToKeywordObj));
var textToToken = new Map2(getEntries({
@@ -13820,16 +13827,16 @@ function collapseTextChangeRangesAcrossMultipleVersions(changes) {
return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
}
function getTypeParameterOwner(d) {
- if (d && d.kind === 167 /* TypeParameter */) {
+ if (d && d.kind === 168 /* TypeParameter */) {
for (let current = d; current; current = current.parent) {
- if (isFunctionLike(current) || isClassLike(current) || current.kind === 267 /* InterfaceDeclaration */) {
+ if (isFunctionLike(current) || isClassLike(current) || current.kind === 270 /* InterfaceDeclaration */) {
return current;
}
}
}
}
function isParameterPropertyDeclaration(node, parent2) {
- return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 176 /* Constructor */;
+ return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 178 /* Constructor */;
}
function isEmptyBindingPattern(node) {
if (isBindingPattern(node)) {
@@ -13855,14 +13862,14 @@ function getCombinedFlags(node, getFlags) {
node = walkUpBindingElementsAndPatterns(node);
}
let flags = getFlags(node);
- if (node.kind === 261 /* VariableDeclaration */) {
+ if (node.kind === 263 /* VariableDeclaration */) {
node = node.parent;
}
- if (node && node.kind === 262 /* VariableDeclarationList */) {
+ if (node && node.kind === 264 /* VariableDeclarationList */) {
flags |= getFlags(node);
node = node.parent;
}
- if (node && node.kind === 244 /* VariableStatement */) {
+ if (node && node.kind === 246 /* VariableStatement */) {
flags |= getFlags(node);
}
return flags;
@@ -13983,30 +13990,30 @@ function nameForNamelessJSDocTypedef(declaration) {
return getDeclarationIdentifier(hostNode);
}
switch (hostNode.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (hostNode.declarationList && hostNode.declarationList.declarations[0]) {
return getDeclarationIdentifier(hostNode.declarationList.declarations[0]);
}
break;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
let expr = hostNode.expression;
- if (expr.kind === 227 /* BinaryExpression */ && expr.operatorToken.kind === 63 /* EqualsToken */) {
+ if (expr.kind === 229 /* BinaryExpression */ && expr.operatorToken.kind === 63 /* EqualsToken */) {
expr = expr.left;
}
switch (expr.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return expr.name;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const arg = expr.argumentExpression;
if (isIdentifier(arg)) {
return arg;
}
}
break;
- case 217 /* ParenthesizedExpression */: {
+ case 219 /* ParenthesizedExpression */: {
return getDeclarationIdentifier(hostNode.expression);
}
- case 257 /* LabeledStatement */: {
+ case 259 /* LabeledStatement */: {
if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) {
return getDeclarationIdentifier(hostNode.statement);
}
@@ -14037,16 +14044,16 @@ function getNonAssignedNameOfDeclaration(declaration) {
switch (declaration.kind) {
case 79 /* Identifier */:
return declaration;
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */: {
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */: {
const { name } = declaration;
- if (name.kind === 165 /* QualifiedName */) {
+ if (name.kind === 166 /* QualifiedName */) {
return name.right;
}
break;
}
- case 213 /* CallExpression */:
- case 227 /* BinaryExpression */: {
+ case 215 /* CallExpression */:
+ case 229 /* BinaryExpression */: {
const expr2 = declaration;
switch (getAssignmentDeclarationKind(expr2)) {
case 1 /* ExportsProperty */:
@@ -14062,15 +14069,15 @@ function getNonAssignedNameOfDeclaration(declaration) {
return void 0;
}
}
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return getNameOfJSDocTypedef(declaration);
- case 348 /* JSDocEnumTag */:
+ case 351 /* JSDocEnumTag */:
return nameForNamelessJSDocTypedef(declaration);
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
const { expression } = declaration;
return isIdentifier(expression) ? expression : void 0;
}
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = declaration;
if (isBindableStaticElementAccessExpression(expr)) {
return expr.argumentExpression;
@@ -14284,10 +14291,10 @@ function getAllJSDocTagsOfKind(node, kind) {
return getJSDocTags(node).filter((doc) => doc.kind === kind);
}
function getTextOfJSDocComment(comment) {
- return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 330 /* JSDocText */ ? c.text : formatJSDocLink(c)).join("");
+ return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 333 /* JSDocText */ ? c.text : formatJSDocLink(c)).join("");
}
function formatJSDocLink(link) {
- const kind = link.kind === 333 /* JSDocLink */ ? "link" : link.kind === 334 /* JSDocLinkCode */ ? "linkcode" : "linkplain";
+ const kind = link.kind === 336 /* JSDocLink */ ? "link" : link.kind === 337 /* JSDocLinkCode */ ? "linkcode" : "linkplain";
const name = link.name ? entityNameToString(link.name) : "";
const space = link.name && link.text.startsWith("://") ? "" : " ";
return `{@${kind} ${name}${space}${link.text}}`;
@@ -14297,7 +14304,7 @@ function getEffectiveTypeParameterDeclarations(node) {
return emptyArray;
}
if (isJSDocTypeAlias(node)) {
- Debug.assert(node.parent.kind === 329 /* JSDoc */);
+ Debug.assert(node.parent.kind === 332 /* JSDoc */);
return flatMap(node.parent.tags, (tag) => isJSDocTemplateTag(tag) ? tag.typeParameters : void 0);
}
if (node.typeParameters) {
@@ -14325,7 +14332,7 @@ function isMemberName(node) {
return node.kind === 79 /* Identifier */ || node.kind === 80 /* PrivateIdentifier */;
}
function isGetOrSetAccessorDeclaration(node) {
- return node.kind === 178 /* SetAccessor */ || node.kind === 177 /* GetAccessor */;
+ return node.kind === 180 /* SetAccessor */ || node.kind === 179 /* GetAccessor */;
}
function isPropertyAccessChain(node) {
return isPropertyAccessExpression(node) && !!(node.flags & 32 /* OptionalChain */);
@@ -14338,7 +14345,7 @@ function isCallChain(node) {
}
function isOptionalChain(node) {
const kind = node.kind;
- return !!(node.flags & 32 /* OptionalChain */) && (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */ || kind === 213 /* CallExpression */ || kind === 236 /* NonNullExpression */);
+ return !!(node.flags & 32 /* OptionalChain */) && (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */ || kind === 215 /* CallExpression */ || kind === 238 /* NonNullExpression */);
}
function isOptionalChainRoot(node) {
return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken;
@@ -14350,7 +14357,7 @@ function isOutermostOptionalChain(node) {
return !isOptionalChain(node.parent) || isOptionalChainRoot(node.parent) || node !== node.parent.expression;
}
function isNullishCoalesce(node) {
- return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
+ return node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
}
function isConstTypeReference(node) {
return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "const" && !node.typeArguments;
@@ -14362,34 +14369,34 @@ function isNonNullChain(node) {
return isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */);
}
function isBreakOrContinueStatement(node) {
- return node.kind === 253 /* BreakStatement */ || node.kind === 252 /* ContinueStatement */;
+ return node.kind === 255 /* BreakStatement */ || node.kind === 254 /* ContinueStatement */;
}
function isNamedExportBindings(node) {
- return node.kind === 283 /* NamespaceExport */ || node.kind === 282 /* NamedExports */;
+ return node.kind === 286 /* NamespaceExport */ || node.kind === 285 /* NamedExports */;
}
function isUnparsedTextLike(node) {
switch (node.kind) {
- case 311 /* UnparsedText */:
- case 312 /* UnparsedInternalText */:
+ case 314 /* UnparsedText */:
+ case 315 /* UnparsedInternalText */:
return true;
default:
return false;
}
}
function isUnparsedNode(node) {
- return isUnparsedTextLike(node) || node.kind === 309 /* UnparsedPrologue */ || node.kind === 313 /* UnparsedSyntheticReference */;
+ return isUnparsedTextLike(node) || node.kind === 312 /* UnparsedPrologue */ || node.kind === 316 /* UnparsedSyntheticReference */;
}
function isJSDocPropertyLikeTag(node) {
- return node.kind === 356 /* JSDocPropertyTag */ || node.kind === 349 /* JSDocParameterTag */;
+ return node.kind === 359 /* JSDocPropertyTag */ || node.kind === 352 /* JSDocParameterTag */;
}
function isNode(node) {
return isNodeKind(node.kind);
}
function isNodeKind(kind) {
- return kind >= 165 /* FirstNode */;
+ return kind >= 166 /* FirstNode */;
}
function isTokenKind(kind) {
- return kind >= 0 /* FirstToken */ && kind <= 164 /* LastToken */;
+ return kind >= 0 /* FirstToken */ && kind <= 165 /* LastToken */;
}
function isToken(n) {
return isTokenKind(n.kind);
@@ -14405,11 +14412,11 @@ function isLiteralExpression(node) {
}
function isLiteralExpressionOfObject(node) {
switch (node.kind) {
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
case 13 /* RegularExpressionLiteral */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
return true;
}
return false;
@@ -14429,13 +14436,13 @@ function isImportOrExportSpecifier(node) {
}
function isTypeOnlyImportOrExportDeclaration(node) {
switch (node.kind) {
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return node.isTypeOnly || node.parent.parent.isTypeOnly;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return node.parent.isTypeOnly;
- case 276 /* ImportClause */:
- case 274 /* ImportEqualsDeclaration */:
+ case 279 /* ImportClause */:
+ case 277 /* ImportEqualsDeclaration */:
return node.isTypeOnly;
default:
return false;
@@ -14491,15 +14498,15 @@ function isModifier(node) {
}
function isEntityName(node) {
const kind = node.kind;
- return kind === 165 /* QualifiedName */ || kind === 79 /* Identifier */;
+ return kind === 166 /* QualifiedName */ || kind === 79 /* Identifier */;
}
function isPropertyName(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 80 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ || kind === 166 /* ComputedPropertyName */;
+ return kind === 79 /* Identifier */ || kind === 80 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ || kind === 167 /* ComputedPropertyName */;
}
function isBindingName(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 206 /* ObjectBindingPattern */ || kind === 207 /* ArrayBindingPattern */;
+ return kind === 79 /* Identifier */ || kind === 208 /* ObjectBindingPattern */ || kind === 209 /* ArrayBindingPattern */;
}
function isFunctionLike(node) {
return !!node && isFunctionLikeKind(node.kind);
@@ -14515,13 +14522,13 @@ function isBooleanLiteral(node) {
}
function isFunctionLikeDeclarationKind(kind) {
switch (kind) {
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
default:
return false;
@@ -14529,14 +14536,14 @@ function isFunctionLikeDeclarationKind(kind) {
}
function isFunctionLikeKind(kind) {
switch (kind) {
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 184 /* FunctionType */:
- case 326 /* JSDocFunctionType */:
- case 185 /* ConstructorType */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 186 /* FunctionType */:
+ case 329 /* JSDocFunctionType */:
+ case 187 /* ConstructorType */:
return true;
default:
return isFunctionLikeDeclarationKind(kind);
@@ -14547,29 +14554,33 @@ function isFunctionOrModuleBlock(node) {
}
function isAnnotationElement(node) {
const kind = node.kind;
- return kind === 172 /* AnnotationPropertyDeclaration */;
+ return kind === 173 /* AnnotationPropertyDeclaration */;
+}
+function isOverloadElement(node) {
+ const kind = node.kind;
+ return kind === 174 /* OverloadPropertyDeclaration */;
}
function isClassElement(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 171 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 241 /* SemicolonClassElement */;
+ return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */;
}
function isClassLike(node) {
- return node && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || node.kind === 265 /* StructDeclaration */);
+ return node && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 267 /* StructDeclaration */);
}
function isStruct(node) {
- return node && node.kind === 265 /* StructDeclaration */;
+ return node && node.kind === 267 /* StructDeclaration */;
}
function isAccessor(node) {
- return node && (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */);
+ return node && (node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */);
}
function isAutoAccessorPropertyDeclaration(node) {
return isPropertyDeclaration(node) && hasAccessorModifier(node);
}
function isMethodOrAccessor(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -14577,10 +14588,10 @@ function isMethodOrAccessor(node) {
}
function isNamedClassElement(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
return true;
default:
return false;
@@ -14591,22 +14602,22 @@ function isModifierLike(node) {
}
function isTypeElement(node) {
const kind = node.kind;
- return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 170 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function isClassOrTypeElement(node) {
return isTypeElement(node) || isClassElement(node);
}
function isObjectLiteralElementLike(node) {
const kind = node.kind;
- return kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 307 /* SpreadAssignment */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 310 /* SpreadAssignment */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function isTypeNode(node) {
return isTypeNodeKind(node.kind);
}
function isFunctionOrConstructorTypeNode(node) {
switch (node.kind) {
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return true;
}
return false;
@@ -14614,23 +14625,23 @@ function isFunctionOrConstructorTypeNode(node) {
function isBindingPattern(node) {
if (node) {
const kind = node.kind;
- return kind === 207 /* ArrayBindingPattern */ || kind === 206 /* ObjectBindingPattern */;
+ return kind === 209 /* ArrayBindingPattern */ || kind === 208 /* ObjectBindingPattern */;
}
return false;
}
function isAssignmentPattern(node) {
const kind = node.kind;
- return kind === 209 /* ArrayLiteralExpression */ || kind === 210 /* ObjectLiteralExpression */;
+ return kind === 211 /* ArrayLiteralExpression */ || kind === 212 /* ObjectLiteralExpression */;
}
function isArrayBindingElement(node) {
const kind = node.kind;
- return kind === 208 /* BindingElement */ || kind === 233 /* OmittedExpression */;
+ return kind === 210 /* BindingElement */ || kind === 235 /* OmittedExpression */;
}
function isDeclarationBindingElement(bindingElement) {
switch (bindingElement.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
return true;
}
return false;
@@ -14640,78 +14651,78 @@ function isBindingOrAssignmentPattern(node) {
}
function isObjectBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 206 /* ObjectBindingPattern */:
- case 210 /* ObjectLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 212 /* ObjectLiteralExpression */:
return true;
}
return false;
}
function isObjectBindingOrAssignmentElement(node) {
switch (node.kind) {
- case 208 /* BindingElement */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 210 /* BindingElement */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return true;
}
return false;
}
function isArrayBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return true;
}
return false;
}
function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
const kind = node.kind;
- return kind === 211 /* PropertyAccessExpression */ || kind === 165 /* QualifiedName */ || kind === 205 /* ImportType */;
+ return kind === 213 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */ || kind === 207 /* ImportType */;
}
function isPropertyAccessOrQualifiedName(node) {
const kind = node.kind;
- return kind === 211 /* PropertyAccessExpression */ || kind === 165 /* QualifiedName */;
+ return kind === 213 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
}
function isCallLikeExpression(node) {
switch (node.kind) {
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 215 /* TaggedTemplateExpression */:
- case 169 /* Decorator */:
- case 220 /* EtsComponentExpression */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 170 /* Decorator */:
+ case 222 /* EtsComponentExpression */:
return true;
default:
return false;
}
}
function isCallOrNewExpression(node) {
- return node.kind === 213 /* CallExpression */ || node.kind === 214 /* NewExpression */;
+ return node.kind === 215 /* CallExpression */ || node.kind === 216 /* NewExpression */;
}
function isTemplateLiteral(node) {
const kind = node.kind;
- return kind === 229 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */;
+ return kind === 231 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */;
}
function isLeftHandSideExpression(node) {
return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind);
}
function isLeftHandSideExpressionKind(kind) {
switch (kind) {
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
- case 214 /* NewExpression */:
- case 213 /* CallExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
- case 215 /* TaggedTemplateExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 217 /* ParenthesizedExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 220 /* EtsComponentExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 216 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
+ case 217 /* TaggedTemplateExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 222 /* EtsComponentExpression */:
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
case 13 /* RegularExpressionLiteral */:
@@ -14719,15 +14730,15 @@ function isLeftHandSideExpressionKind(kind) {
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
case 96 /* FalseKeyword */:
case 105 /* NullKeyword */:
case 109 /* ThisKeyword */:
case 111 /* TrueKeyword */:
case 107 /* SuperKeyword */:
- case 236 /* NonNullExpression */:
- case 234 /* ExpressionWithTypeArguments */:
- case 237 /* MetaProperty */:
+ case 238 /* NonNullExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 239 /* MetaProperty */:
case 101 /* ImportKeyword */:
return true;
default:
@@ -14739,13 +14750,13 @@ function isUnaryExpression(node) {
}
function isUnaryExpressionKind(kind) {
switch (kind) {
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
- case 221 /* DeleteExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 224 /* AwaitExpression */:
- case 216 /* TypeAssertionExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 223 /* DeleteExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 226 /* AwaitExpression */:
+ case 218 /* TypeAssertionExpression */:
return true;
default:
return isLeftHandSideExpressionKind(kind);
@@ -14753,9 +14764,9 @@ function isUnaryExpressionKind(kind) {
}
function isUnaryExpressionWithWrite(expr) {
switch (expr.kind) {
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return true;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */;
default:
return false;
@@ -14766,16 +14777,16 @@ function isExpression(node) {
}
function isExpressionKind(kind) {
switch (kind) {
- case 228 /* ConditionalExpression */:
- case 230 /* YieldExpression */:
- case 219 /* ArrowFunction */:
- case 227 /* BinaryExpression */:
- case 231 /* SpreadElement */:
- case 235 /* AsExpression */:
- case 233 /* OmittedExpression */:
- case 360 /* CommaListExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 239 /* SatisfiesExpression */:
+ case 230 /* ConditionalExpression */:
+ case 232 /* YieldExpression */:
+ case 221 /* ArrowFunction */:
+ case 229 /* BinaryExpression */:
+ case 233 /* SpreadElement */:
+ case 237 /* AsExpression */:
+ case 235 /* OmittedExpression */:
+ case 363 /* CommaListExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 241 /* SatisfiesExpression */:
return true;
default:
return isUnaryExpressionKind(kind);
@@ -14783,20 +14794,20 @@ function isExpressionKind(kind) {
}
function isAssertionExpression(node) {
const kind = node.kind;
- return kind === 216 /* TypeAssertionExpression */ || kind === 235 /* AsExpression */;
+ return kind === 218 /* TypeAssertionExpression */ || kind === 237 /* AsExpression */;
}
function isNotEmittedOrPartiallyEmittedNode(node) {
return isNotEmittedStatement(node) || isPartiallyEmittedExpression(node);
}
function isIterationStatement(node, lookInLabeledStatements) {
switch (node.kind) {
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return true;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
}
return false;
@@ -14855,7 +14866,7 @@ function allImportsAreAnnotations(imports, resolver) {
});
}
function isForInOrOfStatement(node) {
- return node.kind === 250 /* ForInStatement */ || node.kind === 251 /* ForOfStatement */;
+ return node.kind === 252 /* ForInStatement */ || node.kind === 253 /* ForOfStatement */;
}
function isConciseBody(node) {
return isBlock(node) || isExpression(node);
@@ -14868,35 +14879,35 @@ function isForInitializer(node) {
}
function isModuleBody(node) {
const kind = node.kind;
- return kind === 271 /* ModuleBlock */ || kind === 270 /* ModuleDeclaration */ || kind === 79 /* Identifier */;
+ return kind === 274 /* ModuleBlock */ || kind === 273 /* ModuleDeclaration */ || kind === 79 /* Identifier */;
}
function isNamespaceBody(node) {
const kind = node.kind;
- return kind === 271 /* ModuleBlock */ || kind === 270 /* ModuleDeclaration */;
+ return kind === 274 /* ModuleBlock */ || kind === 273 /* ModuleDeclaration */;
}
function isJSDocNamespaceBody(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 270 /* ModuleDeclaration */;
+ return kind === 79 /* Identifier */ || kind === 273 /* ModuleDeclaration */;
}
function isNamedImportBindings(node) {
const kind = node.kind;
- return kind === 278 /* NamedImports */ || kind === 277 /* NamespaceImport */;
+ return kind === 281 /* NamedImports */ || kind === 280 /* NamespaceImport */;
}
function isModuleOrEnumDeclaration(node) {
- return node.kind === 270 /* ModuleDeclaration */ || node.kind === 269 /* EnumDeclaration */;
+ return node.kind === 273 /* ModuleDeclaration */ || node.kind === 272 /* EnumDeclaration */;
}
function isDeclarationKind(kind) {
- return kind === 219 /* ArrowFunction */ || kind === 208 /* BindingElement */ || kind === 264 /* ClassDeclaration */ || kind === 232 /* ClassExpression */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 176 /* Constructor */ || kind === 269 /* EnumDeclaration */ || kind === 308 /* EnumMember */ || kind === 284 /* ExportSpecifier */ || kind === 263 /* FunctionDeclaration */ || kind === 218 /* FunctionExpression */ || kind === 177 /* GetAccessor */ || kind === 276 /* ImportClause */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 279 /* ImportSpecifier */ || kind === 267 /* InterfaceDeclaration */ || kind === 294 /* JsxAttribute */ || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 270 /* ModuleDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 277 /* NamespaceImport */ || kind === 283 /* NamespaceExport */ || kind === 168 /* Parameter */ || kind === 305 /* PropertyAssignment */ || kind === 171 /* PropertyDeclaration */ || kind === 172 /* AnnotationPropertyDeclaration */ || kind === 170 /* PropertySignature */ || kind === 178 /* SetAccessor */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 268 /* TypeAliasDeclaration */ || kind === 167 /* TypeParameter */ || kind === 261 /* VariableDeclaration */ || kind === 354 /* JSDocTypedefTag */ || kind === 347 /* JSDocCallbackTag */ || kind === 356 /* JSDocPropertyTag */;
+ return kind === 221 /* ArrowFunction */ || kind === 210 /* BindingElement */ || kind === 266 /* ClassDeclaration */ || kind === 234 /* ClassExpression */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 174 /* OverloadPropertyDeclaration */ || kind === 178 /* Constructor */ || kind === 272 /* EnumDeclaration */ || kind === 311 /* EnumMember */ || kind === 287 /* ExportSpecifier */ || kind === 265 /* FunctionDeclaration */ || kind === 220 /* FunctionExpression */ || kind === 179 /* GetAccessor */ || kind === 279 /* ImportClause */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 282 /* ImportSpecifier */ || kind === 270 /* InterfaceDeclaration */ || kind === 297 /* JsxAttribute */ || kind === 176 /* MethodDeclaration */ || kind === 175 /* MethodSignature */ || kind === 273 /* ModuleDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 280 /* NamespaceImport */ || kind === 286 /* NamespaceExport */ || kind === 169 /* Parameter */ || kind === 308 /* PropertyAssignment */ || kind === 172 /* PropertyDeclaration */ || kind === 173 /* AnnotationPropertyDeclaration */ || kind === 171 /* PropertySignature */ || kind === 180 /* SetAccessor */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 271 /* TypeAliasDeclaration */ || kind === 168 /* TypeParameter */ || kind === 263 /* VariableDeclaration */ || kind === 357 /* JSDocTypedefTag */ || kind === 350 /* JSDocCallbackTag */ || kind === 359 /* JSDocPropertyTag */;
}
function isDeclarationStatementKind(kind) {
- return kind === 263 /* FunctionDeclaration */ || kind === 285 /* MissingDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 280 /* ExportAssignment */ || kind === 273 /* NamespaceExportDeclaration */;
+ return kind === 265 /* FunctionDeclaration */ || kind === 288 /* MissingDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 269 /* OverloadDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 276 /* NamespaceExportDeclaration */;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 253 /* BreakStatement */ || kind === 252 /* ContinueStatement */ || kind === 260 /* DebuggerStatement */ || kind === 247 /* DoStatement */ || kind === 245 /* ExpressionStatement */ || kind === 243 /* EmptyStatement */ || kind === 250 /* ForInStatement */ || kind === 251 /* ForOfStatement */ || kind === 249 /* ForStatement */ || kind === 246 /* IfStatement */ || kind === 257 /* LabeledStatement */ || kind === 254 /* ReturnStatement */ || kind === 256 /* SwitchStatement */ || kind === 258 /* ThrowStatement */ || kind === 259 /* TryStatement */ || kind === 244 /* VariableStatement */ || kind === 248 /* WhileStatement */ || kind === 255 /* WithStatement */ || kind === 358 /* NotEmittedStatement */ || kind === 362 /* EndOfDeclarationMarker */ || kind === 361 /* MergeDeclarationMarker */;
+ return kind === 255 /* BreakStatement */ || kind === 254 /* ContinueStatement */ || kind === 262 /* DebuggerStatement */ || kind === 249 /* DoStatement */ || kind === 247 /* ExpressionStatement */ || kind === 245 /* EmptyStatement */ || kind === 252 /* ForInStatement */ || kind === 253 /* ForOfStatement */ || kind === 251 /* ForStatement */ || kind === 248 /* IfStatement */ || kind === 259 /* LabeledStatement */ || kind === 256 /* ReturnStatement */ || kind === 258 /* SwitchStatement */ || kind === 260 /* ThrowStatement */ || kind === 261 /* TryStatement */ || kind === 246 /* VariableStatement */ || kind === 250 /* WhileStatement */ || kind === 257 /* WithStatement */ || kind === 361 /* NotEmittedStatement */ || kind === 365 /* EndOfDeclarationMarker */ || kind === 364 /* MergeDeclarationMarker */;
}
function isDeclaration(node) {
- if (node.kind === 167 /* TypeParameter */) {
- return node.parent && node.parent.kind !== 353 /* JSDocTemplateTag */ || isInJSFile(node);
+ if (node.kind === 168 /* TypeParameter */) {
+ return node.parent && node.parent.kind !== 356 /* JSDocTemplateTag */ || isInJSFile(node);
}
return isDeclarationKind(node.kind);
}
@@ -14911,10 +14922,10 @@ function isStatement(node) {
return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || isBlockStatement(node);
}
function isBlockStatement(node) {
- if (node.kind !== 242 /* Block */)
+ if (node.kind !== 244 /* Block */)
return false;
if (node.parent !== void 0) {
- if (node.parent.kind === 259 /* TryStatement */ || node.parent.kind === 301 /* CatchClause */) {
+ if (node.parent.kind === 261 /* TryStatement */ || node.parent.kind === 304 /* CatchClause */) {
return false;
}
}
@@ -14922,50 +14933,50 @@ function isBlockStatement(node) {
}
function isStatementOrBlock(node) {
const kind = node.kind;
- return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 242 /* Block */;
+ return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 244 /* Block */;
}
function isModuleReference(node) {
const kind = node.kind;
- return kind === 286 /* ExternalModuleReference */ || kind === 165 /* QualifiedName */ || kind === 79 /* Identifier */;
+ return kind === 289 /* ExternalModuleReference */ || kind === 166 /* QualifiedName */ || kind === 79 /* Identifier */;
}
function isJsxTagNameExpression(node) {
const kind = node.kind;
- return kind === 109 /* ThisKeyword */ || kind === 79 /* Identifier */ || kind === 211 /* PropertyAccessExpression */;
+ return kind === 109 /* ThisKeyword */ || kind === 79 /* Identifier */ || kind === 213 /* PropertyAccessExpression */;
}
function isJsxChild(node) {
const kind = node.kind;
- return kind === 287 /* JsxElement */ || kind === 297 /* JsxExpression */ || kind === 288 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ || kind === 291 /* JsxFragment */;
+ return kind === 290 /* JsxElement */ || kind === 300 /* JsxExpression */ || kind === 291 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ || kind === 294 /* JsxFragment */;
}
function isJsxAttributeLike(node) {
const kind = node.kind;
- return kind === 294 /* JsxAttribute */ || kind === 296 /* JsxSpreadAttribute */;
+ return kind === 297 /* JsxAttribute */ || kind === 299 /* JsxSpreadAttribute */;
}
function isStringLiteralOrJsxExpression(node) {
const kind = node.kind;
- return kind === 10 /* StringLiteral */ || kind === 297 /* JsxExpression */;
+ return kind === 10 /* StringLiteral */ || kind === 300 /* JsxExpression */;
}
function isJsxOpeningLikeElement(node) {
const kind = node.kind;
- return kind === 289 /* JsxOpeningElement */ || kind === 288 /* JsxSelfClosingElement */;
+ return kind === 292 /* JsxOpeningElement */ || kind === 291 /* JsxSelfClosingElement */;
}
function isCaseOrDefaultClause(node) {
const kind = node.kind;
- return kind === 298 /* CaseClause */ || kind === 299 /* DefaultClause */;
+ return kind === 301 /* CaseClause */ || kind === 302 /* DefaultClause */;
}
function isJSDocNode(node) {
- return node.kind >= 318 /* FirstJSDocNode */ && node.kind <= 356 /* LastJSDocNode */;
+ return node.kind >= 321 /* FirstJSDocNode */ && node.kind <= 359 /* LastJSDocNode */;
}
function isJSDocCommentContainingNode(node) {
- return node.kind === 329 /* JSDoc */ || node.kind === 328 /* JSDocNamepathType */ || node.kind === 330 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node);
+ return node.kind === 332 /* JSDoc */ || node.kind === 331 /* JSDocNamepathType */ || node.kind === 333 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node);
}
function isJSDocTag(node) {
- return node.kind >= 336 /* FirstJSDocTagNode */ && node.kind <= 356 /* LastJSDocTagNode */;
+ return node.kind >= 339 /* FirstJSDocTagNode */ && node.kind <= 359 /* LastJSDocTagNode */;
}
function isSetAccessor(node) {
- return node.kind === 178 /* SetAccessor */;
+ return node.kind === 180 /* SetAccessor */;
}
function isGetAccessor(node) {
- return node.kind === 177 /* GetAccessor */;
+ return node.kind === 179 /* GetAccessor */;
}
function hasJSDocNodes(node) {
const { jsDoc } = node;
@@ -14979,23 +14990,23 @@ function hasInitializer(node) {
}
function hasOnlyExpressionInitializer(node) {
switch (node.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 305 /* PropertyAssignment */:
- case 308 /* EnumMember */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 308 /* PropertyAssignment */:
+ case 311 /* EnumMember */:
return true;
default:
return false;
}
}
function isObjectLiteralElement(node) {
- return node.kind === 294 /* JsxAttribute */ || node.kind === 296 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);
+ return node.kind === 297 /* JsxAttribute */ || node.kind === 299 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);
}
function isTypeReferenceType(node) {
- return node.kind === 183 /* TypeReference */ || node.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.kind === 185 /* TypeReference */ || node.kind === 236 /* ExpressionWithTypeArguments */;
}
var MAX_SMI_X86 = 1073741823;
function guessIndentation(lines) {
@@ -15023,7 +15034,7 @@ function isStringLiteralLike(node) {
return node.kind === 10 /* StringLiteral */ || node.kind === 14 /* NoSubstitutionTemplateLiteral */;
}
function isJSDocLinkLike(node) {
- return node.kind === 333 /* JSDocLink */ || node.kind === 334 /* JSDocLinkCode */ || node.kind === 335 /* JSDocLinkPlain */;
+ return node.kind === 336 /* JSDocLink */ || node.kind === 337 /* JSDocLinkCode */ || node.kind === 338 /* JSDocLinkPlain */;
}
function hasRestParameter(s) {
const last2 = lastOrUndefined(s.parameters);
@@ -15031,7 +15042,7 @@ function hasRestParameter(s) {
}
function isRestParameter(node) {
const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
- return node.dotDotDotToken !== void 0 || !!type && type.kind === 327 /* JSDocVariadicType */;
+ return node.dotDotDotToken !== void 0 || !!type && type.kind === 330 /* JSDocVariadicType */;
}
var _MemoryUtils = class {
static tryGC() {
@@ -15255,7 +15266,7 @@ function aggregateChildData(node) {
}
}
function getSourceFileOfNode(node) {
- while (node && node.kind !== 314 /* SourceFile */) {
+ while (node && node.kind !== 317 /* SourceFile */) {
node = node.parent;
}
return node;
@@ -15268,11 +15279,11 @@ function isPlainJsFile(file, checkJs) {
}
function isStatementWithLocals(node) {
switch (node.kind) {
- case 242 /* Block */:
- case 272 /* CaseBlock */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 244 /* Block */:
+ case 275 /* CaseBlock */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
return true;
}
return false;
@@ -15429,7 +15440,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
if (includeJsDoc && hasJSDocNodes(node)) {
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
}
- if (node.kind === 357 /* SyntaxList */ && node._children.length > 0) {
+ if (node.kind === 360 /* SyntaxList */ && node._children.length > 0) {
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
}
return node.virtual ? node.pos : skipTrivia(
@@ -15632,7 +15643,7 @@ function isBlockOrCatchScoped(declaration) {
}
function isCatchClauseVariableDeclarationOrBindingElement(declaration) {
const node = getRootDeclaration(declaration);
- return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 301 /* CatchClause */;
+ return node.kind === 263 /* VariableDeclaration */ && node.parent.kind === 304 /* CatchClause */;
}
function isAmbientModule(node) {
return isModuleDeclaration(node) && (node.name.kind === 10 /* StringLiteral */ || isGlobalScopeAugmentation(node));
@@ -15650,10 +15661,10 @@ function isShorthandAmbientModuleSymbol(moduleSymbol) {
return isShorthandAmbientModule(moduleSymbol.valueDeclaration);
}
function isShorthandAmbientModule(node) {
- return !!node && node.kind === 270 /* ModuleDeclaration */ && !node.body;
+ return !!node && node.kind === 273 /* ModuleDeclaration */ && !node.body;
}
function isBlockScopedContainerTopLevel(node) {
- return node.kind === 314 /* SourceFile */ || node.kind === 270 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node);
+ return node.kind === 317 /* SourceFile */ || node.kind === 273 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node);
}
function isGlobalScopeAugmentation(module2) {
return !!(module2.flags & 1024 /* GlobalAugmentation */);
@@ -15663,9 +15674,9 @@ function isExternalModuleAugmentation(node) {
}
function isModuleAugmentationExternal(node) {
switch (node.parent.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return isExternalModule(node.parent);
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return isAmbientModule(node.parent.parent) && isSourceFile(node.parent.parent.parent) && !isExternalModule(node.parent.parent.parent);
}
return false;
@@ -15713,34 +15724,34 @@ function isAmbientPropertyDeclaration(node) {
}
function isBlockScope(node, parentNode) {
switch (node.kind) {
- case 314 /* SourceFile */:
- case 272 /* CaseBlock */:
- case 301 /* CatchClause */:
- case 270 /* ModuleDeclaration */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 317 /* SourceFile */:
+ case 275 /* CaseBlock */:
+ case 304 /* CatchClause */:
+ case 273 /* ModuleDeclaration */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return true;
- case 242 /* Block */:
+ case 244 /* Block */:
return !isFunctionLikeOrClassStaticBlockDeclaration(parentNode);
}
return false;
}
function isDeclarationWithTypeParameters(node) {
switch (node.kind) {
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
- case 332 /* JSDocSignature */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 335 /* JSDocSignature */:
return true;
default:
assertType(node);
@@ -15749,26 +15760,26 @@ function isDeclarationWithTypeParameters(node) {
}
function isDeclarationWithTypeParameterChildren(node) {
switch (node.kind) {
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 326 /* JSDocFunctionType */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 353 /* JSDocTemplateTag */:
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 329 /* JSDocFunctionType */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 356 /* JSDocTemplateTag */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
default:
assertType(node);
@@ -15777,8 +15788,8 @@ function isDeclarationWithTypeParameterChildren(node) {
}
function isAnyImportSyntax(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return true;
default:
return false;
@@ -15789,17 +15800,18 @@ function isAnyImportOrBareOrAccessedRequire(node) {
}
function isLateVisibilityPaintedStatement(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 244 /* VariableStatement */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 246 /* VariableStatement */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
return true;
default:
return false;
@@ -15832,7 +15844,7 @@ function getNameFromIndexInfo(info) {
return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : void 0;
}
function isComputedNonLiteralName(name) {
- return name.kind === 166 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
+ return name.kind === 167 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
}
function tryGetTextOfPropertyName(name) {
switch (name.kind) {
@@ -15843,7 +15855,7 @@ function tryGetTextOfPropertyName(name) {
case 8 /* NumericLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return escapeLeadingUnderscores(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
if (isStringOrNumericLiteralLike(name.expression))
return escapeLeadingUnderscores(name.expression.text);
return void 0;
@@ -15861,15 +15873,15 @@ function entityNameToString(name) {
case 80 /* PrivateIdentifier */:
case 79 /* Identifier */:
return getFullWidth(name) === 0 ? idText(name) : getTextOfNode(name);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return entityNameToString(name.left) + "." + entityNameToString(name.right);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isIdentifier(name.name) || isPrivateIdentifier(name.name)) {
return entityNameToString(name.expression) + "." + entityNameToString(name.name);
} else {
return Debug.assertNever(name.name);
}
- case 320 /* JSDocMemberName */:
+ case 323 /* JSDocMemberName */:
return entityNameToString(name.left) + entityNameToString(name.right);
default:
return Debug.assertNever(name);
@@ -15949,7 +15961,7 @@ function getSpanOfTokenAtPosition(sourceFile, pos) {
}
function getErrorSpanForArrowFunction(sourceFile, node) {
const pos = skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 242 /* Block */) {
+ if (node.body && node.body.kind === 244 /* Block */) {
const { line: startLine } = getLineAndCharacterOfPosition(sourceFile, node.body.pos);
const { line: endLine } = getLineAndCharacterOfPosition(sourceFile, node.body.end);
if (startLine < endLine) {
@@ -15961,37 +15973,37 @@ function getErrorSpanForArrowFunction(sourceFile, node) {
function getErrorSpanForNode(sourceFile, node) {
let errorNode = node;
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
const pos2 = skipTrivia(sourceFile.text, 0, false);
if (pos2 === sourceFile.text.length) {
return createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos2);
- case 261 /* VariableDeclaration */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 268 /* TypeAliasDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 277 /* NamespaceImport */:
+ case 263 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 271 /* TypeAliasDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 280 /* NamespaceImport */:
errorNode = node.name;
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return getErrorSpanForArrowFunction(sourceFile, node);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
const start = skipTrivia(sourceFile.text, node.pos);
const end = node.statements.length > 0 ? node.statements[0].pos : node.end;
return createTextSpanFromBounds(start, end);
@@ -16033,10 +16045,10 @@ function isLet(node) {
return !!(getCombinedNodeFlags(node) & 1 /* Let */);
}
function isSuperCall(n) {
- return n.kind === 213 /* CallExpression */ && n.expression.kind === 107 /* SuperKeyword */;
+ return n.kind === 215 /* CallExpression */ && n.expression.kind === 107 /* SuperKeyword */;
}
function isImportCall(n) {
- return n.kind === 213 /* CallExpression */ && n.expression.kind === 101 /* ImportKeyword */;
+ return n.kind === 215 /* CallExpression */ && n.expression.kind === 101 /* ImportKeyword */;
}
function isImportMeta(n) {
return isMetaProperty(n) && n.keywordToken === 101 /* ImportKeyword */ && n.name.escapedText === "meta";
@@ -16045,7 +16057,7 @@ function isLiteralImportTypeNode(n) {
return isImportTypeNode(n) && isLiteralTypeNode(n.argument) && isStringLiteral(n.argument.literal);
}
function isPrologueDirective(node) {
- return node.kind === 245 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */;
+ return node.kind === 247 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */;
}
function isCustomPrologue(node) {
return !!(getEmitFlags(node) & 1048576 /* CustomPrologue */);
@@ -16060,7 +16072,7 @@ function isHoistedVariableStatement(node) {
return isCustomPrologue(node) && isVariableStatement(node) && every(node.declarationList.declarations, isHoistedVariable);
}
function getJSDocCommentRanges(node, text) {
- const commentRanges = node.kind === 168 /* Parameter */ || node.kind === 167 /* TypeParameter */ || node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */ || node.kind === 217 /* ParenthesizedExpression */ || node.kind === 261 /* VariableDeclaration */ || node.kind === 284 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos);
+ const commentRanges = node.kind === 169 /* Parameter */ || node.kind === 168 /* TypeParameter */ || node.kind === 220 /* FunctionExpression */ || node.kind === 221 /* ArrowFunction */ || node.kind === 219 /* ParenthesizedExpression */ || node.kind === 263 /* VariableDeclaration */ || node.kind === 287 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos);
return filter(commentRanges, (comment) => text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */);
}
var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/;
@@ -16068,7 +16080,7 @@ var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/;
var defaultLibReferenceRegEx = /^(\/\/\/\s*/;
function isPartOfTypeNode(node) {
- if (182 /* FirstTypeNode */ <= node.kind && node.kind <= 205 /* LastTypeNode */) {
+ if (184 /* FirstTypeNode */ <= node.kind && node.kind <= 207 /* LastTypeNode */) {
return true;
}
switch (node.kind) {
@@ -16084,65 +16096,65 @@ function isPartOfTypeNode(node) {
case 145 /* NeverKeyword */:
return true;
case 115 /* VoidKeyword */:
- return node.parent.kind !== 223 /* VoidExpression */;
- case 234 /* ExpressionWithTypeArguments */:
+ return node.parent.kind !== 225 /* VoidExpression */;
+ case 236 /* ExpressionWithTypeArguments */:
return isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node);
- case 167 /* TypeParameter */:
- return node.parent.kind === 200 /* MappedType */ || node.parent.kind === 195 /* InferType */;
+ case 168 /* TypeParameter */:
+ return node.parent.kind === 202 /* MappedType */ || node.parent.kind === 197 /* InferType */;
case 79 /* Identifier */:
- if (node.parent.kind === 165 /* QualifiedName */ && node.parent.right === node) {
+ if (node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node) {
node = node.parent;
- } else if (node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node) {
+ } else if (node.parent.kind === 213 /* PropertyAccessExpression */ && node.parent.name === node) {
node = node.parent;
}
Debug.assert(
- node.kind === 79 /* Identifier */ || node.kind === 165 /* QualifiedName */ || node.kind === 211 /* PropertyAccessExpression */,
+ node.kind === 79 /* Identifier */ || node.kind === 166 /* QualifiedName */ || node.kind === 213 /* PropertyAccessExpression */,
"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."
);
- case 165 /* QualifiedName */:
- case 211 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
case 109 /* ThisKeyword */: {
const { parent: parent2 } = node;
- if (parent2.kind === 186 /* TypeQuery */) {
+ if (parent2.kind === 188 /* TypeQuery */) {
return false;
}
- if (parent2.kind === 205 /* ImportType */) {
+ if (parent2.kind === 207 /* ImportType */) {
return !parent2.isTypeOf;
}
- if (182 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 205 /* LastTypeNode */) {
+ if (184 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 207 /* LastTypeNode */) {
return true;
}
switch (parent2.kind) {
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return isHeritageClause(parent2.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent2);
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return node === parent2.constraint;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return node === parent2.constraint;
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 168 /* Parameter */:
- case 261 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 169 /* Parameter */:
+ case 263 /* VariableDeclaration */:
return node === parent2.type;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return node === parent2.type;
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return node === parent2.type;
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return node === parent2.type;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
return contains(parent2.typeArguments, node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return false;
}
}
@@ -16162,23 +16174,23 @@ function forEachReturnStatement(body, visitor) {
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitor(node);
- case 272 /* CaseBlock */:
- case 242 /* Block */:
- case 246 /* IfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 255 /* WithStatement */:
- case 256 /* SwitchStatement */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 257 /* LabeledStatement */:
- case 259 /* TryStatement */:
- case 301 /* CatchClause */:
+ case 275 /* CaseBlock */:
+ case 244 /* Block */:
+ case 248 /* IfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 257 /* WithStatement */:
+ case 258 /* SwitchStatement */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 259 /* LabeledStatement */:
+ case 261 /* TryStatement */:
+ case 304 /* CatchClause */:
return forEachChild(node, traverse);
}
}
@@ -16187,21 +16199,21 @@ function forEachYieldExpression(body, visitor) {
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
visitor(node);
const operand = node.expression;
if (operand) {
traverse(operand);
}
return;
- case 269 /* EnumDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return;
default:
if (isFunctionLike(node)) {
- if (node.name && node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name && node.name.kind === 167 /* ComputedPropertyName */) {
traverse(node.name.expression);
return;
}
@@ -16212,9 +16224,9 @@ function forEachYieldExpression(body, visitor) {
}
}
function getRestParameterElementType(node) {
- if (node && node.kind === 188 /* ArrayType */) {
+ if (node && node.kind === 190 /* ArrayType */) {
return node.elementType;
- } else if (node && node.kind === 183 /* TypeReference */) {
+ } else if (node && node.kind === 185 /* TypeReference */) {
return singleOrUndefined(node.typeArguments);
} else {
return void 0;
@@ -16222,27 +16234,27 @@ function getRestParameterElementType(node) {
}
function getMembersOfDeclaration(node) {
switch (node.kind) {
- case 267 /* InterfaceDeclaration */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 187 /* TypeLiteral */:
+ case 270 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 189 /* TypeLiteral */:
return node.members;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return node.properties;
}
}
function isVariableLike(node) {
if (node) {
switch (node.kind) {
- case 208 /* BindingElement */:
- case 308 /* EnumMember */:
- case 168 /* Parameter */:
- case 305 /* PropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 306 /* ShorthandPropertyAssignment */:
- case 261 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 311 /* EnumMember */:
+ case 169 /* Parameter */:
+ case 308 /* PropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 263 /* VariableDeclaration */:
return true;
}
}
@@ -16252,7 +16264,7 @@ function isVariableLikeOrAccessor(node) {
return isVariableLike(node) || isAccessor(node);
}
function isVariableDeclarationInVariableStatement(node) {
- return node.parent.kind === 262 /* VariableDeclarationList */ && node.parent.parent.kind === 244 /* VariableStatement */;
+ return node.parent.kind === 264 /* VariableDeclarationList */ && node.parent.parent.kind === 246 /* VariableStatement */;
}
function isCommonJsExportedExpression(node) {
if (!isInJSFile(node))
@@ -16269,13 +16281,13 @@ function isValidESSymbolDeclaration(node) {
}
function introducesArgumentsExoticObject(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return true;
}
return false;
@@ -16285,20 +16297,20 @@ function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) {
if (beforeUnwrapLabelCallback) {
beforeUnwrapLabelCallback(node);
}
- if (node.statement.kind !== 257 /* LabeledStatement */) {
+ if (node.statement.kind !== 259 /* LabeledStatement */) {
return node.statement;
}
node = node.statement;
}
}
function isFunctionBlock(node) {
- return node && node.kind === 242 /* Block */ && isFunctionLike(node.parent);
+ return node && node.kind === 244 /* Block */ && isFunctionLike(node.parent);
}
function isObjectLiteralMethod(node) {
- return node && node.kind === 174 /* MethodDeclaration */ && node.parent.kind === 210 /* ObjectLiteralExpression */;
+ return node && node.kind === 176 /* MethodDeclaration */ && node.parent.kind === 212 /* ObjectLiteralExpression */;
}
function isObjectLiteralOrClassExpressionMethodOrAccessor(node) {
- return (node.kind === 174 /* MethodDeclaration */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */) && (node.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.kind === 232 /* ClassExpression */);
+ return (node.kind === 176 /* MethodDeclaration */ || node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */) && (node.parent.kind === 212 /* ObjectLiteralExpression */ || node.parent.kind === 234 /* ClassExpression */);
}
function isIdentifierTypePredicate(predicate) {
return predicate && predicate.kind === 1 /* Identifier */;
@@ -16308,7 +16320,7 @@ function isThisTypePredicate(predicate) {
}
function getPropertyAssignment(objectLiteral, key, key2) {
return objectLiteral.properties.filter((property) => {
- if (property.kind === 305 /* PropertyAssignment */) {
+ if (property.kind === 308 /* PropertyAssignment */) {
const propName = tryGetTextOfPropertyName(property.name);
return key === propName || !!key2 && key2 === propName;
}
@@ -16358,63 +16370,63 @@ function getContainingStruct(node) {
return findAncestor(node.parent, isStruct);
}
function getThisContainer(node, includeArrowFunctions) {
- Debug.assert(node.kind !== 314 /* SourceFile */);
+ Debug.assert(node.kind !== 317 /* SourceFile */);
while (true) {
node = node.parent;
if (!node) {
return Debug.fail();
}
switch (node.kind) {
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
if (isClassLike(node.parent.parent)) {
return node;
}
node = node.parent;
break;
- case 169 /* Decorator */:
- if (node.parent.kind === 168 /* Parameter */ && isClassElement(node.parent.parent)) {
+ case 170 /* Decorator */:
+ if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) {
node = node.parent.parent;
} else if (isClassElement(node.parent)) {
node = node.parent;
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (!includeArrowFunctions) {
continue;
}
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 270 /* ModuleDeclaration */:
- case 175 /* ClassStaticBlockDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 269 /* EnumDeclaration */:
- case 314 /* SourceFile */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 273 /* ModuleDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 272 /* EnumDeclaration */:
+ case 317 /* SourceFile */:
return node;
}
}
}
function isThisContainerOrFunctionBlock(node) {
switch (node.kind) {
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 171 /* PropertyDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 172 /* PropertyDeclaration */:
return true;
- case 242 /* Block */:
+ case 244 /* Block */:
switch (node.parent.kind) {
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -16434,9 +16446,9 @@ function getNewTargetContainer(node) {
const container = getThisContainer(node, false);
if (container) {
switch (container.kind) {
- case 176 /* Constructor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return container;
}
}
@@ -16449,26 +16461,26 @@ function getSuperContainer(node, stopOnFunctions) {
return node;
}
switch (node.kind) {
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
node = node.parent;
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
if (!stopOnFunctions) {
continue;
}
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
return node;
- case 169 /* Decorator */:
- if (node.parent.kind === 168 /* Parameter */ && isClassElement(node.parent.parent)) {
+ case 170 /* Decorator */:
+ if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) {
node = node.parent.parent;
} else if (isClassElement(node.parent)) {
node = node.parent;
@@ -16478,14 +16490,14 @@ function getSuperContainer(node, stopOnFunctions) {
}
}
function getImmediatelyInvokedFunctionExpression(func) {
- if (func.kind === 218 /* FunctionExpression */ || func.kind === 219 /* ArrowFunction */) {
+ if (func.kind === 220 /* FunctionExpression */ || func.kind === 221 /* ArrowFunction */) {
let prev = func;
let parent2 = func.parent;
- while (parent2.kind === 217 /* ParenthesizedExpression */) {
+ while (parent2.kind === 219 /* ParenthesizedExpression */) {
prev = parent2;
parent2 = parent2.parent;
}
- if (parent2.kind === 213 /* CallExpression */ && parent2.expression === prev) {
+ if (parent2.kind === 215 /* CallExpression */ && parent2.expression === prev) {
return parent2;
}
}
@@ -16495,11 +16507,11 @@ function isSuperOrSuperProperty(node) {
}
function isSuperProperty(node) {
const kind = node.kind;
- return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 107 /* SuperKeyword */;
+ return (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */) && node.expression.kind === 107 /* SuperKeyword */;
}
function isThisProperty(node) {
const kind = node.kind;
- return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 109 /* ThisKeyword */;
+ return (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */) && node.expression.kind === 109 /* ThisKeyword */;
}
function isThisInitializedDeclaration(node) {
var _a2;
@@ -16510,22 +16522,22 @@ function isThisInitializedObjectBindingExpression(node) {
}
function getEntityNameFromTypeNode(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return node.typeName;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return isEntityNameExpression(node.expression) ? node.expression : void 0;
case 79 /* Identifier */:
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return node;
}
return void 0;
}
function getInvokedExpression(node) {
switch (node.kind) {
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return node.tag;
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return node.tagName;
default:
return node.expression;
@@ -16536,20 +16548,20 @@ function nodeCanBeDecorated(node, parent2, grandparent, compilerOptions) {
return false;
}
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
return true;
- case 171 /* PropertyDeclaration */:
- return parent2.kind === 264 /* ClassDeclaration */ || parent2.kind === 265 /* StructDeclaration */;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- return node.body !== void 0 && (parent2.kind === 264 /* ClassDeclaration */ || parent2.kind === 265 /* StructDeclaration */);
- case 168 /* Parameter */:
- return parent2.body !== void 0 && (parent2.kind === 176 /* Constructor */ || parent2.kind === 174 /* MethodDeclaration */ || parent2.kind === 178 /* SetAccessor */) && (grandparent.kind === 264 /* ClassDeclaration */ || grandparent.kind === 265 /* StructDeclaration */);
- case 263 /* FunctionDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ return parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */;
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ return node.body !== void 0 && (parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */);
+ case 169 /* Parameter */:
+ return parent2.body !== void 0 && (parent2.kind === 178 /* Constructor */ || parent2.kind === 176 /* MethodDeclaration */ || parent2.kind === 180 /* SetAccessor */) && (grandparent.kind === 266 /* ClassDeclaration */ || grandparent.kind === 267 /* StructDeclaration */);
+ case 265 /* FunctionDeclaration */:
return isArkTsDecorator(node, compilerOptions) || isSendableFunctionOrType(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return isSendableFunctionOrType(node);
}
return false;
@@ -16562,13 +16574,13 @@ function nodeOrChildIsDecorated(node, parent2, grandparent) {
}
function childIsDecorated(node, parent2) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return some(node.members, (m) => nodeOrChildIsDecorated(m, node, parent2));
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return some(node.members, (m) => nodeOrChildIsDecorated(m, node, parent2));
- case 174 /* MethodDeclaration */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
return some(node.parameters, (p) => nodeIsDecorated(p, node, parent2));
default:
return false;
@@ -16582,7 +16594,7 @@ function classOrConstructorParameterIsDecorated(node) {
}
function isJSXTagName(node) {
const { parent: parent2 } = node;
- if (parent2.kind === 289 /* JsxOpeningElement */ || parent2.kind === 288 /* JsxSelfClosingElement */ || parent2.kind === 290 /* JsxClosingElement */) {
+ if (parent2.kind === 292 /* JsxOpeningElement */ || parent2.kind === 291 /* JsxSelfClosingElement */ || parent2.kind === 293 /* JsxClosingElement */) {
return parent2.tagName === node;
}
return false;
@@ -16594,55 +16606,55 @@ function isExpressionNode(node) {
case 111 /* TrueKeyword */:
case 96 /* FalseKeyword */:
case 13 /* RegularExpressionLiteral */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 211 /* PropertyAccessExpression */:
- case 220 /* EtsComponentExpression */:
- case 212 /* ElementAccessExpression */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 215 /* TaggedTemplateExpression */:
- case 235 /* AsExpression */:
- case 216 /* TypeAssertionExpression */:
- case 239 /* SatisfiesExpression */:
- case 236 /* NonNullExpression */:
- case 217 /* ParenthesizedExpression */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
- case 219 /* ArrowFunction */:
- case 223 /* VoidExpression */:
- case 221 /* DeleteExpression */:
- case 222 /* TypeOfExpression */:
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
- case 227 /* BinaryExpression */:
- case 228 /* ConditionalExpression */:
- case 231 /* SpreadElement */:
- case 229 /* TemplateExpression */:
- case 233 /* OmittedExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
- case 230 /* YieldExpression */:
- case 224 /* AwaitExpression */:
- case 237 /* MetaProperty */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 222 /* EtsComponentExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 237 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 241 /* SatisfiesExpression */:
+ case 238 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 225 /* VoidExpression */:
+ case 223 /* DeleteExpression */:
+ case 224 /* TypeOfExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 229 /* BinaryExpression */:
+ case 230 /* ConditionalExpression */:
+ case 233 /* SpreadElement */:
+ case 231 /* TemplateExpression */:
+ case 235 /* OmittedExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
+ case 232 /* YieldExpression */:
+ case 226 /* AwaitExpression */:
+ case 239 /* MetaProperty */:
return true;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return !isHeritageClause(node.parent);
- case 165 /* QualifiedName */:
- while (node.parent.kind === 165 /* QualifiedName */) {
+ case 166 /* QualifiedName */:
+ while (node.parent.kind === 166 /* QualifiedName */) {
node = node.parent;
}
- return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
- case 320 /* JSDocMemberName */:
+ return node.parent.kind === 188 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
+ case 323 /* JSDocMemberName */:
while (isJSDocMemberName(node.parent)) {
node = node.parent;
}
- return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
+ return node.parent.kind === 188 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
case 80 /* PrivateIdentifier */:
return isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 102 /* InKeyword */;
case 79 /* Identifier */:
- if (node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) {
+ if (node.parent.kind === 188 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) {
return true;
}
case 8 /* NumericLiteral */:
@@ -16658,64 +16670,64 @@ function isExpressionNode(node) {
function isInExpressionContext(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 308 /* EnumMember */:
- case 305 /* PropertyAssignment */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 311 /* EnumMember */:
+ case 308 /* PropertyAssignment */:
+ case 210 /* BindingElement */:
return parent2.initializer === node;
- case 245 /* ExpressionStatement */:
- case 246 /* IfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 254 /* ReturnStatement */:
- case 255 /* WithStatement */:
- case 256 /* SwitchStatement */:
- case 298 /* CaseClause */:
- case 258 /* ThrowStatement */:
+ case 247 /* ExpressionStatement */:
+ case 248 /* IfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 256 /* ReturnStatement */:
+ case 257 /* WithStatement */:
+ case 258 /* SwitchStatement */:
+ case 301 /* CaseClause */:
+ case 260 /* ThrowStatement */:
return parent2.expression === node;
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
const forStatement = parent2;
- return forStatement.initializer === node && forStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ return forStatement.initializer === node && forStatement.initializer.kind !== 264 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
const forInStatement = parent2;
- return forInStatement.initializer === node && forInStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forInStatement.expression === node;
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ return forInStatement.initializer === node && forInStatement.initializer.kind !== 264 /* VariableDeclarationList */ || forInStatement.expression === node;
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return node === parent2.expression;
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return node === parent2.expression;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return node === parent2.expression;
- case 169 /* Decorator */:
- case 297 /* JsxExpression */:
- case 296 /* JsxSpreadAttribute */:
- case 307 /* SpreadAssignment */:
+ case 170 /* Decorator */:
+ case 300 /* JsxExpression */:
+ case 299 /* JsxSpreadAttribute */:
+ case 310 /* SpreadAssignment */:
return true;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return parent2.expression === node && !isPartOfTypeNode(parent2);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return parent2.objectAssignmentInitializer === node;
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return node === parent2.expression;
default:
return isExpressionNode(parent2);
}
}
function isPartOfTypeQuery(node) {
- while (node.kind === 165 /* QualifiedName */ || node.kind === 79 /* Identifier */) {
+ while (node.kind === 166 /* QualifiedName */ || node.kind === 79 /* Identifier */) {
node = node.parent;
}
- return node.kind === 186 /* TypeQuery */;
+ return node.kind === 188 /* TypeQuery */;
}
function isNamespaceReexportDeclaration(node) {
return isNamespaceExport(node) && !!node.parent.moduleSpecifier;
}
function isExternalModuleImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 286 /* ExternalModuleReference */;
+ return node.kind === 277 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 289 /* ExternalModuleReference */;
}
function getExternalModuleImportEqualsDeclarationExpression(node) {
Debug.assert(isExternalModuleImportEqualsDeclaration(node));
@@ -16725,7 +16737,7 @@ function getExternalModuleRequireArgument(node) {
return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
}
function isInternalModuleImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 286 /* ExternalModuleReference */;
+ return node.kind === 277 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 289 /* ExternalModuleReference */;
}
function isSourceFileJS(file) {
return isInJSFile(file);
@@ -16784,7 +16796,7 @@ function isInStruct(node) {
return !!container && isStruct(container);
}
function isRequireCall(callExpression, requireStringLiteralLikeArgument) {
- if (callExpression.kind !== 213 /* CallExpression */) {
+ if (callExpression.kind !== 215 /* CallExpression */) {
return false;
}
const { expression, arguments: args } = callExpression;
@@ -16846,9 +16858,9 @@ function getAssignedExpandoInitializer(node) {
function getExpandoInitializer(initializer, isPrototypeAssignment) {
if (isCallExpression(initializer)) {
const e = skipParentheses(initializer.expression);
- return e.kind === 218 /* FunctionExpression */ || e.kind === 219 /* ArrowFunction */ ? initializer : void 0;
+ return e.kind === 220 /* FunctionExpression */ || e.kind === 221 /* ArrowFunction */ ? initializer : void 0;
}
- if (initializer.kind === 218 /* FunctionExpression */ || initializer.kind === 232 /* ClassExpression */ || initializer.kind === 219 /* ArrowFunction */) {
+ if (initializer.kind === 220 /* FunctionExpression */ || initializer.kind === 234 /* ClassExpression */ || initializer.kind === 221 /* ArrowFunction */) {
return initializer;
}
if (isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) {
@@ -17010,7 +17022,7 @@ function isPrototypePropertyAssignment(node) {
return isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 3 /* PrototypeProperty */;
}
function isSpecialPropertyDeclaration(expr) {
- return isInJSFile(expr) && expr.parent && expr.parent.kind === 245 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent);
+ return isInJSFile(expr) && expr.parent && expr.parent.kind === 247 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent);
}
function setValueDeclaration(symbol, node) {
const { valueDeclaration } = symbol;
@@ -17023,16 +17035,16 @@ function isFunctionSymbol(symbol) {
return false;
}
const decl = symbol.valueDeclaration;
- return decl.kind === 263 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer);
+ return decl.kind === 265 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer);
}
function tryGetModuleSpecifierFromDeclaration(node) {
var _a2, _b;
switch (node.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return (_a2 = findAncestor(node.initializer, (node2) => isRequireCall(node2, true))) == null ? void 0 : _a2.arguments[0];
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return tryCast(node.moduleSpecifier, isStringLiteralLike);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
default:
Debug.assertNever(node);
@@ -17043,14 +17055,14 @@ function importFromModuleSpecifier(node) {
}
function tryGetImportFromModuleSpecifier(node) {
switch (node.parent.kind) {
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
return node.parent;
- case 286 /* ExternalModuleReference */:
+ case 289 /* ExternalModuleReference */:
return node.parent.parent;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return isImportCall(node.parent) || isRequireCall(node.parent, false) ? node.parent : void 0;
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
Debug.assert(isStringLiteral(node));
return tryCast(node.parent.parent, isImportTypeNode);
default:
@@ -17059,16 +17071,16 @@ function tryGetImportFromModuleSpecifier(node) {
}
function getExternalModuleName(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
return node.moduleSpecifier;
- case 274 /* ImportEqualsDeclaration */:
- return node.moduleReference.kind === 286 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
- case 205 /* ImportType */:
+ case 277 /* ImportEqualsDeclaration */:
+ return node.moduleReference.kind === 289 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
+ case 207 /* ImportType */:
return isLiteralImportTypeNode(node) ? node.argument.literal : void 0;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return node.arguments[0];
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return node.name.kind === 10 /* StringLiteral */ ? node.name : void 0;
default:
return Debug.assertNever(node);
@@ -17076,18 +17088,18 @@ function getExternalModuleName(node) {
}
function getNamespaceDeclarationNode(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return node.importClause && tryCast(node.importClause.namedBindings, isNamespaceImport);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return node;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return node.exportClause && tryCast(node.exportClause, isNamespaceExport);
default:
return Debug.assertNever(node);
}
}
function isDefaultImport(node) {
- return node.kind === 275 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
+ return node.kind === 278 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
}
function forEachImportClauseDeclaration(node, action) {
if (node.name) {
@@ -17104,13 +17116,13 @@ function forEachImportClauseDeclaration(node, action) {
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
- case 168 /* Parameter */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 306 /* ShorthandPropertyAssignment */:
- case 305 /* PropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 169 /* Parameter */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return node.questionToken !== void 0;
}
}
@@ -17122,7 +17134,7 @@ function isJSDocConstructSignature(node) {
return !!name && name.escapedText === "new";
}
function isJSDocTypeAlias(node) {
- return node.kind === 354 /* JSDocTypedefTag */ || node.kind === 347 /* JSDocCallbackTag */ || node.kind === 348 /* JSDocEnumTag */;
+ return node.kind === 357 /* JSDocTypedefTag */ || node.kind === 350 /* JSDocCallbackTag */ || node.kind === 351 /* JSDocEnumTag */;
}
function isTypeAlias(node) {
return isJSDocTypeAlias(node) || isTypeAliasDeclaration(node);
@@ -17135,14 +17147,14 @@ function getSourceOfDefaultedAssignment(node) {
}
function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
const v = getSingleVariableOfVariableStatement(node);
return v && v.initializer;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return node.initializer;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return node.initializer;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return node.initializer;
}
}
@@ -17150,7 +17162,7 @@ function getSingleVariableOfVariableStatement(node) {
return isVariableStatement(node) ? firstOrUndefined(node.declarationList.declarations) : void 0;
}
function getNestedModuleDeclaration(node) {
- return isModuleDeclaration(node) && node.body && node.body.kind === 270 /* ModuleDeclaration */ ? node.body : void 0;
+ return isModuleDeclaration(node) && node.body && node.body.kind === 273 /* ModuleDeclaration */ ? node.body : void 0;
}
function getJSDocCommentsAndTags(hostNode, noCache) {
let result;
@@ -17162,11 +17174,11 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
if (hasJSDocNodes(node)) {
result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
}
- if (node.kind === 168 /* Parameter */) {
+ if (node.kind === 169 /* Parameter */) {
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
break;
}
- if (node.kind === 167 /* TypeParameter */) {
+ if (node.kind === 168 /* TypeParameter */) {
result = addRange(result, (noCache ? getJSDocTypeParameterTagsNoCache : getJSDocTypeParameterTags)(node));
break;
}
@@ -17186,7 +17198,7 @@ function ownsJSDocTag(hostNode, tag) {
}
function getNextJSDocCommentLocation(node) {
const parent2 = node.parent;
- if (parent2.kind === 305 /* PropertyAssignment */ || parent2.kind === 280 /* ExportAssignment */ || parent2.kind === 171 /* PropertyDeclaration */ || parent2.kind === 245 /* ExpressionStatement */ && node.kind === 211 /* PropertyAccessExpression */ || parent2.kind === 254 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isBinaryExpression(node) && node.operatorToken.kind === 63 /* EqualsToken */) {
+ if (parent2.kind === 308 /* PropertyAssignment */ || parent2.kind === 283 /* ExportAssignment */ || parent2.kind === 172 /* PropertyDeclaration */ || parent2.kind === 247 /* ExpressionStatement */ && node.kind === 213 /* PropertyAccessExpression */ || parent2.kind === 256 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isBinaryExpression(node) && node.operatorToken.kind === 63 /* EqualsToken */) {
return parent2;
} else if (parent2.parent && (getSingleVariableOfVariableStatement(parent2.parent) === node || isBinaryExpression(parent2) && parent2.operatorToken.kind === 63 /* EqualsToken */)) {
return parent2.parent;
@@ -17262,32 +17274,32 @@ function getAssignmentTargetKind(node) {
let parent2 = node.parent;
while (true) {
switch (parent2.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const binaryOperator = parent2.operatorToken.kind;
return isAssignmentOperator(binaryOperator) && parent2.left === node ? binaryOperator === 63 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
const unaryOperator = parent2.operator;
return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
return parent2.initializer === node ? 1 /* Definite */ : 0 /* None */;
- case 217 /* ParenthesizedExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 231 /* SpreadElement */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 233 /* SpreadElement */:
+ case 238 /* NonNullExpression */:
node = parent2;
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
node = parent2.parent;
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
if (parent2.name !== node) {
return 0 /* None */;
}
node = parent2.parent;
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (parent2.name === node) {
return 0 /* None */;
}
@@ -17304,22 +17316,22 @@ function isAssignmentTarget(node) {
}
function isNodeWithPossibleHoistedDeclaration(node) {
switch (node.kind) {
- case 242 /* Block */:
- case 244 /* VariableStatement */:
- case 255 /* WithStatement */:
- case 246 /* IfStatement */:
- case 256 /* SwitchStatement */:
- case 272 /* CaseBlock */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 257 /* LabeledStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 259 /* TryStatement */:
- case 301 /* CatchClause */:
+ case 244 /* Block */:
+ case 246 /* VariableStatement */:
+ case 257 /* WithStatement */:
+ case 248 /* IfStatement */:
+ case 258 /* SwitchStatement */:
+ case 275 /* CaseBlock */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 259 /* LabeledStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 261 /* TryStatement */:
+ case 304 /* CatchClause */:
return true;
}
return false;
@@ -17334,14 +17346,14 @@ function walkUp(node, kind) {
return node;
}
function walkUpParenthesizedTypes(node) {
- return walkUp(node, 196 /* ParenthesizedType */);
+ return walkUp(node, 198 /* ParenthesizedType */);
}
function walkUpParenthesizedExpressions(node) {
- return walkUp(node, 217 /* ParenthesizedExpression */);
+ return walkUp(node, 219 /* ParenthesizedExpression */);
}
function walkUpParenthesizedTypesAndGetParentAndChild(node) {
let child;
- while (node && node.kind === 196 /* ParenthesizedType */) {
+ while (node && node.kind === 198 /* ParenthesizedType */) {
child = node;
node = node.parent;
}
@@ -17357,11 +17369,11 @@ function skipParentheses(node, excludeJSDocTypeAssertions) {
return skipOuterExpressions(node, flags);
}
function isDeleteTarget(node) {
- if (node.kind !== 211 /* PropertyAccessExpression */ && node.kind !== 212 /* ElementAccessExpression */) {
+ if (node.kind !== 213 /* PropertyAccessExpression */ && node.kind !== 214 /* ElementAccessExpression */) {
return false;
}
node = walkUpParenthesizedExpressions(node.parent);
- return node && node.kind === 221 /* DeleteExpression */;
+ return node && node.kind === 223 /* DeleteExpression */;
}
function isNodeDescendantOf(node, ancestor) {
while (node) {
@@ -17399,56 +17411,56 @@ function getDeclarationFromName(name) {
}
}
function isLiteralComputedPropertyDeclarationName(node) {
- return isStringOrNumericLiteralLike(node) && node.parent.kind === 166 /* ComputedPropertyName */ && isDeclaration(node.parent.parent);
+ return isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ && isDeclaration(node.parent.parent);
}
function isIdentifierName(node) {
const parent2 = node.parent;
switch (parent2.kind) {
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 308 /* EnumMember */:
- case 305 /* PropertyAssignment */:
- case 211 /* PropertyAccessExpression */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 311 /* EnumMember */:
+ case 308 /* PropertyAssignment */:
+ case 213 /* PropertyAccessExpression */:
return parent2.name === node;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return parent2.right === node;
- case 208 /* BindingElement */:
- case 279 /* ImportSpecifier */:
+ case 210 /* BindingElement */:
+ case 282 /* ImportSpecifier */:
return parent2.propertyName === node;
- case 284 /* ExportSpecifier */:
- case 294 /* JsxAttribute */:
- case 288 /* JsxSelfClosingElement */:
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
+ case 287 /* ExportSpecifier */:
+ case 297 /* JsxAttribute */:
+ case 291 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
return true;
}
return false;
}
function isAliasSymbolDeclaration(node) {
- if (node.kind === 274 /* ImportEqualsDeclaration */ || node.kind === 273 /* NamespaceExportDeclaration */ || node.kind === 276 /* ImportClause */ && !!node.name || node.kind === 277 /* NamespaceImport */ || node.kind === 283 /* NamespaceExport */ || node.kind === 279 /* ImportSpecifier */ || node.kind === 284 /* ExportSpecifier */ || node.kind === 280 /* ExportAssignment */ && exportAssignmentIsAlias(node)) {
+ if (node.kind === 277 /* ImportEqualsDeclaration */ || node.kind === 276 /* NamespaceExportDeclaration */ || node.kind === 279 /* ImportClause */ && !!node.name || node.kind === 280 /* NamespaceImport */ || node.kind === 286 /* NamespaceExport */ || node.kind === 282 /* ImportSpecifier */ || node.kind === 287 /* ExportSpecifier */ || node.kind === 283 /* ExportAssignment */ && exportAssignmentIsAlias(node)) {
return true;
}
return isInJSFile(node) && (isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isPropertyAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableExpression(node.parent.right));
}
function getAliasDeclarationFromName(node) {
switch (node.parent.kind) {
- case 276 /* ImportClause */:
- case 279 /* ImportSpecifier */:
- case 277 /* NamespaceImport */:
- case 284 /* ExportSpecifier */:
- case 280 /* ExportAssignment */:
- case 274 /* ImportEqualsDeclaration */:
- case 283 /* NamespaceExport */:
+ case 279 /* ImportClause */:
+ case 282 /* ImportSpecifier */:
+ case 280 /* NamespaceImport */:
+ case 287 /* ExportSpecifier */:
+ case 283 /* ExportAssignment */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 286 /* NamespaceExport */:
return node.parent;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
do {
node = node.parent;
- } while (node.parent.kind === 165 /* QualifiedName */);
+ } while (node.parent.kind === 166 /* QualifiedName */);
return getAliasDeclarationFromName(node);
}
}
@@ -17463,7 +17475,7 @@ function getExportAssignmentExpression(node) {
return isExportAssignment(node) ? node.expression : node.right;
}
function getPropertyAssignmentAliasLikeExpression(node) {
- return node.kind === 306 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 305 /* PropertyAssignment */ ? node.initializer : node.parent.right;
+ return node.kind === 309 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 308 /* PropertyAssignment */ ? node.initializer : node.parent.right;
}
function getEffectiveBaseTypeNode(node) {
const baseType = getClassExtendsHeritageElement(node);
@@ -17548,10 +17560,10 @@ function getVirtualEtsComponent(node) {
return void 0;
}
function isKeyword(token) {
- return 81 /* FirstKeyword */ <= token && token <= 164 /* LastKeyword */;
+ return 81 /* FirstKeyword */ <= token && token <= 165 /* LastKeyword */;
}
function isContextualKeyword(token) {
- return 127 /* FirstContextualKeyword */ <= token && token <= 164 /* LastContextualKeyword */;
+ return 127 /* FirstContextualKeyword */ <= token && token <= 165 /* LastContextualKeyword */;
}
function isNonContextualKeyword(token) {
return isKeyword(token) && !isContextualKeyword(token);
@@ -17587,13 +17599,13 @@ function getFunctionFlags(node) {
}
let flags = 0 /* Normal */;
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
if (node.asteriskToken) {
flags |= 1 /* Generator */;
}
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (hasSyntacticModifier(node, 512 /* Async */)) {
flags |= 2 /* Async */;
}
@@ -17606,10 +17618,10 @@ function getFunctionFlags(node) {
}
function isAsyncFunction(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 512 /* Async */);
}
return false;
@@ -17625,7 +17637,7 @@ function hasDynamicName(declaration) {
return !!name && isDynamicName(name);
}
function isDynamicName(name) {
- if (!(name.kind === 166 /* ComputedPropertyName */ || name.kind === 212 /* ElementAccessExpression */)) {
+ if (!(name.kind === 167 /* ComputedPropertyName */ || name.kind === 214 /* ElementAccessExpression */)) {
return false;
}
const expr = isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression;
@@ -17639,7 +17651,7 @@ function getPropertyNameForPropertyNameNode(name) {
case 10 /* StringLiteral */:
case 8 /* NumericLiteral */:
return escapeLeadingUnderscores(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
const nameExpression = name.expression;
if (isStringOrNumericLiteralLike(nameExpression)) {
return escapeLeadingUnderscores(nameExpression.text);
@@ -17691,17 +17703,17 @@ function isPushOrUnshiftIdentifier(node) {
}
function isParameterDeclaration(node) {
const root = getRootDeclaration(node);
- return root.kind === 168 /* Parameter */;
+ return root.kind === 169 /* Parameter */;
}
function getRootDeclaration(node) {
- while (node.kind === 208 /* BindingElement */) {
+ while (node.kind === 210 /* BindingElement */) {
node = node.parent.parent;
}
return node;
}
function nodeStartsNewLexicalEnvironment(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 218 /* FunctionExpression */ || kind === 263 /* FunctionDeclaration */ || kind === 219 /* ArrowFunction */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 270 /* ModuleDeclaration */ || kind === 314 /* SourceFile */;
+ return kind === 178 /* Constructor */ || kind === 220 /* FunctionExpression */ || kind === 265 /* FunctionDeclaration */ || kind === 221 /* ArrowFunction */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 273 /* ModuleDeclaration */ || kind === 317 /* SourceFile */;
}
function nodeIsSynthesized(range) {
return positionIsSynthesized(range.pos) || positionIsSynthesized(range.end);
@@ -17716,22 +17728,22 @@ var Associativity = /* @__PURE__ */ ((Associativity2) => {
})(Associativity || {});
function getExpressionAssociativity(expression) {
const operator = getOperator(expression);
- const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0;
+ const hasArguments = expression.kind === 216 /* NewExpression */ && expression.arguments !== void 0;
return getOperatorAssociativity(expression.kind, operator, hasArguments);
}
function getOperatorAssociativity(kind, operator, hasArguments) {
switch (kind) {
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return hasArguments ? 0 /* Left */ : 1 /* Right */;
- case 225 /* PrefixUnaryExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 221 /* DeleteExpression */:
- case 224 /* AwaitExpression */:
- case 228 /* ConditionalExpression */:
- case 230 /* YieldExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 223 /* DeleteExpression */:
+ case 226 /* AwaitExpression */:
+ case 230 /* ConditionalExpression */:
+ case 232 /* YieldExpression */:
return 1 /* Right */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (operator) {
case 42 /* AsteriskAsteriskToken */:
case 63 /* EqualsToken */:
@@ -17757,13 +17769,13 @@ function getOperatorAssociativity(kind, operator, hasArguments) {
}
function getExpressionPrecedence(expression) {
const operator = getOperator(expression);
- const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0;
+ const hasArguments = expression.kind === 216 /* NewExpression */ && expression.arguments !== void 0;
return getOperatorPrecedence(expression.kind, operator, hasArguments);
}
function getOperator(expression) {
- if (expression.kind === 227 /* BinaryExpression */) {
+ if (expression.kind === 229 /* BinaryExpression */) {
return expression.operatorToken.kind;
- } else if (expression.kind === 225 /* PrefixUnaryExpression */ || expression.kind === 226 /* PostfixUnaryExpression */) {
+ } else if (expression.kind === 227 /* PrefixUnaryExpression */ || expression.kind === 228 /* PostfixUnaryExpression */) {
return expression.operator;
} else {
return expression.kind;
@@ -17799,15 +17811,15 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => {
})(OperatorPrecedence || {});
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return 0 /* Comma */;
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return 1 /* Spread */;
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return 2 /* Yield */;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return 4 /* Conditional */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (operatorKind) {
case 27 /* CommaToken */:
return 0 /* Comma */;
@@ -17831,27 +17843,27 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
default:
return getBinaryOperatorPrecedence(operatorKind);
}
- case 216 /* TypeAssertionExpression */:
- case 236 /* NonNullExpression */:
- case 225 /* PrefixUnaryExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 221 /* DeleteExpression */:
- case 224 /* AwaitExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 238 /* NonNullExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 223 /* DeleteExpression */:
+ case 226 /* AwaitExpression */:
return 16 /* Unary */;
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return 17 /* Update */;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return 18 /* LeftHandSide */;
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */;
- case 215 /* TaggedTemplateExpression */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
- case 237 /* MetaProperty */:
+ case 217 /* TaggedTemplateExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 239 /* MetaProperty */:
return 19 /* Member */;
- case 235 /* AsExpression */:
- case 239 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 241 /* SatisfiesExpression */:
return 11 /* Relational */;
case 109 /* ThisKeyword */:
case 107 /* SuperKeyword */:
@@ -17863,19 +17875,19 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
case 8 /* NumericLiteral */:
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 232 /* ClassExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
case 13 /* RegularExpressionLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
- case 217 /* ParenthesizedExpression */:
- case 233 /* OmittedExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
+ case 231 /* TemplateExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 235 /* OmittedExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
return 20 /* Primary */;
default:
return -1 /* Invalid */;
@@ -17928,7 +17940,7 @@ function getBinaryOperatorPrecedence(kind) {
function getSemanticJsxChildren(children) {
return filter(children, (i) => {
switch (i.kind) {
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return !!i.expression;
case 11 /* JsxText */:
return !i.containsOnlyTriviaWhiteSpaces;
@@ -18319,7 +18331,7 @@ function isThisInTypeQuery(node) {
while (isQualifiedName(node.parent) && node.parent.left === node) {
node = node.parent;
}
- return node.parent.kind === 186 /* TypeQuery */;
+ return node.parent.kind === 188 /* TypeQuery */;
}
function identifierIsThisKeyword(id) {
return id.originalKeywordKind === 109 /* ThisKeyword */;
@@ -18331,9 +18343,9 @@ function getAllAccessorDeclarations(declarations, accessor) {
let setAccessor;
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
- if (accessor.kind === 177 /* GetAccessor */) {
+ if (accessor.kind === 179 /* GetAccessor */) {
getAccessor = accessor;
- } else if (accessor.kind === 178 /* SetAccessor */) {
+ } else if (accessor.kind === 180 /* SetAccessor */) {
setAccessor = accessor;
} else {
Debug.fail("Accessor has wrong kind");
@@ -18349,10 +18361,10 @@ function getAllAccessorDeclarations(declarations, accessor) {
} else if (!secondAccessor) {
secondAccessor = member;
}
- if (member.kind === 177 /* GetAccessor */ && !getAccessor) {
+ if (member.kind === 179 /* GetAccessor */ && !getAccessor) {
getAccessor = member;
}
- if (member.kind === 178 /* SetAccessor */ && !setAccessor) {
+ if (member.kind === 180 /* SetAccessor */ && !setAccessor) {
setAccessor = member;
}
}
@@ -18384,7 +18396,7 @@ function getJSDocTypeParameterDeclarations(node) {
return flatMap(getJSDocTags(node), (tag) => isNonTypeAliasTemplate(tag) ? tag.typeParameters : void 0);
}
function isNonTypeAliasTemplate(tag) {
- return isJSDocTemplateTag(tag) && !(tag.parent.kind === 329 /* JSDoc */ && tag.parent.tags.some(isJSDocTypeAlias));
+ return isJSDocTemplateTag(tag) && !(tag.parent.kind === 332 /* JSDoc */ && tag.parent.tags.some(isJSDocTypeAlias));
}
function getEffectiveSetAccessorTypeAnnotationNode(node) {
const parameter = getSetAccessorValueParameter(node);
@@ -18569,7 +18581,7 @@ function getSelectedSyntacticModifierFlags(node, flags) {
return getSyntacticModifierFlags(node) & flags;
}
function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) {
- if (node.kind >= 0 /* FirstToken */ && node.kind <= 164 /* LastToken */) {
+ if (node.kind >= 0 /* FirstToken */ && node.kind <= 165 /* LastToken */) {
return 0 /* None */;
}
if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) {
@@ -18660,7 +18672,7 @@ function modifierToFlag(token) {
return 32768 /* In */;
case 146 /* OutKeyword */:
return 65536 /* Out */;
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return 131072 /* Decorator */;
}
return 0 /* None */;
@@ -18693,7 +18705,7 @@ function isLeftHandSideOfAssignment(node) {
function isDestructuringAssignment(node) {
if (isAssignmentExpression(node, true)) {
const kind = node.left.kind;
- return kind === 210 /* ObjectLiteralExpression */ || kind === 209 /* ArrayLiteralExpression */;
+ return kind === 212 /* ObjectLiteralExpression */ || kind === 211 /* ArrayLiteralExpression */;
}
return false;
}
@@ -18707,12 +18719,12 @@ function getFirstIdentifier(node) {
switch (node.kind) {
case 79 /* Identifier */:
return node;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
do {
node = node.left;
} while (node.kind !== 79 /* Identifier */);
return node;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
do {
node = node.expression;
} while (node.kind !== 79 /* Identifier */);
@@ -18720,7 +18732,7 @@ function getFirstIdentifier(node) {
}
}
function isDottedName(node) {
- return node.kind === 79 /* Identifier */ || node.kind === 109 /* ThisKeyword */ || node.kind === 107 /* SuperKeyword */ || node.kind === 237 /* MetaProperty */ || node.kind === 211 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 217 /* ParenthesizedExpression */ && isDottedName(node.expression);
+ return node.kind === 79 /* Identifier */ || node.kind === 109 /* ThisKeyword */ || node.kind === 107 /* SuperKeyword */ || node.kind === 239 /* MetaProperty */ || node.kind === 213 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 219 /* ParenthesizedExpression */ && isDottedName(node.expression);
}
function isPropertyAccessEntityNameExpression(node) {
return isPropertyAccessExpression(node) && isIdentifier(node.name) && isEntityNameExpression(node.expression);
@@ -18745,7 +18757,7 @@ function isPrototypeAccess(node) {
return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype";
}
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
- return node.parent.kind === 165 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node;
+ return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 213 /* PropertyAccessExpression */ && node.parent.name === node;
}
function isRightSideOfAccessExpression(node) {
return isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node;
@@ -18754,10 +18766,10 @@ function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) {
return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node || isJSDocMemberName(node.parent) && node.parent.right === node;
}
function isEmptyObjectLiteral(expression) {
- return expression.kind === 210 /* ObjectLiteralExpression */ && expression.properties.length === 0;
+ return expression.kind === 212 /* ObjectLiteralExpression */ && expression.properties.length === 0;
}
function isEmptyArrayLiteral(expression) {
- return expression.kind === 209 /* ArrayLiteralExpression */ && expression.elements.length === 0;
+ return expression.kind === 211 /* ArrayLiteralExpression */ && expression.elements.length === 0;
}
function getLocalSymbolForExportDefault(symbol) {
if (!isExportDefaultSymbol(symbol) || !symbol.declarations)
@@ -18985,8 +18997,8 @@ function isDeclarationNameOfEnumOrNamespace(node) {
const parseNode = getParseTreeNode(node);
if (parseNode) {
switch (parseNode.parent.kind) {
- case 269 /* EnumDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
return parseNode === parseNode.parent.name;
}
}
@@ -19047,30 +19059,30 @@ function accessKind(node) {
if (!parent2)
return 0 /* Read */;
switch (parent2.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return accessKind(parent2);
- case 226 /* PostfixUnaryExpression */:
- case 225 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const { operator } = parent2;
return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const { left, operatorToken } = parent2;
return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 63 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return parent2.name !== node ? 0 /* Read */ : accessKind(parent2);
- case 305 /* PropertyAssignment */: {
+ case 308 /* PropertyAssignment */: {
const parentAccess = accessKind(parent2.parent);
return node === parent2.name ? reverseAccessKind(parentAccess) : parentAccess;
}
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return node === parent2.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent2.parent);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return accessKind(parent2);
default:
return 0 /* Read */;
}
function writeOrReadWrite() {
- return parent2.parent && walkUpParenthesizedExpressions(parent2.parent).kind === 245 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
+ return parent2.parent && walkUpParenthesizedExpressions(parent2.parent).kind === 247 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
}
}
function reverseAccessKind(a) {
@@ -19183,16 +19195,16 @@ function isObjectTypeDeclaration(node) {
return isClassLike(node) || isInterfaceDeclaration(node) || isTypeLiteralNode(node);
}
function isTypeNodeKind(kind) {
- return kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */ || kind === 132 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 149 /* NumberKeyword */ || kind === 162 /* BigIntKeyword */ || kind === 150 /* ObjectKeyword */ || kind === 135 /* BooleanKeyword */ || kind === 153 /* StringKeyword */ || kind === 154 /* SymbolKeyword */ || kind === 115 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 145 /* NeverKeyword */ || kind === 234 /* ExpressionWithTypeArguments */ || kind === 321 /* JSDocAllType */ || kind === 322 /* JSDocUnknownType */ || kind === 323 /* JSDocNullableType */ || kind === 324 /* JSDocNonNullableType */ || kind === 325 /* JSDocOptionalType */ || kind === 326 /* JSDocFunctionType */ || kind === 327 /* JSDocVariadicType */;
+ return kind >= 184 /* FirstTypeNode */ && kind <= 207 /* LastTypeNode */ || kind === 132 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 149 /* NumberKeyword */ || kind === 162 /* BigIntKeyword */ || kind === 150 /* ObjectKeyword */ || kind === 135 /* BooleanKeyword */ || kind === 153 /* StringKeyword */ || kind === 154 /* SymbolKeyword */ || kind === 115 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 145 /* NeverKeyword */ || kind === 236 /* ExpressionWithTypeArguments */ || kind === 324 /* JSDocAllType */ || kind === 325 /* JSDocUnknownType */ || kind === 326 /* JSDocNullableType */ || kind === 327 /* JSDocNonNullableType */ || kind === 328 /* JSDocOptionalType */ || kind === 329 /* JSDocFunctionType */ || kind === 330 /* JSDocVariadicType */;
}
function isAccessExpression(node) {
- return node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */;
+ return node.kind === 213 /* PropertyAccessExpression */ || node.kind === 214 /* ElementAccessExpression */;
}
function getNameOfAccessExpression(node) {
- if (node.kind === 211 /* PropertyAccessExpression */) {
+ if (node.kind === 213 /* PropertyAccessExpression */) {
return node.name;
}
- Debug.assert(node.kind === 212 /* ElementAccessExpression */);
+ Debug.assert(node.kind === 214 /* ElementAccessExpression */);
return node.argumentExpression;
}
function isBundleFileTextLike(section) {
@@ -19205,7 +19217,7 @@ function isBundleFileTextLike(section) {
}
}
function isNamedImportsOrExports(node) {
- return node.kind === 278 /* NamedImports */ || node.kind === 282 /* NamedExports */;
+ return node.kind === 281 /* NamedImports */ || node.kind === 285 /* NamedExports */;
}
function getLeftmostAccessExpression(expr) {
while (isAccessExpression(expr)) {
@@ -19218,12 +19230,12 @@ function forEachNameInAccessChainWalkingLeft(name, action) {
return walkAccessExpression(name.parent);
}
function walkAccessExpression(access) {
- if (access.kind === 211 /* PropertyAccessExpression */) {
+ if (access.kind === 213 /* PropertyAccessExpression */) {
const res = action(access.name);
if (res !== void 0) {
return res;
}
- } else if (access.kind === 212 /* ElementAccessExpression */) {
+ } else if (access.kind === 214 /* ElementAccessExpression */) {
if (isIdentifier(access.argumentExpression) || isStringLiteralLike(access.argumentExpression)) {
const res = action(access.argumentExpression);
if (res !== void 0) {
@@ -19245,28 +19257,28 @@ function forEachNameInAccessChainWalkingLeft(name, action) {
function getLeftmostExpression(node, stopAtCallExpressions) {
while (true) {
switch (node.kind) {
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
node = node.operand;
continue;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
node = node.left;
continue;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
node = node.condition;
continue;
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
node = node.tag;
continue;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (stopAtCallExpressions) {
return node;
}
- case 235 /* AsExpression */:
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
- case 236 /* NonNullExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 239 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 238 /* NonNullExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 241 /* SatisfiesExpression */:
node = node.expression;
continue;
}
@@ -20230,33 +20242,33 @@ function isShorthandPropertyNameUseSite(useSite) {
return isIdentifier(useSite) && isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite;
}
function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) {
- while (node.kind === 79 /* Identifier */ || node.kind === 211 /* PropertyAccessExpression */) {
+ while (node.kind === 79 /* Identifier */ || node.kind === 213 /* PropertyAccessExpression */) {
node = node.parent;
}
- if (node.kind !== 166 /* ComputedPropertyName */) {
+ if (node.kind !== 167 /* ComputedPropertyName */) {
return false;
}
if (hasSyntacticModifier(node.parent, 256 /* Abstract */)) {
return true;
}
const containerKind = node.parent.parent.kind;
- return containerKind === 267 /* InterfaceDeclaration */ || containerKind === 187 /* TypeLiteral */;
+ return containerKind === 270 /* InterfaceDeclaration */ || containerKind === 189 /* TypeLiteral */;
}
function isIdentifierInNonEmittingHeritageClause(node) {
if (node.kind !== 79 /* Identifier */)
return false;
const heritageClause = findAncestor(node.parent, (parent2) => {
switch (parent2.kind) {
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return true;
- case 211 /* PropertyAccessExpression */:
- case 234 /* ExpressionWithTypeArguments */:
+ case 213 /* PropertyAccessExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
return false;
default:
return "quit";
}
});
- return (heritageClause == null ? void 0 : heritageClause.token) === 118 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 267 /* InterfaceDeclaration */;
+ return (heritageClause == null ? void 0 : heritageClause.token) === 118 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 270 /* InterfaceDeclaration */;
}
function isIdentifierTypeReference(node) {
return isTypeReferenceNode(node) && isIdentifier(node.typeName);
@@ -20345,20 +20357,20 @@ function getContainingNodeArray(node) {
if (!node.parent)
return void 0;
switch (node.kind) {
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
const { parent: parent3 } = node;
- return parent3.kind === 195 /* InferType */ ? void 0 : parent3.typeParameters;
- case 168 /* Parameter */:
+ return parent3.kind === 197 /* InferType */ ? void 0 : parent3.typeParameters;
+ case 169 /* Parameter */:
return node.parent.parameters;
- case 204 /* TemplateLiteralTypeSpan */:
+ case 206 /* TemplateLiteralTypeSpan */:
return node.parent.templateSpans;
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return node.parent.templateSpans;
- case 169 /* Decorator */: {
+ case 170 /* Decorator */: {
const { parent: parent4 } = node;
return canHaveDecorators(parent4) ? parent4.modifiers : canHaveIllegalDecorators(parent4) ? parent4.illegalDecorators : void 0;
}
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return node.parent.heritageClauses;
}
const { parent: parent2 } = node;
@@ -20366,43 +20378,43 @@ function getContainingNodeArray(node) {
return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags;
}
switch (parent2.kind) {
- case 187 /* TypeLiteral */:
- case 267 /* InterfaceDeclaration */:
+ case 189 /* TypeLiteral */:
+ case 270 /* InterfaceDeclaration */:
return isTypeElement(node) ? parent2.members : void 0;
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return parent2.types;
- case 189 /* TupleType */:
- case 209 /* ArrayLiteralExpression */:
- case 360 /* CommaListExpression */:
- case 278 /* NamedImports */:
- case 282 /* NamedExports */:
+ case 191 /* TupleType */:
+ case 211 /* ArrayLiteralExpression */:
+ case 363 /* CommaListExpression */:
+ case 281 /* NamedImports */:
+ case 285 /* NamedExports */:
return parent2.elements;
- case 210 /* ObjectLiteralExpression */:
- case 295 /* JsxAttributes */:
+ case 212 /* ObjectLiteralExpression */:
+ case 298 /* JsxAttributes */:
return parent2.properties;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
return isTypeNode(node) ? parent2.typeArguments : parent2.expression === node ? void 0 : parent2.arguments;
- case 287 /* JsxElement */:
- case 291 /* JsxFragment */:
+ case 290 /* JsxElement */:
+ case 294 /* JsxFragment */:
return isJsxChild(node) ? parent2.children : void 0;
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return isTypeNode(node) ? parent2.typeArguments : void 0;
- case 242 /* Block */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 274 /* ModuleBlock */:
return parent2.statements;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return parent2.clauses;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return isClassElement(node) ? parent2.members : void 0;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return isEnumMember(node) ? parent2.members : void 0;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return parent2.statements;
}
}
@@ -20411,7 +20423,7 @@ function hasContextSensitiveParameters(node) {
if (some(node.parameters, (p) => !getEffectiveTypeAnnotationNode(p))) {
return true;
}
- if (node.kind !== 219 /* ArrowFunction */) {
+ if (node.kind !== 221 /* ArrowFunction */) {
const parameter = firstOrUndefined(node.parameters);
if (!(parameter && parameterIsThisKeyword(parameter))) {
return true;
@@ -20424,14 +20436,14 @@ function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "-Infinity" || name === "NaN";
}
function isCatchClauseVariableDeclaration(node) {
- return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 301 /* CatchClause */;
+ return node.kind === 263 /* VariableDeclaration */ && node.parent.kind === 304 /* CatchClause */;
}
function isParameterOrCatchClauseVariable(symbol) {
const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
return !!declaration && (isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
}
function isFunctionExpressionOrArrowFunction(node) {
- return node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */;
+ return node.kind === 220 /* FunctionExpression */ || node.kind === 221 /* ArrowFunction */;
}
function escapeSnippetText(text) {
return text.replace(/\$/gm, () => "\\$");
@@ -20494,23 +20506,23 @@ function getNodeModulePathParts(fullPath, modulePathPart) {
}
function getParameterTypeNode(parameter) {
var _a2;
- return parameter.kind === 349 /* JSDocParameterTag */ ? (_a2 = parameter.typeExpression) == null ? void 0 : _a2.type : parameter.type;
+ return parameter.kind === 352 /* JSDocParameterTag */ ? (_a2 = parameter.typeExpression) == null ? void 0 : _a2.type : parameter.type;
}
function isTypeDeclaration(node) {
switch (node.kind) {
- case 167 /* TypeParameter */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 168 /* TypeParameter */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return true;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return node.isTypeOnly;
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return node.parent.parent.isTypeOnly;
default:
return false;
@@ -20523,7 +20535,7 @@ function isCalledStructDeclaration(declarations) {
if (!declarations) {
return false;
}
- return declarations.some((declaration) => declaration.kind === 265 /* StructDeclaration */);
+ return declarations.some((declaration) => declaration.kind === 267 /* StructDeclaration */);
}
function getNameOfDecorator(node) {
const expression = node.expression;
@@ -20755,16 +20767,16 @@ function createParenthesizerRules(factory2) {
return parenthesizerRule;
}
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
- const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator);
- const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator);
+ const binaryOperatorPrecedence = getOperatorPrecedence(229 /* BinaryExpression */, binaryOperator);
+ const binaryOperatorAssociativity = getOperatorAssociativity(229 /* BinaryExpression */, binaryOperator);
const emittedOperand = skipPartiallyEmittedExpressions(operand);
- if (!isLeftSideOfBinary && operand.kind === 219 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
+ if (!isLeftSideOfBinary && operand.kind === 221 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
return true;
}
const operandPrecedence = getExpressionPrecedence(emittedOperand);
switch (compareValues(operandPrecedence, binaryOperatorPrecedence)) {
case -1 /* LessThan */:
- if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 230 /* YieldExpression */) {
+ if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 232 /* YieldExpression */) {
return false;
}
return true;
@@ -20798,7 +20810,7 @@ function createParenthesizerRules(factory2) {
if (isLiteralKind(node.kind)) {
return node.kind;
}
- if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {
+ if (node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {
if (node.cachedLiteralKind !== void 0) {
return node.cachedLiteralKind;
}
@@ -20811,7 +20823,7 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
const skipped = skipPartiallyEmittedExpressions(operand);
- if (skipped.kind === 217 /* ParenthesizedExpression */) {
+ if (skipped.kind === 219 /* ParenthesizedExpression */) {
return operand;
}
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory2.createParenthesizedExpression(operand) : operand;
@@ -20826,7 +20838,7 @@ function createParenthesizerRules(factory2) {
return isCommaSequence(expression) ? factory2.createParenthesizedExpression(expression) : expression;
}
function parenthesizeConditionOfConditionalExpression(condition) {
- const conditionalPrecedence = getOperatorPrecedence(228 /* ConditionalExpression */, 57 /* QuestionToken */);
+ const conditionalPrecedence = getOperatorPrecedence(230 /* ConditionalExpression */, 57 /* QuestionToken */);
const emittedCondition = skipPartiallyEmittedExpressions(condition);
const conditionPrecedence = getExpressionPrecedence(emittedCondition);
if (compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) {
@@ -20843,8 +20855,8 @@ function createParenthesizerRules(factory2) {
let needsParens = isCommaSequence(check);
if (!needsParens) {
switch (getLeftmostExpression(check, false).kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
needsParens = true;
}
}
@@ -20853,16 +20865,16 @@ function createParenthesizerRules(factory2) {
function parenthesizeExpressionOfNew(expression) {
const leftmostExpr = getLeftmostExpression(expression, true);
switch (leftmostExpr.kind) {
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return factory2.createParenthesizedExpression(expression);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return !leftmostExpr.arguments ? factory2.createParenthesizedExpression(expression) : expression;
}
return parenthesizeLeftSideOfAccess(expression);
}
function parenthesizeLeftSideOfAccess(expression, optionalChain) {
const emittedExpression = skipPartiallyEmittedExpressions(expression);
- if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 214 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) {
+ if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 216 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) {
return expression;
}
return setTextRange(factory2.createParenthesizedExpression(expression), expression);
@@ -20880,7 +20892,7 @@ function createParenthesizerRules(factory2) {
function parenthesizeExpressionForDisallowedComma(expression) {
const emittedExpression = skipPartiallyEmittedExpressions(expression);
const expressionPrecedence = getExpressionPrecedence(emittedExpression);
- const commaPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, 27 /* CommaToken */);
+ const commaPrecedence = getOperatorPrecedence(229 /* BinaryExpression */, 27 /* CommaToken */);
return expressionPrecedence > commaPrecedence ? expression : setTextRange(factory2.createParenthesizedExpression(expression), expression);
}
function parenthesizeExpressionOfExpressionStatement(expression) {
@@ -20888,7 +20900,7 @@ function createParenthesizerRules(factory2) {
if (isCallExpression(emittedExpression)) {
const callee = emittedExpression.expression;
const kind = skipPartiallyEmittedExpressions(callee).kind;
- if (kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */) {
+ if (kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */) {
const updated = factory2.updateCallExpression(
emittedExpression,
setTextRange(factory2.createParenthesizedExpression(callee), callee),
@@ -20899,37 +20911,37 @@ function createParenthesizerRules(factory2) {
}
}
const leftmostExpressionKind = getLeftmostExpression(emittedExpression, false).kind;
- if (leftmostExpressionKind === 210 /* ObjectLiteralExpression */ || leftmostExpressionKind === 218 /* FunctionExpression */) {
+ if (leftmostExpressionKind === 212 /* ObjectLiteralExpression */ || leftmostExpressionKind === 220 /* FunctionExpression */) {
return setTextRange(factory2.createParenthesizedExpression(expression), expression);
}
return expression;
}
function parenthesizeConciseBodyOfArrowFunction(body) {
- if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 210 /* ObjectLiteralExpression */)) {
+ if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 212 /* ObjectLiteralExpression */)) {
return setTextRange(factory2.createParenthesizedExpression(body), body);
}
return body;
}
function parenthesizeCheckTypeOfConditionalType(checkType) {
switch (checkType.kind) {
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 194 /* ConditionalType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 196 /* ConditionalType */:
return factory2.createParenthesizedType(checkType);
}
return checkType;
}
function parenthesizeExtendsTypeOfConditionalType(extendsType) {
switch (extendsType.kind) {
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return factory2.createParenthesizedType(extendsType);
}
return extendsType;
}
function parenthesizeConstituentTypeOfUnionType(type) {
switch (type.kind) {
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeCheckTypeOfConditionalType(type);
@@ -20939,8 +20951,8 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeConstituentTypeOfIntersectionType(type) {
switch (type.kind) {
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeConstituentTypeOfUnionType(type);
@@ -20950,23 +20962,23 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeOperandOfTypeOperator(type) {
switch (type.kind) {
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeConstituentTypeOfIntersectionType(type);
}
function parenthesizeOperandOfReadonlyTypeOperator(type) {
switch (type.kind) {
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return factory2.createParenthesizedType(type);
}
return parenthesizeOperandOfTypeOperator(type);
}
function parenthesizeNonArrayTypeOfPostfixType(type) {
switch (type.kind) {
- case 195 /* InferType */:
- case 198 /* TypeOperator */:
- case 186 /* TypeQuery */:
+ case 197 /* InferType */:
+ case 200 /* TypeOperator */:
+ case 188 /* TypeQuery */:
return factory2.createParenthesizedType(type);
}
return parenthesizeOperandOfTypeOperator(type);
@@ -21120,11 +21132,11 @@ function createNodeConverters(factory2) {
}
function convertToAssignmentPattern(node) {
switch (node.kind) {
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return convertToArrayAssignmentPattern(node);
- case 206 /* ObjectBindingPattern */:
- case 210 /* ObjectLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 212 /* ObjectLiteralExpression */:
return convertToObjectAssignmentPattern(node);
}
}
@@ -21249,6 +21261,8 @@ function createNodeFactory(flags, baseFactory2) {
updatePropertyDeclaration: updatePropertyDeclaration2,
createAnnotationPropertyDeclaration,
updateAnnotationPropertyDeclaration,
+ createOverloadPropertyDeclaration,
+ updateOverloadPropertyDeclaration,
createMethodSignature: createMethodSignature3,
updateMethodSignature: updateMethodSignature3,
createMethodDeclaration,
@@ -21444,6 +21458,8 @@ function createNodeFactory(flags, baseFactory2) {
updateStructDeclaration,
createAnnotationDeclaration,
updateAnnotationDeclaration,
+ createOverloadDeclaration,
+ updateOverloadDeclaration,
createInterfaceDeclaration: createInterfaceDeclaration2,
updateInterfaceDeclaration: updateInterfaceDeclaration2,
createTypeAliasDeclaration: createTypeAliasDeclaration2,
@@ -21490,40 +21506,40 @@ function createNodeFactory(flags, baseFactory2) {
createExternalModuleReference: createExternalModuleReference2,
updateExternalModuleReference: updateExternalModuleReference2,
get createJSDocAllType() {
- return getJSDocPrimaryTypeCreateFunction(321 /* JSDocAllType */);
+ return getJSDocPrimaryTypeCreateFunction(324 /* JSDocAllType */);
},
get createJSDocUnknownType() {
- return getJSDocPrimaryTypeCreateFunction(322 /* JSDocUnknownType */);
+ return getJSDocPrimaryTypeCreateFunction(325 /* JSDocUnknownType */);
},
get createJSDocNonNullableType() {
- return getJSDocPrePostfixUnaryTypeCreateFunction(324 /* JSDocNonNullableType */);
+ return getJSDocPrePostfixUnaryTypeCreateFunction(327 /* JSDocNonNullableType */);
},
get updateJSDocNonNullableType() {
- return getJSDocPrePostfixUnaryTypeUpdateFunction(324 /* JSDocNonNullableType */);
+ return getJSDocPrePostfixUnaryTypeUpdateFunction(327 /* JSDocNonNullableType */);
},
get createJSDocNullableType() {
- return getJSDocPrePostfixUnaryTypeCreateFunction(323 /* JSDocNullableType */);
+ return getJSDocPrePostfixUnaryTypeCreateFunction(326 /* JSDocNullableType */);
},
get updateJSDocNullableType() {
- return getJSDocPrePostfixUnaryTypeUpdateFunction(323 /* JSDocNullableType */);
+ return getJSDocPrePostfixUnaryTypeUpdateFunction(326 /* JSDocNullableType */);
},
get createJSDocOptionalType() {
- return getJSDocUnaryTypeCreateFunction(325 /* JSDocOptionalType */);
+ return getJSDocUnaryTypeCreateFunction(328 /* JSDocOptionalType */);
},
get updateJSDocOptionalType() {
- return getJSDocUnaryTypeUpdateFunction(325 /* JSDocOptionalType */);
+ return getJSDocUnaryTypeUpdateFunction(328 /* JSDocOptionalType */);
},
get createJSDocVariadicType() {
- return getJSDocUnaryTypeCreateFunction(327 /* JSDocVariadicType */);
+ return getJSDocUnaryTypeCreateFunction(330 /* JSDocVariadicType */);
},
get updateJSDocVariadicType() {
- return getJSDocUnaryTypeUpdateFunction(327 /* JSDocVariadicType */);
+ return getJSDocUnaryTypeUpdateFunction(330 /* JSDocVariadicType */);
},
get createJSDocNamepathType() {
- return getJSDocUnaryTypeCreateFunction(328 /* JSDocNamepathType */);
+ return getJSDocUnaryTypeCreateFunction(331 /* JSDocNamepathType */);
},
get updateJSDocNamepathType() {
- return getJSDocUnaryTypeUpdateFunction(328 /* JSDocNamepathType */);
+ return getJSDocUnaryTypeUpdateFunction(331 /* JSDocNamepathType */);
},
createJSDocFunctionType,
updateJSDocFunctionType,
@@ -21560,76 +21576,76 @@ function createNodeFactory(flags, baseFactory2) {
createJSDocLinkPlain,
updateJSDocLinkPlain,
get createJSDocTypeTag() {
- return getJSDocTypeLikeTagCreateFunction(352 /* JSDocTypeTag */);
+ return getJSDocTypeLikeTagCreateFunction(355 /* JSDocTypeTag */);
},
get updateJSDocTypeTag() {
- return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocTypeTag */);
+ return getJSDocTypeLikeTagUpdateFunction(355 /* JSDocTypeTag */);
},
get createJSDocReturnTag() {
- return getJSDocTypeLikeTagCreateFunction(350 /* JSDocReturnTag */);
+ return getJSDocTypeLikeTagCreateFunction(353 /* JSDocReturnTag */);
},
get updateJSDocReturnTag() {
- return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocReturnTag */);
+ return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocReturnTag */);
},
get createJSDocThisTag() {
- return getJSDocTypeLikeTagCreateFunction(351 /* JSDocThisTag */);
+ return getJSDocTypeLikeTagCreateFunction(354 /* JSDocThisTag */);
},
get updateJSDocThisTag() {
- return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocThisTag */);
+ return getJSDocTypeLikeTagUpdateFunction(354 /* JSDocThisTag */);
},
get createJSDocEnumTag() {
- return getJSDocTypeLikeTagCreateFunction(348 /* JSDocEnumTag */);
+ return getJSDocTypeLikeTagCreateFunction(351 /* JSDocEnumTag */);
},
get updateJSDocEnumTag() {
- return getJSDocTypeLikeTagUpdateFunction(348 /* JSDocEnumTag */);
+ return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocEnumTag */);
},
get createJSDocAuthorTag() {
- return getJSDocSimpleTagCreateFunction(339 /* JSDocAuthorTag */);
+ return getJSDocSimpleTagCreateFunction(342 /* JSDocAuthorTag */);
},
get updateJSDocAuthorTag() {
- return getJSDocSimpleTagUpdateFunction(339 /* JSDocAuthorTag */);
+ return getJSDocSimpleTagUpdateFunction(342 /* JSDocAuthorTag */);
},
get createJSDocClassTag() {
- return getJSDocSimpleTagCreateFunction(341 /* JSDocClassTag */);
+ return getJSDocSimpleTagCreateFunction(344 /* JSDocClassTag */);
},
get updateJSDocClassTag() {
- return getJSDocSimpleTagUpdateFunction(341 /* JSDocClassTag */);
+ return getJSDocSimpleTagUpdateFunction(344 /* JSDocClassTag */);
},
get createJSDocPublicTag() {
- return getJSDocSimpleTagCreateFunction(342 /* JSDocPublicTag */);
+ return getJSDocSimpleTagCreateFunction(345 /* JSDocPublicTag */);
},
get updateJSDocPublicTag() {
- return getJSDocSimpleTagUpdateFunction(342 /* JSDocPublicTag */);
+ return getJSDocSimpleTagUpdateFunction(345 /* JSDocPublicTag */);
},
get createJSDocPrivateTag() {
- return getJSDocSimpleTagCreateFunction(343 /* JSDocPrivateTag */);
+ return getJSDocSimpleTagCreateFunction(346 /* JSDocPrivateTag */);
},
get updateJSDocPrivateTag() {
- return getJSDocSimpleTagUpdateFunction(343 /* JSDocPrivateTag */);
+ return getJSDocSimpleTagUpdateFunction(346 /* JSDocPrivateTag */);
},
get createJSDocProtectedTag() {
- return getJSDocSimpleTagCreateFunction(344 /* JSDocProtectedTag */);
+ return getJSDocSimpleTagCreateFunction(347 /* JSDocProtectedTag */);
},
get updateJSDocProtectedTag() {
- return getJSDocSimpleTagUpdateFunction(344 /* JSDocProtectedTag */);
+ return getJSDocSimpleTagUpdateFunction(347 /* JSDocProtectedTag */);
},
get createJSDocReadonlyTag() {
- return getJSDocSimpleTagCreateFunction(345 /* JSDocReadonlyTag */);
+ return getJSDocSimpleTagCreateFunction(348 /* JSDocReadonlyTag */);
},
get updateJSDocReadonlyTag() {
- return getJSDocSimpleTagUpdateFunction(345 /* JSDocReadonlyTag */);
+ return getJSDocSimpleTagUpdateFunction(348 /* JSDocReadonlyTag */);
},
get createJSDocOverrideTag() {
- return getJSDocSimpleTagCreateFunction(346 /* JSDocOverrideTag */);
+ return getJSDocSimpleTagCreateFunction(349 /* JSDocOverrideTag */);
},
get updateJSDocOverrideTag() {
- return getJSDocSimpleTagUpdateFunction(346 /* JSDocOverrideTag */);
+ return getJSDocSimpleTagUpdateFunction(349 /* JSDocOverrideTag */);
},
get createJSDocDeprecatedTag() {
- return getJSDocSimpleTagCreateFunction(340 /* JSDocDeprecatedTag */);
+ return getJSDocSimpleTagCreateFunction(343 /* JSDocDeprecatedTag */);
},
get updateJSDocDeprecatedTag() {
- return getJSDocSimpleTagUpdateFunction(340 /* JSDocDeprecatedTag */);
+ return getJSDocSimpleTagUpdateFunction(343 /* JSDocDeprecatedTag */);
},
createJSDocUnknownTag,
updateJSDocUnknownTag,
@@ -21880,12 +21896,13 @@ function createNodeFactory(flags, baseFactory2) {
}
if (name) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 305 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 308 /* PropertyAssignment */:
if (isIdentifier(name)) {
node.transformFlags |= propagateIdentifierNameFlags(name);
break;
@@ -22152,7 +22169,7 @@ function createNodeFactory(flags, baseFactory2) {
return baseFactory2.createBaseTokenNode(kind);
}
function createToken3(token) {
- Debug.assert(token >= 0 /* FirstToken */ && token <= 164 /* LastToken */, "Invalid token");
+ Debug.assert(token >= 0 /* FirstToken */ && token <= 165 /* LastToken */, "Invalid token");
Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals.");
Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals.");
Debug.assert(token !== 79 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers");
@@ -22256,7 +22273,7 @@ function createNodeFactory(flags, baseFactory2) {
return result.length ? result : void 0;
}
function createQualifiedName2(left, right) {
- const node = createBaseNode(165 /* QualifiedName */);
+ const node = createBaseNode(166 /* QualifiedName */);
node.left = left;
node.right = asName(right);
node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right);
@@ -22266,7 +22283,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.right !== right ? update(createQualifiedName2(left, right), node) : node;
}
function createComputedPropertyName2(expression) {
- const node = createBaseNode(166 /* ComputedPropertyName */);
+ const node = createBaseNode(167 /* ComputedPropertyName */);
node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */;
return node;
@@ -22276,7 +22293,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createTypeParameterDeclaration2(modifiers, name, constraint, defaultType) {
const node = createBaseNamedDeclaration(
- 167 /* TypeParameter */,
+ 168 /* TypeParameter */,
modifiers,
name
);
@@ -22290,7 +22307,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 168 /* Parameter */,
+ 169 /* Parameter */,
modifiers,
name,
type,
@@ -22315,7 +22332,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? update(createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer), node) : node;
}
function createDecorator2(expression, annotationDeclaration) {
- const node = createBaseNode(169 /* Decorator */);
+ const node = createBaseNode(170 /* Decorator */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.annotationDeclaration = annotationDeclaration;
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */ | 8192 /* ContainsTypeScriptClassSyntax */ | 33554432 /* ContainsDecorators */;
@@ -22326,7 +22343,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertySignature3(modifiers, name, questionToken, type) {
const node = createBaseNamedDeclaration(
- 170 /* PropertySignature */,
+ 171 /* PropertySignature */,
modifiers,
name
);
@@ -22339,6 +22356,21 @@ function createNodeFactory(flags, baseFactory2) {
function updatePropertySignature3(node, modifiers, name, questionToken, type) {
return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature3(modifiers, name, questionToken, type), node) : node;
}
+ function createOverloadPropertyDeclaration(modifiers, name, questionToken, type) {
+ const node = createBaseNamedDeclaration(
+ 174 /* OverloadPropertyDeclaration */,
+ modifiers,
+ name
+ );
+ node.type = type;
+ node.questionToken = questionToken;
+ node.transformFlags = 1 /* ContainsTypeScript */;
+ node.initializer = void 0;
+ return node;
+ }
+ function updateOverloadPropertyDeclaration(node, modifiers, name, questionToken, type) {
+ return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createOverloadPropertyDeclaration(modifiers, name, questionToken, type), node) : node;
+ }
function finishUpdatePropertySignature(updated, original) {
if (updated !== original) {
updated.initializer = original.initializer;
@@ -22347,7 +22379,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 171 /* PropertyDeclaration */,
+ 172 /* PropertyDeclaration */,
modifiers,
name,
type,
@@ -22369,7 +22401,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createAnnotationPropertyDeclaration(name, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
void 0,
name,
type,
@@ -22383,7 +22415,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createMethodSignature3(modifiers, name, questionToken, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 173 /* MethodSignature */,
+ 175 /* MethodSignature */,
modifiers,
name,
typeParameters,
@@ -22399,7 +22431,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 174 /* MethodDeclaration */,
+ 176 /* MethodDeclaration */,
modifiers,
name,
typeParameters,
@@ -22436,7 +22468,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassStaticBlockDeclaration(body) {
const node = createBaseGenericNamedDeclaration(
- 175 /* ClassStaticBlockDeclaration */,
+ 177 /* ClassStaticBlockDeclaration */,
void 0,
void 0,
void 0
@@ -22459,7 +22491,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructorDeclaration(modifiers, parameters, body) {
const node = createBaseFunctionLikeDeclaration(
- 176 /* Constructor */,
+ 178 /* Constructor */,
modifiers,
void 0,
void 0,
@@ -22486,7 +22518,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createGetAccessorDeclaration(modifiers, name, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 177 /* GetAccessor */,
+ 179 /* GetAccessor */,
modifiers,
name,
void 0,
@@ -22508,7 +22540,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createSetAccessorDeclaration(modifiers, name, parameters, body) {
const node = createBaseFunctionLikeDeclaration(
- 178 /* SetAccessor */,
+ 180 /* SetAccessor */,
modifiers,
name,
void 0,
@@ -22532,7 +22564,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createCallSignature2(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 179 /* CallSignature */,
+ 181 /* CallSignature */,
void 0,
void 0,
typeParameters,
@@ -22547,7 +22579,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructSignature2(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 180 /* ConstructSignature */,
+ 182 /* ConstructSignature */,
void 0,
void 0,
typeParameters,
@@ -22562,7 +22594,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createIndexSignature3(modifiers, parameters, type) {
const node = createBaseSignatureDeclaration(
- 181 /* IndexSignature */,
+ 183 /* IndexSignature */,
modifiers,
void 0,
void 0,
@@ -22576,7 +22608,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature3(modifiers, parameters, type), node) : node;
}
function createTemplateLiteralTypeSpan(type, literal) {
- const node = createBaseNode(204 /* TemplateLiteralTypeSpan */);
+ const node = createBaseNode(206 /* TemplateLiteralTypeSpan */);
node.type = type;
node.literal = literal;
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22589,7 +22621,7 @@ function createNodeFactory(flags, baseFactory2) {
return createToken3(kind);
}
function createTypePredicateNode3(assertsModifier, parameterName, type) {
- const node = createBaseNode(182 /* TypePredicate */);
+ const node = createBaseNode(184 /* TypePredicate */);
node.assertsModifier = assertsModifier;
node.parameterName = asName(parameterName);
node.type = type;
@@ -22600,7 +22632,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode3(assertsModifier, parameterName, type), node) : node;
}
function createTypeReferenceNode2(typeName, typeArguments) {
- const node = createBaseNode(183 /* TypeReference */);
+ const node = createBaseNode(185 /* TypeReference */);
node.typeName = asName(typeName);
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray2(typeArguments));
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22611,7 +22643,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionTypeNode2(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 184 /* FunctionType */,
+ 186 /* FunctionType */,
void 0,
void 0,
typeParameters,
@@ -22636,7 +22668,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 185 /* ConstructorType */,
+ 187 /* ConstructorType */,
modifiers,
void 0,
typeParameters,
@@ -22659,7 +22691,7 @@ function createNodeFactory(flags, baseFactory2) {
return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);
}
function createTypeQueryNode2(exprName, typeArguments) {
- const node = createBaseNode(186 /* TypeQuery */);
+ const node = createBaseNode(188 /* TypeQuery */);
node.exprName = exprName;
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22669,7 +22701,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode2(exprName, typeArguments), node) : node;
}
function createTypeLiteralNode2(members) {
- const node = createBaseNode(187 /* TypeLiteral */);
+ const node = createBaseNode(189 /* TypeLiteral */);
node.members = createNodeArray2(members);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22678,7 +22710,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.members !== members ? update(createTypeLiteralNode2(members), node) : node;
}
function createArrayTypeNode2(elementType) {
- const node = createBaseNode(188 /* ArrayType */);
+ const node = createBaseNode(190 /* ArrayType */);
node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22687,7 +22719,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elementType !== elementType ? update(createArrayTypeNode2(elementType), node) : node;
}
function createTupleTypeNode2(elements) {
- const node = createBaseNode(189 /* TupleType */);
+ const node = createBaseNode(191 /* TupleType */);
node.elements = createNodeArray2(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements));
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22696,7 +22728,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createTupleTypeNode2(elements), node) : node;
}
function createNamedTupleMember(dotDotDotToken, name, questionToken, type) {
- const node = createBaseNode(202 /* NamedTupleMember */);
+ const node = createBaseNode(204 /* NamedTupleMember */);
node.dotDotDotToken = dotDotDotToken;
node.name = name;
node.questionToken = questionToken;
@@ -22708,7 +22740,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node) : node;
}
function createOptionalTypeNode2(type) {
- const node = createBaseNode(190 /* OptionalType */);
+ const node = createBaseNode(192 /* OptionalType */);
node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22717,7 +22749,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createOptionalTypeNode2(type), node) : node;
}
function createRestTypeNode2(type) {
- const node = createBaseNode(191 /* RestType */);
+ const node = createBaseNode(193 /* RestType */);
node.type = type;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22735,19 +22767,19 @@ function createNodeFactory(flags, baseFactory2) {
return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node;
}
function createUnionTypeNode2(types) {
- return createUnionOrIntersectionTypeNode(192 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
+ return createUnionOrIntersectionTypeNode(194 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
}
function updateUnionTypeNode2(node, types) {
return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
}
function createIntersectionTypeNode2(types) {
- return createUnionOrIntersectionTypeNode(193 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
+ return createUnionOrIntersectionTypeNode(195 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
}
function updateIntersectionTypeNode2(node, types) {
return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
}
function createConditionalTypeNode2(checkType, extendsType, trueType, falseType) {
- const node = createBaseNode(194 /* ConditionalType */);
+ const node = createBaseNode(196 /* ConditionalType */);
node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType);
node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType);
node.trueType = trueType;
@@ -22759,7 +22791,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode2(checkType, extendsType, trueType, falseType), node) : node;
}
function createInferTypeNode2(typeParameter) {
- const node = createBaseNode(195 /* InferType */);
+ const node = createBaseNode(197 /* InferType */);
node.typeParameter = typeParameter;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22768,7 +22800,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.typeParameter !== typeParameter ? update(createInferTypeNode2(typeParameter), node) : node;
}
function createTemplateLiteralType(head, templateSpans) {
- const node = createBaseNode(203 /* TemplateLiteralType */);
+ const node = createBaseNode(205 /* TemplateLiteralType */);
node.head = head;
node.templateSpans = createNodeArray2(templateSpans);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22778,7 +22810,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
}
function createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf = false) {
- const node = createBaseNode(205 /* ImportType */);
+ const node = createBaseNode(207 /* ImportType */);
node.argument = argument;
node.assertions = assertions;
node.qualifier = qualifier;
@@ -22791,7 +22823,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node;
}
function createParenthesizedType2(type) {
- const node = createBaseNode(196 /* ParenthesizedType */);
+ const node = createBaseNode(198 /* ParenthesizedType */);
node.type = type;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22800,12 +22832,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createParenthesizedType2(type), node) : node;
}
function createThisTypeNode2() {
- const node = createBaseNode(197 /* ThisType */);
+ const node = createBaseNode(199 /* ThisType */);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
}
function createTypeOperatorNode3(operator, type) {
- const node = createBaseNode(198 /* TypeOperator */);
+ const node = createBaseNode(200 /* TypeOperator */);
node.operator = operator;
node.type = operator === 147 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22815,7 +22847,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createTypeOperatorNode3(node.operator, type), node) : node;
}
function createIndexedAccessTypeNode2(objectType, indexType) {
- const node = createBaseNode(199 /* IndexedAccessType */);
+ const node = createBaseNode(201 /* IndexedAccessType */);
node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType);
node.indexType = indexType;
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22825,7 +22857,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode2(objectType, indexType), node) : node;
}
function createMappedTypeNode2(readonlyToken, typeParameter, nameType, questionToken, type, members) {
- const node = createBaseNode(200 /* MappedType */);
+ const node = createBaseNode(202 /* MappedType */);
node.readonlyToken = readonlyToken;
node.typeParameter = typeParameter;
node.nameType = nameType;
@@ -22839,7 +22871,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode2(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node;
}
function createLiteralTypeNode2(literal) {
- const node = createBaseNode(201 /* LiteralType */);
+ const node = createBaseNode(203 /* LiteralType */);
node.literal = literal;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22848,7 +22880,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.literal !== literal ? update(createLiteralTypeNode2(literal), node) : node;
}
function createObjectBindingPattern2(elements) {
- const node = createBaseNode(206 /* ObjectBindingPattern */);
+ const node = createBaseNode(208 /* ObjectBindingPattern */);
node.elements = createNodeArray2(elements);
node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */;
if (node.transformFlags & 32768 /* ContainsRestOrSpread */) {
@@ -22860,7 +22892,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createObjectBindingPattern2(elements), node) : node;
}
function createArrayBindingPattern2(elements) {
- const node = createBaseNode(207 /* ArrayBindingPattern */);
+ const node = createBaseNode(209 /* ArrayBindingPattern */);
node.elements = createNodeArray2(elements);
node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */;
return node;
@@ -22870,7 +22902,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createBindingElement2(dotDotDotToken, propertyName, name, initializer) {
const node = createBaseBindingLikeDeclaration(
- 208 /* BindingElement */,
+ 210 /* BindingElement */,
void 0,
name,
initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
@@ -22893,7 +22925,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createArrayLiteralExpression(elements, multiLine) {
- const node = createBaseExpression(209 /* ArrayLiteralExpression */);
+ const node = createBaseExpression(211 /* ArrayLiteralExpression */);
const lastElement = elements && lastOrUndefined(elements);
const elementsArray = createNodeArray2(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0);
node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray);
@@ -22905,7 +22937,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node;
}
function createObjectLiteralExpression(properties, multiLine) {
- const node = createBaseExpression(210 /* ObjectLiteralExpression */);
+ const node = createBaseExpression(212 /* ObjectLiteralExpression */);
node.properties = createNodeArray2(properties);
node.multiLine = multiLine;
node.transformFlags |= propagateChildrenFlags(node.properties);
@@ -22915,7 +22947,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node;
}
function createPropertyAccessExpression(expression, name) {
- const node = createBaseExpression(211 /* PropertyAccessExpression */);
+ const node = createBaseExpression(213 /* PropertyAccessExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.name = asName(name);
node.transformFlags = propagateChildFlags(node.expression) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
@@ -22931,7 +22963,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node;
}
function createPropertyAccessChain2(expression, questionDotToken, name) {
- const node = createBaseExpression(211 /* PropertyAccessExpression */);
+ const node = createBaseExpression(213 /* PropertyAccessExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -22944,7 +22976,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain2(expression, questionDotToken, name), node) : node;
}
function createElementAccessExpression(expression, index) {
- const node = createBaseExpression(212 /* ElementAccessExpression */);
+ const node = createBaseExpression(214 /* ElementAccessExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.argumentExpression = asExpression(index);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.argumentExpression);
@@ -22960,7 +22992,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node;
}
function createElementAccessChain2(expression, questionDotToken, index) {
- const node = createBaseExpression(212 /* ElementAccessExpression */);
+ const node = createBaseExpression(214 /* ElementAccessExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -22973,7 +23005,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain2(expression, questionDotToken, argumentExpression), node) : node;
}
function createCallExpression(expression, typeArguments, argumentsArray) {
- const node = createBaseExpression(213 /* CallExpression */);
+ const node = createBaseExpression(215 /* CallExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray2(argumentsArray));
@@ -22995,7 +23027,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node;
}
function createCallChain2(expression, questionDotToken, typeArguments, argumentsArray) {
- const node = createBaseExpression(213 /* CallExpression */);
+ const node = createBaseExpression(215 /* CallExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -23015,7 +23047,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain2(expression, questionDotToken, typeArguments, argumentsArray), node) : node;
}
function createNewExpression(expression, typeArguments, argumentsArray) {
- const node = createBaseExpression(214 /* NewExpression */);
+ const node = createBaseExpression(216 /* NewExpression */);
node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0;
@@ -23029,7 +23061,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createNewExpression(expression, typeArguments, argumentsArray), node) : node;
}
function createTaggedTemplateExpression(tag, typeArguments, template) {
- const node = createBaseExpression(215 /* TaggedTemplateExpression */);
+ const node = createBaseExpression(217 /* TaggedTemplateExpression */);
node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag, false);
node.typeArguments = asNodeArray(typeArguments);
node.template = template;
@@ -23046,7 +23078,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node;
}
function createTypeAssertion2(type, expression) {
- const node = createBaseExpression(216 /* TypeAssertionExpression */);
+ const node = createBaseExpression(218 /* TypeAssertionExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -23056,7 +23088,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type || node.expression !== expression ? update(createTypeAssertion2(type, expression), node) : node;
}
function createParenthesizedExpression(expression) {
- const node = createBaseExpression(217 /* ParenthesizedExpression */);
+ const node = createBaseExpression(219 /* ParenthesizedExpression */);
node.expression = expression;
node.transformFlags = propagateChildFlags(node.expression);
return node;
@@ -23066,7 +23098,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionExpression2(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 218 /* FunctionExpression */,
+ 220 /* FunctionExpression */,
modifiers,
name,
typeParameters,
@@ -23094,7 +23126,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression2(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node;
}
function createEtsComponentExpression(name, argumentsArray, body) {
- const node = createBaseExpression(220 /* EtsComponentExpression */);
+ const node = createBaseExpression(222 /* EtsComponentExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(name);
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray2(argumentsArray));
node.body = body;
@@ -23105,7 +23137,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createArrowFunction3(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
const node = createBaseFunctionLikeDeclaration(
- 219 /* ArrowFunction */,
+ 221 /* ArrowFunction */,
modifiers,
void 0,
typeParameters,
@@ -23124,7 +23156,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction3(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node;
}
function createDeleteExpression(expression) {
- const node = createBaseExpression(221 /* DeleteExpression */);
+ const node = createBaseExpression(223 /* DeleteExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23133,7 +23165,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createDeleteExpression(expression), node) : node;
}
function createTypeOfExpression(expression) {
- const node = createBaseExpression(222 /* TypeOfExpression */);
+ const node = createBaseExpression(224 /* TypeOfExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23142,7 +23174,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node;
}
function createVoidExpression(expression) {
- const node = createBaseExpression(223 /* VoidExpression */);
+ const node = createBaseExpression(225 /* VoidExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23151,7 +23183,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createVoidExpression(expression), node) : node;
}
function createAwaitExpression(expression) {
- const node = createBaseExpression(224 /* AwaitExpression */);
+ const node = createBaseExpression(226 /* AwaitExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */;
return node;
@@ -23160,7 +23192,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createAwaitExpression(expression), node) : node;
}
function createPrefixUnaryExpression(operator, operand) {
- const node = createBaseExpression(225 /* PrefixUnaryExpression */);
+ const node = createBaseExpression(227 /* PrefixUnaryExpression */);
node.operator = operator;
node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand);
node.transformFlags |= propagateChildFlags(node.operand);
@@ -23173,7 +23205,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node;
}
function createPostfixUnaryExpression(operand, operator) {
- const node = createBaseExpression(226 /* PostfixUnaryExpression */);
+ const node = createBaseExpression(228 /* PostfixUnaryExpression */);
node.operator = operator;
node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand);
node.transformFlags |= propagateChildFlags(node.operand);
@@ -23186,7 +23218,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node;
}
function createBinaryExpression(left, operator, right) {
- const node = createBaseExpression(227 /* BinaryExpression */);
+ const node = createBaseExpression(229 /* BinaryExpression */);
const operatorToken = asToken(operator);
const operatorKind = operatorToken.kind;
node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left);
@@ -23235,7 +23267,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node;
}
function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) {
- const node = createBaseExpression(228 /* ConditionalExpression */);
+ const node = createBaseExpression(230 /* ConditionalExpression */);
node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition);
node.questionToken = questionToken != null ? questionToken : createToken3(57 /* QuestionToken */);
node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue);
@@ -23248,7 +23280,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node;
}
function createTemplateExpression2(head, templateSpans) {
- const node = createBaseExpression(229 /* TemplateExpression */);
+ const node = createBaseExpression(231 /* TemplateExpression */);
node.head = head;
node.templateSpans = createNodeArray2(templateSpans);
node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */;
@@ -23301,7 +23333,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createYieldExpression(asteriskToken, expression) {
Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression.");
- const node = createBaseExpression(230 /* YieldExpression */);
+ const node = createBaseExpression(232 /* YieldExpression */);
node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.asteriskToken = asteriskToken;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */;
@@ -23311,7 +23343,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node;
}
function createSpreadElement(expression) {
- const node = createBaseExpression(231 /* SpreadElement */);
+ const node = createBaseExpression(233 /* SpreadElement */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */;
return node;
@@ -23321,7 +23353,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassExpression3(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 232 /* ClassExpression */,
+ 234 /* ClassExpression */,
modifiers,
name,
typeParameters,
@@ -23335,10 +23367,10 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression3(modifiers, name, typeParameters, heritageClauses, members), node) : node;
}
function createOmittedExpression2() {
- return createBaseExpression(233 /* OmittedExpression */);
+ return createBaseExpression(235 /* OmittedExpression */);
}
function createExpressionWithTypeArguments3(expression, typeArguments) {
- const node = createBaseNode(234 /* ExpressionWithTypeArguments */);
+ const node = createBaseNode(236 /* ExpressionWithTypeArguments */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | 1024 /* ContainsES2015 */;
@@ -23348,7 +23380,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments3(expression, typeArguments), node) : node;
}
function createAsExpression2(expression, type) {
- const node = createBaseExpression(235 /* AsExpression */);
+ const node = createBaseExpression(237 /* AsExpression */);
node.expression = expression;
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -23358,7 +23390,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.type !== type ? update(createAsExpression2(expression, type), node) : node;
}
function createNonNullExpression2(expression) {
- const node = createBaseExpression(236 /* NonNullExpression */);
+ const node = createBaseExpression(238 /* NonNullExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
return node;
@@ -23370,7 +23402,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createNonNullExpression2(expression), node) : node;
}
function createSatisfiesExpression(expression, type) {
- const node = createBaseExpression(239 /* SatisfiesExpression */);
+ const node = createBaseExpression(241 /* SatisfiesExpression */);
node.expression = expression;
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -23380,7 +23412,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node;
}
function createNonNullChain2(expression) {
- const node = createBaseExpression(236 /* NonNullExpression */);
+ const node = createBaseExpression(238 /* NonNullExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -23391,7 +23423,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createNonNullChain2(expression), node) : node;
}
function createMetaProperty2(keywordToken, name) {
- const node = createBaseExpression(237 /* MetaProperty */);
+ const node = createBaseExpression(239 /* MetaProperty */);
node.keywordToken = keywordToken;
node.name = name;
node.transformFlags |= propagateChildFlags(node.name);
@@ -23411,7 +23443,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createMetaProperty2(node.keywordToken, name), node) : node;
}
function createTemplateSpan2(expression, literal) {
- const node = createBaseNode(240 /* TemplateSpan */);
+ const node = createBaseNode(242 /* TemplateSpan */);
node.expression = expression;
node.literal = literal;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */;
@@ -23421,12 +23453,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan2(expression, literal), node) : node;
}
function createSemicolonClassElement2() {
- const node = createBaseNode(241 /* SemicolonClassElement */);
+ const node = createBaseNode(243 /* SemicolonClassElement */);
node.transformFlags |= 1024 /* ContainsES2015 */;
return node;
}
function createBlock2(statements, multiLine) {
- const node = createBaseNode(242 /* Block */);
+ const node = createBaseNode(244 /* Block */);
node.statements = createNodeArray2(statements);
node.multiLine = multiLine;
node.transformFlags |= propagateChildrenFlags(node.statements);
@@ -23436,7 +23468,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createBlock2(statements, node.multiLine), node) : node;
}
function createVariableStatement2(modifiers, declarationList) {
- const node = createBaseDeclaration(244 /* VariableStatement */);
+ const node = createBaseDeclaration(246 /* VariableStatement */);
node.modifiers = asNodeArray(modifiers);
node.declarationList = isArray(declarationList) ? createVariableDeclarationList2(declarationList) : declarationList;
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList);
@@ -23449,10 +23481,10 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement2(modifiers, declarationList), node) : node;
}
function createEmptyStatement2() {
- return createBaseNode(243 /* EmptyStatement */);
+ return createBaseNode(245 /* EmptyStatement */);
}
function createExpressionStatement2(expression) {
- const node = createBaseNode(245 /* ExpressionStatement */);
+ const node = createBaseNode(247 /* ExpressionStatement */);
node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23461,7 +23493,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createExpressionStatement2(expression), node) : node;
}
function createIfStatement(expression, thenStatement, elseStatement) {
- const node = createBaseNode(246 /* IfStatement */);
+ const node = createBaseNode(248 /* IfStatement */);
node.expression = expression;
node.thenStatement = asEmbeddedStatement(thenStatement);
node.elseStatement = asEmbeddedStatement(elseStatement);
@@ -23472,7 +23504,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? update(createIfStatement(expression, thenStatement, elseStatement), node) : node;
}
function createDoStatement(statement, expression) {
- const node = createBaseNode(247 /* DoStatement */);
+ const node = createBaseNode(249 /* DoStatement */);
node.statement = asEmbeddedStatement(statement);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression);
@@ -23482,7 +23514,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statement !== statement || node.expression !== expression ? update(createDoStatement(statement, expression), node) : node;
}
function createWhileStatement(expression, statement) {
- const node = createBaseNode(248 /* WhileStatement */);
+ const node = createBaseNode(250 /* WhileStatement */);
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
@@ -23492,7 +23524,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statement !== statement ? update(createWhileStatement(expression, statement), node) : node;
}
function createForStatement(initializer, condition, incrementor, statement) {
- const node = createBaseNode(249 /* ForStatement */);
+ const node = createBaseNode(251 /* ForStatement */);
node.initializer = initializer;
node.condition = condition;
node.incrementor = incrementor;
@@ -23504,7 +23536,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement ? update(createForStatement(initializer, condition, incrementor, statement), node) : node;
}
function createForInStatement(initializer, expression, statement) {
- const node = createBaseNode(250 /* ForInStatement */);
+ const node = createBaseNode(252 /* ForInStatement */);
node.initializer = initializer;
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
@@ -23515,7 +23547,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForInStatement(initializer, expression, statement), node) : node;
}
function createForOfStatement(awaitModifier, initializer, expression, statement) {
- const node = createBaseNode(251 /* ForOfStatement */);
+ const node = createBaseNode(253 /* ForOfStatement */);
node.awaitModifier = awaitModifier;
node.initializer = initializer;
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
@@ -23529,7 +23561,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForOfStatement(awaitModifier, initializer, expression, statement), node) : node;
}
function createContinueStatement(label) {
- const node = createBaseNode(252 /* ContinueStatement */);
+ const node = createBaseNode(254 /* ContinueStatement */);
node.label = asName(label);
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -23538,7 +23570,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label ? update(createContinueStatement(label), node) : node;
}
function createBreakStatement(label) {
- const node = createBaseNode(253 /* BreakStatement */);
+ const node = createBaseNode(255 /* BreakStatement */);
node.label = asName(label);
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -23547,7 +23579,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label ? update(createBreakStatement(label), node) : node;
}
function createReturnStatement(expression) {
- const node = createBaseNode(254 /* ReturnStatement */);
+ const node = createBaseNode(256 /* ReturnStatement */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -23556,7 +23588,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createReturnStatement(expression), node) : node;
}
function createWithStatement(expression, statement) {
- const node = createBaseNode(255 /* WithStatement */);
+ const node = createBaseNode(257 /* WithStatement */);
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
@@ -23566,7 +23598,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statement !== statement ? update(createWithStatement(expression, statement), node) : node;
}
function createSwitchStatement(expression, caseBlock) {
- const node = createBaseNode(256 /* SwitchStatement */);
+ const node = createBaseNode(258 /* SwitchStatement */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.caseBlock = caseBlock;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock);
@@ -23576,7 +23608,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.caseBlock !== caseBlock ? update(createSwitchStatement(expression, caseBlock), node) : node;
}
function createLabeledStatement(label, statement) {
- const node = createBaseNode(257 /* LabeledStatement */);
+ const node = createBaseNode(259 /* LabeledStatement */);
node.label = asName(label);
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement);
@@ -23586,7 +23618,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label || node.statement !== statement ? update(createLabeledStatement(label, statement), node) : node;
}
function createThrowStatement(expression) {
- const node = createBaseNode(258 /* ThrowStatement */);
+ const node = createBaseNode(260 /* ThrowStatement */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23595,7 +23627,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createThrowStatement(expression), node) : node;
}
function createTryStatement(tryBlock, catchClause, finallyBlock) {
- const node = createBaseNode(259 /* TryStatement */);
+ const node = createBaseNode(261 /* TryStatement */);
node.tryBlock = tryBlock;
node.catchClause = catchClause;
node.finallyBlock = finallyBlock;
@@ -23606,11 +23638,11 @@ function createNodeFactory(flags, baseFactory2) {
return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node;
}
function createDebuggerStatement2() {
- return createBaseNode(260 /* DebuggerStatement */);
+ return createBaseNode(262 /* DebuggerStatement */);
}
function createVariableDeclaration3(name, exclamationToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 261 /* VariableDeclaration */,
+ 263 /* VariableDeclaration */,
void 0,
name,
type,
@@ -23627,7 +23659,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration3(name, exclamationToken, type, initializer), node) : node;
}
function createVariableDeclarationList2(declarations, flags2 = 0 /* None */) {
- const node = createBaseNode(262 /* VariableDeclarationList */);
+ const node = createBaseNode(264 /* VariableDeclarationList */);
node.flags |= flags2 & 3 /* BlockScoped */;
node.declarations = createNodeArray2(declarations);
node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
@@ -23641,7 +23673,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 263 /* FunctionDeclaration */,
+ 265 /* FunctionDeclaration */,
modifiers,
name,
typeParameters,
@@ -23678,7 +23710,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassDeclaration2(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 264 /* ClassDeclaration */,
+ 266 /* ClassDeclaration */,
modifiers,
name,
typeParameters,
@@ -23700,7 +23732,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createStructDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 265 /* StructDeclaration */,
+ 267 /* StructDeclaration */,
modifiers,
name,
typeParameters,
@@ -23722,7 +23754,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createAnnotationDeclaration(modifiers, name, members) {
const node = createBaseNamedDeclaration(
- 266 /* AnnotationDeclaration */,
+ 268 /* AnnotationDeclaration */,
modifiers,
name
);
@@ -23739,9 +23771,28 @@ function createNodeFactory(flags, baseFactory2) {
function updateAnnotationDeclaration(node, modifiers, name, members) {
return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createAnnotationDeclaration(modifiers, name, members), node) : node;
}
+ function createOverloadDeclaration(modifiers, name, members) {
+ const node = createBaseNamedDeclaration(
+ 269 /* OverloadDeclaration */,
+ modifiers,
+ name
+ );
+ node.members = createNodeArray2(members);
+ node.transformFlags |= propagateChildrenFlags(node.members);
+ if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
+ node.transformFlags = 1 /* ContainsTypeScript */;
+ } else {
+ node.transformFlags |= 1024 /* ContainsES2015 */;
+ node.transformFlags |= 1 /* ContainsTypeScript */;
+ }
+ return node;
+ }
+ function updateOverloadDeclaration(node, modifiers, name, members) {
+ return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createOverloadDeclaration(modifiers, name, members), node) : node;
+ }
function createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseInterfaceOrClassLikeDeclaration(
- 267 /* InterfaceDeclaration */,
+ 270 /* InterfaceDeclaration */,
modifiers,
name,
typeParameters,
@@ -23763,7 +23814,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createTypeAliasDeclaration2(modifiers, name, typeParameters, type) {
const node = createBaseGenericNamedDeclaration(
- 268 /* TypeAliasDeclaration */,
+ 271 /* TypeAliasDeclaration */,
modifiers,
name,
typeParameters
@@ -23784,7 +23835,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createEnumDeclaration2(modifiers, name, members) {
const node = createBaseNamedDeclaration(
- 269 /* EnumDeclaration */,
+ 272 /* EnumDeclaration */,
modifiers,
name
);
@@ -23804,7 +23855,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createModuleDeclaration2(modifiers, name, body, flags2 = 0 /* None */) {
- const node = createBaseDeclaration(270 /* ModuleDeclaration */);
+ const node = createBaseDeclaration(273 /* ModuleDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.flags |= flags2 & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */);
node.name = name;
@@ -23828,7 +23879,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createModuleBlock2(statements) {
- const node = createBaseNode(271 /* ModuleBlock */);
+ const node = createBaseNode(274 /* ModuleBlock */);
node.statements = createNodeArray2(statements);
node.transformFlags |= propagateChildrenFlags(node.statements);
return node;
@@ -23837,7 +23888,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createModuleBlock2(statements), node) : node;
}
function createCaseBlock2(clauses) {
- const node = createBaseNode(272 /* CaseBlock */);
+ const node = createBaseNode(275 /* CaseBlock */);
node.clauses = createNodeArray2(clauses);
node.transformFlags |= propagateChildrenFlags(node.clauses);
return node;
@@ -23847,7 +23898,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createNamespaceExportDeclaration2(name) {
const node = createBaseNamedDeclaration(
- 273 /* NamespaceExportDeclaration */,
+ 276 /* NamespaceExportDeclaration */,
void 0,
name
);
@@ -23868,7 +23919,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference) {
const node = createBaseNamedDeclaration(
- 274 /* ImportEqualsDeclaration */,
+ 277 /* ImportEqualsDeclaration */,
modifiers,
name
);
@@ -23891,7 +23942,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause) {
- const node = createBaseDeclaration(275 /* ImportDeclaration */);
+ const node = createBaseDeclaration(278 /* ImportDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.importClause = importClause;
node.moduleSpecifier = moduleSpecifier;
@@ -23911,7 +23962,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createImportClause3(isTypeOnly, name, namedBindings) {
- const node = createBaseNode(276 /* ImportClause */);
+ const node = createBaseNode(279 /* ImportClause */);
node.isTypeOnly = isTypeOnly;
node.name = name;
node.namedBindings = namedBindings;
@@ -23933,7 +23984,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createAssertClause(elements, multiLine) {
- const node = createBaseNode(302 /* AssertClause */);
+ const node = createBaseNode(305 /* AssertClause */);
node.elements = createNodeArray2(elements);
node.multiLine = multiLine;
node.transformFlags |= 4 /* ContainsESNext */;
@@ -23943,7 +23994,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements || node.multiLine !== multiLine ? update(createAssertClause(elements, multiLine), node) : node;
}
function createAssertEntry(name, value) {
- const node = createBaseNode(303 /* AssertEntry */);
+ const node = createBaseNode(306 /* AssertEntry */);
node.name = name;
node.value = value;
node.transformFlags |= 4 /* ContainsESNext */;
@@ -23953,7 +24004,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.value !== value ? update(createAssertEntry(name, value), node) : node;
}
function createImportTypeAssertionContainer(clause, multiLine) {
- const node = createBaseNode(304 /* ImportTypeAssertionContainer */);
+ const node = createBaseNode(307 /* ImportTypeAssertionContainer */);
node.assertClause = clause;
node.multiLine = multiLine;
return node;
@@ -23962,7 +24013,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
}
function createNamespaceImport2(name) {
- const node = createBaseNode(277 /* NamespaceImport */);
+ const node = createBaseNode(280 /* NamespaceImport */);
node.name = name;
node.transformFlags |= propagateChildFlags(node.name);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -23972,7 +24023,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createNamespaceImport2(name), node) : node;
}
function createNamespaceExport2(name) {
- const node = createBaseNode(283 /* NamespaceExport */);
+ const node = createBaseNode(286 /* NamespaceExport */);
node.name = name;
node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */;
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -23982,7 +24033,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createNamespaceExport2(name), node) : node;
}
function createNamedImports2(elements) {
- const node = createBaseNode(278 /* NamedImports */);
+ const node = createBaseNode(281 /* NamedImports */);
node.elements = createNodeArray2(elements);
node.transformFlags |= propagateChildrenFlags(node.elements);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -23992,7 +24043,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createNamedImports2(elements), node) : node;
}
function createImportSpecifier2(isTypeOnly, propertyName, name) {
- const node = createBaseNode(279 /* ImportSpecifier */);
+ const node = createBaseNode(282 /* ImportSpecifier */);
node.isTypeOnly = isTypeOnly;
node.propertyName = propertyName;
node.name = name;
@@ -24004,7 +24055,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier2(isTypeOnly, propertyName, name), node) : node;
}
function createExportAssignment3(modifiers, isExportEquals, expression) {
- const node = createBaseDeclaration(280 /* ExportAssignment */);
+ const node = createBaseDeclaration(283 /* ExportAssignment */);
node.modifiers = asNodeArray(modifiers);
node.isExportEquals = isExportEquals;
node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary(63 /* EqualsToken */, void 0, expression) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression);
@@ -24023,7 +24074,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
- const node = createBaseDeclaration(281 /* ExportDeclaration */);
+ const node = createBaseDeclaration(284 /* ExportDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.isTypeOnly = isTypeOnly;
node.exportClause = exportClause;
@@ -24044,7 +24095,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createNamedExports2(elements) {
- const node = createBaseNode(282 /* NamedExports */);
+ const node = createBaseNode(285 /* NamedExports */);
node.elements = createNodeArray2(elements);
node.transformFlags |= propagateChildrenFlags(node.elements);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -24054,7 +24105,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createNamedExports2(elements), node) : node;
}
function createExportSpecifier2(isTypeOnly, propertyName, name) {
- const node = createBaseNode(284 /* ExportSpecifier */);
+ const node = createBaseNode(287 /* ExportSpecifier */);
node.isTypeOnly = isTypeOnly;
node.propertyName = asName(propertyName);
node.name = asName(name);
@@ -24066,11 +24117,11 @@ function createNodeFactory(flags, baseFactory2) {
return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier2(isTypeOnly, propertyName, name), node) : node;
}
function createMissingDeclaration() {
- const node = createBaseDeclaration(285 /* MissingDeclaration */);
+ const node = createBaseDeclaration(288 /* MissingDeclaration */);
return node;
}
function createExternalModuleReference2(expression) {
- const node = createBaseNode(286 /* ExternalModuleReference */);
+ const node = createBaseNode(289 /* ExternalModuleReference */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -24103,7 +24154,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createJSDocFunctionType(parameters, type) {
const node = createBaseSignatureDeclaration(
- 326 /* JSDocFunctionType */,
+ 329 /* JSDocFunctionType */,
void 0,
void 0,
void 0,
@@ -24116,7 +24167,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node;
}
function createJSDocTypeLiteral2(propertyTags, isArrayType = false) {
- const node = createBaseNode(331 /* JSDocTypeLiteral */);
+ const node = createBaseNode(334 /* JSDocTypeLiteral */);
node.jsDocPropertyTags = asNodeArray(propertyTags);
node.isArrayType = isArrayType;
return node;
@@ -24125,7 +24176,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral2(propertyTags, isArrayType), node) : node;
}
function createJSDocTypeExpression2(type) {
- const node = createBaseNode(318 /* JSDocTypeExpression */);
+ const node = createBaseNode(321 /* JSDocTypeExpression */);
node.type = type;
return node;
}
@@ -24133,7 +24184,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createJSDocTypeExpression2(type), node) : node;
}
function createJSDocSignature2(typeParameters, parameters, type) {
- const node = createBaseNode(332 /* JSDocSignature */);
+ const node = createBaseNode(335 /* JSDocSignature */);
node.typeParameters = asNodeArray(typeParameters);
node.parameters = createNodeArray2(parameters);
node.type = type;
@@ -24153,7 +24204,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createJSDocTemplateTag2(tagName, constraint, typeParameters, comment) {
- const node = createBaseJSDocTag(353 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier3("template"), comment);
+ const node = createBaseJSDocTag(356 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier3("template"), comment);
node.constraint = constraint;
node.typeParameters = createNodeArray2(typeParameters);
return node;
@@ -24162,7 +24213,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag2(tagName, constraint, typeParameters, comment), node) : node;
}
function createJSDocTypedefTag2(tagName, typeExpression, fullName, comment) {
- const node = createBaseJSDocTag(354 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier3("typedef"), comment);
+ const node = createBaseJSDocTag(357 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier3("typedef"), comment);
node.typeExpression = typeExpression;
node.fullName = fullName;
node.name = getJSDocTypeAliasName(fullName);
@@ -24172,7 +24223,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag2(tagName, typeExpression, fullName, comment), node) : node;
}
function createJSDocParameterTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
- const node = createBaseJSDocTag(349 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier3("param"), comment);
+ const node = createBaseJSDocTag(352 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier3("param"), comment);
node.typeExpression = typeExpression;
node.name = name;
node.isNameFirst = !!isNameFirst;
@@ -24183,7 +24234,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node;
}
function createJSDocPropertyTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
- const node = createBaseJSDocTag(356 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier3("prop"), comment);
+ const node = createBaseJSDocTag(359 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier3("prop"), comment);
node.typeExpression = typeExpression;
node.name = name;
node.isNameFirst = !!isNameFirst;
@@ -24194,7 +24245,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node;
}
function createJSDocCallbackTag2(tagName, typeExpression, fullName, comment) {
- const node = createBaseJSDocTag(347 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier3("callback"), comment);
+ const node = createBaseJSDocTag(350 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier3("callback"), comment);
node.typeExpression = typeExpression;
node.fullName = fullName;
node.name = getJSDocTypeAliasName(fullName);
@@ -24204,7 +24255,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag2(tagName, typeExpression, fullName, comment), node) : node;
}
function createJSDocAugmentsTag2(tagName, className, comment) {
- const node = createBaseJSDocTag(337 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier3("augments"), comment);
+ const node = createBaseJSDocTag(340 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier3("augments"), comment);
node.class = className;
return node;
}
@@ -24212,12 +24263,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag2(tagName, className, comment), node) : node;
}
function createJSDocImplementsTag2(tagName, className, comment) {
- const node = createBaseJSDocTag(338 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier3("implements"), comment);
+ const node = createBaseJSDocTag(341 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier3("implements"), comment);
node.class = className;
return node;
}
function createJSDocSeeTag(tagName, name, comment) {
- const node = createBaseJSDocTag(355 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier3("see"), comment);
+ const node = createBaseJSDocTag(358 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier3("see"), comment);
node.name = name;
return node;
}
@@ -24225,7 +24276,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.comment !== comment ? update(createJSDocSeeTag(tagName, name, comment), node) : node;
}
function createJSDocNameReference(name) {
- const node = createBaseNode(319 /* JSDocNameReference */);
+ const node = createBaseNode(322 /* JSDocNameReference */);
node.name = name;
return node;
}
@@ -24233,7 +24284,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocNameReference(name), node) : node;
}
function createJSDocMemberName(left, right) {
- const node = createBaseNode(320 /* JSDocMemberName */);
+ const node = createBaseNode(323 /* JSDocMemberName */);
node.left = left;
node.right = right;
node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.right);
@@ -24243,7 +24294,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.right !== right ? update(createJSDocMemberName(left, right), node) : node;
}
function createJSDocLink(name, text) {
- const node = createBaseNode(333 /* JSDocLink */);
+ const node = createBaseNode(336 /* JSDocLink */);
node.name = name;
node.text = text;
return node;
@@ -24252,7 +24303,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocLink(name, text), node) : node;
}
function createJSDocLinkCode(name, text) {
- const node = createBaseNode(334 /* JSDocLinkCode */);
+ const node = createBaseNode(337 /* JSDocLinkCode */);
node.name = name;
node.text = text;
return node;
@@ -24261,7 +24312,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocLinkCode(name, text), node) : node;
}
function createJSDocLinkPlain(name, text) {
- const node = createBaseNode(335 /* JSDocLinkPlain */);
+ const node = createBaseNode(338 /* JSDocLinkPlain */);
node.name = name;
node.text = text;
return node;
@@ -24288,14 +24339,14 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment), node) : node;
}
function createJSDocUnknownTag(tagName, comment) {
- const node = createBaseJSDocTag(336 /* JSDocTag */, tagName, comment);
+ const node = createBaseJSDocTag(339 /* JSDocTag */, tagName, comment);
return node;
}
function updateJSDocUnknownTag(node, tagName, comment) {
return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node;
}
function createJSDocText(text) {
- const node = createBaseNode(330 /* JSDocText */);
+ const node = createBaseNode(333 /* JSDocText */);
node.text = text;
return node;
}
@@ -24303,7 +24354,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.text !== text ? update(createJSDocText(text), node) : node;
}
function createJSDocComment2(comment, tags) {
- const node = createBaseNode(329 /* JSDoc */);
+ const node = createBaseNode(332 /* JSDoc */);
node.comment = comment;
node.tags = asNodeArray(tags);
return node;
@@ -24312,7 +24363,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.comment !== comment || node.tags !== tags ? update(createJSDocComment2(comment, tags), node) : node;
}
function createJsxElement2(openingElement, children, closingElement) {
- const node = createBaseNode(287 /* JsxElement */);
+ const node = createBaseNode(290 /* JsxElement */);
node.openingElement = openingElement;
node.children = createNodeArray2(children);
node.closingElement = closingElement;
@@ -24323,7 +24374,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement2(openingElement, children, closingElement), node) : node;
}
function createJsxSelfClosingElement2(tagName, typeArguments, attributes) {
- const node = createBaseNode(288 /* JsxSelfClosingElement */);
+ const node = createBaseNode(291 /* JsxSelfClosingElement */);
node.tagName = tagName;
node.typeArguments = asNodeArray(typeArguments);
node.attributes = attributes;
@@ -24337,7 +24388,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement2(tagName, typeArguments, attributes), node) : node;
}
function createJsxOpeningElement2(tagName, typeArguments, attributes) {
- const node = createBaseNode(289 /* JsxOpeningElement */);
+ const node = createBaseNode(292 /* JsxOpeningElement */);
node.tagName = tagName;
node.typeArguments = asNodeArray(typeArguments);
node.attributes = attributes;
@@ -24351,7 +24402,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement2(tagName, typeArguments, attributes), node) : node;
}
function createJsxClosingElement2(tagName) {
- const node = createBaseNode(290 /* JsxClosingElement */);
+ const node = createBaseNode(293 /* JsxClosingElement */);
node.tagName = tagName;
node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */;
return node;
@@ -24360,7 +24411,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName ? update(createJsxClosingElement2(tagName), node) : node;
}
function createJsxFragment2(openingFragment, children, closingFragment) {
- const node = createBaseNode(291 /* JsxFragment */);
+ const node = createBaseNode(294 /* JsxFragment */);
node.openingFragment = openingFragment;
node.children = createNodeArray2(children);
node.closingFragment = closingFragment;
@@ -24381,17 +24432,17 @@ function createNodeFactory(flags, baseFactory2) {
return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText2(text, containsOnlyTriviaWhiteSpaces), node) : node;
}
function createJsxOpeningFragment2() {
- const node = createBaseNode(292 /* JsxOpeningFragment */);
+ const node = createBaseNode(295 /* JsxOpeningFragment */);
node.transformFlags |= 2 /* ContainsJsx */;
return node;
}
function createJsxJsxClosingFragment2() {
- const node = createBaseNode(293 /* JsxClosingFragment */);
+ const node = createBaseNode(296 /* JsxClosingFragment */);
node.transformFlags |= 2 /* ContainsJsx */;
return node;
}
function createJsxAttribute2(name, initializer) {
- const node = createBaseNode(294 /* JsxAttribute */);
+ const node = createBaseNode(297 /* JsxAttribute */);
node.name = name;
node.initializer = initializer;
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */;
@@ -24401,7 +24452,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute2(name, initializer), node) : node;
}
function createJsxAttributes2(properties) {
- const node = createBaseNode(295 /* JsxAttributes */);
+ const node = createBaseNode(298 /* JsxAttributes */);
node.properties = createNodeArray2(properties);
node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */;
return node;
@@ -24410,7 +24461,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.properties !== properties ? update(createJsxAttributes2(properties), node) : node;
}
function createJsxSpreadAttribute2(expression) {
- const node = createBaseNode(296 /* JsxSpreadAttribute */);
+ const node = createBaseNode(299 /* JsxSpreadAttribute */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */;
return node;
@@ -24419,7 +24470,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createJsxSpreadAttribute2(expression), node) : node;
}
function createJsxExpression2(dotDotDotToken, expression) {
- const node = createBaseNode(297 /* JsxExpression */);
+ const node = createBaseNode(300 /* JsxExpression */);
node.dotDotDotToken = dotDotDotToken;
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */;
@@ -24429,7 +24480,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createJsxExpression2(node.dotDotDotToken, expression), node) : node;
}
function createCaseClause2(expression, statements) {
- const node = createBaseNode(298 /* CaseClause */);
+ const node = createBaseNode(301 /* CaseClause */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.statements = createNodeArray2(statements);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements);
@@ -24439,7 +24490,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statements !== statements ? update(createCaseClause2(expression, statements), node) : node;
}
function createDefaultClause2(statements) {
- const node = createBaseNode(299 /* DefaultClause */);
+ const node = createBaseNode(302 /* DefaultClause */);
node.statements = createNodeArray2(statements);
node.transformFlags = propagateChildrenFlags(node.statements);
return node;
@@ -24448,7 +24499,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createDefaultClause2(statements), node) : node;
}
function createHeritageClause2(token, types) {
- const node = createBaseNode(300 /* HeritageClause */);
+ const node = createBaseNode(303 /* HeritageClause */);
node.token = token;
node.types = createNodeArray2(types);
node.transformFlags |= propagateChildrenFlags(node.types);
@@ -24468,7 +24519,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.types !== types ? update(createHeritageClause2(node.token, types), node) : node;
}
function createCatchClause2(variableDeclaration, block) {
- const node = createBaseNode(301 /* CatchClause */);
+ const node = createBaseNode(304 /* CatchClause */);
if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
variableDeclaration = createVariableDeclaration3(
variableDeclaration,
@@ -24489,7 +24540,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertyAssignment2(name, initializer) {
const node = createBaseNamedDeclaration(
- 305 /* PropertyAssignment */,
+ 308 /* PropertyAssignment */,
void 0,
name
);
@@ -24515,7 +24566,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createShorthandPropertyAssignment2(name, objectAssignmentInitializer) {
const node = createBaseNamedDeclaration(
- 306 /* ShorthandPropertyAssignment */,
+ 309 /* ShorthandPropertyAssignment */,
void 0,
name
);
@@ -24542,7 +24593,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createSpreadAssignment2(expression) {
- const node = createBaseNode(307 /* SpreadAssignment */);
+ const node = createBaseNode(310 /* SpreadAssignment */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */;
return node;
@@ -24551,7 +24602,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createSpreadAssignment2(expression), node) : node;
}
function createEnumMember2(name, initializer) {
- const node = createBaseNode(308 /* EnumMember */);
+ const node = createBaseNode(311 /* EnumMember */);
node.name = asName(name);
node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */;
@@ -24561,7 +24612,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.initializer !== initializer ? update(createEnumMember2(name, initializer), node) : node;
}
function createSourceFile2(statements, endOfFileToken, flags2) {
- const node = baseFactory2.createBaseSourceFileNode(314 /* SourceFile */);
+ const node = baseFactory2.createBaseSourceFileNode(317 /* SourceFile */);
node.statements = createNodeArray2(statements);
node.endOfFileToken = endOfFileToken;
node.flags |= flags2;
@@ -24576,7 +24627,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
- const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(314 /* SourceFile */);
+ const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(317 /* SourceFile */);
for (const p in source) {
if (p === "emitNode" || hasProperty(node, p) || !hasProperty(source, p))
continue;
@@ -24598,7 +24649,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node;
}
function createBundle2(sourceFiles, prepends = emptyArray) {
- const node = createBaseNode(315 /* Bundle */);
+ const node = createBaseNode(318 /* Bundle */);
node.prepends = prepends;
node.sourceFiles = sourceFiles;
return node;
@@ -24607,7 +24658,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle2(sourceFiles, prepends), node) : node;
}
function createUnparsedSource(prologues, syntheticReferences, texts) {
- const node = createBaseNode(316 /* UnparsedSource */);
+ const node = createBaseNode(319 /* UnparsedSource */);
node.prologues = prologues;
node.syntheticReferences = syntheticReferences;
node.texts = texts;
@@ -24624,48 +24675,48 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createUnparsedPrologue(data) {
- return createBaseUnparsedNode(309 /* UnparsedPrologue */, data);
+ return createBaseUnparsedNode(312 /* UnparsedPrologue */, data);
}
function createUnparsedPrepend(data, texts) {
- const node = createBaseUnparsedNode(310 /* UnparsedPrepend */, data);
+ const node = createBaseUnparsedNode(313 /* UnparsedPrepend */, data);
node.texts = texts;
return node;
}
function createUnparsedTextLike(data, internal) {
- return createBaseUnparsedNode(internal ? 312 /* UnparsedInternalText */ : 311 /* UnparsedText */, data);
+ return createBaseUnparsedNode(internal ? 315 /* UnparsedInternalText */ : 314 /* UnparsedText */, data);
}
function createUnparsedSyntheticReference(section) {
- const node = createBaseNode(313 /* UnparsedSyntheticReference */);
+ const node = createBaseNode(316 /* UnparsedSyntheticReference */);
node.data = section.data;
node.section = section;
return node;
}
function createInputFiles2() {
- const node = createBaseNode(317 /* InputFiles */);
+ const node = createBaseNode(320 /* InputFiles */);
node.javascriptText = "";
node.declarationText = "";
return node;
}
function createSyntheticExpression(type, isSpread = false, tupleNameSource) {
- const node = createBaseNode(238 /* SyntheticExpression */);
+ const node = createBaseNode(240 /* SyntheticExpression */);
node.type = type;
node.isSpread = isSpread;
node.tupleNameSource = tupleNameSource;
return node;
}
function createSyntaxList3(children) {
- const node = createBaseNode(357 /* SyntaxList */);
+ const node = createBaseNode(360 /* SyntaxList */);
node._children = children;
return node;
}
function createNotEmittedStatement2(original) {
- const node = createBaseNode(358 /* NotEmittedStatement */);
+ const node = createBaseNode(361 /* NotEmittedStatement */);
node.original = original;
setTextRange(node, original);
return node;
}
function createPartiallyEmittedExpression2(expression, original) {
- const node = createBaseNode(359 /* PartiallyEmittedExpression */);
+ const node = createBaseNode(362 /* PartiallyEmittedExpression */);
node.expression = expression;
node.original = original;
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -24687,7 +24738,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createCommaListExpression(elements) {
- const node = createBaseNode(360 /* CommaListExpression */);
+ const node = createBaseNode(363 /* CommaListExpression */);
node.elements = createNodeArray2(sameFlatMap(elements, flattenCommaElements));
node.transformFlags |= propagateChildrenFlags(node.elements);
return node;
@@ -24696,19 +24747,19 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
}
function createEndOfDeclarationMarker(original) {
- const node = createBaseNode(362 /* EndOfDeclarationMarker */);
+ const node = createBaseNode(365 /* EndOfDeclarationMarker */);
node.emitNode = {};
node.original = original;
return node;
}
function createMergeDeclarationMarker(original) {
- const node = createBaseNode(361 /* MergeDeclarationMarker */);
+ const node = createBaseNode(364 /* MergeDeclarationMarker */);
node.emitNode = {};
node.original = original;
return node;
}
function createSyntheticReferenceExpression(expression, thisArg) {
- const node = createBaseNode(363 /* SyntheticReferenceExpression */);
+ const node = createBaseNode(366 /* SyntheticReferenceExpression */);
node.expression = expression;
node.thisArg = thisArg;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -24721,7 +24772,7 @@ function createNodeFactory(flags, baseFactory2) {
if (node === void 0) {
return node;
}
- const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(314 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
+ const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(317 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
clone2.flags |= node.flags & ~8 /* Synthesized */;
clone2.transformFlags = node.transformFlags;
setOriginalNode(clone2, node);
@@ -24846,17 +24897,17 @@ function createNodeFactory(flags, baseFactory2) {
}
function updateOuterExpression(outerExpression, expression) {
switch (outerExpression.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return updateParenthesizedExpression(outerExpression, expression);
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return updateTypeAssertion2(outerExpression, outerExpression.type, expression);
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return updateAsExpression2(outerExpression, expression, outerExpression.type);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return updateNonNullExpression2(outerExpression, expression);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return updatePartiallyEmittedExpression2(outerExpression, expression);
}
}
@@ -24896,13 +24947,13 @@ function createNodeFactory(flags, baseFactory2) {
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
return false;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
const elements = target.elements;
if (elements.length === 0) {
return false;
}
return true;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return target.properties.length > 0;
default:
return true;
@@ -25149,7 +25200,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray2(array) : void 0;
@@ -25182,41 +25233,41 @@ function updateWithOriginal(updated, original) {
}
function getDefaultTagNameForKind(kind) {
switch (kind) {
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return "type";
- case 350 /* JSDocReturnTag */:
+ case 353 /* JSDocReturnTag */:
return "returns";
- case 351 /* JSDocThisTag */:
+ case 354 /* JSDocThisTag */:
return "this";
- case 348 /* JSDocEnumTag */:
+ case 351 /* JSDocEnumTag */:
return "enum";
- case 339 /* JSDocAuthorTag */:
+ case 342 /* JSDocAuthorTag */:
return "author";
- case 341 /* JSDocClassTag */:
+ case 344 /* JSDocClassTag */:
return "class";
- case 342 /* JSDocPublicTag */:
+ case 345 /* JSDocPublicTag */:
return "public";
- case 343 /* JSDocPrivateTag */:
+ case 346 /* JSDocPrivateTag */:
return "private";
- case 344 /* JSDocProtectedTag */:
+ case 347 /* JSDocProtectedTag */:
return "protected";
- case 345 /* JSDocReadonlyTag */:
+ case 348 /* JSDocReadonlyTag */:
return "readonly";
- case 346 /* JSDocOverrideTag */:
+ case 349 /* JSDocOverrideTag */:
return "override";
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return "template";
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return "typedef";
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
return "param";
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
return "prop";
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
return "callback";
- case 337 /* JSDocAugmentsTag */:
+ case 340 /* JSDocAugmentsTag */:
return "augments";
- case 338 /* JSDocImplementsTag */:
+ case 341 /* JSDocImplementsTag */:
return "implements";
default:
return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`);
@@ -25289,35 +25340,35 @@ function aggregateChildrenFlags(children) {
children.transformFlags = subtreeFlags;
}
function getTransformFlagsSubtreeExclusions(kind) {
- if (kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */) {
+ if (kind >= 184 /* FirstTypeNode */ && kind <= 207 /* LastTypeNode */) {
return -2 /* TypeExcludes */;
}
switch (kind) {
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 211 /* ArrayLiteralExpression */:
return -2147450880 /* ArrayLiteralOrCallOrNewExcludes */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return -1941676032 /* ModuleExcludes */;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return -2147483648 /* ParameterExcludes */;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return -2072174592 /* ArrowFunctionExcludes */;
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
return -1937940480 /* FunctionExcludes */;
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return -2146893824 /* VariableDeclarationListExcludes */;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return -2147344384 /* ClassExcludes */;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return -1937948672 /* ConstructorExcludes */;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return -2013249536 /* PropertyExcludes */;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return -2005057536 /* MethodOrAccessorExcludes */;
case 132 /* AnyKeyword */:
case 149 /* NumberKeyword */:
@@ -25328,31 +25379,31 @@ function getTransformFlagsSubtreeExclusions(kind) {
case 135 /* BooleanKeyword */:
case 154 /* SymbolKeyword */:
case 115 /* VoidKeyword */:
- case 167 /* TypeParameter */:
- case 170 /* PropertySignature */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 168 /* TypeParameter */:
+ case 171 /* PropertySignature */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return -2 /* TypeExcludes */;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return -2147278848 /* ObjectLiteralExcludes */;
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return -2147418112 /* CatchClauseExcludes */;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return -2147450880 /* BindingPatternExcludes */;
- case 216 /* TypeAssertionExpression */:
- case 239 /* SatisfiesExpression */:
- case 235 /* AsExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 241 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 219 /* ParenthesizedExpression */:
case 107 /* SuperKeyword */:
return -2147483648 /* OuterExpressionExcludes */;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return -2147483648 /* PropertyAccessExcludes */;
default:
return -2147483648 /* NodeExcludes */;
@@ -25653,7 +25704,7 @@ function getOrCreateEmitNode(node) {
var _a2;
if (!node.emitNode) {
if (isParseTreeNode(node)) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return node.emitNode = { annotatedNodes: [node] };
}
const sourceFile = (_a2 = getSourceFileOfNode(getParseTreeNode(getSourceFileOfNode(node)))) != null ? _a2 : Debug.fail("Could not determine parsed source file.");
@@ -26652,589 +26703,595 @@ function isImportKeyword(node) {
return node.kind === 101 /* ImportKeyword */;
}
function isQualifiedName(node) {
- return node.kind === 165 /* QualifiedName */;
+ return node.kind === 166 /* QualifiedName */;
}
function isComputedPropertyName(node) {
- return node.kind === 166 /* ComputedPropertyName */;
+ return node.kind === 167 /* ComputedPropertyName */;
}
function isTypeParameterDeclaration(node) {
- return node.kind === 167 /* TypeParameter */;
+ return node.kind === 168 /* TypeParameter */;
}
function isParameter(node) {
- return node.kind === 168 /* Parameter */;
+ return node.kind === 169 /* Parameter */;
}
function isDecoratorOrAnnotation(node) {
- return node.kind === 169 /* Decorator */;
+ return node.kind === 170 /* Decorator */;
}
function isDecorator(node) {
- return node.kind === 169 /* Decorator */ && node.annotationDeclaration === void 0;
+ return node.kind === 170 /* Decorator */ && node.annotationDeclaration === void 0;
}
function isAnnotation(node) {
- return node.kind === 169 /* Decorator */ && node.annotationDeclaration !== void 0;
+ return node.kind === 170 /* Decorator */ && node.annotationDeclaration !== void 0;
}
function isPropertySignature(node) {
- return node.kind === 170 /* PropertySignature */;
+ return node.kind === 171 /* PropertySignature */;
+}
+function isOverloadPropertyDeclaration(node) {
+ return node.kind === 174 /* OverloadPropertyDeclaration */;
}
function isPropertyDeclaration(node) {
- return node.kind === 171 /* PropertyDeclaration */;
+ return node.kind === 172 /* PropertyDeclaration */;
}
function isAnnotationPropertyDeclaration(node) {
- return node.kind === 172 /* AnnotationPropertyDeclaration */;
+ return node.kind === 173 /* AnnotationPropertyDeclaration */;
}
function isMethodSignature(node) {
- return node.kind === 173 /* MethodSignature */;
+ return node.kind === 175 /* MethodSignature */;
}
function isMethodDeclaration(node) {
- return node.kind === 174 /* MethodDeclaration */;
+ return node.kind === 176 /* MethodDeclaration */;
}
function isClassStaticBlockDeclaration(node) {
- return node.kind === 175 /* ClassStaticBlockDeclaration */;
+ return node.kind === 177 /* ClassStaticBlockDeclaration */;
}
function isConstructorDeclaration(node) {
- return node.kind === 176 /* Constructor */;
+ return node.kind === 178 /* Constructor */;
}
function isGetAccessorDeclaration(node) {
- return node.kind === 177 /* GetAccessor */;
+ return node.kind === 179 /* GetAccessor */;
}
function isSetAccessorDeclaration(node) {
- return node.kind === 178 /* SetAccessor */;
+ return node.kind === 180 /* SetAccessor */;
}
function isCallSignatureDeclaration(node) {
- return node.kind === 179 /* CallSignature */;
+ return node.kind === 181 /* CallSignature */;
}
function isConstructSignatureDeclaration(node) {
- return node.kind === 180 /* ConstructSignature */;
+ return node.kind === 182 /* ConstructSignature */;
}
function isIndexSignatureDeclaration(node) {
- return node.kind === 181 /* IndexSignature */;
+ return node.kind === 183 /* IndexSignature */;
}
function isTypePredicateNode(node) {
- return node.kind === 182 /* TypePredicate */;
+ return node.kind === 184 /* TypePredicate */;
}
function isTypeReferenceNode(node) {
- return node.kind === 183 /* TypeReference */;
+ return node.kind === 185 /* TypeReference */;
}
function isFunctionTypeNode(node) {
- return node.kind === 184 /* FunctionType */;
+ return node.kind === 186 /* FunctionType */;
}
function isConstructorTypeNode(node) {
- return node.kind === 185 /* ConstructorType */;
+ return node.kind === 187 /* ConstructorType */;
}
function isTypeQueryNode(node) {
- return node.kind === 186 /* TypeQuery */;
+ return node.kind === 188 /* TypeQuery */;
}
function isTypeLiteralNode(node) {
- return node.kind === 187 /* TypeLiteral */;
+ return node.kind === 189 /* TypeLiteral */;
}
function isArrayTypeNode(node) {
- return node.kind === 188 /* ArrayType */;
+ return node.kind === 190 /* ArrayType */;
}
function isTupleTypeNode(node) {
- return node.kind === 189 /* TupleType */;
+ return node.kind === 191 /* TupleType */;
}
function isNamedTupleMember(node) {
- return node.kind === 202 /* NamedTupleMember */;
+ return node.kind === 204 /* NamedTupleMember */;
}
function isOptionalTypeNode(node) {
- return node.kind === 190 /* OptionalType */;
+ return node.kind === 192 /* OptionalType */;
}
function isRestTypeNode(node) {
- return node.kind === 191 /* RestType */;
+ return node.kind === 193 /* RestType */;
}
function isUnionTypeNode(node) {
- return node.kind === 192 /* UnionType */;
+ return node.kind === 194 /* UnionType */;
}
function isIntersectionTypeNode(node) {
- return node.kind === 193 /* IntersectionType */;
+ return node.kind === 195 /* IntersectionType */;
}
function isConditionalTypeNode(node) {
- return node.kind === 194 /* ConditionalType */;
+ return node.kind === 196 /* ConditionalType */;
}
function isInferTypeNode(node) {
- return node.kind === 195 /* InferType */;
+ return node.kind === 197 /* InferType */;
}
function isParenthesizedTypeNode(node) {
- return node.kind === 196 /* ParenthesizedType */;
+ return node.kind === 198 /* ParenthesizedType */;
}
function isThisTypeNode(node) {
- return node.kind === 197 /* ThisType */;
+ return node.kind === 199 /* ThisType */;
}
function isTypeOperatorNode(node) {
- return node.kind === 198 /* TypeOperator */;
+ return node.kind === 200 /* TypeOperator */;
}
function isIndexedAccessTypeNode(node) {
- return node.kind === 199 /* IndexedAccessType */;
+ return node.kind === 201 /* IndexedAccessType */;
}
function isMappedTypeNode(node) {
- return node.kind === 200 /* MappedType */;
+ return node.kind === 202 /* MappedType */;
}
function isLiteralTypeNode(node) {
- return node.kind === 201 /* LiteralType */;
+ return node.kind === 203 /* LiteralType */;
}
function isImportTypeNode(node) {
- return node.kind === 205 /* ImportType */;
+ return node.kind === 207 /* ImportType */;
}
function isTemplateLiteralTypeSpan(node) {
- return node.kind === 204 /* TemplateLiteralTypeSpan */;
+ return node.kind === 206 /* TemplateLiteralTypeSpan */;
}
function isTemplateLiteralTypeNode(node) {
- return node.kind === 203 /* TemplateLiteralType */;
+ return node.kind === 205 /* TemplateLiteralType */;
}
function isObjectBindingPattern(node) {
- return node.kind === 206 /* ObjectBindingPattern */;
+ return node.kind === 208 /* ObjectBindingPattern */;
}
function isArrayBindingPattern(node) {
- return node.kind === 207 /* ArrayBindingPattern */;
+ return node.kind === 209 /* ArrayBindingPattern */;
}
function isBindingElement(node) {
- return node.kind === 208 /* BindingElement */;
+ return node.kind === 210 /* BindingElement */;
}
function isArrayLiteralExpression(node) {
- return node.kind === 209 /* ArrayLiteralExpression */;
+ return node.kind === 211 /* ArrayLiteralExpression */;
}
function isObjectLiteralExpression(node) {
- return node.kind === 210 /* ObjectLiteralExpression */;
+ return node.kind === 212 /* ObjectLiteralExpression */;
}
function isPropertyAccessExpression(node) {
- return node.kind === 211 /* PropertyAccessExpression */;
+ return node.kind === 213 /* PropertyAccessExpression */;
}
function isElementAccessExpression(node) {
- return node.kind === 212 /* ElementAccessExpression */;
+ return node.kind === 214 /* ElementAccessExpression */;
}
function isCallExpression(node) {
- return node.kind === 213 /* CallExpression */;
+ return node.kind === 215 /* CallExpression */;
}
function isNewExpression(node) {
- return node.kind === 214 /* NewExpression */;
+ return node.kind === 216 /* NewExpression */;
}
function isTaggedTemplateExpression(node) {
- return node.kind === 215 /* TaggedTemplateExpression */;
+ return node.kind === 217 /* TaggedTemplateExpression */;
}
function isTypeAssertionExpression(node) {
- return node.kind === 216 /* TypeAssertionExpression */;
+ return node.kind === 218 /* TypeAssertionExpression */;
}
function isParenthesizedExpression(node) {
- return node.kind === 217 /* ParenthesizedExpression */;
+ return node.kind === 219 /* ParenthesizedExpression */;
}
function isFunctionExpression(node) {
- return node.kind === 218 /* FunctionExpression */;
+ return node.kind === 220 /* FunctionExpression */;
}
function isEtsComponentExpression(node) {
- return node.kind === 220 /* EtsComponentExpression */;
+ return node.kind === 222 /* EtsComponentExpression */;
}
function isArrowFunction(node) {
- return node.kind === 219 /* ArrowFunction */;
+ return node.kind === 221 /* ArrowFunction */;
}
function isDeleteExpression(node) {
- return node.kind === 221 /* DeleteExpression */;
+ return node.kind === 223 /* DeleteExpression */;
}
function isTypeOfExpression(node) {
- return node.kind === 222 /* TypeOfExpression */;
+ return node.kind === 224 /* TypeOfExpression */;
}
function isVoidExpression(node) {
- return node.kind === 223 /* VoidExpression */;
+ return node.kind === 225 /* VoidExpression */;
}
function isAwaitExpression(node) {
- return node.kind === 224 /* AwaitExpression */;
+ return node.kind === 226 /* AwaitExpression */;
}
function isPrefixUnaryExpression(node) {
- return node.kind === 225 /* PrefixUnaryExpression */;
+ return node.kind === 227 /* PrefixUnaryExpression */;
}
function isPostfixUnaryExpression(node) {
- return node.kind === 226 /* PostfixUnaryExpression */;
+ return node.kind === 228 /* PostfixUnaryExpression */;
}
function isBinaryExpression(node) {
- return node.kind === 227 /* BinaryExpression */;
+ return node.kind === 229 /* BinaryExpression */;
}
function isConditionalExpression(node) {
- return node.kind === 228 /* ConditionalExpression */;
+ return node.kind === 230 /* ConditionalExpression */;
}
function isTemplateExpression(node) {
- return node.kind === 229 /* TemplateExpression */;
+ return node.kind === 231 /* TemplateExpression */;
}
function isYieldExpression(node) {
- return node.kind === 230 /* YieldExpression */;
+ return node.kind === 232 /* YieldExpression */;
}
function isSpreadElement(node) {
- return node.kind === 231 /* SpreadElement */;
+ return node.kind === 233 /* SpreadElement */;
}
function isClassExpression(node) {
- return node.kind === 232 /* ClassExpression */;
+ return node.kind === 234 /* ClassExpression */;
}
function isOmittedExpression(node) {
- return node.kind === 233 /* OmittedExpression */;
+ return node.kind === 235 /* OmittedExpression */;
}
function isExpressionWithTypeArguments(node) {
- return node.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.kind === 236 /* ExpressionWithTypeArguments */;
}
function isAsExpression(node) {
- return node.kind === 235 /* AsExpression */;
+ return node.kind === 237 /* AsExpression */;
}
function isSatisfiesExpression(node) {
- return node.kind === 239 /* SatisfiesExpression */;
+ return node.kind === 241 /* SatisfiesExpression */;
}
function isNonNullExpression(node) {
- return node.kind === 236 /* NonNullExpression */;
+ return node.kind === 238 /* NonNullExpression */;
}
function isMetaProperty(node) {
- return node.kind === 237 /* MetaProperty */;
+ return node.kind === 239 /* MetaProperty */;
}
function isSyntheticExpression(node) {
- return node.kind === 238 /* SyntheticExpression */;
+ return node.kind === 240 /* SyntheticExpression */;
}
function isPartiallyEmittedExpression(node) {
- return node.kind === 359 /* PartiallyEmittedExpression */;
+ return node.kind === 362 /* PartiallyEmittedExpression */;
}
function isCommaListExpression(node) {
- return node.kind === 360 /* CommaListExpression */;
+ return node.kind === 363 /* CommaListExpression */;
}
function isTemplateSpan(node) {
- return node.kind === 240 /* TemplateSpan */;
+ return node.kind === 242 /* TemplateSpan */;
}
function isSemicolonClassElement(node) {
- return node.kind === 241 /* SemicolonClassElement */;
+ return node.kind === 243 /* SemicolonClassElement */;
}
function isBlock(node) {
- return node.kind === 242 /* Block */;
+ return node.kind === 244 /* Block */;
}
function isVariableStatement(node) {
- return node.kind === 244 /* VariableStatement */;
+ return node.kind === 246 /* VariableStatement */;
}
function isEmptyStatement(node) {
- return node.kind === 243 /* EmptyStatement */;
+ return node.kind === 245 /* EmptyStatement */;
}
function isExpressionStatement(node) {
- return node.kind === 245 /* ExpressionStatement */;
+ return node.kind === 247 /* ExpressionStatement */;
}
function isIfStatement(node) {
- return node.kind === 246 /* IfStatement */;
+ return node.kind === 248 /* IfStatement */;
}
function isDoStatement(node) {
- return node.kind === 247 /* DoStatement */;
+ return node.kind === 249 /* DoStatement */;
}
function isWhileStatement(node) {
- return node.kind === 248 /* WhileStatement */;
+ return node.kind === 250 /* WhileStatement */;
}
function isForStatement(node) {
- return node.kind === 249 /* ForStatement */;
+ return node.kind === 251 /* ForStatement */;
}
function isForInStatement(node) {
- return node.kind === 250 /* ForInStatement */;
+ return node.kind === 252 /* ForInStatement */;
}
function isForOfStatement(node) {
- return node.kind === 251 /* ForOfStatement */;
+ return node.kind === 253 /* ForOfStatement */;
}
function isContinueStatement(node) {
- return node.kind === 252 /* ContinueStatement */;
+ return node.kind === 254 /* ContinueStatement */;
}
function isBreakStatement(node) {
- return node.kind === 253 /* BreakStatement */;
+ return node.kind === 255 /* BreakStatement */;
}
function isReturnStatement(node) {
- return node.kind === 254 /* ReturnStatement */;
+ return node.kind === 256 /* ReturnStatement */;
}
function isWithStatement(node) {
- return node.kind === 255 /* WithStatement */;
+ return node.kind === 257 /* WithStatement */;
}
function isSwitchStatement(node) {
- return node.kind === 256 /* SwitchStatement */;
+ return node.kind === 258 /* SwitchStatement */;
}
function isLabeledStatement(node) {
- return node.kind === 257 /* LabeledStatement */;
+ return node.kind === 259 /* LabeledStatement */;
}
function isThrowStatement(node) {
- return node.kind === 258 /* ThrowStatement */;
+ return node.kind === 260 /* ThrowStatement */;
}
function isTryStatement(node) {
- return node.kind === 259 /* TryStatement */;
+ return node.kind === 261 /* TryStatement */;
}
function isDebuggerStatement(node) {
- return node.kind === 260 /* DebuggerStatement */;
+ return node.kind === 262 /* DebuggerStatement */;
}
function isVariableDeclaration(node) {
- return node.kind === 261 /* VariableDeclaration */;
+ return node.kind === 263 /* VariableDeclaration */;
}
function isVariableDeclarationList(node) {
- return node.kind === 262 /* VariableDeclarationList */;
+ return node.kind === 264 /* VariableDeclarationList */;
}
function isFunctionDeclaration(node) {
- return node.kind === 263 /* FunctionDeclaration */;
+ return node.kind === 265 /* FunctionDeclaration */;
}
function isClassDeclaration(node) {
- return node.kind === 264 /* ClassDeclaration */;
+ return node.kind === 266 /* ClassDeclaration */;
}
function isStructDeclaration(node) {
- return node.kind === 265 /* StructDeclaration */;
+ return node.kind === 267 /* StructDeclaration */;
}
function isAnnotationDeclaration(node) {
- return node.kind === 266 /* AnnotationDeclaration */;
+ return node.kind === 268 /* AnnotationDeclaration */;
+}
+function isOverloadDeclaration(node) {
+ return node.kind === 269 /* OverloadDeclaration */;
}
function isInterfaceDeclaration(node) {
- return node.kind === 267 /* InterfaceDeclaration */;
+ return node.kind === 270 /* InterfaceDeclaration */;
}
function isTypeAliasDeclaration(node) {
- return node.kind === 268 /* TypeAliasDeclaration */;
+ return node.kind === 271 /* TypeAliasDeclaration */;
}
function isEnumDeclaration(node) {
- return node.kind === 269 /* EnumDeclaration */;
+ return node.kind === 272 /* EnumDeclaration */;
}
function isModuleDeclaration(node) {
- return node.kind === 270 /* ModuleDeclaration */;
+ return node.kind === 273 /* ModuleDeclaration */;
}
function isModuleBlock(node) {
- return node.kind === 271 /* ModuleBlock */;
+ return node.kind === 274 /* ModuleBlock */;
}
function isCaseBlock(node) {
- return node.kind === 272 /* CaseBlock */;
+ return node.kind === 275 /* CaseBlock */;
}
function isNamespaceExportDeclaration(node) {
- return node.kind === 273 /* NamespaceExportDeclaration */;
+ return node.kind === 276 /* NamespaceExportDeclaration */;
}
function isImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */;
+ return node.kind === 277 /* ImportEqualsDeclaration */;
}
function isImportDeclaration(node) {
- return node.kind === 275 /* ImportDeclaration */;
+ return node.kind === 278 /* ImportDeclaration */;
}
function isImportClause(node) {
- return node.kind === 276 /* ImportClause */;
+ return node.kind === 279 /* ImportClause */;
}
function isImportTypeAssertionContainer(node) {
- return node.kind === 304 /* ImportTypeAssertionContainer */;
+ return node.kind === 307 /* ImportTypeAssertionContainer */;
}
function isAssertClause(node) {
- return node.kind === 302 /* AssertClause */;
+ return node.kind === 305 /* AssertClause */;
}
function isAssertEntry(node) {
- return node.kind === 303 /* AssertEntry */;
+ return node.kind === 306 /* AssertEntry */;
}
function isNamespaceImport(node) {
- return node.kind === 277 /* NamespaceImport */;
+ return node.kind === 280 /* NamespaceImport */;
}
function isNamespaceExport(node) {
- return node.kind === 283 /* NamespaceExport */;
+ return node.kind === 286 /* NamespaceExport */;
}
function isNamedImports(node) {
- return node.kind === 278 /* NamedImports */;
+ return node.kind === 281 /* NamedImports */;
}
function isImportSpecifier(node) {
- return node.kind === 279 /* ImportSpecifier */;
+ return node.kind === 282 /* ImportSpecifier */;
}
function isExportAssignment(node) {
- return node.kind === 280 /* ExportAssignment */;
+ return node.kind === 283 /* ExportAssignment */;
}
function isExportDeclaration(node) {
- return node.kind === 281 /* ExportDeclaration */;
+ return node.kind === 284 /* ExportDeclaration */;
}
function isNamedExports(node) {
- return node.kind === 282 /* NamedExports */;
+ return node.kind === 285 /* NamedExports */;
}
function isExportSpecifier(node) {
- return node.kind === 284 /* ExportSpecifier */;
+ return node.kind === 287 /* ExportSpecifier */;
}
function isMissingDeclaration(node) {
- return node.kind === 285 /* MissingDeclaration */;
+ return node.kind === 288 /* MissingDeclaration */;
}
function isNotEmittedStatement(node) {
- return node.kind === 358 /* NotEmittedStatement */;
+ return node.kind === 361 /* NotEmittedStatement */;
}
function isSyntheticReference(node) {
- return node.kind === 363 /* SyntheticReferenceExpression */;
+ return node.kind === 366 /* SyntheticReferenceExpression */;
}
function isMergeDeclarationMarker(node) {
- return node.kind === 361 /* MergeDeclarationMarker */;
+ return node.kind === 364 /* MergeDeclarationMarker */;
}
function isEndOfDeclarationMarker(node) {
- return node.kind === 362 /* EndOfDeclarationMarker */;
+ return node.kind === 365 /* EndOfDeclarationMarker */;
}
function isExternalModuleReference(node) {
- return node.kind === 286 /* ExternalModuleReference */;
+ return node.kind === 289 /* ExternalModuleReference */;
}
function isJsxElement(node) {
- return node.kind === 287 /* JsxElement */;
+ return node.kind === 290 /* JsxElement */;
}
function isJsxSelfClosingElement(node) {
- return node.kind === 288 /* JsxSelfClosingElement */;
+ return node.kind === 291 /* JsxSelfClosingElement */;
}
function isJsxOpeningElement(node) {
- return node.kind === 289 /* JsxOpeningElement */;
+ return node.kind === 292 /* JsxOpeningElement */;
}
function isJsxClosingElement(node) {
- return node.kind === 290 /* JsxClosingElement */;
+ return node.kind === 293 /* JsxClosingElement */;
}
function isJsxFragment(node) {
- return node.kind === 291 /* JsxFragment */;
+ return node.kind === 294 /* JsxFragment */;
}
function isJsxOpeningFragment(node) {
- return node.kind === 292 /* JsxOpeningFragment */;
+ return node.kind === 295 /* JsxOpeningFragment */;
}
function isJsxClosingFragment(node) {
- return node.kind === 293 /* JsxClosingFragment */;
+ return node.kind === 296 /* JsxClosingFragment */;
}
function isJsxAttribute(node) {
- return node.kind === 294 /* JsxAttribute */;
+ return node.kind === 297 /* JsxAttribute */;
}
function isJsxAttributes(node) {
- return node.kind === 295 /* JsxAttributes */;
+ return node.kind === 298 /* JsxAttributes */;
}
function isJsxSpreadAttribute(node) {
- return node.kind === 296 /* JsxSpreadAttribute */;
+ return node.kind === 299 /* JsxSpreadAttribute */;
}
function isJsxExpression(node) {
- return node.kind === 297 /* JsxExpression */;
+ return node.kind === 300 /* JsxExpression */;
}
function isCaseClause(node) {
- return node.kind === 298 /* CaseClause */;
+ return node.kind === 301 /* CaseClause */;
}
function isDefaultClause(node) {
- return node.kind === 299 /* DefaultClause */;
+ return node.kind === 302 /* DefaultClause */;
}
function isHeritageClause(node) {
- return node.kind === 300 /* HeritageClause */;
+ return node.kind === 303 /* HeritageClause */;
}
function isCatchClause(node) {
- return node.kind === 301 /* CatchClause */;
+ return node.kind === 304 /* CatchClause */;
}
function isPropertyAssignment(node) {
- return node.kind === 305 /* PropertyAssignment */;
+ return node.kind === 308 /* PropertyAssignment */;
}
function isShorthandPropertyAssignment(node) {
- return node.kind === 306 /* ShorthandPropertyAssignment */;
+ return node.kind === 309 /* ShorthandPropertyAssignment */;
}
function isSpreadAssignment(node) {
- return node.kind === 307 /* SpreadAssignment */;
+ return node.kind === 310 /* SpreadAssignment */;
}
function isEnumMember(node) {
- return node.kind === 308 /* EnumMember */;
+ return node.kind === 311 /* EnumMember */;
}
function isUnparsedPrepend(node) {
- return node.kind === 310 /* UnparsedPrepend */;
+ return node.kind === 313 /* UnparsedPrepend */;
}
function isSourceFile(node) {
- return node.kind === 314 /* SourceFile */;
+ return node.kind === 317 /* SourceFile */;
}
function isBundle(node) {
- return node.kind === 315 /* Bundle */;
+ return node.kind === 318 /* Bundle */;
}
function isUnparsedSource(node) {
- return node.kind === 316 /* UnparsedSource */;
+ return node.kind === 319 /* UnparsedSource */;
}
function isJSDocTypeExpression(node) {
- return node.kind === 318 /* JSDocTypeExpression */;
+ return node.kind === 321 /* JSDocTypeExpression */;
}
function isJSDocNameReference(node) {
- return node.kind === 319 /* JSDocNameReference */;
+ return node.kind === 322 /* JSDocNameReference */;
}
function isJSDocMemberName(node) {
- return node.kind === 320 /* JSDocMemberName */;
+ return node.kind === 323 /* JSDocMemberName */;
}
function isJSDocLink(node) {
- return node.kind === 333 /* JSDocLink */;
+ return node.kind === 336 /* JSDocLink */;
}
function isJSDocLinkCode(node) {
- return node.kind === 334 /* JSDocLinkCode */;
+ return node.kind === 337 /* JSDocLinkCode */;
}
function isJSDocLinkPlain(node) {
- return node.kind === 335 /* JSDocLinkPlain */;
+ return node.kind === 338 /* JSDocLinkPlain */;
}
function isJSDocAllType(node) {
- return node.kind === 321 /* JSDocAllType */;
+ return node.kind === 324 /* JSDocAllType */;
}
function isJSDocUnknownType(node) {
- return node.kind === 322 /* JSDocUnknownType */;
+ return node.kind === 325 /* JSDocUnknownType */;
}
function isJSDocNullableType(node) {
- return node.kind === 323 /* JSDocNullableType */;
+ return node.kind === 326 /* JSDocNullableType */;
}
function isJSDocNonNullableType(node) {
- return node.kind === 324 /* JSDocNonNullableType */;
+ return node.kind === 327 /* JSDocNonNullableType */;
}
function isJSDocOptionalType(node) {
- return node.kind === 325 /* JSDocOptionalType */;
+ return node.kind === 328 /* JSDocOptionalType */;
}
function isJSDocFunctionType(node) {
- return node.kind === 326 /* JSDocFunctionType */;
+ return node.kind === 329 /* JSDocFunctionType */;
}
function isJSDocVariadicType(node) {
- return node.kind === 327 /* JSDocVariadicType */;
+ return node.kind === 330 /* JSDocVariadicType */;
}
function isJSDocNamepathType(node) {
- return node.kind === 328 /* JSDocNamepathType */;
+ return node.kind === 331 /* JSDocNamepathType */;
}
function isJSDoc(node) {
- return node.kind === 329 /* JSDoc */;
+ return node.kind === 332 /* JSDoc */;
}
function isJSDocTypeLiteral(node) {
- return node.kind === 331 /* JSDocTypeLiteral */;
+ return node.kind === 334 /* JSDocTypeLiteral */;
}
function isJSDocSignature(node) {
- return node.kind === 332 /* JSDocSignature */;
+ return node.kind === 335 /* JSDocSignature */;
}
function isJSDocAugmentsTag(node) {
- return node.kind === 337 /* JSDocAugmentsTag */;
+ return node.kind === 340 /* JSDocAugmentsTag */;
}
function isJSDocAuthorTag(node) {
- return node.kind === 339 /* JSDocAuthorTag */;
+ return node.kind === 342 /* JSDocAuthorTag */;
}
function isJSDocClassTag(node) {
- return node.kind === 341 /* JSDocClassTag */;
+ return node.kind === 344 /* JSDocClassTag */;
}
function isJSDocCallbackTag(node) {
- return node.kind === 347 /* JSDocCallbackTag */;
+ return node.kind === 350 /* JSDocCallbackTag */;
}
function isJSDocPublicTag(node) {
- return node.kind === 342 /* JSDocPublicTag */;
+ return node.kind === 345 /* JSDocPublicTag */;
}
function isJSDocPrivateTag(node) {
- return node.kind === 343 /* JSDocPrivateTag */;
+ return node.kind === 346 /* JSDocPrivateTag */;
}
function isJSDocProtectedTag(node) {
- return node.kind === 344 /* JSDocProtectedTag */;
+ return node.kind === 347 /* JSDocProtectedTag */;
}
function isJSDocReadonlyTag(node) {
- return node.kind === 345 /* JSDocReadonlyTag */;
+ return node.kind === 348 /* JSDocReadonlyTag */;
}
function isJSDocOverrideTag(node) {
- return node.kind === 346 /* JSDocOverrideTag */;
+ return node.kind === 349 /* JSDocOverrideTag */;
}
function isJSDocDeprecatedTag(node) {
- return node.kind === 340 /* JSDocDeprecatedTag */;
+ return node.kind === 343 /* JSDocDeprecatedTag */;
}
function isJSDocSeeTag(node) {
- return node.kind === 355 /* JSDocSeeTag */;
+ return node.kind === 358 /* JSDocSeeTag */;
}
function isJSDocEnumTag(node) {
- return node.kind === 348 /* JSDocEnumTag */;
+ return node.kind === 351 /* JSDocEnumTag */;
}
function isJSDocParameterTag(node) {
- return node.kind === 349 /* JSDocParameterTag */;
+ return node.kind === 352 /* JSDocParameterTag */;
}
function isJSDocReturnTag(node) {
- return node.kind === 350 /* JSDocReturnTag */;
+ return node.kind === 353 /* JSDocReturnTag */;
}
function isJSDocThisTag(node) {
- return node.kind === 351 /* JSDocThisTag */;
+ return node.kind === 354 /* JSDocThisTag */;
}
function isJSDocTypeTag(node) {
- return node.kind === 352 /* JSDocTypeTag */;
+ return node.kind === 355 /* JSDocTypeTag */;
}
function isJSDocTemplateTag(node) {
- return node.kind === 353 /* JSDocTemplateTag */;
+ return node.kind === 356 /* JSDocTemplateTag */;
}
function isJSDocTypedefTag(node) {
- return node.kind === 354 /* JSDocTypedefTag */;
+ return node.kind === 357 /* JSDocTypedefTag */;
}
function isJSDocUnknownTag(node) {
- return node.kind === 336 /* JSDocTag */;
+ return node.kind === 339 /* JSDocTag */;
}
function isJSDocPropertyTag(node) {
- return node.kind === 356 /* JSDocPropertyTag */;
+ return node.kind === 359 /* JSDocPropertyTag */;
}
function isJSDocImplementsTag(node) {
- return node.kind === 338 /* JSDocImplementsTag */;
+ return node.kind === 341 /* JSDocImplementsTag */;
}
function isSyntaxList(n) {
- return n.kind === 357 /* SyntaxList */;
+ return n.kind === 360 /* SyntaxList */;
}
// src/compiler/factory/utilities.ts
@@ -27478,14 +27535,14 @@ function createExpressionForObjectLiteralElementLike(factory2, node, property, r
Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals.");
}
switch (property.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return createExpressionForAccessorDeclaration(factory2, node.properties, property, receiver, !!node.multiLine);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return createExpressionForPropertyAssignment(factory2, property, receiver);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return createExpressionForShorthandPropertyAssignment(factory2, property, receiver);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return createExpressionForMethodDeclaration(factory2, property, receiver);
}
}
@@ -27538,7 +27595,7 @@ function startsWithUseStrict(statements) {
return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement);
}
function isCommaSequence(node) {
- return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 360 /* CommaListExpression */;
+ return node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 363 /* CommaListExpression */;
}
function isJSDocTypeAssertion(node) {
return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
@@ -27550,18 +27607,18 @@ function getJSDocTypeAssertionType(node) {
}
function isOuterExpression(node, kinds = 15 /* All */) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
if (kinds & 16 /* ExcludeJSDocTypeAssertion */ && isJSDocTypeAssertion(node)) {
return false;
}
return (kinds & 1 /* Parentheses */) !== 0;
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
- case 239 /* SatisfiesExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
+ case 241 /* SatisfiesExpression */:
return (kinds & 2 /* TypeAssertions */) !== 0;
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return (kinds & 4 /* NonNullAssertions */) !== 0;
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
}
return false;
@@ -27667,10 +27724,10 @@ function getLocalNameForExternalImport(factory2, node, sourceFile) {
const name = namespaceDeclaration.name;
return isGeneratedIdentifier(name) ? name : factory2.createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name) || idText(name));
}
- if (node.kind === 275 /* ImportDeclaration */ && node.importClause) {
+ if (node.kind === 278 /* ImportDeclaration */ && node.importClause) {
return factory2.getGeneratedNameForNode(node);
}
- if (node.kind === 281 /* ExportDeclaration */ && node.moduleSpecifier) {
+ if (node.kind === 284 /* ExportDeclaration */ && node.moduleSpecifier) {
return factory2.getGeneratedNameForNode(node);
}
return void 0;
@@ -27725,11 +27782,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) {
}
if (isObjectLiteralElementLike(bindingElement)) {
switch (bindingElement.kind) {
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return bindingElement.name;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return getTargetOfBindingOrAssignmentElement(bindingElement.expression);
}
}
@@ -27743,11 +27800,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) {
}
function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
return bindingElement.dotDotDotToken;
- case 231 /* SpreadElement */:
- case 307 /* SpreadAssignment */:
+ case 233 /* SpreadElement */:
+ case 310 /* SpreadAssignment */:
return bindingElement;
}
return void 0;
@@ -27759,7 +27816,7 @@ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) {
}
function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
if (bindingElement.propertyName) {
const propertyName = bindingElement.propertyName;
if (isPrivateIdentifier(propertyName)) {
@@ -27768,7 +27825,7 @@ function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName;
}
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (bindingElement.name) {
const propertyName = bindingElement.name;
if (isPrivateIdentifier(propertyName)) {
@@ -27777,7 +27834,7 @@ function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName;
}
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
if (bindingElement.name && isPrivateIdentifier(bindingElement.name)) {
return Debug.failBadSyntaxKind(bindingElement.name);
}
@@ -27794,11 +27851,11 @@ function isStringOrNumericLiteral(node) {
}
function getElementsOfBindingOrAssignmentPattern(name) {
switch (name.kind) {
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return name.elements;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return name.properties;
}
}
@@ -27815,19 +27872,19 @@ function getJSDocTypeAliasName(fullName) {
}
function canHaveIllegalType(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 178 /* SetAccessor */;
+ return kind === 178 /* Constructor */ || kind === 180 /* SetAccessor */;
}
function canHaveIllegalTypeParameters(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function canHaveIllegalDecorators(node) {
const kind = node.kind;
- return kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 263 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 285 /* MissingDeclaration */ || kind === 244 /* VariableStatement */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 280 /* ExportAssignment */;
+ return kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 265 /* FunctionDeclaration */ || kind === 178 /* Constructor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 288 /* MissingDeclaration */ || kind === 246 /* VariableStatement */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 283 /* ExportAssignment */;
}
function canHaveIllegalModifiers(node) {
const kind = node.kind;
- return kind === 175 /* ClassStaticBlockDeclaration */ || kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 184 /* FunctionType */ || kind === 285 /* MissingDeclaration */ || kind === 273 /* NamespaceExportDeclaration */;
+ return kind === 177 /* ClassStaticBlockDeclaration */ || kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 186 /* FunctionType */ || kind === 288 /* MissingDeclaration */ || kind === 276 /* NamespaceExportDeclaration */;
}
var isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration);
var isQuestionOrExclamationToken = or(isQuestionToken, isExclamationToken);
@@ -28113,11 +28170,11 @@ function setTextRange(range, location) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 167 /* TypeParameter */ || kind === 168 /* Parameter */ || kind === 170 /* PropertySignature */ || kind === 171 /* PropertyDeclaration */ || kind === 173 /* MethodSignature */ || kind === 174 /* MethodDeclaration */ || kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 185 /* ConstructorType */ || kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || kind === 232 /* ClassExpression */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 244 /* VariableStatement */ || kind === 263 /* FunctionDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 280 /* ExportAssignment */ || kind === 281 /* ExportDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 168 /* Parameter */ || kind === 171 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 232 /* ClassExpression */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* StructDeclaration */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */;
}
// src/compiler/parser.ts
@@ -28172,430 +28229,434 @@ function isImportMeta2(node) {
return isMetaProperty(node) && node.keywordToken === 101 /* ImportKeyword */ && node.name.escapedText === "meta";
}
var forEachChildTable = {
- [165 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) {
+ [166 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right);
},
- [167 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) {
+ [168 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression);
},
- [306 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) {
+ [309 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer);
},
- [307 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) {
+ [310 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [168 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) {
+ [169 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [171 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) {
+ [172 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [172 /* AnnotationPropertyDeclaration */]: function forEachChildInAnnotationPropertyDeclaration(node, cbNode, _cbNodes) {
+ [173 /* AnnotationPropertyDeclaration */]: function forEachChildInAnnotationPropertyDeclaration(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [170 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) {
+ [171 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) {
+ return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
+ },
+ [174 /* OverloadPropertyDeclaration */]: function forEachChildInOverloadPropertyDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [305 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) {
+ [308 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer);
},
- [261 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) {
+ [263 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [208 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) {
+ [210 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [181 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) {
+ [183 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [185 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) {
+ [187 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [184 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) {
+ [186 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [179 /* CallSignature */]: forEachChildInCallOrConstructSignature,
- [180 /* ConstructSignature */]: forEachChildInCallOrConstructSignature,
- [220 /* EtsComponentExpression */]: function forEachChildInEtsComponentExpression(node, cbNode, cbNodes) {
+ [181 /* CallSignature */]: forEachChildInCallOrConstructSignature,
+ [182 /* ConstructSignature */]: forEachChildInCallOrConstructSignature,
+ [222 /* EtsComponentExpression */]: function forEachChildInEtsComponentExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.arguments) || visitNode2(cbNode, node.body);
},
- [174 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) {
+ [176 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [173 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) {
+ [175 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [176 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) {
+ [178 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [177 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) {
+ [179 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [178 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) {
+ [180 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [263 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) {
+ [265 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [218 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) {
+ [220 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [219 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) {
+ [221 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body);
},
- [175 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) {
+ [177 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body);
},
- [183 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) {
+ [185 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [182 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) {
+ [184 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.assertsModifier) || visitNode2(cbNode, node.parameterName) || visitNode2(cbNode, node.type);
},
- [186 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) {
+ [188 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.exprName) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [187 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) {
+ [189 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.members);
},
- [188 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) {
+ [190 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.elementType);
},
- [189 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) {
+ [191 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [192 /* UnionType */]: forEachChildInUnionOrIntersectionType,
- [193 /* IntersectionType */]: forEachChildInUnionOrIntersectionType,
- [194 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) {
+ [194 /* UnionType */]: forEachChildInUnionOrIntersectionType,
+ [195 /* IntersectionType */]: forEachChildInUnionOrIntersectionType,
+ [196 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.checkType) || visitNode2(cbNode, node.extendsType) || visitNode2(cbNode, node.trueType) || visitNode2(cbNode, node.falseType);
},
- [195 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) {
+ [197 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.typeParameter);
},
- [205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
+ [207 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.assertions) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [304 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
+ [307 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.assertClause);
},
- [196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
- [198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
- [199 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) {
+ [198 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
+ [200 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
+ [201 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.objectType) || visitNode2(cbNode, node.indexType);
},
- [200 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) {
+ [202 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.readonlyToken) || visitNode2(cbNode, node.typeParameter) || visitNode2(cbNode, node.nameType) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNodes(cbNode, cbNodes, node.members);
},
- [201 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) {
+ [203 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.literal);
},
- [202 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) {
+ [204 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type);
},
- [206 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
- [207 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
- [209 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) {
+ [208 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
+ [209 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
+ [211 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [210 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) {
+ [212 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.properties);
},
- [211 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) {
+ [213 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.name);
},
- [212 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) {
+ [214 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.argumentExpression);
},
- [213 /* CallExpression */]: forEachChildInCallOrNewExpression,
- [214 /* NewExpression */]: forEachChildInCallOrNewExpression,
- [215 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) {
+ [215 /* CallExpression */]: forEachChildInCallOrNewExpression,
+ [216 /* NewExpression */]: forEachChildInCallOrNewExpression,
+ [217 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tag) || visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.template);
},
- [216 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) {
+ [218 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.expression);
},
- [217 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) {
+ [219 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [221 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) {
+ [223 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [222 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) {
+ [224 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [223 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) {
+ [225 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [225 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) {
+ [227 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.operand);
},
- [230 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) {
+ [232 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.expression);
},
- [224 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) {
+ [226 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [226 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) {
+ [228 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.operand);
},
- [227 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) {
+ [229 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.operatorToken) || visitNode2(cbNode, node.right);
},
- [235 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) {
+ [237 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type);
},
- [236 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) {
+ [238 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [239 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) {
+ [241 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type);
},
- [237 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) {
+ [239 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [228 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) {
+ [230 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.whenTrue) || visitNode2(cbNode, node.colonToken) || visitNode2(cbNode, node.whenFalse);
},
- [231 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) {
+ [233 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [242 /* Block */]: forEachChildInBlock,
- [271 /* ModuleBlock */]: forEachChildInBlock,
- [314 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) {
+ [244 /* Block */]: forEachChildInBlock,
+ [274 /* ModuleBlock */]: forEachChildInBlock,
+ [317 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken);
},
- [244 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) {
+ [246 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList);
},
- [262 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) {
+ [264 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.declarations);
},
- [245 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) {
+ [247 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [246 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) {
+ [248 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.thenStatement) || visitNode2(cbNode, node.elseStatement);
},
- [247 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) {
+ [249 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.statement) || visitNode2(cbNode, node.expression);
},
- [248 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) {
+ [250 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [249 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) {
+ [251 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.incrementor) || visitNode2(cbNode, node.statement);
},
- [250 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) {
+ [252 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [251 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) {
+ [253 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.awaitModifier) || visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [252 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement,
- [253 /* BreakStatement */]: forEachChildInContinueOrBreakStatement,
- [254 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) {
+ [254 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement,
+ [255 /* BreakStatement */]: forEachChildInContinueOrBreakStatement,
+ [256 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [255 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) {
+ [257 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [256 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) {
+ [258 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.caseBlock);
},
- [272 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) {
+ [275 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.clauses);
},
- [298 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) {
+ [301 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements);
},
- [299 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) {
+ [302 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.statements);
},
- [257 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) {
+ [259 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.label) || visitNode2(cbNode, node.statement);
},
- [258 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) {
+ [260 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [259 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) {
+ [261 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.tryBlock) || visitNode2(cbNode, node.catchClause) || visitNode2(cbNode, node.finallyBlock);
},
- [301 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) {
+ [304 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.variableDeclaration) || visitNode2(cbNode, node.block);
},
- [169 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) {
+ [170 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [264 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression,
- [232 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression,
- [265 /* StructDeclaration */]: forEachChildInClassDeclarationOrExpression,
- [266 /* AnnotationDeclaration */]: forEachChildInAnnotationDeclaration,
- [267 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) {
+ [266 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression,
+ [234 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression,
+ [267 /* StructDeclaration */]: forEachChildInClassDeclarationOrExpression,
+ [268 /* AnnotationDeclaration */]: forEachChildInAnnotationDeclaration,
+ [269 /* OverloadDeclaration */]: forEachChildInOverloadDeclaration,
+ [270 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members);
},
- [268 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) {
+ [271 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type);
},
- [269 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) {
+ [272 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
},
- [308 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) {
+ [311 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [270 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) {
+ [273 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body);
},
- [274 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) {
+ [277 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
},
- [275 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
+ [278 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
},
- [276 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
+ [279 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
},
- [302 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) {
+ [305 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [303 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) {
+ [306 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
},
- [273 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
+ [276 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNode2(cbNode, node.name);
},
- [277 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) {
+ [280 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [283 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) {
+ [286 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [278 /* NamedImports */]: forEachChildInNamedImportsOrExports,
- [282 /* NamedExports */]: forEachChildInNamedImportsOrExports,
- [281 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
+ [281 /* NamedImports */]: forEachChildInNamedImportsOrExports,
+ [285 /* NamedExports */]: forEachChildInNamedImportsOrExports,
+ [284 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
},
- [279 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
- [284 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
- [280 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) {
+ [282 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
+ [287 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
+ [283 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression);
},
- [229 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) {
+ [231 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
},
- [240 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) {
+ [242 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.literal);
},
- [203 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) {
+ [205 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
},
- [204 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) {
+ [206 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.literal);
},
- [166 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) {
+ [167 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [300 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) {
+ [303 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.types);
},
- [234 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) {
+ [236 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [286 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) {
+ [289 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [285 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
+ [288 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
},
- [360 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
+ [363 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [287 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
+ [290 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingElement);
},
- [291 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) {
+ [294 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingFragment);
},
- [288 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
- [289 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
- [295 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) {
+ [291 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
+ [292 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
+ [298 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.properties);
},
- [294 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) {
+ [297 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [296 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) {
+ [299 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [297 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) {
+ [300 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.expression);
},
- [290 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) {
+ [293 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.tagName);
},
- [190 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [191 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [318 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [324 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [323 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [325 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [327 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [326 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) {
+ [192 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [193 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [321 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [327 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [326 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [328 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [330 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [329 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [329 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) {
+ [332 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) {
return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags);
},
- [355 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
+ [358 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [319 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) {
+ [322 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [320 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) {
+ [323 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right);
},
- [349 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
- [356 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
- [339 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) {
+ [352 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
+ [359 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
+ [342 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [338 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) {
+ [341 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [337 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) {
+ [340 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [353 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
+ [356 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [354 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
- return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 318 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)));
+ [357 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
+ return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 321 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)));
},
- [347 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
+ [350 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [350 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
- [352 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
- [351 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
- [348 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
- [332 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
+ [353 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
+ [355 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
+ [354 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
+ [351 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
+ [335 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type);
},
- [333 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain,
- [334 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain,
- [335 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain,
- [331 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) {
+ [336 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain,
+ [337 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain,
+ [338 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain,
+ [334 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) {
return forEach(node.jsDocPropertyTags, cbNode);
},
- [336 /* JSDocTag */]: forEachChildInJSDocTag,
- [341 /* JSDocClassTag */]: forEachChildInJSDocTag,
- [342 /* JSDocPublicTag */]: forEachChildInJSDocTag,
- [343 /* JSDocPrivateTag */]: forEachChildInJSDocTag,
- [344 /* JSDocProtectedTag */]: forEachChildInJSDocTag,
- [345 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
- [340 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
- [346 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
- [359 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
+ [339 /* JSDocTag */]: forEachChildInJSDocTag,
+ [344 /* JSDocClassTag */]: forEachChildInJSDocTag,
+ [345 /* JSDocPublicTag */]: forEachChildInJSDocTag,
+ [346 /* JSDocPrivateTag */]: forEachChildInJSDocTag,
+ [347 /* JSDocProtectedTag */]: forEachChildInJSDocTag,
+ [348 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
+ [343 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
+ [349 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
+ [362 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
};
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
@@ -28624,6 +28685,9 @@ function forEachChildInClassDeclarationOrExpression(node, cbNode, cbNodes) {
function forEachChildInAnnotationDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
}
+function forEachChildInOverloadDeclaration(node, cbNode, cbNodes) {
+ return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
+}
function forEachChildInNamedImportsOrExports(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
}
@@ -28652,7 +28716,7 @@ function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
}
function forEachChild(node, cbNode, cbNodes) {
- if (node === void 0 || node.kind <= 164 /* LastToken */) {
+ if (node === void 0 || node.kind <= 165 /* LastToken */) {
return;
}
const fn = forEachChildTable[node.kind];
@@ -28687,7 +28751,7 @@ function forEachChildRecursively(rootNode, cbNode, cbNodes) {
continue;
return res;
}
- if (current.kind >= 165 /* FirstNode */) {
+ if (current.kind >= 166 /* FirstNode */) {
for (const child of gatherPossibleChildren(current)) {
queue.push(child);
parents.push(current);
@@ -29663,7 +29727,7 @@ var Parser;
parseErrorAtCurrentToken(diagnosticMessage, arg0);
}
const pos = getNodePos();
- const result = kind === 79 /* Identifier */ ? factory2.createIdentifier("", void 0, void 0) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, "", "", void 0) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral("", void 0) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral("", void 0) : kind === 285 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind);
+ const result = kind === 79 /* Identifier */ ? factory2.createIdentifier("", void 0, void 0) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, "", "", void 0) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral("", void 0) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral("", void 0) : kind === 288 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind);
return finishNode(result, pos);
}
function internIdentifier(text) {
@@ -29788,6 +29852,9 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
+ if (token() === 164 /* OverloadKeyword */) {
+ return true;
+ }
return canFollowExportModifier();
case 89 /* DefaultKeyword */:
return nextTokenCanFollowDefaultKeyword();
@@ -29812,7 +29879,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -30087,15 +30154,15 @@ var Parser;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 181 /* IndexSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 241 /* SemicolonClassElement */:
+ case 178 /* Constructor */:
+ case 183 /* IndexSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 243 /* SemicolonClassElement */:
return true;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return !inStructContext();
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
const methodDeclaration = node;
const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 136 /* ConstructorKeyword */;
return !nameIsConstructor;
@@ -30106,8 +30173,8 @@ var Parser;
function isReusableSwitchClause(node) {
if (node) {
switch (node.kind) {
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return true;
}
}
@@ -30116,66 +30183,66 @@ var Parser;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 244 /* VariableStatement */:
- case 242 /* Block */:
- case 246 /* IfStatement */:
- case 245 /* ExpressionStatement */:
- case 258 /* ThrowStatement */:
- case 254 /* ReturnStatement */:
- case 256 /* SwitchStatement */:
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 249 /* ForStatement */:
- case 248 /* WhileStatement */:
- case 255 /* WithStatement */:
- case 243 /* EmptyStatement */:
- case 259 /* TryStatement */:
- case 257 /* LabeledStatement */:
- case 247 /* DoStatement */:
- case 260 /* DebuggerStatement */:
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 246 /* VariableStatement */:
+ case 244 /* Block */:
+ case 248 /* IfStatement */:
+ case 247 /* ExpressionStatement */:
+ case 260 /* ThrowStatement */:
+ case 256 /* ReturnStatement */:
+ case 258 /* SwitchStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 250 /* WhileStatement */:
+ case 257 /* WithStatement */:
+ case 245 /* EmptyStatement */:
+ case 261 /* TryStatement */:
+ case 259 /* LabeledStatement */:
+ case 249 /* DoStatement */:
+ case 262 /* DebuggerStatement */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
}
}
return false;
}
function isReusableEnumMember(node) {
- return node.kind === 308 /* EnumMember */;
+ return node.kind === 311 /* EnumMember */;
}
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 170 /* PropertySignature */:
- case 179 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 171 /* PropertySignature */:
+ case 181 /* CallSignature */:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 261 /* VariableDeclaration */) {
+ if (node.kind !== 263 /* VariableDeclaration */) {
return false;
}
const variableDeclarator = node;
return variableDeclarator.initializer === void 0;
}
function isReusableParameter(node) {
- if (node.kind !== 168 /* Parameter */) {
+ if (node.kind !== 169 /* Parameter */) {
return false;
}
const parameter = node;
@@ -30466,14 +30533,14 @@ var Parser;
}
function typeHasArrowFunctionBlockingParseError(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return nodeIsMissing(node.typeName);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */: {
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */: {
const { parameters, type } = node;
return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type);
}
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return typeHasArrowFunctionBlockingParseError(node.type);
default:
return false;
@@ -30714,14 +30781,14 @@ var Parser;
function parseSignatureMember(kind) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
- if (kind === 180 /* ConstructSignature */) {
+ if (kind === 182 /* ConstructSignature */) {
parseExpected(104 /* NewKeyword */);
}
const typeParameters = parseTypeParameters();
const parameters = parseParameters(4 /* Type */);
const type = parseReturnType(58 /* ColonToken */, true);
parseTypeMemberSemicolon();
- const node = kind === 179 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type);
+ const node = kind === 181 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function isIndexSignature() {
@@ -30759,6 +30826,17 @@ var Parser;
node.illegalDecorators = decorators;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+ function parseOverloadPropertyDeclaration(pos, hasJSDoc, modifiers) {
+ const name = parsePropertyName();
+ const questionToken = parseOptionalToken(57 /* QuestionToken */);
+ let node;
+ const type = parseTypeAnnotation();
+ node = factory2.createOverloadPropertyDeclaration(modifiers, name, questionToken, type);
+ if (token() === 63 /* EqualsToken */)
+ node.initializer = parseInitializer();
+ parseTypeMemberSemicolon();
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
+ }
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
@@ -30800,19 +30878,19 @@ var Parser;
}
function parseTypeMember() {
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) {
- return parseSignatureMember(179 /* CallSignature */);
+ return parseSignatureMember(181 /* CallSignature */);
}
if (token() === 104 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) {
- return parseSignatureMember(180 /* ConstructSignature */);
+ return parseSignatureMember(182 /* ConstructSignature */);
}
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 177 /* GetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 179 /* GetAccessor */, 4 /* Type */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 178 /* SetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 180 /* SetAccessor */, 4 /* Type */);
}
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
@@ -31688,7 +31766,7 @@ var Parser;
return void 0;
}
let unwrappedType = type;
- while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 196 /* ParenthesizedType */) {
+ while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 198 /* ParenthesizedType */) {
unwrappedType = unwrappedType.type;
}
const hasJSDocFunctionType = unwrappedType && isJSDocFunctionType(unwrappedType);
@@ -31751,7 +31829,7 @@ var Parser;
return parseBinaryExpressionRest(precedence, leftOperand, pos);
}
function isInOrOfKeyword(t) {
- return t === 102 /* InKeyword */ || t === 164 /* OfKeyword */;
+ return t === 102 /* InKeyword */ || t === 165 /* OfKeyword */;
}
function parseBinaryExpressionRest(precedence, leftOperand, pos) {
while (true) {
@@ -31833,7 +31911,7 @@ var Parser;
if (token() === 42 /* AsteriskAsteriskToken */) {
const pos = skipTrivia(sourceText, simpleUnaryExpression.pos);
const { end } = simpleUnaryExpression;
- if (simpleUnaryExpression.kind === 216 /* TypeAssertionExpression */) {
+ if (simpleUnaryExpression.kind === 218 /* TypeAssertionExpression */) {
parseErrorAt(pos, end, Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
} else {
parseErrorAt(pos, end, Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator));
@@ -31956,11 +32034,11 @@ var Parser;
const pos = getNodePos();
const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext);
let result;
- if (opening.kind === 289 /* JsxOpeningElement */) {
+ if (opening.kind === 292 /* JsxOpeningElement */) {
let children = parseJsxChildren(opening);
let closingElement;
const lastChild = children[children.length - 1];
- if ((lastChild == null ? void 0 : lastChild.kind) === 287 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) {
+ if ((lastChild == null ? void 0 : lastChild.kind) === 290 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) {
const end = lastChild.children.end;
const newLast = finishNode(
factory2.createJsxElement(
@@ -31984,10 +32062,10 @@ var Parser;
}
}
result = finishNode(factory2.createJsxElement(opening, children, closingElement), pos);
- } else if (opening.kind === 292 /* JsxOpeningFragment */) {
+ } else if (opening.kind === 295 /* JsxOpeningFragment */) {
result = finishNode(factory2.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos);
} else {
- Debug.assert(opening.kind === 288 /* JsxSelfClosingElement */);
+ Debug.assert(opening.kind === 291 /* JsxSelfClosingElement */);
result = opening;
}
if (inExpressionContext && token() === 29 /* LessThanToken */) {
@@ -32043,7 +32121,7 @@ var Parser;
if (!child)
break;
list.push(child);
- if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 287 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) {
+ if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 290 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) {
break;
}
}
@@ -32251,7 +32329,7 @@ var Parser;
continue;
}
if (isTemplateStartOfTaggedTemplate()) {
- expression = !questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest(pos, expression, questionDotToken, void 0);
+ expression = !questionDotToken && expression.kind === 236 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest(pos, expression, questionDotToken, void 0);
continue;
}
if (!questionDotToken) {
@@ -32299,7 +32377,7 @@ var Parser;
}
}
if (typeArguments || token() === 20 /* OpenParenToken */) {
- if (!questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (!questionDotToken && expression.kind === 236 /* ExpressionWithTypeArguments */) {
typeArguments = expression.typeArguments;
expression = expression.expression;
}
@@ -32526,10 +32604,10 @@ var Parser;
const decorators = parseDecorators();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 177 /* GetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 0 /* None */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 178 /* SetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 0 /* None */);
}
const asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
const tokenIsIdentifier = isIdentifier2();
@@ -32599,7 +32677,7 @@ var Parser;
const expressionPos = getNodePos();
let expression = parseMemberExpressionRest(expressionPos, parsePrimaryExpression(), false);
let typeArguments;
- if (expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (expression.kind === 236 /* ExpressionWithTypeArguments */) {
typeArguments = expression.typeArguments;
expression = expression.expression;
}
@@ -32707,7 +32785,7 @@ var Parser;
}
}
let node;
- if (awaitToken ? parseExpected(164 /* OfKeyword */) : parseOptional(164 /* OfKeyword */)) {
+ if (awaitToken ? parseExpected(165 /* OfKeyword */) : parseOptional(165 /* OfKeyword */)) {
const expression = allowInAnd(() => parseAssignmentExpressionOrHigher(true));
parseExpected(21 /* CloseParenToken */);
node = factory2.createForOfStatement(awaitToken, initializer, expression, parseStatement());
@@ -32728,10 +32806,10 @@ var Parser;
function parseBreakOrContinueStatement(kind) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
- parseExpected(kind === 253 /* BreakStatement */ ? 81 /* BreakKeyword */ : 87 /* ContinueKeyword */);
+ parseExpected(kind === 255 /* BreakStatement */ ? 81 /* BreakKeyword */ : 87 /* ContinueKeyword */);
const label = canParseSemicolon() ? void 0 : parseIdentifier();
parseSemicolon();
- const node = kind === 253 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label);
+ const node = kind === 255 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseReturnStatement() {
@@ -32885,6 +32963,8 @@ var Parser;
return inEtsContext();
case 59 /* AtToken */:
return inAllowAnnotationContext() && nextToken() === 119 /* InterfaceKeyword */;
+ case 164 /* OverloadKeyword */:
+ return nextTokenIsIdentifierOnSameLine();
case 119 /* InterfaceKeyword */:
case 155 /* TypeKeyword */:
return nextTokenIsIdentifierOnSameLine();
@@ -33019,9 +33099,9 @@ var Parser;
case 98 /* ForKeyword */:
return parseForOrForInOrForOfStatement();
case 87 /* ContinueKeyword */:
- return parseBreakOrContinueStatement(252 /* ContinueStatement */);
+ return parseBreakOrContinueStatement(254 /* ContinueStatement */);
case 81 /* BreakKeyword */:
- return parseBreakOrContinueStatement(253 /* BreakStatement */);
+ return parseBreakOrContinueStatement(255 /* BreakStatement */);
case 106 /* ReturnKeyword */:
return parseReturnStatement();
case 117 /* WithKeyword */:
@@ -33037,6 +33117,7 @@ var Parser;
case 88 /* DebuggerKeyword */:
return parseDebuggerStatement();
case 59 /* AtToken */:
+ case 164 /* OverloadKeyword */:
return parseDeclaration();
case 133 /* AsyncKeyword */:
case 119 /* InterfaceKeyword */:
@@ -33085,6 +33166,19 @@ var Parser;
const node = factory2.createAnnotationDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+ function parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers) {
+ parseExpected(164 /* OverloadKeyword */);
+ const name = createIdentifier3(isBindingIdentifier());
+ let members;
+ if (parseExpected(18 /* OpenBraceToken */)) {
+ members = parseOverloadMembers();
+ parseExpected(19 /* CloseBraceToken */);
+ } else {
+ members = createMissingList();
+ }
+ const node = factory2.createOverloadDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
+ }
function parseDeclaration() {
var _a2, _b;
const pos = getNodePos();
@@ -33154,6 +33248,8 @@ var Parser;
return parseAnnotationDeclaration(pos, hasJSDoc, decorators, modifiers);
}
return parseDeclarationDefault(pos, decorators, modifiers);
+ case 164 /* OverloadKeyword */:
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
case 119 /* InterfaceKeyword */:
return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
case 155 /* TypeKeyword */:
@@ -33183,7 +33279,7 @@ var Parser;
}
function parseDeclarationDefault(pos, decorators, modifiers) {
if (decorators || modifiers) {
- const missing = createMissingNode(285 /* MissingDeclaration */, true, Diagnostics.Declaration_expected);
+ const missing = createMissingNode(288 /* MissingDeclaration */, true, Diagnostics.Declaration_expected);
setTextRangePos(missing, pos);
missing.illegalDecorators = decorators;
missing.modifiers = modifiers;
@@ -33293,7 +33389,7 @@ var Parser;
}
nextToken();
let declarations;
- if (token() === 164 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {
+ if (token() === 165 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {
declarations = createMissingList();
} else {
const savedDisallowIn = inDisallowInContext();
@@ -33323,7 +33419,7 @@ var Parser;
const asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
const name = modifierFlags & 1024 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier();
if (name && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
- fileStylesComponents.set(name.escapedText.toString(), 263 /* FunctionDeclaration */);
+ fileStylesComponents.set(name.escapedText.toString(), 265 /* FunctionDeclaration */);
}
const originalUICallbackContext = inUICallbackContext();
setEtsBuilderContext(hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions));
@@ -33427,7 +33523,7 @@ var Parser;
setUICallbackContext(inBuildContext() || inBuilderContext());
if (inStructContext() && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
if (methodName && currentStructName) {
- structStylesComponents.set(methodName, { structName: currentStructName, kind: 174 /* MethodDeclaration */ });
+ structStylesComponents.set(methodName, { structName: currentStructName, kind: 176 /* MethodDeclaration */ });
}
const stylesEtsComponentDecoratorNames = getEtsStylesDecoratorComponentNames(decorators, sourceFileCompilerOptions);
if (stylesEtsComponentDecoratorNames.length > 0) {
@@ -33516,7 +33612,7 @@ var Parser;
const parameters = parseParameters(0 /* None */);
const type = parseReturnType(58 /* ColonToken */, false);
const body = parseFunctionBlockOrSemicolon(flags);
- const node = kind === 177 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body);
+ const node = kind === 179 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body);
node.typeParameters = typeParameters;
if (isSetAccessorDeclaration(node))
node.type = type;
@@ -33728,10 +33824,10 @@ var Parser;
return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 177 /* GetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 0 /* None */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 178 /* SetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 0 /* None */);
}
if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers);
@@ -33767,35 +33863,35 @@ var Parser;
const hasJSDoc = hasPrecedingJSDocComment();
if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (parseContextualModifier(138 /* GetKeyword */)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (isIndexSignature()) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
@@ -33806,11 +33902,66 @@ var Parser;
}
return Debug.fail("Should not have attempted to parse annotation member declaration.");
}
+ function parseOverloadElement() {
+ const pos = getNodePos();
+ if (token() === 26 /* SemicolonToken */) {
+ parseErrorAt(pos, pos, Diagnostics.Unexpected_keyword_or_identifier);
+ }
+ const hasJSDoc = hasPrecedingJSDocComment();
+ if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (parseContextualModifier(138 /* GetKeyword */)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (parseContextualModifier(152 /* SetKeyword */)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (isIndexSignature()) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (tokenIsIdentifierOrKeyword(token())) {
+ const modifiers = parseModifiers();
+ let overloadPropertyDeclaration = parseOverloadPropertyDeclaration(pos, hasJSDoc, modifiers);
+ if (overloadPropertyDeclaration.kind === 174 /* OverloadPropertyDeclaration */) {
+ return overloadPropertyDeclaration;
+ }
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ return Debug.fail("Should not have attempted to parse annotation member declaration.");
+ }
function parseClassExpression() {
- return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0, 232 /* ClassExpression */);
+ return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0, 234 /* ClassExpression */);
}
function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) {
- return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 264 /* ClassDeclaration */);
+ return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 266 /* ClassDeclaration */);
}
function parseStructDeclaration(pos, hasJSDoc, decorators, modifiers) {
return parseStructDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers);
@@ -33831,7 +33982,7 @@ var Parser;
members = createMissingList();
}
setAwaitContext(savedAwaitContext);
- const node = kind === 264 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
+ const node = kind === 266 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseStructDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers) {
@@ -33895,7 +34046,7 @@ var Parser;
function parseExpressionWithTypeArguments() {
const pos = getNodePos();
const expression = parseLeftHandSideExpressionOrHigher();
- if (expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (expression.kind === 236 /* ExpressionWithTypeArguments */) {
return expression;
}
const typeArguments = tryParseTypeArguments();
@@ -33913,13 +34064,16 @@ var Parser;
function parseAnnotationMembers() {
return parseList(ParsingContext.AnnotationMembers, parseAnnotationElement);
}
+ function parseOverloadMembers() {
+ return parseList(ParsingContext.TypeMembers, parseOverloadElement);
+ }
function parseStructMembers(pos) {
const structMembers = parseList(ParsingContext.ClassMembers, parseClassElement);
const virtualStructMembers = [];
const virtualParameterProperties = [];
structMembers.forEach((member) => {
virtualStructMembers.push(member);
- if (member.kind === 171 /* PropertyDeclaration */) {
+ if (member.kind === 172 /* PropertyDeclaration */) {
const property = member;
virtualParameterProperties.push(
finishVirtualNode(
@@ -34166,7 +34320,7 @@ var Parser;
function parseImportClause(identifier, pos, isTypeOnly) {
let namedBindings;
if (!identifier || parseOptional(27 /* CommaToken */)) {
- namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(278 /* NamedImports */);
+ namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(281 /* NamedImports */);
}
return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos);
}
@@ -34199,15 +34353,15 @@ var Parser;
}
function parseNamedImportsOrExports(kind) {
const pos = getNodePos();
- const node = kind === 278 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */));
+ const node = kind === 281 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */));
return finishNode(node, pos);
}
function parseExportSpecifier() {
const hasJSDoc = hasPrecedingJSDocComment();
- return withJSDoc(parseImportOrExportSpecifier(284 /* ExportSpecifier */), hasJSDoc);
+ return withJSDoc(parseImportOrExportSpecifier(287 /* ExportSpecifier */), hasJSDoc);
}
function parseImportSpecifier() {
- return parseImportOrExportSpecifier(279 /* ImportSpecifier */);
+ return parseImportOrExportSpecifier(282 /* ImportSpecifier */);
}
function parseImportOrExportSpecifier(kind) {
const pos = getNodePos();
@@ -34251,10 +34405,10 @@ var Parser;
parseExpected(129 /* AsKeyword */);
name = parseNameWithKeywordCheck();
}
- if (kind === 279 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
+ if (kind === 282 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected);
}
- const node = kind === 279 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
+ const node = kind === 282 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
return finishNode(node, pos);
function parseNameWithKeywordCheck() {
checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2();
@@ -34281,7 +34435,7 @@ var Parser;
parseExpected(160 /* FromKeyword */);
moduleSpecifier = parseModuleSpecifier();
} else {
- exportClause = parseNamedImportsOrExports(282 /* NamedExports */);
+ exportClause = parseNamedImportsOrExports(285 /* NamedExports */);
if (token() === 160 /* FromKeyword */ || token() === 10 /* StringLiteral */ && !scanner2.hasPrecedingLineBreak()) {
parseExpected(160 /* FromKeyword */);
moduleSpecifier = parseModuleSpecifier();
@@ -34855,7 +35009,7 @@ var Parser;
switch (node.kind) {
case 150 /* ObjectKeyword */:
return true;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return isObjectOrObjectArrayTypeReference(node.elementType);
default:
return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments;
@@ -34885,12 +35039,12 @@ var Parser;
let child;
let children;
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent3, name))) {
- if (child.kind === 349 /* JSDocParameterTag */ || child.kind === 356 /* JSDocPropertyTag */) {
+ if (child.kind === 352 /* JSDocParameterTag */ || child.kind === 359 /* JSDocPropertyTag */) {
children = append(children, child);
}
}
if (children) {
- const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 188 /* ArrayType */), pos);
+ const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 190 /* ArrayType */), pos);
return finishNode(factory2.createJSDocTypeExpression(literal), pos);
}
}
@@ -35003,7 +35157,7 @@ var Parser;
let hasChildren = false;
while (child = tryParse(() => parseChildPropertyTag(indent3))) {
hasChildren = true;
- if (child.kind === 352 /* JSDocTypeTag */) {
+ if (child.kind === 355 /* JSDocTypeTag */) {
if (childTypeTag) {
const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
if (lastError) {
@@ -35018,7 +35172,7 @@ var Parser;
}
}
if (hasChildren) {
- const isArrayType = typeExpression && typeExpression.type.kind === 188 /* ArrayType */;
+ const isArrayType = typeExpression && typeExpression.type.kind === 190 /* ArrayType */;
const jsdocTypeLiteral = factory2.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType);
typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral, start2);
end2 = typeExpression.end;
@@ -35069,7 +35223,7 @@ var Parser;
const returnTag = tryParse(() => {
if (parseOptionalJsdoc(59 /* AtToken */)) {
const tag = parseTag(indent3);
- if (tag && tag.kind === 350 /* JSDocReturnTag */) {
+ if (tag && tag.kind === 353 /* JSDocReturnTag */) {
return tag;
}
}
@@ -35103,7 +35257,7 @@ var Parser;
case 59 /* AtToken */:
if (canParseTag) {
const child = tryParseChildTag(target, indent3);
- if (child && (child.kind === 349 /* JSDocParameterTag */ || child.kind === 356 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
+ if (child && (child.kind === 352 /* JSDocParameterTag */ || child.kind === 359 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
return false;
}
return child;
@@ -37623,7 +37777,7 @@ function convertConfigFileToObject(sourceFile, errors, reportOptionsErrors, opti
var _a2;
const rootExpression = (_a2 = sourceFile.statements[0]) == null ? void 0 : _a2.expression;
const knownRootOptions = reportOptionsErrors ? getTsconfigRootOptionsMap() : void 0;
- if (rootExpression && rootExpression.kind !== 210 /* ObjectLiteralExpression */) {
+ if (rootExpression && rootExpression.kind !== 212 /* ObjectLiteralExpression */) {
errors.push(createDiagnosticForNodeInSourceFile(
sourceFile,
rootExpression,
@@ -37655,7 +37809,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) {
const result = returnValue ? {} : void 0;
for (const element of node.properties) {
- if (element.kind !== 305 /* PropertyAssignment */) {
+ if (element.kind !== 308 /* PropertyAssignment */) {
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element, Diagnostics.Property_assignment_expected));
continue;
}
@@ -37743,13 +37897,13 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
case 8 /* NumericLiteral */:
reportInvalidOptionValue(option && option.type !== "number");
return validateValue(Number(valueExpression.text));
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) {
break;
}
reportInvalidOptionValue(option && option.type !== "number");
return validateValue(-Number(valueExpression.operand.text));
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
reportInvalidOptionValue(option && option.type !== "object");
const objectLiteralExpression = valueExpression;
if (option) {
@@ -37768,7 +37922,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
void 0
));
}
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
reportInvalidOptionValue(option && option.type !== "list");
return validateValue(convertArrayLiteralExpressionToJson(
valueExpression.elements,
@@ -40813,7 +40967,7 @@ function getReservedDecoratorsOfEtsFile(node, host) {
}
function getReservedDecoratorsOfStructDeclaration(node, host) {
let reservedDecorators;
- if (node.parent.kind === 265 /* StructDeclaration */) {
+ if (node.parent.kind === 267 /* StructDeclaration */) {
reservedDecorators = ensureEtsDecorators(node, host);
}
return reservedDecorators;
@@ -41030,10 +41184,10 @@ function isTokenInsideBuilder(decorators, compilerOptions) {
return false;
}
function getEtsComponentExpressionInnerCallExpressionNode(node) {
- while (node && node.kind !== 220 /* EtsComponentExpression */) {
- if (node.kind === 213 /* CallExpression */) {
+ while (node && node.kind !== 222 /* EtsComponentExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
node = node.expression;
- } else if (node.kind === 211 /* PropertyAccessExpression */) {
+ } else if (node.kind === 213 /* PropertyAccessExpression */) {
node = node.expression;
} else {
node = void 0;
@@ -41046,7 +41200,7 @@ function getRootEtsComponentInnerCallExpressionNode(node) {
return node;
}
while (node) {
- const ancestor = getAncestor(isCallExpression(node) ? node.parent : node, 213 /* CallExpression */);
+ const ancestor = getAncestor(isCallExpression(node) ? node.parent : node, 215 /* CallExpression */);
const target = getRootEtsComponent(ancestor);
if (target && isInStateStylesObject(node)) {
return target;
@@ -41075,7 +41229,7 @@ function getEtsComponentExpressionInnerExpressionStatementNode(node) {
return void 0;
}
function isInStateStylesObject(node) {
- const ancestor = getAncestor(node, 210 /* ObjectLiteralExpression */);
+ const ancestor = getAncestor(node, 212 /* ObjectLiteralExpression */);
return ancestor !== void 0 && ancestor.parent !== void 0 && isPropertyAssignment(ancestor.parent);
}
function getEtsExtendDecoratorsComponentNames(decorators, compilerOptions) {
@@ -41083,7 +41237,7 @@ function getEtsExtendDecoratorsComponentNames(decorators, compilerOptions) {
const extendComponents = [];
const extendDecorator = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.extend) == null ? void 0 : _b.decorator) != null ? _c : "Extend";
decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (decorator.expression.kind === 213 /* CallExpression */) {
+ if (decorator.expression.kind === 215 /* CallExpression */) {
const identifier = decorator.expression.expression;
const args = decorator.expression.arguments;
if (identifier.kind === 79 /* Identifier */ && (extendDecorator == null ? void 0 : extendDecorator.includes(identifier.escapedText.toString())) && args.length) {
@@ -41100,7 +41254,7 @@ function getEtsStylesDecoratorComponentNames(decorators, compilerOptions) {
const stylesComponents = [];
const stylesDecorator = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.styles) == null ? void 0 : _b.decorator) != null ? _c : "Styles";
decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (decorator.kind === 169 /* Decorator */ && decorator.expression.kind === 79 /* Identifier */) {
+ if (decorator.kind === 170 /* Decorator */ && decorator.expression.kind === 79 /* Identifier */) {
const identifier = decorator.expression;
if (identifier.kind === 79 /* Identifier */ && identifier.escapedText === stylesDecorator) {
stylesComponents.push(identifier.escapedText);
@@ -41146,7 +41300,7 @@ function transformAnnotation(context) {
}
function visitAnnotationsDeclarations(node) {
switch (node.kind) {
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return visitAnnotationDeclaration(node);
default:
return visitEachChild(node, visitAnnotationsDeclarations, context);
@@ -41154,9 +41308,9 @@ function transformAnnotation(context) {
}
function visitAnnotations(node) {
switch (node.kind) {
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return visitImportSpecifier(node);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return visitAnnotation(node);
default:
return visitEachChild(node, visitAnnotations, context);
@@ -41196,14 +41350,14 @@ function transformAnnotation(context) {
return factory.createIdentifier(
annotationMagicNamePrefix + expr.escapedText
);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
const propAccessExpr = expr;
return factory.updatePropertyAccessExpression(
propAccessExpr,
propAccessExpr.expression,
addMagicPrefixToAnnotationNameIdentifier(propAccessExpr.name)
);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
const callExpr = expr;
return factory.updateCallExpression(
callExpr,
@@ -41284,16 +41438,16 @@ function transformTypeExportImportAndConstEnumInTypeScript(context) {
}
function visitImportExportAndConstEnumMember(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitConstEnum(node);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return visitEnumMember(node);
default:
return visitEachChild(node, visitImportExportAndConstEnumMember, context);
@@ -41339,7 +41493,7 @@ function transformTypeExportImportAndConstEnumInTypeScript(context) {
return name || namedBindings ? factory.updateImportClause(node, false, name, namedBindings) : void 0;
}
function visitNamedImportBindings(node) {
- if (node.kind === 277 /* NamespaceImport */) {
+ if (node.kind === 280 /* NamespaceImport */) {
if (resolver.isReferencedAliasDeclaration(node)) {
return node;
}
@@ -41939,23 +42093,23 @@ function getModuleInstanceStateCached(node, visited = new Map2()) {
}
function getModuleInstanceStateWorker(node, visited) {
switch (node.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return 0 /* NonInstantiated */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (isEnumConst(node)) {
return 2 /* ConstEnumOnly */;
}
break;
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
if (!hasSyntacticModifier(node, 1 /* Export */)) {
return 0 /* NonInstantiated */;
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportDeclaration = node;
- if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 282 /* NamedExports */) {
+ if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 285 /* NamedExports */) {
let state = 0 /* NonInstantiated */;
for (const specifier of exportDeclaration.exportClause.elements) {
const specifierState = getModuleInstanceStateForAliasTarget(specifier, visited);
@@ -41969,7 +42123,7 @@ function getModuleInstanceStateWorker(node, visited) {
return state;
}
break;
- case 271 /* ModuleBlock */: {
+ case 274 /* ModuleBlock */: {
let state = 0 /* NonInstantiated */;
forEachChild(node, (n) => {
const childState = getModuleInstanceStateCached(n, visited);
@@ -41988,7 +42142,7 @@ function getModuleInstanceStateWorker(node, visited) {
});
return state;
}
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return getModuleInstanceState(node, visited);
case 79 /* Identifier */:
if (node.isInJSDocNamespace) {
@@ -42148,7 +42302,7 @@ function createBinder() {
}
}
function getDeclarationName(node) {
- if (node.kind === 280 /* ExportAssignment */) {
+ if (node.kind === 283 /* ExportAssignment */) {
return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
}
const name = getNameOfDeclaration(node);
@@ -42157,7 +42311,7 @@ function createBinder() {
const moduleName = getTextOfIdentifierOrLiteral(name);
return isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName}"`;
}
- if (name.kind === 166 /* ComputedPropertyName */) {
+ if (name.kind === 167 /* ComputedPropertyName */) {
const nameExpression = name.expression;
if (isStringOrNumericLiteralLike(nameExpression)) {
return escapeLeadingUnderscores(nameExpression.text);
@@ -42179,30 +42333,30 @@ function createBinder() {
return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0;
}
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return "__constructor" /* Constructor */;
- case 184 /* FunctionType */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
+ case 186 /* FunctionType */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
return "__call" /* Call */;
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
return "__new" /* New */;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return "__index" /* Index */;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return "__export" /* ExportStar */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return "export=" /* ExportEquals */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) {
return "export=" /* ExportEquals */;
}
Debug.fail("Unknown binary declaration kind");
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */;
- case 168 /* Parameter */:
- Debug.assert(node.parent.kind === 326 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
+ case 169 /* Parameter */:
+ Debug.assert(node.parent.kind === 329 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
const functionType = node.parent;
const index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -42249,7 +42403,7 @@ function createBinder() {
messageNeedsName = false;
multipleDefaultExports = true;
} else {
- if (symbol.declarations && symbol.declarations.length && (node.kind === 280 /* ExportAssignment */ && !node.isExportEquals)) {
+ if (symbol.declarations && symbol.declarations.length && (node.kind === 283 /* ExportAssignment */ && !node.isExportEquals)) {
message = Diagnostics.A_module_cannot_have_multiple_default_exports;
messageNeedsName = false;
multipleDefaultExports = true;
@@ -42288,7 +42442,7 @@ function createBinder() {
function declareModuleMember(node, symbolFlags, symbolExcludes) {
const hasExportModifier = !!(getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node);
if (symbolFlags & 2097152 /* Alias */) {
- if (node.kind === 284 /* ExportSpecifier */ || node.kind === 274 /* ImportEqualsDeclaration */ && hasExportModifier) {
+ if (node.kind === 287 /* ExportSpecifier */ || node.kind === 277 /* ImportEqualsDeclaration */ && hasExportModifier) {
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
} else {
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
@@ -42332,7 +42486,7 @@ function createBinder() {
const saveThisParentContainer = thisParentContainer;
const savedBlockScopeContainer = blockScopeContainer;
if (containerFlags & 1 /* IsContainer */) {
- if (node.kind !== 219 /* ArrowFunction */) {
+ if (node.kind !== 221 /* ArrowFunction */) {
thisParentContainer = container;
}
container = blockScopeContainer = node;
@@ -42352,14 +42506,14 @@ function createBinder() {
const saveExceptionTarget = currentExceptionTarget;
const saveActiveLabelList = activeLabelList;
const saveHasExplicitReturn = hasExplicitReturn;
- const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 512 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */;
+ const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 512 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 177 /* ClassStaticBlockDeclaration */;
if (!isImmediatelyInvoked) {
currentFlow = initFlowNode({ flags: 2 /* Start */ });
if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) {
currentFlow.node = node;
}
}
- currentReturnTarget = isImmediatelyInvoked || node.kind === 176 /* Constructor */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */) ? createBranchLabel() : void 0;
+ currentReturnTarget = isImmediatelyInvoked || node.kind === 178 /* Constructor */ || isInJSFile(node) && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */) ? createBranchLabel() : void 0;
currentExceptionTarget = void 0;
currentBreakTarget = void 0;
currentContinueTarget = void 0;
@@ -42373,14 +42527,14 @@ function createBinder() {
node.flags |= 512 /* HasExplicitReturn */;
node.endFlowNode = currentFlow;
}
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
node.flags |= emitFlags;
node.endFlowNode = currentFlow;
}
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
currentFlow = finishFlowLabel(currentReturnTarget);
- if (node.kind === 176 /* Constructor */ || node.kind === 175 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) {
+ if (node.kind === 178 /* Constructor */ || node.kind === 177 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */)) {
node.returnFlowNode = currentFlow;
}
}
@@ -42405,8 +42559,8 @@ function createBinder() {
blockScopeContainer = savedBlockScopeContainer;
}
function bindEachFunctionsFirst(nodes) {
- bindEach(nodes, (n) => n.kind === 263 /* FunctionDeclaration */ ? bind(n) : void 0);
- bindEach(nodes, (n) => n.kind !== 263 /* FunctionDeclaration */ ? bind(n) : void 0);
+ bindEach(nodes, (n) => n.kind === 265 /* FunctionDeclaration */ ? bind(n) : void 0);
+ bindEach(nodes, (n) => n.kind !== 265 /* FunctionDeclaration */ ? bind(n) : void 0);
}
function bindEach(nodes, bindFunction = bind) {
if (nodes === void 0) {
@@ -42426,59 +42580,59 @@ function createBinder() {
inAssignmentPattern = saveInAssignmentPattern;
return;
}
- if (node.kind >= 244 /* FirstStatement */ && node.kind <= 260 /* LastStatement */ && !options.allowUnreachableCode) {
+ if (node.kind >= 246 /* FirstStatement */ && node.kind <= 262 /* LastStatement */ && !options.allowUnreachableCode) {
node.flowNode = currentFlow;
}
switch (node.kind) {
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
bindWhileStatement(node);
break;
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
bindDoStatement(node);
break;
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
bindForStatement(node);
break;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
bindForInOrForOfStatement(node);
break;
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
bindIfStatement(node);
break;
- case 254 /* ReturnStatement */:
- case 258 /* ThrowStatement */:
+ case 256 /* ReturnStatement */:
+ case 260 /* ThrowStatement */:
bindReturnOrThrow(node);
break;
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
bindBreakOrContinueStatement(node);
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
bindTryStatement(node);
break;
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
bindSwitchStatement(node);
break;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
bindCaseBlock(node);
break;
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
bindCaseClause(node);
break;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
bindExpressionStatement(node);
break;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
bindLabeledStatement(node);
break;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
bindPrefixUnaryExpressionFlow(node);
break;
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
bindPostfixUnaryExpressionFlow(node);
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
inAssignmentPattern = saveInAssignmentPattern;
bindDestructuringAssignmentFlow(node);
@@ -42486,49 +42640,49 @@ function createBinder() {
}
bindBinaryExpressionFlow(node);
break;
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
bindDeleteExpressionFlow(node);
break;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
bindConditionalExpressionFlow(node);
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
bindVariableDeclarationFlow(node);
break;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
bindAccessExpressionFlow(node);
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
bindCallExpressionFlow(node);
break;
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
bindNonNullExpressionFlow(node);
break;
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
bindJSDocTypeAlias(node);
break;
- case 314 /* SourceFile */: {
+ case 317 /* SourceFile */: {
bindEachFunctionsFirst(node.statements);
bind(node.endOfFileToken);
break;
}
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
bindEachFunctionsFirst(node.statements);
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
bindBindingElementFlow(node);
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
bindParameterFlow(node);
break;
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 305 /* PropertyAssignment */:
- case 231 /* SpreadElement */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 308 /* PropertyAssignment */:
+ case 233 /* SpreadElement */:
inAssignmentPattern = saveInAssignmentPattern;
default:
bindEachChild(node);
@@ -42542,19 +42696,19 @@ function createBinder() {
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
case 109 /* ThisKeyword */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return containsNarrowableReference(expr);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return hasNarrowableArgument(expr);
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return isNarrowingExpression(expr.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isNarrowingBinaryExpression(expr);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return isNarrowingExpression(expr.expression);
}
return false;
@@ -42573,7 +42727,7 @@ function createBinder() {
}
}
}
- if (expr.expression.kind === 211 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) {
+ if (expr.expression.kind === 213 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) {
return true;
}
return false;
@@ -42604,9 +42758,9 @@ function createBinder() {
}
function isNarrowableOperand(expr) {
switch (expr.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isNarrowableOperand(expr.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (expr.operatorToken.kind) {
case 63 /* EqualsToken */:
return isNarrowableOperand(expr.left);
@@ -42679,24 +42833,24 @@ function createBinder() {
function isStatementCondition(node) {
const parent3 = node.parent;
switch (parent3.kind) {
- case 246 /* IfStatement */:
- case 248 /* WhileStatement */:
- case 247 /* DoStatement */:
+ case 248 /* IfStatement */:
+ case 250 /* WhileStatement */:
+ case 249 /* DoStatement */:
return parent3.expression === node;
- case 249 /* ForStatement */:
- case 228 /* ConditionalExpression */:
+ case 251 /* ForStatement */:
+ case 230 /* ConditionalExpression */:
return parent3.condition === node;
}
return false;
}
function isLogicalExpression(node) {
while (true) {
- if (node.kind === 217 /* ParenthesizedExpression */) {
+ if (node.kind === 219 /* ParenthesizedExpression */) {
node = node.expression;
- } else if (node.kind === 225 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
+ } else if (node.kind === 227 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
node = node.operand;
} else {
- return node.kind === 227 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */);
+ return node.kind === 229 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */);
}
}
}
@@ -42737,7 +42891,7 @@ function createBinder() {
}
function setContinueTarget(node, target) {
let label = activeLabelList;
- while (label && node.parent.kind === 257 /* LabeledStatement */) {
+ while (label && node.parent.kind === 259 /* LabeledStatement */) {
label.continueTarget = target;
label = label.next;
node = node.parent;
@@ -42788,12 +42942,12 @@ function createBinder() {
bind(node.expression);
addAntecedent(preLoopLabel, currentFlow);
currentFlow = preLoopLabel;
- if (node.kind === 251 /* ForOfStatement */) {
+ if (node.kind === 253 /* ForOfStatement */) {
bind(node.awaitModifier);
}
addAntecedent(postLoopLabel, currentFlow);
bind(node.initializer);
- if (node.initializer.kind !== 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind !== 264 /* VariableDeclarationList */) {
bindAssignmentTargetFlow(node.initializer);
}
bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
@@ -42815,7 +42969,7 @@ function createBinder() {
}
function bindReturnOrThrow(node) {
bind(node.expression);
- if (node.kind === 254 /* ReturnStatement */) {
+ if (node.kind === 256 /* ReturnStatement */) {
hasExplicitReturn = true;
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
@@ -42832,7 +42986,7 @@ function createBinder() {
return void 0;
}
function bindBreakOrContinueFlow(node, breakTarget, continueTarget) {
- const flowLabel = node.kind === 253 /* BreakStatement */ ? breakTarget : continueTarget;
+ const flowLabel = node.kind === 255 /* BreakStatement */ ? breakTarget : continueTarget;
if (flowLabel) {
addAntecedent(flowLabel, currentFlow);
currentFlow = unreachableFlow;
@@ -42902,7 +43056,7 @@ function createBinder() {
preSwitchCaseFlow = currentFlow;
bind(node.caseBlock);
addAntecedent(postSwitchLabel, currentFlow);
- const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 299 /* DefaultClause */);
+ const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 302 /* DefaultClause */);
node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents;
if (!hasDefault) {
addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0));
@@ -42945,7 +43099,7 @@ function createBinder() {
maybeBindExpressionFlowIfCall(node.expression);
}
function maybeBindExpressionFlowIfCall(node) {
- if (node.kind === 213 /* CallExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
const call = node;
if (call.expression.kind !== 107 /* SuperKeyword */ && isDottedName(call.expression)) {
currentFlow = createFlowCall(currentFlow, call);
@@ -42971,7 +43125,7 @@ function createBinder() {
currentFlow = finishFlowLabel(postStatementLabel);
}
function bindDestructuringTargetFlow(node) {
- if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */) {
+ if (node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */) {
bindAssignmentTargetFlow(node.left);
} else {
bindAssignmentTargetFlow(node);
@@ -42980,21 +43134,21 @@ function createBinder() {
function bindAssignmentTargetFlow(node) {
if (isNarrowableReference(node)) {
currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node);
- } else if (node.kind === 209 /* ArrayLiteralExpression */) {
+ } else if (node.kind === 211 /* ArrayLiteralExpression */) {
for (const e of node.elements) {
- if (e.kind === 231 /* SpreadElement */) {
+ if (e.kind === 233 /* SpreadElement */) {
bindAssignmentTargetFlow(e.expression);
} else {
bindDestructuringTargetFlow(e);
}
}
- } else if (node.kind === 210 /* ObjectLiteralExpression */) {
+ } else if (node.kind === 212 /* ObjectLiteralExpression */) {
for (const p of node.properties) {
- if (p.kind === 305 /* PropertyAssignment */) {
+ if (p.kind === 308 /* PropertyAssignment */) {
bindDestructuringTargetFlow(p.initializer);
- } else if (p.kind === 306 /* ShorthandPropertyAssignment */) {
+ } else if (p.kind === 309 /* ShorthandPropertyAssignment */) {
bindAssignmentTargetFlow(p.name);
- } else if (p.kind === 307 /* SpreadAssignment */) {
+ } else if (p.kind === 310 /* SpreadAssignment */) {
bindAssignmentTargetFlow(p.expression);
}
}
@@ -43117,7 +43271,7 @@ function createBinder() {
const operator = node.operatorToken.kind;
if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
- if (operator === 63 /* EqualsToken */ && node.left.kind === 212 /* ElementAccessExpression */) {
+ if (operator === 63 /* EqualsToken */ && node.left.kind === 214 /* ElementAccessExpression */) {
const elementAccess = node.left;
if (isNarrowableOperand(elementAccess.expression)) {
currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
@@ -43145,7 +43299,7 @@ function createBinder() {
}
function bindDeleteExpressionFlow(node) {
bindEachChild(node);
- if (node.expression.kind === 211 /* PropertyAccessExpression */) {
+ if (node.expression.kind === 213 /* PropertyAccessExpression */) {
bindAssignmentTargetFlow(node.expression);
}
}
@@ -43210,7 +43364,7 @@ function createBinder() {
}
function bindJSDocTypeAlias(node) {
bind(node.tagName);
- if (node.kind !== 348 /* JSDocEnumTag */ && node.fullName) {
+ if (node.kind !== 351 /* JSDocEnumTag */ && node.fullName) {
setParent(node.fullName, node);
setParentRecursive(node.fullName, false);
}
@@ -43221,7 +43375,7 @@ function createBinder() {
function bindJSDocClassTag(node) {
bindEachChild(node);
const host = getHostSignatureFromJSDoc(node);
- if (host && host.kind !== 174 /* MethodDeclaration */) {
+ if (host && host.kind !== 176 /* MethodDeclaration */) {
addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
}
}
@@ -43234,15 +43388,15 @@ function createBinder() {
}
function bindOptionalChainRest(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
bind(node.questionDotToken);
bind(node.name);
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
bind(node.questionDotToken);
bind(node.argumentExpression);
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
bind(node.questionDotToken);
bindEach(node.typeArguments);
bindEach(node.arguments);
@@ -43289,7 +43443,7 @@ function createBinder() {
bindOptionalChainFlow(node);
} else {
const expr = skipParentheses(node.expression);
- if (expr.kind === 218 /* FunctionExpression */ || expr.kind === 219 /* ArrowFunction */) {
+ if (expr.kind === 220 /* FunctionExpression */ || expr.kind === 221 /* ArrowFunction */) {
bindEach(node.typeArguments);
bindEach(node.arguments);
bind(node.expression);
@@ -43300,7 +43454,7 @@ function createBinder() {
}
}
}
- if (node.expression.kind === 211 /* PropertyAccessExpression */) {
+ if (node.expression.kind === 213 /* PropertyAccessExpression */) {
const propertyAccess = node.expression;
if (isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && isPushOrUnshiftIdentifier(propertyAccess.name)) {
currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
@@ -43309,58 +43463,60 @@ function createBinder() {
}
function getContainerFlags(node) {
switch (node.kind) {
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 269 /* EnumDeclaration */:
- case 210 /* ObjectLiteralExpression */:
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 295 /* JsxAttributes */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 212 /* ObjectLiteralExpression */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 298 /* JsxAttributes */:
return 1 /* IsContainer */;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return 1 /* IsContainer */ | 64 /* IsInterface */;
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 200 /* MappedType */:
- case 181 /* IndexSignature */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 202 /* MappedType */:
+ case 183 /* IndexSignature */:
return 1 /* IsContainer */ | 32 /* HasLocals */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
}
- case 176 /* Constructor */:
- case 263 /* FunctionDeclaration */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
- case 326 /* JSDocFunctionType */:
- case 184 /* FunctionType */:
- case 180 /* ConstructSignature */:
- case 185 /* ConstructorType */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 265 /* FunctionDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
+ case 329 /* JSDocFunctionType */:
+ case 186 /* FunctionType */:
+ case 182 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 177 /* ClassStaticBlockDeclaration */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return 4 /* IsControlFlowContainer */;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
- case 301 /* CatchClause */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 272 /* CaseBlock */:
+ case 304 /* CatchClause */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 275 /* CaseBlock */:
return 2 /* IsBlockScopedContainer */;
- case 242 /* Block */:
+ case 244 /* Block */:
return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */;
}
return 0 /* None */;
@@ -43373,43 +43529,44 @@ function createBinder() {
}
function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) {
switch (container.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return declareModuleMember(node, symbolFlags, symbolExcludes);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
return declareClassMember(node, symbolFlags, symbolExcludes);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 210 /* ObjectLiteralExpression */:
- case 267 /* InterfaceDeclaration */:
- case 295 /* JsxAttributes */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 212 /* ObjectLiteralExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 298 /* JsxAttributes */:
return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 332 /* JSDocSignature */:
- case 181 /* IndexSignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 326 /* JSDocFunctionType */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 175 /* ClassStaticBlockDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 200 /* MappedType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 335 /* JSDocSignature */:
+ case 183 /* IndexSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 329 /* JSDocFunctionType */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 202 /* MappedType */:
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
}
}
@@ -43495,10 +43652,10 @@ function createBinder() {
}
function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {
switch (blockScopeContainer.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (isExternalOrCommonJsModule(container)) {
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
@@ -43688,7 +43845,7 @@ function createBinder() {
}
function checkStrictModeFunctionDeclaration(node) {
if (languageVersion < 2 /* ES2015 */) {
- if (blockScopeContainer.kind !== 314 /* SourceFile */ && blockScopeContainer.kind !== 270 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
+ if (blockScopeContainer.kind !== 317 /* SourceFile */ && blockScopeContainer.kind !== 273 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
const errorSpan = getErrorSpanForNode(file, node);
file.bindDiagnostics.push(createFileDiagnostic(
file,
@@ -43755,7 +43912,7 @@ function createBinder() {
node.tracingPath = file.path;
const saveInStrictMode = inStrictMode;
bindWorker(node);
- if (node.kind > 164 /* LastToken */) {
+ if (node.kind > 165 /* LastToken */) {
const saveParent = parent2;
parent2 = node;
const containerFlags = getContainerFlags(node);
@@ -43817,23 +43974,23 @@ function createBinder() {
break;
}
case 109 /* ThisKeyword */:
- if (currentFlow && (isExpression(node) || parent2.kind === 306 /* ShorthandPropertyAssignment */)) {
+ if (currentFlow && (isExpression(node) || parent2.kind === 309 /* ShorthandPropertyAssignment */)) {
node.flowNode = currentFlow;
}
return checkContextualIdentifier(node);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
if (currentFlow && isPartOfTypeQuery(node)) {
node.flowNode = currentFlow;
}
break;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
case 107 /* SuperKeyword */:
node.flowNode = currentFlow;
break;
case 80 /* PrivateIdentifier */:
return checkPrivateIdentifier(node);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = node;
if (currentFlow && isNarrowableReference(expr)) {
expr.flowNode = currentFlow;
@@ -43851,7 +44008,7 @@ function createBinder() {
);
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const specialKind = getAssignmentDeclarationKind(node);
switch (specialKind) {
case 1 /* ExportsProperty */:
@@ -43886,79 +44043,80 @@ function createBinder() {
Debug.fail("Unknown binary expression special property assignment kind");
}
return checkStrictModeBinaryExpression(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return checkStrictModeCatchClause(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return checkStrictModeDeleteExpression(node);
case 8 /* NumericLiteral */:
return checkStrictModeNumericLiteral(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return checkStrictModePostfixUnaryExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return checkStrictModePrefixUnaryExpression(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return checkStrictModeWithStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return checkStrictModeLabeledStatement(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
seenThisKeyword = true;
return;
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
break;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return bindTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return bindParameter(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return bindVariableDeclarationOrBindingElement(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
node.flowNode = currentFlow;
return bindVariableDeclarationOrBindingElement(node);
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 174 /* OverloadPropertyDeclaration */:
return bindPropertyWorker(node);
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */);
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return bindPropertyOrMethodOrAccessor(
node,
8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */),
isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */
);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return bindFunctionDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, 0 /* None */);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */);
- case 184 /* FunctionType */:
- case 326 /* JSDocFunctionType */:
- case 332 /* JSDocSignature */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 329 /* JSDocFunctionType */:
+ case 335 /* JSDocSignature */:
+ case 187 /* ConstructorType */:
return bindFunctionOrConstructorType(node);
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 200 /* MappedType */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 202 /* MappedType */:
return bindAnonymousTypeWorker(node);
- case 341 /* JSDocClassTag */:
+ case 344 /* JSDocClassTag */:
return bindJSDocClassTag(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return bindObjectLiteralExpression(node);
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return bindFunctionExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
const assignmentKind = getAssignmentDeclarationKind(node);
switch (assignmentKind) {
case 7 /* ObjectDefinePropertyValue */:
@@ -43976,61 +44134,63 @@ function createBinder() {
bindCallExpression(node);
}
break;
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
inStrictMode = true;
return bindClassLikeDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return bindAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return bindOverloadDeclaration(node);
+ case 270 /* InterfaceDeclaration */:
return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return bindEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return bindModuleDeclaration(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return bindJsxAttributes(node);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */);
- case 274 /* ImportEqualsDeclaration */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return bindNamespaceExportDeclaration(node);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return bindImportClause(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return bindExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return bindExportAssignment(node);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
updateStrictModeStatementList(node.statements);
return bindSourceFileIfExternalModule();
- case 242 /* Block */:
+ case 244 /* Block */:
if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) {
return;
}
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return updateStrictModeStatementList(node.statements);
- case 349 /* JSDocParameterTag */:
- if (node.parent.kind === 332 /* JSDocSignature */) {
+ case 352 /* JSDocParameterTag */:
+ if (node.parent.kind === 335 /* JSDocSignature */) {
return bindParameter(node);
}
- if (node.parent.kind !== 331 /* JSDocTypeLiteral */) {
+ if (node.parent.kind !== 334 /* JSDocTypeLiteral */) {
break;
}
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
const propTag = node;
- const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 325 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
+ const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 328 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */);
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
}
}
@@ -44168,8 +44328,8 @@ function createBinder() {
}
const thisContainer = getThisContainer(node, false);
switch (thisContainer.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
let constructorSymbol = thisContainer.symbol;
if (isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 63 /* EqualsToken */) {
const l = thisContainer.parent.left;
@@ -44187,13 +44347,14 @@ function createBinder() {
addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */);
}
break;
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
const containingClass = thisContainer.parent;
const symbolTable = isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members;
if (hasDynamicName(node)) {
@@ -44202,7 +44363,7 @@ function createBinder() {
declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, true);
}
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (hasDynamicName(node)) {
break;
} else if (thisContainer.commonJsModuleIndicator) {
@@ -44227,7 +44388,7 @@ function createBinder() {
function bindSpecialPropertyDeclaration(node) {
if (node.expression.kind === 109 /* ThisKeyword */) {
bindThisPropertyAssignment(node);
- } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 314 /* SourceFile */) {
+ } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 317 /* SourceFile */) {
if (isPrototypeAccess(node.expression)) {
bindPrototypePropertyAssignment(node, node.parent);
} else {
@@ -44257,7 +44418,7 @@ function createBinder() {
}
function bindObjectDefinePropertyAssignment(node) {
let namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]);
- const isToplevel = node.parent.parent.kind === 314 /* SourceFile */;
+ const isToplevel = node.parent.parent.kind === 317 /* SourceFile */;
namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, false, false);
bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, false);
}
@@ -44343,7 +44504,7 @@ function createBinder() {
declareSymbol(symbolTable, namespaceSymbol, declaration, includes | 67108864 /* Assignment */, excludes & ~67108864 /* Assignment */);
}
function isTopLevelNamespaceAssignment(propertyAccess) {
- return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 314 /* SourceFile */ : propertyAccess.parent.parent.kind === 314 /* SourceFile */;
+ return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 317 /* SourceFile */ : propertyAccess.parent.parent.kind === 317 /* SourceFile */;
}
function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) {
let namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer);
@@ -44401,7 +44562,7 @@ function createBinder() {
}
}
function bindClassLikeDeclaration(node) {
- if (node.kind === 264 /* ClassDeclaration */ || node.kind === 265 /* StructDeclaration */) {
+ if (node.kind === 266 /* ClassDeclaration */ || node.kind === 267 /* StructDeclaration */) {
bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */);
} else {
const bindingName = node.name ? node.name.escapedText : "__class" /* Class */;
@@ -44423,7 +44584,7 @@ function createBinder() {
prototypeSymbol.parent = symbol;
}
function bindAnnotationDeclaration(node) {
- Debug.assert(node.kind === 266 /* AnnotationDeclaration */);
+ Debug.assert(node.kind === 268 /* AnnotationDeclaration */);
bindBlockScopedDeclaration(node, 32 /* Class */ | 268435456 /* Annotation */, 899503 /* ClassExcludes */);
const { symbol } = node;
const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype");
@@ -44437,6 +44598,21 @@ function createBinder() {
symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);
prototypeSymbol.parent = symbol;
}
+ function bindOverloadDeclaration(node) {
+ Debug.assert(node.kind === 269 /* OverloadDeclaration */);
+ bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */);
+ const { symbol } = node;
+ const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype");
+ const symbolExport = symbol.exports.get(prototypeSymbol.escapedName);
+ if (symbolExport) {
+ if (node.name) {
+ setParent(node.name, node);
+ }
+ file.bindDiagnostics.push(createDiagnosticForNode2(symbolExport.declarations[0], Diagnostics.Duplicate_identifier_0, symbolName(prototypeSymbol)));
+ }
+ symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);
+ prototypeSymbol.parent = symbol;
+ }
function bindEnumDeclaration(node) {
return isEnumConst(node) ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */);
}
@@ -44445,7 +44621,7 @@ function createBinder() {
checkStrictModeEvalOrArguments(node, node.name);
}
if (!isBindingPattern(node.name)) {
- const possibleVariableDecl = node.kind === 261 /* VariableDeclaration */ ? node : node.parent.parent;
+ const possibleVariableDecl = node.kind === 263 /* VariableDeclaration */ ? node : node.parent.parent;
if (isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) {
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
} else if (isBlockOrCatchScoped(node)) {
@@ -44458,7 +44634,7 @@ function createBinder() {
}
}
function bindParameter(node) {
- if (node.kind === 349 /* JSDocParameterTag */ && container.kind !== 332 /* JSDocSignature */) {
+ if (node.kind === 352 /* JSDocParameterTag */ && container.kind !== 335 /* JSDocSignature */) {
return;
}
if (inStrictMode && !(node.flags & 16777216 /* Ambient */)) {
@@ -44525,7 +44701,7 @@ function createBinder() {
} else {
declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
}
- } else if (node.parent.kind === 195 /* InferType */) {
+ } else if (node.parent.kind === 197 /* InferType */) {
const container2 = getInferTypeContainer(node.parent);
if (container2) {
if (!container2.locals) {
@@ -44548,7 +44724,7 @@ function createBinder() {
return false;
}
if (currentFlow === unreachableFlow) {
- const reportError = isStatementButNotDeclaration(node) && node.kind !== 243 /* EmptyStatement */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 270 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
+ const reportError = isStatementButNotDeclaration(node) && node.kind !== 245 /* EmptyStatement */ || node.kind === 266 /* ClassDeclaration */ || node.kind === 273 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
if (reportError) {
currentFlow = reportedUnreachableFlow;
if (!options.allowUnreachableCode) {
@@ -44574,12 +44750,12 @@ function isExecutableStatement(s) {
}
function isPurelyTypeDeclaration(s) {
switch (s.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return getModuleInstanceState(s) !== 1 /* Instantiated */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return hasSyntacticModifier(s, 2048 /* Const */);
default:
return false;
@@ -44761,7 +44937,7 @@ function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignatu
symbol.exports.forEach(visitSymbol);
}
forEach(symbol.declarations, (d) => {
- if (d.type && d.type.kind === 186 /* TypeQuery */) {
+ if (d.type && d.type.kind === 188 /* TypeQuery */) {
const query = d.type;
const entity = getResolvedSymbol(getFirstIdentifier2(query.exprName));
visitSymbol(entity);
@@ -46696,7 +46872,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks());
}
function isGlobalSourceFile(node) {
- return node.kind === 314 /* SourceFile */ && !isExternalOrCommonJsModule(node);
+ return node.kind === 317 /* SourceFile */ && !isExternalOrCommonJsModule(node);
}
function isValidFromLibs(symbol, node) {
var _a2;
@@ -46773,13 +46949,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile);
}
if (declaration.pos <= usage.pos && !(isPropertyDeclaration(declaration) && isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) {
- if (declaration.kind === 208 /* BindingElement */) {
- const errorBindingElement = getAncestor(usage, 208 /* BindingElement */);
+ if (declaration.kind === 210 /* BindingElement */) {
+ const errorBindingElement = getAncestor(usage, 210 /* BindingElement */);
if (errorBindingElement) {
return findAncestor(errorBindingElement, isBindingElement) !== findAncestor(declaration, isBindingElement) || declaration.pos < errorBindingElement.pos;
}
- return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 261 /* VariableDeclaration */), usage);
- } else if (declaration.kind === 261 /* VariableDeclaration */) {
+ return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 263 /* VariableDeclaration */), usage);
+ } else if (declaration.kind === 263 /* VariableDeclaration */) {
return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
} else if (isClassDeclaration(declaration)) {
return !findAncestor(usage, (n) => isComputedPropertyName(n) && n.parent.parent === declaration);
@@ -46790,10 +46966,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return true;
}
- if (usage.parent.kind === 284 /* ExportSpecifier */ || usage.parent.kind === 280 /* ExportAssignment */ && usage.parent.isExportEquals) {
+ if (usage.parent.kind === 287 /* ExportSpecifier */ || usage.parent.kind === 283 /* ExportAssignment */ && usage.parent.isExportEquals) {
return true;
}
- if (usage.kind === 280 /* ExportAssignment */ && usage.isExportEquals) {
+ if (usage.kind === 283 /* ExportAssignment */ && usage.isExportEquals) {
return true;
}
if (!!(usage.flags & 8388608 /* JSDoc */) || isInTypeQuery(usage) || usageInTypeDeclaration()) {
@@ -46812,9 +46988,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration2, usage2) {
switch (declaration2.parent.parent.kind) {
- case 244 /* VariableStatement */:
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
+ case 246 /* VariableStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
if (isSameScopeDescendentOf(usage2, declaration2, declContainer)) {
return true;
}
@@ -46839,7 +47015,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const initializerOfProperty = propertyDeclaration.initializer === current;
if (initializerOfProperty) {
if (isStatic(current.parent)) {
- if (declaration2.kind === 174 /* MethodDeclaration */) {
+ if (declaration2.kind === 176 /* MethodDeclaration */) {
return true;
}
if (isPropertyDeclaration(declaration2) && getContainingClass(usage2) === getContainingClass(declaration2)) {
@@ -46853,7 +47029,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
} else {
- const isDeclarationInstanceProperty = declaration2.kind === 171 /* PropertyDeclaration */ && !isStatic(declaration2);
+ const isDeclarationInstanceProperty = declaration2.kind === 172 /* PropertyDeclaration */ && !isStatic(declaration2);
if (!isDeclarationInstanceProperty || getContainingClass(usage2) !== getContainingClass(declaration2)) {
return true;
}
@@ -46872,15 +47048,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return "quit";
}
switch (node.kind) {
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return true;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return stopAtAnyPropertyDeclaration && (isPropertyDeclaration(declaration2) && node.parent === declaration2.parent || isParameterPropertyDeclaration(declaration2, declaration2.parent) && node.parent === declaration2.parent.parent) ? "quit" : true;
- case 242 /* Block */:
+ case 244 /* Block */:
switch (node.parent.kind) {
- case 177 /* GetAccessor */:
- case 174 /* MethodDeclaration */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -46910,22 +47086,22 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function requiresScopeChangeWorker(node) {
switch (node.kind) {
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 176 /* Constructor */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 178 /* Constructor */:
return false;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 305 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 308 /* PropertyAssignment */:
return requiresScopeChangeWorker(node.name);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (hasStaticModifier(node)) {
return target < 99 /* ESNext */ || !useDefineForClassFields;
}
return requiresScopeChangeWorker(node.name);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return requiresScopeChangeWorker(node.name);
default:
if (isNullishCoalesce(node) || isOptionalChain(node)) {
@@ -46967,17 +47143,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (result = lookup(location.locals, name, meaning)) {
let useResult = true;
if (isFunctionLike(location) && lastLocation && lastLocation !== location.body) {
- if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 329 /* JSDoc */) {
- useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || lastLocation.kind === 168 /* Parameter */ || lastLocation.kind === 349 /* JSDocParameterTag */ || lastLocation.kind === 350 /* JSDocReturnTag */ || lastLocation.kind === 167 /* TypeParameter */ : false;
+ if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 332 /* JSDoc */) {
+ useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || lastLocation.kind === 169 /* Parameter */ || lastLocation.kind === 352 /* JSDocParameterTag */ || lastLocation.kind === 353 /* JSDocReturnTag */ || lastLocation.kind === 168 /* TypeParameter */ : false;
}
if (meaning & result.flags & 3 /* Variable */) {
if (useOuterVariableScopeInParameter(result, location, lastLocation)) {
useResult = false;
} else if (result.flags & 1 /* FunctionScopedVariable */) {
- useResult = lastLocation.kind === 168 /* Parameter */ || lastLocation === location.type && !!findAncestor(result.valueDeclaration, isParameter);
+ useResult = lastLocation.kind === 169 /* Parameter */ || lastLocation === location.type && !!findAncestor(result.valueDeclaration, isParameter);
}
}
- } else if (location.kind === 194 /* ConditionalType */) {
+ } else if (location.kind === 196 /* ConditionalType */) {
useResult = lastLocation === location.trueType;
}
if (useResult) {
@@ -46989,13 +47165,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation);
switch (location.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (!isExternalOrCommonJsModule(location))
break;
isInExternalModule = true;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const moduleExports = getSymbolOfNode(location) ? ((_a2 = getSymbolOfNode(location)) == null ? void 0 : _a2.exports) || emptySymbols : emptySymbols;
- if (location.kind === 314 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 16777216 /* Ambient */ && !isGlobalScopeAugmentation(location)) {
+ if (location.kind === 317 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 16777216 /* Ambient */ && !isGlobalScopeAugmentation(location)) {
if (result = moduleExports.get("default" /* Default */)) {
const localSymbol = getLocalSymbolForExportDefault(result);
if (localSymbol && result.flags & meaning && localSymbol.escapedName === name) {
@@ -47004,7 +47180,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
result = void 0;
}
const moduleExport = moduleExports.get(name);
- if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 284 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 283 /* NamespaceExport */))) {
+ if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 287 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 286 /* NamespaceExport */))) {
break;
}
}
@@ -47016,12 +47192,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (result = lookup(((_c = getSymbolOfNode(location)) == null ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) {
break loop;
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (!isStatic(location)) {
const ctor = findConstructorDeclaration(location.parent);
if (ctor && ctor.locals) {
@@ -47032,9 +47208,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
if (result = lookup(getSymbolOfNode(location).members || emptySymbols, name, meaning & 788968 /* Type */)) {
if (!isTypeParameterSymbolDeclaredInContainer(result, location)) {
result = void 0;
@@ -47048,7 +47224,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
break loop;
}
- if (location.kind === 232 /* ClassExpression */ && meaning & 32 /* Class */) {
+ if (location.kind === 234 /* ClassExpression */ && meaning & 32 /* Class */) {
const className = location.name;
if (className && name === className.escapedText) {
result = location.symbol;
@@ -47056,7 +47232,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
if (lastLocation === location.expression && location.parent.token === 95 /* ExtendsKeyword */) {
const container = location.parent.parent;
if (isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 788968 /* Type */))) {
@@ -47067,9 +47243,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
grandparent = location.parent.parent;
- if (isClassLike(grandparent) || grandparent.kind === 267 /* InterfaceDeclaration */) {
+ if (isClassLike(grandparent) || grandparent.kind === 270 /* InterfaceDeclaration */) {
if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) {
if (nameNotFoundMessage) {
error(errorLocation, Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
@@ -47078,21 +47254,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */) {
break;
}
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
if (meaning & 3 /* Variable */ && name === "arguments") {
result = argumentsSymbol;
break loop;
}
break;
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
if (meaning & 3 /* Variable */ && name === "arguments") {
result = argumentsSymbol;
break loop;
@@ -47105,37 +47281,37 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 169 /* Decorator */:
- if (location.parent && location.parent.kind === 168 /* Parameter */) {
+ case 170 /* Decorator */:
+ if (location.parent && location.parent.kind === 169 /* Parameter */) {
location = location.parent;
}
- if (location.parent && (isClassElement(location.parent) || location.parent.kind === 264 /* ClassDeclaration */)) {
+ if (location.parent && (isClassElement(location.parent) || location.parent.kind === 266 /* ClassDeclaration */)) {
location = location.parent;
}
break;
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
const root = getJSDocRoot(location);
if (root) {
location = root.parent;
}
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) {
if (!associatedDeclarationForContainingInitializerOrBindingName) {
associatedDeclarationForContainingInitializerOrBindingName = location;
}
}
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) {
if (isParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) {
associatedDeclarationForContainingInitializerOrBindingName = location;
}
}
break;
- case 195 /* InferType */:
+ case 197 /* InferType */:
if (meaning & 262144 /* TypeParameter */) {
const parameterName = location.typeParameter.name;
if (parameterName && name === parameterName.escapedText) {
@@ -47156,7 +47332,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (!result) {
if (lastLocation) {
- Debug.assert(lastLocation.kind === 314 /* SourceFile */);
+ Debug.assert(lastLocation.kind === 317 /* SourceFile */);
if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) {
return lastLocation.symbol;
}
@@ -47253,7 +47429,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) {
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */);
if (typeOnlyDeclaration) {
- const message = typeOnlyDeclaration.kind === 284 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
+ const message = typeOnlyDeclaration.kind === 287 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
const unescapedName = unescapeLeadingUnderscores(name);
addTypeOnlyDeclarationRelatedInfo(
error(errorLocation, message, unescapedName),
@@ -47273,14 +47449,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
diagnostic,
createDiagnosticForNode(
typeOnlyDeclaration,
- typeOnlyDeclaration.kind === 284 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
+ typeOnlyDeclaration.kind === 287 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
unescapedName
)
);
}
function getIsDeferredContext(location, lastLocation) {
- if (location.kind !== 219 /* ArrowFunction */ && location.kind !== 218 /* FunctionExpression */) {
- return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 171 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name);
+ if (location.kind !== 221 /* ArrowFunction */ && location.kind !== 220 /* FunctionExpression */) {
+ return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 172 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name);
}
if (lastLocation && lastLocation === location.name) {
return false;
@@ -47292,12 +47468,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isSelfReferenceLocation(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 273 /* ModuleDeclaration */:
return true;
default:
return false;
@@ -47309,7 +47485,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isTypeParameterSymbolDeclaredInContainer(symbol, container) {
if (symbol.declarations) {
for (const decl of symbol.declarations) {
- if (decl.kind === 167 /* TypeParameter */) {
+ if (decl.kind === 168 /* TypeParameter */) {
const parent2 = isJSDocTemplateTag(decl.parent) ? getJSDocHost(decl.parent) : decl.parent;
if (parent2 === container) {
return !(isJSDocTemplateTag(decl.parent) && find(decl.parent.parent.tags, isJSDocTypeAlias));
@@ -47359,9 +47535,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getEntityNameForExtendingInterface(node) {
switch (node.kind) {
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return node.parent ? getEntityNameForExtendingInterface(node.parent) : void 0;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
if (isEntityNameExpression(node.expression)) {
return node.expression;
}
@@ -47409,7 +47585,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown";
}
function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) {
- if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 284 /* ExportSpecifier */) {
+ if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 287 /* ExportSpecifier */) {
error(errorLocation, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name);
return true;
}
@@ -47498,7 +47674,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const declaration = (_a2 = result.declarations) == null ? void 0 : _a2.find(
- (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || d.kind === 269 /* EnumDeclaration */
+ (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || d.kind === 272 /* EnumDeclaration */
);
if (declaration === void 0)
return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");
@@ -47532,13 +47708,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getAnyImportSyntax(node) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return node;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return node.parent;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return node.parent.parent;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return node.parent.parent.parent;
default:
return void 0;
@@ -47548,7 +47724,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return symbol.declarations && findLast(symbol.declarations, isAliasSymbolDeclaration2);
}
function isAliasSymbolDeclaration2(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */ || node.kind === 273 /* NamespaceExportDeclaration */ || node.kind === 276 /* ImportClause */ && !!node.name || node.kind === 277 /* NamespaceImport */ || node.kind === 283 /* NamespaceExport */ || node.kind === 279 /* ImportSpecifier */ || node.kind === 284 /* ExportSpecifier */ || node.kind === 280 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 306 /* ShorthandPropertyAssignment */ || node.kind === 305 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 261 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 208 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
+ return node.kind === 277 /* ImportEqualsDeclaration */ || node.kind === 276 /* NamespaceExportDeclaration */ || node.kind === 279 /* ImportClause */ && !!node.name || node.kind === 280 /* NamespaceImport */ || node.kind === 286 /* NamespaceExport */ || node.kind === 282 /* ImportSpecifier */ || node.kind === 287 /* ExportSpecifier */ || node.kind === 283 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 309 /* ShorthandPropertyAssignment */ || node.kind === 308 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 263 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 210 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
}
function isAliasableOrJsExpression(e) {
return isAliasableExpression(e) || isFunctionExpression(e) && isJSConstructor(e);
@@ -47559,7 +47735,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const name = getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0];
return isIdentifier(commonJSPropertyAccess.name) ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) : void 0;
}
- if (isVariableDeclaration(node) || node.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ if (isVariableDeclaration(node) || node.moduleReference.kind === 289 /* ExternalModuleReference */) {
const immediate = resolveExternalModuleName(
node,
getExternalModuleRequireArgument(node) || getExternalModuleImportEqualsDeclarationExpression(node)
@@ -47575,7 +47751,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) {
if (markSymbolOfAliasDeclarationIfTypeOnly(node, void 0, resolved, false) && !node.isTypeOnly) {
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfNode(node));
- const isExport = typeOnlyDeclaration.kind === 284 /* ExportSpecifier */;
+ const isExport = typeOnlyDeclaration.kind === 287 /* ExportSpecifier */;
const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here;
const name = unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
@@ -47677,15 +47853,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getModuleSpecifierForImportOrExport(node) {
switch (node.kind) {
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return node.parent.moduleSpecifier;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : void 0;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return node.parent.parent.moduleSpecifier;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return node.parent.parent.parent.moduleSpecifier;
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return node.parent.parent.moduleSpecifier;
default:
return Debug.assertNever(node);
@@ -47930,31 +48106,31 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTargetOfAliasDeclaration(node, dontRecursivelyResolve = false) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
- case 261 /* VariableDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 263 /* VariableDeclaration */:
return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return getTargetOfImportClause(node, dontRecursivelyResolve);
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return getTargetOfNamespaceImport(node, dontRecursivelyResolve);
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
return getTargetOfNamespaceExport(node, dontRecursivelyResolve);
- case 279 /* ImportSpecifier */:
- case 208 /* BindingElement */:
+ case 282 /* ImportSpecifier */:
+ case 210 /* BindingElement */:
return getTargetOfImportSpecifier(node, dontRecursivelyResolve);
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve);
- case 280 /* ExportAssignment */:
- case 227 /* BinaryExpression */:
+ case 283 /* ExportAssignment */:
+ case 229 /* BinaryExpression */:
return getTargetOfExportAssignment(node, dontRecursivelyResolve);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, true, dontRecursivelyResolve);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getTargetOfAliasLikeExpression(node.initializer, dontRecursivelyResolve);
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return getTargetOfAccessExpression(node, dontRecursivelyResolve);
default:
return Debug.fail();
@@ -48085,10 +48261,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (entityName.kind === 79 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
- if (entityName.kind === 79 /* Identifier */ || entityName.parent.kind === 165 /* QualifiedName */) {
+ if (entityName.kind === 79 /* Identifier */ || entityName.parent.kind === 166 /* QualifiedName */) {
return resolveEntityName(entityName, 1920 /* Namespace */, false, dontResolveAlias);
} else {
- Debug.assert(entityName.parent.kind === 274 /* ImportEqualsDeclaration */);
+ Debug.assert(entityName.parent.kind === 277 /* ImportEqualsDeclaration */);
return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, false, dontResolveAlias);
}
}
@@ -48148,9 +48324,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!symbol) {
return getMergedSymbol(symbolFromJSPrototype);
}
- } else if (name.kind === 165 /* QualifiedName */ || name.kind === 211 /* PropertyAccessExpression */) {
- const left = name.kind === 165 /* QualifiedName */ ? name.left : name.expression;
- const right = name.kind === 165 /* QualifiedName */ ? name.right : name.name;
+ } else if (name.kind === 166 /* QualifiedName */ || name.kind === 213 /* PropertyAccessExpression */) {
+ const left = name.kind === 166 /* QualifiedName */ ? name.left : name.expression;
+ const right = name.kind === 166 /* QualifiedName */ ? name.right : name.name;
let namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, false, location);
if (!namespace || nodeIsMissing(right)) {
return void 0;
@@ -48207,7 +48383,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
throw Debug.assertNever(name, "Unknown entity name kind.");
}
Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here.");
- if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 280 /* ExportAssignment */)) {
+ if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 283 /* ExportAssignment */)) {
markSymbolOfAliasDeclarationIfTypeOnly(getAliasDeclarationFromName(name), symbol, void 0, true);
}
return symbol.flags & meaning || dontResolveAlias ? symbol : resolveAlias(symbol);
@@ -48510,7 +48686,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
var _a2;
const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
if (!dontResolveAlias && symbol) {
- if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 314 /* SourceFile */)) {
+ if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 317 /* SourceFile */)) {
const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop";
error(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName);
return symbol;
@@ -48828,7 +49004,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function findConstructorDeclaration(node) {
const members = node.members;
for (const member of members) {
- if (member.kind === 176 /* Constructor */ && nodeIsPresent(member.body)) {
+ if (member.kind === 178 /* Constructor */ && nodeIsPresent(member.body)) {
return member;
}
}
@@ -48938,19 +49114,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
switch (location.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (!isExternalOrCommonJsModule(location)) {
break;
}
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const sym = getSymbolOfNode(location);
if (result = callback((sym == null ? void 0 : sym.exports) || emptySymbols, void 0, true, location)) {
return result;
}
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
let table;
(getSymbolOfNode(location).members || emptySymbols).forEach((memberSymbol, key) => {
if (memberSymbol.flags & (788968 /* Type */ & ~67108864 /* Assignment */)) {
@@ -49006,7 +49182,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return [symbol];
}
const result2 = forEachEntry(symbols, (symbolFromSymbolTable) => {
- if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 284 /* ExportSpecifier */))) {
+ if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 287 /* ExportSpecifier */))) {
const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
const candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification);
if (candidate) {
@@ -49042,7 +49218,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (symbolFromSymbolTable === symbol) {
return true;
}
- const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 284 /* ExportSpecifier */);
+ const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 287 /* ExportSpecifier */);
symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
const flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
if (flags & meaning) {
@@ -49057,10 +49233,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (symbol.declarations && symbol.declarations.length) {
for (const declaration of symbol.declarations) {
switch (declaration.kind) {
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
continue;
default:
return false;
@@ -49159,10 +49335,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return node && getSymbolOfNode(node);
}
function hasExternalModuleSymbol(declaration) {
- return isAmbientModule(declaration) || declaration.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
+ return isAmbientModule(declaration) || declaration.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
}
function hasNonGlobalAugmentationExternalModuleSymbol(declaration) {
- return isModuleWithStringLiteralName(declaration) || declaration.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
+ return isModuleWithStringLiteralName(declaration) || declaration.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
}
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
let aliasesToMakeVisible;
@@ -49208,9 +49384,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
let meaning;
- if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 234 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 166 /* ComputedPropertyName */) {
+ if (entityName.parent.kind === 188 /* TypeQuery */ || entityName.parent.kind === 236 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
- } else if (entityName.kind === 165 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 274 /* ImportEqualsDeclaration */) {
+ } else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 213 /* PropertyAccessExpression */ || entityName.parent.kind === 277 /* ImportEqualsDeclaration */) {
meaning = 1920 /* Namespace */;
} else {
meaning = 788968 /* Type */;
@@ -49250,7 +49426,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
function symbolToStringWorker(writer2) {
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
- const printer3 = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 314 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
+ const printer3 = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 317 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
printer3.writeNode(4 /* Unspecified */, entity, sourceFile, writer2);
return writer2;
@@ -49261,9 +49437,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function signatureToStringWorker(writer2) {
let sigOutput;
if (flags & 262144 /* WriteArrowStyleSignature */) {
- sigOutput = kind === 1 /* Construct */ ? 185 /* ConstructorType */ : 184 /* FunctionType */;
+ sigOutput = kind === 1 /* Construct */ ? 187 /* ConstructorType */ : 186 /* FunctionType */;
} else {
- sigOutput = kind === 1 /* Construct */ ? 180 /* ConstructSignature */ : 179 /* CallSignature */;
+ sigOutput = kind === 1 /* Construct */ ? 182 /* ConstructSignature */ : 181 /* CallSignature */;
}
const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
const printer3 = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
@@ -49757,7 +49933,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function shouldWriteTypeOfFunctionSymbol() {
var _a3;
const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && some(symbol.declarations, (declaration) => isStatic(declaration));
- const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || forEach(symbol.declarations, (declaration) => declaration.parent.kind === 314 /* SourceFile */ || declaration.parent.kind === 271 /* ModuleBlock */));
+ const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || forEach(symbol.declarations, (declaration) => declaration.parent.kind === 317 /* SourceFile */ || declaration.parent.kind === 274 /* ModuleBlock */));
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a3 = context.visitedTypes) == null ? void 0 : _a3.has(typeId))) && (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
}
@@ -49836,12 +50012,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
const signature = resolved.callSignatures[0];
- const signatureNode = signatureToSignatureDeclarationHelper(signature, 184 /* FunctionType */, context);
+ const signatureNode = signatureToSignatureDeclarationHelper(signature, 186 /* FunctionType */, context);
return signatureNode;
}
if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {
const signature = resolved.constructSignatures[0];
- const signatureNode = signatureToSignatureDeclarationHelper(signature, 185 /* ConstructorType */, context);
+ const signatureNode = signatureToSignatureDeclarationHelper(signature, 187 /* ConstructorType */, context);
return signatureNode;
}
}
@@ -50009,12 +50185,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const typeElements = [];
for (const signature of resolvedType.callSignatures) {
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 179 /* CallSignature */, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 181 /* CallSignature */, context));
}
for (const signature of resolvedType.constructSignatures) {
if (signature.flags & 4 /* Abstract */)
continue;
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 182 /* ConstructSignature */, context));
}
for (const info of resolvedType.indexInfos) {
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
@@ -50086,7 +50262,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {
const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */);
for (const signature of signatures) {
- const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 173 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
+ const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 175 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
typeElements.push(preserveCommentsOn(methodDeclaration));
}
} else {
@@ -50117,8 +50293,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function preserveCommentsOn(node) {
var _a3;
- if (some(propertySymbol.declarations, (d) => d.kind === 356 /* JSDocPropertyTag */)) {
- const d = (_a3 = propertySymbol.declarations) == null ? void 0 : _a3.find((d2) => d2.kind === 356 /* JSDocPropertyTag */);
+ if (some(propertySymbol.declarations, (d) => d.kind === 359 /* JSDocPropertyTag */)) {
+ const d = (_a3 = propertySymbol.declarations) == null ? void 0 : _a3.find((d2) => d2.kind === 359 /* JSDocPropertyTag */);
const commentText = getTextOfJSDocComment(d.comment);
if (commentText) {
setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
@@ -50221,7 +50397,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
typeParameters = signature.typeParameters && signature.typeParameters.map((parameter) => typeParameterToDeclaration(parameter, context));
}
const expandedParams = getExpandedParameters(signature, true)[0];
- const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
+ const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 178 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
if (thisParameter) {
parameters.unshift(thisParameter);
@@ -50242,11 +50418,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
let modifiers = options == null ? void 0 : options.modifiers;
- if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
+ if (kind === 187 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
const flags = modifiersToFlags(modifiers);
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
}
- const node = kind === 179 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 180 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 173 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 176 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0) : kind === 177 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 178 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 181 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 326 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 184 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 185 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 263 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 218 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 219 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
+ const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
if (typeArguments) {
node.typeArguments = factory.createNodeArray(typeArguments);
}
@@ -50284,9 +50460,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return typeParameterToDeclarationWithConstraint(type, context, constraintNode);
}
function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) {
- let parameterDeclaration = getDeclarationOfKind(parameterSymbol, 168 /* Parameter */);
+ let parameterDeclaration = getDeclarationOfKind(parameterSymbol, 169 /* Parameter */);
if (!parameterDeclaration && !isTransientSymbol(parameterSymbol)) {
- parameterDeclaration = getDeclarationOfKind(parameterSymbol, 349 /* JSDocParameterTag */);
+ parameterDeclaration = getDeclarationOfKind(parameterSymbol, 352 /* JSDocParameterTag */);
}
let parameterType = getTypeOfSymbol(parameterSymbol);
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
@@ -50296,7 +50472,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && preserveModifierFlags && parameterDeclaration && canHaveModifiers(parameterDeclaration) ? map(getModifiers(parameterDeclaration), factory.cloneNode) : void 0;
const isRest = parameterDeclaration && isRestParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 32768 /* RestParameter */;
const dotDotDotToken = isRest ? factory.createToken(25 /* DotDotDotToken */) : void 0;
- const name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 79 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 165 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol);
+ const name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 79 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 166 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol);
const isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 16384 /* OptionalParameter */;
const questionToken = isOptional ? factory.createToken(57 /* QuestionToken */) : void 0;
const parameterNode = factory.createParameterDeclaration(
@@ -50444,11 +50620,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getSpecifierForModuleSymbol(symbol, context, overrideImportMode) {
var _a2;
- let file = getDeclarationOfKind(symbol, 314 /* SourceFile */);
+ let file = getDeclarationOfKind(symbol, 317 /* SourceFile */);
if (!file) {
const equivalentFileSymbol = firstDefined(symbol.declarations, (d) => getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol));
if (equivalentFileSymbol) {
- file = getDeclarationOfKind(equivalentFileSymbol, 314 /* SourceFile */);
+ file = getDeclarationOfKind(equivalentFileSymbol, 317 /* SourceFile */);
}
}
if (file && file.moduleName !== void 0) {
@@ -50888,7 +51064,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return transformed === existing ? setTextRange(factory.cloneNode(existing), existing) : transformed;
function visitExistingNodeTreeSymbols(node) {
- if (isJSDocAllType(node) || node.kind === 328 /* JSDocNamepathType */) {
+ if (isJSDocAllType(node) || node.kind === 331 /* JSDocNamepathType */) {
return factory.createKeywordTypeNode(132 /* AnyKeyword */);
}
if (isJSDocUnknownType(node)) {
@@ -51028,8 +51204,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function symbolTableToDeclarationStatements(symbolTable, context, bundled) {
- const serializePropertySymbolForClass = makeSerializePropertySymbol(factory.createPropertyDeclaration, 174 /* MethodDeclaration */, true);
- const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol((mods, name, question, type) => factory.createPropertySignature(mods, name, question, type), 173 /* MethodSignature */, false);
+ const serializePropertySymbolForClass = makeSerializePropertySymbol(factory.createPropertyDeclaration, 176 /* MethodDeclaration */, true);
+ const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol((mods, name, question, type) => factory.createPropertySignature(mods, name, question, type), 175 /* MethodSignature */, false);
const enclosingDeclaration = context.enclosingDeclaration;
let results = [];
const visitedSymbols = new Set2();
@@ -51403,8 +51579,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const baseTypes = getBaseTypes(interfaceType);
const baseType = length(baseTypes) ? getIntersectionType(baseTypes) : void 0;
const members = flatMap(getPropertiesOfType(interfaceType), (p) => serializePropertySymbolForInterface(p, baseType));
- const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 179 /* CallSignature */);
- const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 180 /* ConstructSignature */);
+ const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 181 /* CallSignature */);
+ const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 182 /* ConstructSignature */);
const indexSignatures = serializeIndexSignatures(interfaceType, baseType);
const heritageClauses = !length(baseTypes) ? void 0 : [factory.createHeritageClause(95 /* ExtendsKeyword */, mapDefined(baseTypes, (b) => trySerializeAsTypeReference(b, 111551 /* Value */)))];
addResult(factory.createInterfaceDeclaration(
@@ -51472,7 +51648,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags) {
const signatures = getSignaturesOfType(type, 0 /* Call */);
for (const sig of signatures) {
- const decl = signatureToSignatureDeclarationHelper(sig, 263 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled });
+ const decl = signatureToSignatureDeclarationHelper(sig, 265 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled });
addResult(setTextRange(decl, getSignatureTextRangeLocation(sig)), modifierFlags);
}
if (!(symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && !!symbol.exports && !!symbol.exports.size)) {
@@ -51607,7 +51783,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
(p) => serializePropertySymbolForClass(p, true, staticBaseType)
);
const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */));
- const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 176 /* Constructor */);
+ const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 178 /* Constructor */);
const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]);
context.enclosingDeclaration = oldEnclosing;
addResult(setTextRange(factory.createClassDeclaration(
@@ -51654,8 +51830,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const targetName = getInternalSymbolName(target, verbatimTargetName);
includePrivateSymbol(target);
switch (node.kind) {
- case 208 /* BindingElement */:
- if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 261 /* VariableDeclaration */) {
+ case 210 /* BindingElement */:
+ if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 263 /* VariableDeclaration */) {
const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context);
const { propertyName } = node;
addResult(factory.createImportDeclaration(
@@ -51671,15 +51847,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
Debug.failBadSyntaxKind(((_c = node.parent) == null ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization");
- case 306 /* ShorthandPropertyAssignment */:
- if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 227 /* BinaryExpression */) {
+ case 309 /* ShorthandPropertyAssignment */:
+ if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 229 /* BinaryExpression */) {
serializeExportSpecifier(
unescapeLeadingUnderscores(symbol.escapedName),
targetName
);
}
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
if (isPropertyAccessExpression(node.initializer)) {
const initializer = node.initializer;
const uniqueName = factory.createUniqueName(localName);
@@ -51698,7 +51874,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
), modifierFlags);
break;
}
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, isJsonSourceFile)) {
serializeMaybeAliasAssignment(symbol);
break;
@@ -51711,10 +51887,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
isLocalImport ? symbolToName(target, context, 67108863 /* All */, false) : factory.createExternalModuleReference(factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))
), isLocalImport ? modifierFlags : 0 /* None */);
break;
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
addResult(factory.createNamespaceExportDeclaration(idText(node.name)), 0 /* None */);
break;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
addResult(factory.createImportDeclaration(
void 0,
factory.createImportClause(false, factory.createIdentifier(localName), void 0),
@@ -51722,7 +51898,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void 0
), 0 /* None */);
break;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
addResult(factory.createImportDeclaration(
void 0,
factory.createImportClause(false, void 0, factory.createNamespaceImport(factory.createIdentifier(localName))),
@@ -51730,7 +51906,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void 0
), 0 /* None */);
break;
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
addResult(factory.createExportDeclaration(
void 0,
false,
@@ -51738,7 +51914,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))
), 0 /* None */);
break;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
addResult(factory.createImportDeclaration(
void 0,
factory.createImportClause(
@@ -51756,7 +51932,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void 0
), 0 /* None */);
break;
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
const specifier = node.parent.parent.moduleSpecifier;
serializeExportSpecifier(
unescapeLeadingUnderscores(symbol.escapedName),
@@ -51764,12 +51940,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
specifier && isStringLiteralLike(specifier) ? factory.createStringLiteral(specifier.text) : void 0
);
break;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
serializeMaybeAliasAssignment(symbol);
break;
- case 227 /* BinaryExpression */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 229 /* BinaryExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (symbol.escapedName === "default" /* Default */ || symbol.escapedName === "export=" /* ExportEquals */) {
serializeMaybeAliasAssignment(symbol);
} else {
@@ -52145,17 +52321,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeAliasForTypeLiteral(type) {
if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */ && type.symbol.declarations) {
const node = walkUpParenthesizedTypes(type.symbol.declarations[0].parent);
- if (node.kind === 268 /* TypeAliasDeclaration */) {
+ if (node.kind === 271 /* TypeAliasDeclaration */) {
return getSymbolOfNode(node);
}
}
return void 0;
}
function isTopLevelInExternalModuleAugmentation(node) {
- return node && node.parent && node.parent.kind === 271 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent);
+ return node && node.parent && node.parent.kind === 274 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent);
}
function isDefaultBindingContext(location) {
- return location.kind === 314 /* SourceFile */ || isAmbientModule(location);
+ return location.kind === 317 /* SourceFile */ || isAmbientModule(location);
}
function getNameOfSymbolFromNameType(symbol, context) {
const nameType = getSymbolLinks(symbol).nameType;
@@ -52200,17 +52376,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!declaration) {
declaration = symbol.declarations[0];
}
- if (declaration.parent && declaration.parent.kind === 261 /* VariableDeclaration */) {
+ if (declaration.parent && declaration.parent.kind === 263 /* VariableDeclaration */) {
return declarationNameToString(declaration.parent.name);
}
switch (declaration.kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) {
context.encounteredError = true;
}
- return declaration.kind === 232 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)";
+ return declaration.kind === 234 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)";
}
}
const name = getNameOfSymbolFromNameType(symbol, context);
@@ -52227,68 +52403,68 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
function determineIfDeclarationIsVisible() {
switch (node.kind) {
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
- case 348 /* JSDocEnumTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 351 /* JSDocEnumTag */:
return !!(node.parent && node.parent.parent && node.parent.parent.parent && isSourceFile(node.parent.parent.parent));
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return isDeclarationVisible(node.parent.parent);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
if (isBindingPattern(node.name) && !node.name.elements.length) {
return false;
}
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 269 /* EnumDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 268 /* AnnotationDeclaration */:
if (isExternalModuleAugmentation(node)) {
return true;
}
const parent2 = getDeclarationContainer(node);
- if (!(getCombinedModifierFlags(node) & 1 /* Export */) && !(node.kind !== 274 /* ImportEqualsDeclaration */ && parent2.kind !== 314 /* SourceFile */ && parent2.flags & 16777216 /* Ambient */)) {
+ if (!(getCombinedModifierFlags(node) & 1 /* Export */) && !(node.kind !== 277 /* ImportEqualsDeclaration */ && parent2.kind !== 317 /* SourceFile */ && parent2.flags & 16777216 /* Ambient */)) {
return isGlobalSourceFile(parent2);
}
return isDeclarationVisible(parent2);
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (hasEffectiveModifier(node, 8 /* Private */ | 16 /* Protected */)) {
return false;
}
- case 176 /* Constructor */:
- case 180 /* ConstructSignature */:
- case 179 /* CallSignature */:
- case 181 /* IndexSignature */:
- case 168 /* Parameter */:
- case 271 /* ModuleBlock */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 187 /* TypeLiteral */:
- case 183 /* TypeReference */:
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 196 /* ParenthesizedType */:
- case 202 /* NamedTupleMember */:
+ case 178 /* Constructor */:
+ case 182 /* ConstructSignature */:
+ case 181 /* CallSignature */:
+ case 183 /* IndexSignature */:
+ case 169 /* Parameter */:
+ case 274 /* ModuleBlock */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 189 /* TypeLiteral */:
+ case 185 /* TypeReference */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 198 /* ParenthesizedType */:
+ case 204 /* NamedTupleMember */:
return isDeclarationVisible(node.parent);
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
return false;
- case 167 /* TypeParameter */:
- case 314 /* SourceFile */:
- case 273 /* NamespaceExportDeclaration */:
+ case 168 /* TypeParameter */:
+ case 317 /* SourceFile */:
+ case 276 /* NamespaceExportDeclaration */:
return true;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return false;
default:
return false;
@@ -52297,9 +52473,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function collectLinkedAliases(node, setVisibility) {
let exportSymbol;
- if (node.parent && node.parent.kind === 280 /* ExportAssignment */) {
+ if (node.parent && node.parent.kind === 283 /* ExportAssignment */) {
exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, void 0, node, false);
- } else if (node.parent.kind === 284 /* ExportSpecifier */) {
+ } else if (node.parent.kind === 287 /* ExportSpecifier */) {
exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */);
}
let result;
@@ -52394,12 +52570,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getDeclarationContainer(node) {
return findAncestor(getRootDeclaration(node), (node2) => {
switch (node2.kind) {
- case 261 /* VariableDeclaration */:
- case 262 /* VariableDeclarationList */:
- case 279 /* ImportSpecifier */:
- case 278 /* NamedImports */:
- case 277 /* NamespaceImport */:
- case 276 /* ImportClause */:
+ case 263 /* VariableDeclaration */:
+ case 264 /* VariableDeclarationList */:
+ case 282 /* ImportSpecifier */:
+ case 281 /* NamedImports */:
+ case 280 /* NamespaceImport */:
+ case 279 /* ImportClause */:
return false;
default:
return true;
@@ -52503,23 +52679,23 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getParentElementAccess(node) {
const ancestor = node.parent.parent;
switch (ancestor.kind) {
- case 208 /* BindingElement */:
- case 305 /* PropertyAssignment */:
+ case 210 /* BindingElement */:
+ case 308 /* PropertyAssignment */:
return getSyntheticElementAccess(ancestor);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return getSyntheticElementAccess(node.parent);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return ancestor.initializer;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return ancestor.right;
}
}
function getDestructuringPropertyName(node) {
const parent2 = node.parent;
- if (node.kind === 208 /* BindingElement */ && parent2.kind === 206 /* ObjectBindingPattern */) {
+ if (node.kind === 210 /* BindingElement */ && parent2.kind === 208 /* ObjectBindingPattern */) {
return getLiteralPropertyNameText(node.propertyName || node.name);
}
- if (node.kind === 305 /* PropertyAssignment */ || node.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.kind === 308 /* PropertyAssignment */ || node.kind === 309 /* ShorthandPropertyAssignment */) {
return getLiteralPropertyNameText(node.name);
}
return "" + parent2.elements.indexOf(node);
@@ -52544,7 +52720,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */);
}
let type;
- if (pattern.kind === 206 /* ObjectBindingPattern */) {
+ if (pattern.kind === 208 /* ObjectBindingPattern */) {
if (declaration.dotDotDotToken) {
parentType = getReducedType(parentType);
if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) {
@@ -52599,17 +52775,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isEmptyArrayLiteral2(node) {
const expr = skipParentheses(node, true);
- return expr.kind === 209 /* ArrayLiteralExpression */ && expr.elements.length === 0;
+ return expr.kind === 211 /* ArrayLiteralExpression */ && expr.elements.length === 0;
}
function addOptionality(type, isProperty = false, isOptional = true) {
return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type;
}
function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) {
- if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250 /* ForInStatement */) {
+ if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 252 /* ForInStatement */) {
const indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression, checkMode)));
return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType;
}
- if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) {
+ if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 253 /* ForOfStatement */) {
const forOfStatement = declaration.parent.parent;
return checkRightHandSideOfForOf(forOfStatement) || anyType;
}
@@ -52632,8 +52808,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (isParameter(declaration)) {
const func = declaration.parent;
- if (func.kind === 178 /* SetAccessor */ && hasBindableName(func)) {
- const getter = getDeclarationOfKind(getSymbolOfNode(declaration.parent), 177 /* GetAccessor */);
+ if (func.kind === 180 /* SetAccessor */ && hasBindableName(func)) {
+ const getter = getDeclarationOfKind(getSymbolOfNode(declaration.parent), 179 /* GetAccessor */);
if (getter) {
const getterSignature = getSignatureFromDeclaration(getter);
const thisParameter = getAccessorThisParameter(func);
@@ -52686,7 +52862,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const links = getSymbolLinks(symbol);
if (links.isConstructorDeclaredProperty === void 0) {
links.isConstructorDeclaredProperty = false;
- links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 212 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(void 0, declaration, symbol, declaration));
+ links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 214 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(void 0, declaration, symbol, declaration));
}
return links.isConstructorDeclaredProperty;
}
@@ -52702,7 +52878,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
for (const declaration of symbol.declarations) {
const container = getThisContainer(declaration, false);
- if (container && (container.kind === 176 /* Constructor */ || isJSConstructor(container))) {
+ if (container && (container.kind === 178 /* Constructor */ || isJSConstructor(container))) {
return container;
}
}
@@ -52964,7 +53140,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isDeclarationInConstructor(expression) {
const thisContainer = getThisContainer(expression, false);
- return thisContainer.kind === 176 /* Constructor */ || thisContainer.kind === 263 /* FunctionDeclaration */ || thisContainer.kind === 218 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent);
+ return thisContainer.kind === 178 /* Constructor */ || thisContainer.kind === 265 /* FunctionDeclaration */ || thisContainer.kind === 220 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent);
}
function getConstructorDefinedThisAssignmentTypes(types, declarations) {
Debug.assert(types.length === declarations.length);
@@ -53020,7 +53196,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2) {
const elements = pattern.elements;
const lastElement = lastOrUndefined(elements);
- const restElement = lastElement && lastElement.kind === 208 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0;
+ const restElement = lastElement && lastElement.kind === 210 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0;
if (elements.length === 0 || elements.length === 1 && restElement) {
return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType;
}
@@ -53036,7 +53212,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
}
function getTypeFromBindingPattern(pattern, includePatternInType = false, reportErrors2 = false) {
- return pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2);
+ return pattern.kind === 208 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2);
}
function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors2) {
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, true, 0 /* Normal */), declaration, reportErrors2);
@@ -53069,7 +53245,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function declarationBelongsToPrivateAmbientMember(declaration) {
const root = getRootDeclaration(declaration);
- const memberDeclaration = root.kind === 168 /* Parameter */ ? root.parent : root;
+ const memberDeclaration = root.kind === 169 /* Parameter */ ? root.parent : root;
return isPrivateWithinAmbient(memberDeclaration);
}
function tryGetTypeFromEffectiveTypeNode(node) {
@@ -53137,7 +53313,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return reportCircularityError(symbol);
}
let type;
- if (declaration.kind === 280 /* ExportAssignment */) {
+ if (declaration.kind === 283 /* ExportAssignment */) {
type = widenTypeForVariableLikeDeclaration(tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionCached(declaration.expression), declaration);
} else if (isBinaryExpression(declaration) || isInJSFile(declaration) && (isCallExpression(declaration) || (isPropertyAccessExpression(declaration) || isBindableStaticElementAccessExpression(declaration)) && isBinaryExpression(declaration.parent))) {
type = getWidenedTypeForAssignmentDeclaration(symbol);
@@ -53154,7 +53330,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, 0 /* Normal */);
} else if (isObjectLiteralMethod(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, 0 /* Normal */);
- } else if (isParameter(declaration) || isPropertyDeclaration(declaration) || isPropertySignature(declaration) || isAnnotationPropertyDeclaration(declaration) || isVariableDeclaration(declaration) || isBindingElement(declaration) || isJSDocPropertyLikeTag(declaration)) {
+ } else if (isParameter(declaration) || isPropertyDeclaration(declaration) || isPropertySignature(declaration) || isAnnotationPropertyDeclaration(declaration) || isVariableDeclaration(declaration) || isBindingElement(declaration) || isOverloadPropertyDeclaration(declaration) || isJSDocPropertyLikeTag(declaration)) {
type = getWidenedTypeForVariableLikeDeclaration(declaration, true);
} else if (isEnumDeclaration(declaration)) {
type = getTypeOfFuncClassEnumModule(symbol);
@@ -53174,13 +53350,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getAnnotatedAccessorTypeNode(accessor) {
if (accessor) {
switch (accessor.kind) {
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
const getterTypeAnnotation = getEffectiveReturnTypeNode(accessor);
return getterTypeAnnotation;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
const setterTypeAnnotation = getEffectiveSetAccessorTypeAnnotationNode(accessor);
return setterTypeAnnotation;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
Debug.assert(hasAccessorModifier(accessor));
const accessorTypeAnnotation = getEffectiveTypeAnnotationNode(accessor);
return accessorTypeAnnotation;
@@ -53205,9 +53381,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!pushTypeResolution(symbol, 0 /* Type */)) {
return errorType;
}
- const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */);
- const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */);
- const accessor = tryCast(getDeclarationOfKind(symbol, 171 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
+ const getter = getDeclarationOfKind(symbol, 179 /* GetAccessor */);
+ const setter = getDeclarationOfKind(symbol, 180 /* SetAccessor */);
+ const accessor = tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && accessor.initializer && getWidenedTypeForVariableLikeDeclaration(accessor, true);
if (!type) {
if (setter && !isPrivateWithinAmbient(setter)) {
@@ -53242,7 +53418,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!pushTypeResolution(symbol, 8 /* WriteType */)) {
return errorType;
}
- const setter = (_a2 = getDeclarationOfKind(symbol, 178 /* SetAccessor */)) != null ? _a2 : tryCast(getDeclarationOfKind(symbol, 171 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
+ const setter = (_a2 = getDeclarationOfKind(symbol, 180 /* SetAccessor */)) != null ? _a2 : tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
let writeType = getAnnotatedAccessorType(setter);
if (!popTypeResolution()) {
if (getAnnotatedAccessorTypeNode(setter)) {
@@ -53277,7 +53453,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const declaration = symbol.valueDeclaration;
if (symbol.flags & 1536 /* Module */ && isShorthandAmbientModuleSymbol(symbol)) {
return anyType;
- } else if (declaration && (declaration.kind === 227 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 227 /* BinaryExpression */)) {
+ } else if (declaration && (declaration.kind === 229 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 229 /* BinaryExpression */)) {
return getWidenedTypeForAssignmentDeclaration(symbol);
} else if (symbol.flags & 512 /* ValueModule */ && declaration && isSourceFile(declaration) && declaration.commonJsModuleIndicator) {
const resolvedModule = resolveExternalModuleSymbol(symbol);
@@ -53333,7 +53509,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
);
return errorType;
}
- if (noImplicitAny && (declaration.kind !== 168 /* Parameter */ || declaration.initializer)) {
+ if (noImplicitAny && (declaration.kind !== 169 /* Parameter */ || declaration.initializer)) {
error(
symbol.valueDeclaration,
Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,
@@ -53444,43 +53620,43 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 326 /* JSDocFunctionType */:
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 268 /* TypeAliasDeclaration */:
- case 353 /* JSDocTemplateTag */:
- case 354 /* JSDocTypedefTag */:
- case 348 /* JSDocEnumTag */:
- case 347 /* JSDocCallbackTag */:
- case 200 /* MappedType */:
- case 194 /* ConditionalType */: {
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 329 /* JSDocFunctionType */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 271 /* TypeAliasDeclaration */:
+ case 356 /* JSDocTemplateTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 351 /* JSDocEnumTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 202 /* MappedType */:
+ case 196 /* ConditionalType */: {
const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
- if (node.kind === 200 /* MappedType */) {
+ if (node.kind === 202 /* MappedType */) {
return append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)));
- } else if (node.kind === 194 /* ConditionalType */) {
+ } else if (node.kind === 196 /* ConditionalType */) {
return concatenate(outerTypeParameters, getInferTypeParameters(node));
}
const outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, getEffectiveTypeParameterDeclarations(node));
- const thisType = includeThisTypes && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || node.kind === 267 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
+ const thisType = includeThisTypes && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 270 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
return thisType ? append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters;
}
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
const paramSymbol = getParameterSymbolFromJSDoc(node);
if (paramSymbol) {
node = paramSymbol.valueDeclaration;
}
break;
- case 329 /* JSDoc */: {
+ case 332 /* JSDoc */: {
const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
return node.tags ? appendTypeParameters(outerTypeParameters, flatMap(node.tags, (t) => isJSDocTemplateTag(t) ? t.typeParameters : void 0)) : outerTypeParameters;
}
@@ -53488,7 +53664,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getOuterTypeParametersOfClassOrInterface(symbol) {
- const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 267 /* InterfaceDeclaration */);
+ const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 270 /* InterfaceDeclaration */);
Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
return getOuterTypeParameters(declaration);
}
@@ -53498,7 +53674,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let result;
for (const node of symbol.declarations) {
- if (node.kind === 267 /* InterfaceDeclaration */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) {
+ if (node.kind === 270 /* InterfaceDeclaration */ || node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) {
const declaration = node;
result = appendTypeParameters(result, getEffectiveTypeParameterDeclarations(declaration));
}
@@ -53631,7 +53807,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (!popTypeResolution() && type.symbol.declarations) {
for (const declaration of type.symbol.declarations) {
- if (declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 267 /* InterfaceDeclaration */) {
+ if (declaration.kind === 266 /* ClassDeclaration */ || declaration.kind === 270 /* InterfaceDeclaration */) {
reportCircularBaseType(declaration, type);
}
}
@@ -53714,7 +53890,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray;
if (type.symbol.declarations) {
for (const declaration of type.symbol.declarations) {
- if (declaration.kind === 267 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) {
+ if (declaration.kind === 270 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) {
for (const node of getInterfaceBaseTypeNodes(declaration)) {
const baseType = getReducedType(getTypeFromTypeNode(node));
if (!isErrorType(baseType)) {
@@ -53742,7 +53918,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
for (const declaration of symbol.declarations) {
- if (declaration.kind === 267 /* InterfaceDeclaration */) {
+ if (declaration.kind === 270 /* InterfaceDeclaration */) {
if (declaration.flags & 128 /* ContainsThis */) {
return false;
}
@@ -53808,7 +53984,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
} else {
type = errorType;
- if (declaration.kind === 348 /* JSDocEnumTag */) {
+ if (declaration.kind === 351 /* JSDocEnumTag */) {
error(declaration.typeExpression.type, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
} else {
error(isNamedDeclaration(declaration) ? declaration.name || declaration : declaration, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
@@ -53821,7 +53997,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isStringConcatExpression(expr) {
if (isStringLiteralLike(expr)) {
return true;
- } else if (expr.kind === 227 /* BinaryExpression */) {
+ } else if (expr.kind === 229 /* BinaryExpression */) {
return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right);
}
return false;
@@ -53836,11 +54012,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return true;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */;
case 79 /* Identifier */:
return nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isStringConcatExpression(expr);
default:
return false;
@@ -53854,7 +54030,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let hasNonLiteralMember = false;
if (symbol.declarations) {
for (const declaration of symbol.declarations) {
- if (declaration.kind === 269 /* EnumDeclaration */) {
+ if (declaration.kind === 272 /* EnumDeclaration */) {
for (const member of declaration.members) {
if (member.initializer && isStringLiteralLike(member.initializer)) {
return links.enumKind = 1 /* Literal */;
@@ -53881,7 +54057,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const memberTypeList = [];
if (symbol.declarations) {
for (const declaration of symbol.declarations) {
- if (declaration.kind === 269 /* EnumDeclaration */) {
+ if (declaration.kind === 272 /* EnumDeclaration */) {
for (const member of declaration.members) {
const value = getEnumMemberValue(member);
const memberType = getFreshTypeOfLiteralType(getEnumLiteralType(value !== void 0 ? value : 0, enumCount, getSymbolOfNode(member)));
@@ -53959,11 +54135,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 115 /* VoidKeyword */:
case 157 /* UndefinedKeyword */:
case 145 /* NeverKeyword */:
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return true;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return isThislessType(node.elementType);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return !node.typeArguments || node.typeArguments.every(isThislessType);
}
return false;
@@ -53979,21 +54155,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isThislessFunctionLikeDeclaration(node) {
const returnType = getEffectiveReturnTypeNode(node);
const typeParameters = getEffectiveTypeParameterDeclarations(node);
- return (node.kind === 176 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter);
+ return (node.kind === 178 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter);
}
function isThisless(symbol) {
if (symbol.declarations && symbol.declarations.length === 1) {
const declaration = symbol.declarations[0];
if (declaration) {
switch (declaration.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return isThislessVariableLikeDeclaration(declaration);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return isThislessFunctionLikeDeclaration(declaration);
}
}
@@ -54858,7 +55034,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isMappedTypeWithKeyofConstraintDeclaration(type) {
const constraintDeclaration = getConstraintDeclarationForMappedType(type);
- return constraintDeclaration.kind === 198 /* TypeOperator */ && constraintDeclaration.operator === 142 /* KeyOfKeyword */;
+ return constraintDeclaration.kind === 200 /* TypeOperator */ && constraintDeclaration.operator === 142 /* KeyOfKeyword */;
}
function getModifiersTypeFromMappedType(type) {
if (!type.modifiersType) {
@@ -55585,7 +55761,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
}
function isJSDocOptionalParameter(node) {
- return isInJSFile(node) && (node.type && node.type.kind === 325 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 325 /* JSDocOptionalType */));
+ return isInJSFile(node) && (node.type && node.type.kind === 328 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 328 /* JSDocOptionalType */));
}
function tryFindAmbientModule(moduleName, withAugmentations) {
if (isExternalModuleNameRelative(moduleName)) {
@@ -55618,7 +55794,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
const { isBracketed, typeExpression } = node;
- return isBracketed || !!typeExpression && typeExpression.type.kind === 325 /* JSDocOptionalType */;
+ return isBracketed || !!typeExpression && typeExpression.type.kind === 328 /* JSDocOptionalType */;
}
function createTypePredicate(kind, parameterName, parameterIndex, type) {
return { kind, parameterName, parameterIndex, type };
@@ -55686,7 +55862,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
parameters.push(paramSymbol);
}
- if (type && type.kind === 201 /* LiteralType */) {
+ if (type && type.kind === 203 /* LiteralType */) {
flags |= 2 /* HasLiteralTypes */;
}
const isOptionalParameter2 = isOptionalJSDocPropertyLikeTag(param) || param.initializer || param.questionToken || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type || isJSDocOptionalParameter(param);
@@ -55694,14 +55870,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
minArgumentCount = parameters.length;
}
}
- if ((declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) {
- const otherKind = declaration.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */;
+ if ((declaration.kind === 179 /* GetAccessor */ || declaration.kind === 180 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) {
+ const otherKind = declaration.kind === 179 /* GetAccessor */ ? 180 /* SetAccessor */ : 179 /* GetAccessor */;
const other = getDeclarationOfKind(getSymbolOfNode(declaration), otherKind);
if (other) {
thisParameter = getAnnotatedAccessorThisParameter(other);
}
}
- const classType = declaration.kind === 176 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
+ const classType = declaration.kind === 178 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
flags |= 1 /* HasRestParameter */;
@@ -55777,15 +55953,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
return node.escapedText === argumentsSymbol.escapedName && getReferencedValueSymbol(node) === argumentsSymbol;
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- return node.name.kind === 166 /* ComputedPropertyName */ && traverse(node.name);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ return node.name.kind === 167 /* ComputedPropertyName */ && traverse(node.name);
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return traverse(node.expression);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return traverse(node.initializer);
default:
return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && !!forEachChild(node, traverse);
@@ -55852,7 +56028,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function createTypePredicateFromTypePredicateNode(node, signature) {
const parameterName = node.parameterName;
const type = node.type && getTypeFromTypeNode(node.type);
- return parameterName.kind === 197 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, void 0, void 0, type) : createTypePredicate(
+ return parameterName.kind === 199 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, void 0, void 0, type) : createTypePredicate(
node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */,
parameterName.escapedText,
findIndex(signature.parameters, (p) => p.escapedName === parameterName.escapedText),
@@ -55895,7 +56071,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return signature.resolvedReturnType;
}
function getReturnTypeFromAnnotation(declaration) {
- if (declaration.kind === 176 /* Constructor */) {
+ if (declaration.kind === 178 /* Constructor */) {
return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol));
}
if (isJSDocConstructSignature(declaration)) {
@@ -55905,12 +56081,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (typeNode) {
return getTypeFromTypeNode(typeNode);
}
- if (declaration.kind === 177 /* GetAccessor */ && hasBindableName(declaration)) {
+ if (declaration.kind === 179 /* GetAccessor */ && hasBindableName(declaration)) {
const jsDocType = isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration);
if (jsDocType) {
return jsDocType;
}
- const setter = getDeclarationOfKind(getSymbolOfNode(declaration), 178 /* SetAccessor */);
+ const setter = getDeclarationOfKind(getSymbolOfNode(declaration), 180 /* SetAccessor */);
const setterType = getAnnotatedAccessorType(setter);
if (setterType) {
return setterType;
@@ -55998,7 +56174,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
var _a2;
if (!signature.isolatedSignatureType) {
const kind = (_a2 = signature.declaration) == null ? void 0 : _a2.kind;
- const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
+ const isConstructor = kind === void 0 || kind === 178 /* Constructor */ || kind === 182 /* ConstructSignature */ || kind === 187 /* ConstructorType */;
const type = createObjectType(16 /* Anonymous */);
type.members = emptySymbols;
type.properties = emptyArray;
@@ -56057,9 +56233,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let inferences;
if ((_a2 = typeParameter.symbol) == null ? void 0 : _a2.declarations) {
for (const declaration of typeParameter.symbol.declarations) {
- if (declaration.parent.kind === 195 /* InferType */) {
+ if (declaration.parent.kind === 197 /* InferType */) {
const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent);
- if (grandParent.kind === 183 /* TypeReference */ && !omitTypeReferences) {
+ if (grandParent.kind === 185 /* TypeReference */ && !omitTypeReferences) {
const typeReference = grandParent;
const typeParameters = getTypeParametersForTypeReference(typeReference);
if (typeParameters) {
@@ -56077,13 +56253,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- } else if (grandParent.kind === 168 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 191 /* RestType */ || grandParent.kind === 202 /* NamedTupleMember */ && grandParent.dotDotDotToken) {
+ } else if (grandParent.kind === 169 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 193 /* RestType */ || grandParent.kind === 204 /* NamedTupleMember */ && grandParent.dotDotDotToken) {
inferences = append(inferences, createArrayType(unknownType));
- } else if (grandParent.kind === 204 /* TemplateLiteralTypeSpan */) {
+ } else if (grandParent.kind === 206 /* TemplateLiteralTypeSpan */) {
inferences = append(inferences, stringType);
- } else if (grandParent.kind === 167 /* TypeParameter */ && grandParent.parent.kind === 200 /* MappedType */) {
+ } else if (grandParent.kind === 168 /* TypeParameter */ && grandParent.parent.kind === 202 /* MappedType */) {
inferences = append(inferences, keyofConstraintType);
- } else if (grandParent.kind === 200 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 194 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 200 /* MappedType */ && grandParent.parent.checkType.type) {
+ } else if (grandParent.kind === 202 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 196 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 202 /* MappedType */ && grandParent.parent.checkType.type) {
const checkMappedType2 = grandParent.parent.checkType;
const nodeType = getTypeFromTypeNode(checkMappedType2.type);
inferences = append(inferences, instantiateType(
@@ -56108,7 +56284,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
let type = getTypeFromTypeNode(constraintDeclaration);
if (type.flags & 1 /* Any */ && !isErrorType(type)) {
- type = constraintDeclaration.parent.parent.kind === 200 /* MappedType */ ? keyofConstraintType : unknownType;
+ type = constraintDeclaration.parent.parent.kind === 202 /* MappedType */ ? keyofConstraintType : unknownType;
}
typeParameter.constraint = type;
}
@@ -56117,7 +56293,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return typeParameter.constraint === noConstraintType ? void 0 : typeParameter.constraint;
}
function getParentSymbolOfTypeParameter(typeParameter) {
- const tp = getDeclarationOfKind(typeParameter.symbol, 167 /* TypeParameter */);
+ const tp = getDeclarationOfKind(typeParameter.symbol, 168 /* TypeParameter */);
const host2 = isJSDocTemplateTag(tp.parent) ? getEffectiveContainerForJSDocTemplateTag(tp.parent) : tp.parent;
return host2 && getSymbolOfNode(host2);
}
@@ -56197,7 +56373,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return ((_a2 = type.target.localTypeParameters) == null ? void 0 : _a2.map(() => errorType)) || emptyArray;
}
const node = type.node;
- const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
+ const typeArguments = !node ? emptyArray : node.kind === 185 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 190 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
if (popTypeResolution()) {
type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
} else {
@@ -56231,7 +56407,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return errorType;
}
}
- if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
+ if (node.kind === 185 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
return createDeferredTypeReference(type, node, void 0);
}
const typeArguments = concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgumentsFromTypeReferenceNode(node), typeParameters, minTypeArgumentCount, isJs));
@@ -56299,9 +56475,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTypeReferenceName(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return node.typeName;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
const expr = node.expression;
if (isEntityNameExpression(expr)) {
return expr;
@@ -56313,10 +56489,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return symbol.parent ? `${getSymbolPath(symbol.parent)}.${symbol.escapedName}` : symbol.escapedName;
}
function getUnresolvedSymbolForEntityName(name) {
- const identifier = name.kind === 165 /* QualifiedName */ ? name.right : name.kind === 211 /* PropertyAccessExpression */ ? name.name : name;
+ const identifier = name.kind === 166 /* QualifiedName */ ? name.right : name.kind === 213 /* PropertyAccessExpression */ ? name.name : name;
const text = identifier.escapedText;
if (text) {
- const parentSymbol = name.kind === 165 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 211 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0;
+ const parentSymbol = name.kind === 166 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 213 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0;
const path2 = parentSymbol ? `${getSymbolPath(parentSymbol)}.${text}` : text;
let result = unresolvedSymbols.get(path2);
if (!result) {
@@ -56392,7 +56568,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const valueType = getTypeOfSymbol(symbol);
let typeType = valueType;
if (symbol.valueDeclaration) {
- const isImportTypeWithQualifier = node.kind === 205 /* ImportType */ && node.qualifier;
+ const isImportTypeWithQualifier = node.kind === 207 /* ImportType */ && node.qualifier;
if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) {
typeType = getTypeReferenceType(node, valueType.symbol);
}
@@ -56420,7 +56596,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
}
function isUnaryTupleTypeNode(node) {
- return node.kind === 189 /* TupleType */ && node.elements.length === 1;
+ return node.kind === 191 /* TupleType */ && node.elements.length === 1;
}
function getImpliedConstraint(type, checkNode, extendsNode) {
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) : void 0;
@@ -56428,17 +56604,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getConditionalFlowTypeOfType(type, node) {
let constraints;
let covariant = true;
- while (node && !isStatement(node) && node.kind !== 329 /* JSDoc */) {
+ while (node && !isStatement(node) && node.kind !== 332 /* JSDoc */) {
const parent2 = node.parent;
- if (parent2.kind === 168 /* Parameter */) {
+ if (parent2.kind === 169 /* Parameter */) {
covariant = !covariant;
}
- if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 194 /* ConditionalType */ && node === parent2.trueType) {
+ if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 196 /* ConditionalType */ && node === parent2.trueType) {
const constraint = getImpliedConstraint(type, parent2.checkType, parent2.extendsType);
if (constraint) {
constraints = append(constraints, constraint);
}
- } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && node === parent2.type) {
+ } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 202 /* MappedType */ && node === parent2.type) {
const mappedType = getTypeFromTypeNode(parent2);
if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
const typeParameter = getHomomorphicTypeVariable(mappedType);
@@ -56455,7 +56631,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return constraints ? getSubstitutionType(type, getIntersectionType(constraints)) : type;
}
function isJSDocTypeReference(node) {
- return !!(node.flags & 8388608 /* JSDoc */) && (node.kind === 183 /* TypeReference */ || node.kind === 205 /* ImportType */);
+ return !!(node.flags & 8388608 /* JSDoc */) && (node.kind === 185 /* TypeReference */ || node.kind === 207 /* ImportType */);
}
function checkNoTypeArguments(node, symbol) {
if (node.typeArguments) {
@@ -56561,9 +56737,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (declarations) {
for (const declaration of declarations) {
switch (declaration.kind) {
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
return declaration;
}
}
@@ -56724,11 +56900,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTupleElementFlags(node) {
switch (node.kind) {
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return 2 /* Optional */;
- case 191 /* RestType */:
+ case 193 /* RestType */:
return getRestTypeElementFlags(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */;
default:
return 1 /* Required */;
@@ -56744,55 +56920,55 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return readonly ? globalReadonlyArrayType : globalArrayType;
}
const elementFlags = map(node.elements, getTupleElementFlags);
- const missingName = some(node.elements, (e) => e.kind !== 202 /* NamedTupleMember */);
+ const missingName = some(node.elements, (e) => e.kind !== 204 /* NamedTupleMember */);
return getTupleTargetType(elementFlags, readonly, missingName ? void 0 : node.elements);
}
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
- return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
+ return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 190 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 191 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
}
function isResolvedByTypeAlias(node) {
const parent2 = node.parent;
switch (parent2.kind) {
- case 196 /* ParenthesizedType */:
- case 202 /* NamedTupleMember */:
- case 183 /* TypeReference */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 199 /* IndexedAccessType */:
- case 194 /* ConditionalType */:
- case 198 /* TypeOperator */:
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
+ case 198 /* ParenthesizedType */:
+ case 204 /* NamedTupleMember */:
+ case 185 /* TypeReference */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 201 /* IndexedAccessType */:
+ case 196 /* ConditionalType */:
+ case 200 /* TypeOperator */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
return isResolvedByTypeAlias(parent2);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
}
return false;
}
function mayResolveTypeAlias(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node, 788968 /* Type */).flags & 524288 /* TypeAlias */);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return true;
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return node.operator !== 158 /* UniqueKeyword */ && mayResolveTypeAlias(node.type);
- case 196 /* ParenthesizedType */:
- case 190 /* OptionalType */:
- case 202 /* NamedTupleMember */:
- case 325 /* JSDocOptionalType */:
- case 323 /* JSDocNullableType */:
- case 324 /* JSDocNonNullableType */:
- case 318 /* JSDocTypeExpression */:
+ case 198 /* ParenthesizedType */:
+ case 192 /* OptionalType */:
+ case 204 /* NamedTupleMember */:
+ case 328 /* JSDocOptionalType */:
+ case 326 /* JSDocNullableType */:
+ case 327 /* JSDocNonNullableType */:
+ case 321 /* JSDocTypeExpression */:
return mayResolveTypeAlias(node.type);
- case 191 /* RestType */:
- return node.type.kind !== 188 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 193 /* RestType */:
+ return node.type.kind !== 190 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return some(node.types, mayResolveTypeAlias);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType);
}
return false;
@@ -56803,10 +56979,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const target = getArrayOrTupleTargetType(node);
if (target === emptyGenericType) {
links.resolvedType = emptyObjectType;
- } else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
- links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, void 0);
+ } else if (!(node.kind === 191 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
+ links.resolvedType = node.kind === 191 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, void 0);
} else {
- const elementTypes = node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
+ const elementTypes = node.kind === 190 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
links.resolvedType = createNormalizedTypeReference(target, elementTypes);
}
}
@@ -57787,7 +57963,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, accessNode, accessFlags) {
var _a2;
- const accessExpression = accessNode && accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode : void 0;
+ const accessExpression = accessNode && accessNode.kind === 214 /* ElementAccessExpression */ ? accessNode : void 0;
const propName = accessNode && isPrivateIdentifier(accessNode) ? void 0 : getPropertyNameFromIndex(indexType, accessNode);
if (propName !== void 0) {
if (accessFlags & 256 /* Contextual */) {
@@ -57955,7 +58131,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getIndexNodeForAccessExpression(accessNode) {
- return accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 199 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 166 /* ComputedPropertyName */ ? accessNode.expression : accessNode;
+ return accessNode.kind === 214 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 201 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 167 /* ComputedPropertyName */ ? accessNode.expression : accessNode;
}
function isPatternLiteralPlaceholderType(type) {
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
@@ -58086,7 +58262,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
accessFlags |= 1 /* IncludeUndefined */;
- if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
+ if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 201 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
if (objectType.flags & 3 /* AnyOrUnknown */) {
return objectType;
}
@@ -58626,7 +58802,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getThisType(node) {
const container = getThisContainer(node, false);
const parent2 = container && container.parent;
- if (parent2 && (isClassLike(parent2) || parent2.kind === 267 /* InterfaceDeclaration */)) {
+ if (parent2 && (isClassLike(parent2) || parent2.kind === 270 /* InterfaceDeclaration */)) {
if (!isStatic(container) && (!isConstructorDeclaration(container) || isNodeDescendantOf(node, container.body))) {
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent2)).thisType;
}
@@ -58656,17 +58832,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getArrayElementTypeNode(node) {
switch (node.kind) {
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return getArrayElementTypeNode(node.type);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
if (node.elements.length === 1) {
node = node.elements[0];
- if (node.kind === 191 /* RestType */ || node.kind === 202 /* NamedTupleMember */ && node.dotDotDotToken) {
+ if (node.kind === 193 /* RestType */ || node.kind === 204 /* NamedTupleMember */ && node.dotDotDotToken) {
return getArrayElementTypeNode(node.type);
}
}
break;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return node.elementType;
}
return void 0;
@@ -58681,8 +58857,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeFromTypeNodeWorker(node) {
switch (node.kind) {
case 132 /* AnyKeyword */:
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
return anyType;
case 159 /* UnknownKeyword */:
return unknownType;
@@ -58708,66 +58884,66 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return node.flags & 262144 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType;
case 140 /* IntrinsicKeyword */:
return intrinsicMarkerType;
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 109 /* ThisKeyword */:
return getTypeFromThisTypeNode(node);
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return getTypeFromLiteralTypeNode(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return getTypeFromTypeReference(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return node.assertsModifier ? voidType : booleanType;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return getTypeFromTypeReference(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return getTypeFromTypeQueryNode(node);
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
return getTypeFromArrayOrTupleTypeNode(node);
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return getTypeFromOptionalTypeNode(node);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return getTypeFromUnionTypeNode(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return getTypeFromIntersectionTypeNode(node);
- case 323 /* JSDocNullableType */:
+ case 326 /* JSDocNullableType */:
return getTypeFromJSDocNullableTypeNode(node);
- case 325 /* JSDocOptionalType */:
+ case 328 /* JSDocOptionalType */:
return addOptionality(getTypeFromTypeNode(node.type));
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return getTypeFromNamedTupleTypeNode(node);
- case 196 /* ParenthesizedType */:
- case 324 /* JSDocNonNullableType */:
- case 318 /* JSDocTypeExpression */:
+ case 198 /* ParenthesizedType */:
+ case 327 /* JSDocNonNullableType */:
+ case 321 /* JSDocTypeExpression */:
return getTypeFromTypeNode(node.type);
- case 191 /* RestType */:
+ case 193 /* RestType */:
return getTypeFromRestTypeNode(node);
- case 327 /* JSDocVariadicType */:
+ case 330 /* JSDocVariadicType */:
return getTypeFromJSDocVariadicType(node);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 326 /* JSDocFunctionType */:
- case 332 /* JSDocSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 329 /* JSDocFunctionType */:
+ case 335 /* JSDocSignature */:
return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return getTypeFromTypeOperatorNode(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return getTypeFromIndexedAccessTypeNode(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return getTypeFromMappedTypeNode(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return getTypeFromConditionalTypeNode(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return getTypeFromInferTypeNode(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return getTypeFromTemplateTypeNode(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return getTypeFromImportTypeNode(node);
case 79 /* Identifier */:
- case 165 /* QualifiedName */:
- case 211 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
const symbol = getSymbolAtLocation(node);
return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType;
default:
@@ -58962,13 +59138,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type;
}
function maybeTypeParameterReference(node) {
- return !(node.parent.kind === 183 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 205 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
+ return !(node.parent.kind === 185 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 207 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
}
function isTypeParameterPossiblyReferenced(tp, node) {
if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {
const container = tp.symbol.declarations[0].parent;
for (let n = node; n !== container; n = n.parent) {
- if (!n || n.kind === 242 /* Block */ || n.kind === 194 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) {
+ if (!n || n.kind === 244 /* Block */ || n.kind === 196 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) {
return true;
}
}
@@ -58977,17 +59153,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
function containsReference(node2) {
switch (node2.kind) {
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return !!tp.isThisType;
case 79 /* Identifier */:
return !tp.isThisType && isPartOfTypeNode(node2) && maybeTypeParameterReference(node2) && getTypeFromTypeNodeWorker(node2) === tp;
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
const entityName = node2.exprName;
const firstIdentifier = getFirstIdentifier(entityName);
const firstIdentifierSymbol = getResolvedSymbol(firstIdentifier);
const tpDeclaration = tp.symbol.declarations[0];
let tpScope;
- if (tpDeclaration.kind === 167 /* TypeParameter */) {
+ if (tpDeclaration.kind === 168 /* TypeParameter */) {
tpScope = tpDeclaration.parent;
} else if (tp.isThisType) {
tpScope = tpDeclaration;
@@ -58998,8 +59174,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return some(firstIdentifierSymbol.declarations, (idDecl) => isNodeDescendantOf(idDecl, tpScope)) || some(node2.typeArguments, containsReference);
}
return true;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return !node2.type && !!node2.body || some(node2.typeParameters, containsReference) || some(node2.parameters, containsReference) || !!node2.type && containsReference(node2.type);
}
return !!forEachChild(node2, containsReference);
@@ -59230,32 +59406,32 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
}
function isContextSensitive(node) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
switch (node.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
return isContextSensitiveFunctionLikeDeclaration(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return some(node.properties, isContextSensitive);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return some(node.elements, isContextSensitive);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right));
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return isContextSensitive(node.initializer);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isContextSensitive(node.expression);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return some(node.properties, isContextSensitive) || isJsxOpeningElement(node.parent) && some(node.parent.parent.children, isContextSensitive);
- case 294 /* JsxAttribute */: {
+ case 297 /* JsxAttribute */: {
const { initializer } = node;
return !!initializer && isContextSensitive(initializer);
}
- case 297 /* JsxExpression */: {
+ case 300 /* JsxExpression */: {
const { expression } = node;
return !!expression && isContextSensitive(expression);
}
@@ -59266,7 +59442,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
}
function hasContextSensitiveReturnExpression(node) {
- return !node.typeParameters && !getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 242 /* Block */ && isContextSensitive(node.body);
+ return !node.typeParameters && !getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 244 /* Block */ && isContextSensitive(node.body);
}
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func);
@@ -59339,23 +59515,23 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
switch (node.kind) {
- case 297 /* JsxExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 300 /* JsxExpression */:
+ case 219 /* ParenthesizedExpression */:
return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (node.operatorToken.kind) {
case 63 /* EqualsToken */:
case 27 /* CommaToken */:
return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
}
break;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer);
}
return false;
@@ -59529,16 +59705,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) {
switch (child.kind) {
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return { errorNode: child, innerExpression: child.expression, nameType };
case 11 /* JsxText */:
if (child.containsOnlyTriviaWhiteSpaces) {
break;
}
return { errorNode: child, innerExpression: void 0, nameType, errorMessage: getInvalidTextDiagnostic() };
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
return { errorNode: child, innerExpression: child, nameType };
default:
return Debug.assertNever(child, "Found invalid jsx child");
@@ -59664,13 +59840,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
}
switch (prop.kind) {
- case 178 /* SetAccessor */:
- case 177 /* GetAccessor */:
- case 174 /* MethodDeclaration */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 180 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 309 /* ShorthandPropertyAssignment */:
yield { errorNode: prop.name, innerExpression: void 0, nameType: type };
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type, errorMessage: isComputedNonLiteralName(prop.name) ? Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 : void 0 };
break;
default:
@@ -59724,7 +59900,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers);
}
const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
- const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 174 /* MethodDeclaration */ && kind !== 173 /* MethodSignature */ && kind !== 176 /* Constructor */;
+ const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 176 /* MethodDeclaration */ && kind !== 175 /* MethodSignature */ && kind !== 178 /* Constructor */;
let result = -1 /* True */;
const sourceThisType = getThisTypeOfSignature(source);
if (sourceThisType && sourceThisType !== voidType) {
@@ -61570,7 +61746,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const sourceSignature = first(sourceSignatures);
const targetSignature = first(targetSignatures);
result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, incompatibleReporter(sourceSignature, targetSignature));
- if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 176 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 176 /* Constructor */)) {
+ if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 178 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 178 /* Constructor */)) {
const constructSignatureToString = (signature) => signatureToString(signature, void 0, 262144 /* WriteArrowStyleSignature */, kind);
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature));
reportError(Diagnostics.Types_of_construct_signatures_are_incompatible);
@@ -62188,7 +62364,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const target = type.target;
if (getObjectFlags(target) & 1 /* Class */) {
const baseTypeNode = getBaseTypeNodeOfClass(target);
- if (baseTypeNode && baseTypeNode.expression.kind !== 79 /* Identifier */ && baseTypeNode.expression.kind !== 211 /* PropertyAccessExpression */) {
+ if (baseTypeNode && baseTypeNode.expression.kind !== 79 /* Identifier */ && baseTypeNode.expression.kind !== 213 /* PropertyAccessExpression */) {
return void 0;
}
}
@@ -62555,12 +62731,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let diagnostic;
switch (declaration.kind) {
- case 227 /* BinaryExpression */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 229 /* BinaryExpression */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
diagnostic = noImplicitAny ? Diagnostics.Member_0_implicitly_has_an_1_type : Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
const param = declaration;
if (isIdentifier(param.name) && (isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(param, param.name.escapedText, 788968 /* Type */, void 0, param.name.escapedText, true) || param.name.originalKeywordKind && isTypeNodeKind(param.name.originalKeywordKind))) {
const newName = "arg" + param.parent.parameters.indexOf(param);
@@ -62570,22 +62746,22 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
diagnostic = Diagnostics.Binding_element_0_implicitly_has_an_1_type;
if (!noImplicitAny) {
return;
}
break;
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
return;
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
if (noImplicitAny && !declaration.name) {
if (wideningKind === 3 /* GeneratorYield */) {
error(declaration, Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString);
@@ -62596,7 +62772,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
diagnostic = !noImplicitAny ? Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage : wideningKind === 3 /* GeneratorYield */ ? Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type;
break;
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
if (noImplicitAny) {
error(declaration, Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type);
}
@@ -62693,7 +62869,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function inferFromIntraExpressionSites(context) {
if (context.intraExpressionInferenceSites) {
for (const { node, type } of context.intraExpressionInferenceSites) {
- const contextualType = node.kind === 174 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */);
+ const contextualType = node.kind === 176 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */);
if (contextualType) {
inferTypes(context.inferences, type, contextualType);
}
@@ -62745,8 +62921,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isNonGenericTopLevelType(type) {
if (type.aliasSymbol && !type.aliasTypeArguments) {
- const declaration = getDeclarationOfKind(type.aliasSymbol, 268 /* TypeAliasDeclaration */);
- return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 314 /* SourceFile */ ? true : n.kind === 270 /* ModuleDeclaration */ ? false : "quit"));
+ const declaration = getDeclarationOfKind(type.aliasSymbol, 271 /* TypeAliasDeclaration */);
+ return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 317 /* SourceFile */ ? true : n.kind === 273 /* ModuleDeclaration */ ? false : "quit"));
}
return false;
}
@@ -63491,7 +63667,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function inferFromSignature(source, target) {
const saveBivariant = bivariant;
const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
- bivariant = bivariant || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 176 /* Constructor */;
+ bivariant = bivariant || kind === 176 /* MethodDeclaration */ || kind === 175 /* MethodSignature */ || kind === 178 /* Constructor */;
applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
bivariant = saveBivariant;
applyToReturnTypes(source, target, inferFromTypes);
@@ -63647,7 +63823,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function;
}
default:
- if (node.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.parent.kind === 309 /* ShorthandPropertyAssignment */) {
return Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;
} else {
return Diagnostics.Cannot_find_name_0;
@@ -63672,7 +63848,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isInTypeQuery(node) {
return !!findAncestor(
node,
- (n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 79 /* Identifier */ || n.kind === 165 /* QualifiedName */ ? false : "quit"
+ (n) => n.kind === 188 /* TypeQuery */ ? true : n.kind === 79 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
);
}
function getFlowCacheKey(node, declaredType, initialType, flowContainer) {
@@ -63684,59 +63860,59 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
case 109 /* ThisKeyword */:
return `0|${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}`;
- case 236 /* NonNullExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
const left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer);
return left && left + "." + node.right.escapedText;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const propName = getAccessedPropertyName(node);
if (propName !== void 0) {
const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
return key && key + "." + propName;
}
break;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
return `${getNodeId(node)}#${getTypeId(declaredType)}`;
}
return void 0;
}
function isMatchingReference(source, target) {
switch (target.kind) {
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return isMatchingReference(source, target.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isAssignmentExpression(target) && isMatchingReference(source, target.left) || isBinaryExpression(target) && target.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source, target.right);
}
switch (source.kind) {
- case 237 /* MetaProperty */:
- return target.kind === 237 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText;
+ case 239 /* MetaProperty */:
+ return target.kind === 239 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText;
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
- return isThisInTypeQuery(source) ? target.kind === 109 /* ThisKeyword */ : target.kind === 79 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || (target.kind === 261 /* VariableDeclaration */ || target.kind === 208 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
+ return isThisInTypeQuery(source) ? target.kind === 109 /* ThisKeyword */ : target.kind === 79 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || (target.kind === 263 /* VariableDeclaration */ || target.kind === 210 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
case 109 /* ThisKeyword */:
return target.kind === 109 /* ThisKeyword */;
case 107 /* SuperKeyword */:
return target.kind === 107 /* SuperKeyword */;
- case 236 /* NonNullExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
return isMatchingReference(source.expression, target);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const sourcePropertyName = getAccessedPropertyName(source);
const targetPropertyName = isAccessExpression(target) ? getAccessedPropertyName(target) : void 0;
return sourcePropertyName !== void 0 && targetPropertyName !== void 0 && targetPropertyName === sourcePropertyName && isMatchingReference(source.expression, target.expression);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return isAccessExpression(target) && source.right.escapedText === getAccessedPropertyName(target) && isMatchingReference(source.left, target.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isBinaryExpression(source) && source.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source.right, target);
}
return false;
@@ -63886,7 +64062,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getMatchingUnionConstituentForObjectLiteral(unionType, node) {
const keyPropertyName = getKeyPropertyName(unionType);
- const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 305 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer));
+ const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 308 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer));
const propType = propNode && getContextFreeTypeOfExpression(propNode.initializer);
return propType && getConstituentTypeForKeyType(unionType, propType);
}
@@ -63901,7 +64077,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (expression.expression.kind === 211 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) {
+ if (expression.expression.kind === 213 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) {
return true;
}
return false;
@@ -64062,11 +64238,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, void 0) || errorType);
}
function getAssignedTypeOfBinaryExpression(node) {
- const isDestructuringDefaultAssignment = node.parent.kind === 209 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 305 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);
+ const isDestructuringDefaultAssignment = node.parent.kind === 211 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 308 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);
return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right);
}
function isDestructuringAssignmentTarget(parent2) {
- return parent2.parent.kind === 227 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 251 /* ForOfStatement */ && parent2.parent.initializer === parent2;
+ return parent2.parent.kind === 229 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 253 /* ForOfStatement */ && parent2.parent.initializer === parent2;
}
function getAssignedTypeOfArrayLiteralElement(node, element) {
return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element));
@@ -64083,21 +64259,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getAssignedType(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return stringType;
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return checkRightHandSideOfForOf(parent2) || errorType;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return getAssignedTypeOfBinaryExpression(parent2);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return undefinedType;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return getAssignedTypeOfArrayLiteralElement(parent2, node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return getAssignedTypeOfSpreadExpression(parent2);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getAssignedTypeOfPropertyAssignment(parent2);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return getAssignedTypeOfShorthandPropertyAssignment(parent2);
}
return errorType;
@@ -64105,7 +64281,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getInitialTypeOfBindingElement(node) {
const pattern = node.parent;
const parentType = getInitialType(pattern.parent);
- const type = pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType);
+ const type = pattern.kind === 208 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType);
return getTypeWithDefault(type, node.initializer);
}
function getTypeOfInitializer(node) {
@@ -64116,25 +64292,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.initializer) {
return getTypeOfInitializer(node.initializer);
}
- if (node.parent.parent.kind === 250 /* ForInStatement */) {
+ if (node.parent.parent.kind === 252 /* ForInStatement */) {
return stringType;
}
- if (node.parent.parent.kind === 251 /* ForOfStatement */) {
+ if (node.parent.parent.kind === 253 /* ForOfStatement */) {
return checkRightHandSideOfForOf(node.parent.parent) || errorType;
}
return errorType;
}
function getInitialType(node) {
- return node.kind === 261 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node);
+ return node.kind === 263 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node);
}
function isEmptyArrayAssignment(node) {
- return node.kind === 261 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 208 /* BindingElement */ && node.parent.kind === 227 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right);
+ return node.kind === 263 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 210 /* BindingElement */ && node.parent.kind === 229 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right);
}
function getReferenceCandidate(node) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return getReferenceCandidate(node.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (node.operatorToken.kind) {
case 63 /* EqualsToken */:
case 75 /* BarBarEqualsToken */:
@@ -64149,10 +64325,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getReferenceRoot(node) {
const { parent: parent2 } = node;
- return parent2.kind === 217 /* ParenthesizedExpression */ || parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 63 /* EqualsToken */ && parent2.left === node || parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 27 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node;
+ return parent2.kind === 219 /* ParenthesizedExpression */ || parent2.kind === 229 /* BinaryExpression */ && parent2.operatorToken.kind === 63 /* EqualsToken */ && parent2.left === node || parent2.kind === 229 /* BinaryExpression */ && parent2.operatorToken.kind === 27 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node;
}
function getTypeOfSwitchClause(clause) {
- if (clause.kind === 298 /* CaseClause */) {
+ if (clause.kind === 301 /* CaseClause */) {
return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression));
}
return neverType;
@@ -64168,12 +64344,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return links.switchTypes;
}
function getSwitchClauseTypeOfWitnesses(switchStatement) {
- if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 298 /* CaseClause */ && !isStringLiteralLike(clause.expression))) {
+ if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 301 /* CaseClause */ && !isStringLiteralLike(clause.expression))) {
return void 0;
}
const witnesses = [];
for (const clause of switchStatement.caseBlock.clauses) {
- const text = clause.kind === 298 /* CaseClause */ ? clause.expression.text : void 0;
+ const text = clause.kind === 301 /* CaseClause */ ? clause.expression.text : void 0;
witnesses.push(text && !contains(witnesses, text) ? text : void 0);
}
return witnesses;
@@ -64323,8 +64499,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isEvolvingArrayOperationTarget(node) {
const root = getReferenceRoot(node);
const parent2 = root.parent;
- const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 213 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name));
- const isElementAssignment = parent2.kind === 212 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 227 /* BinaryExpression */ && parent2.parent.operatorToken.kind === 63 /* EqualsToken */ && parent2.parent.left === parent2 && !isAssignmentTarget(parent2.parent) && isTypeAssignableToKind(getTypeOfExpression(parent2.argumentExpression), 296 /* NumberLike */);
+ const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 215 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name));
+ const isElementAssignment = parent2.kind === 214 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 229 /* BinaryExpression */ && parent2.parent.operatorToken.kind === 63 /* EqualsToken */ && parent2.parent.left === parent2 && !isAssignmentTarget(parent2.parent) && isTypeAssignableToKind(getTypeOfExpression(parent2.argumentExpression), 296 /* NumberLike */);
return isLengthPushOrUnshift || isElementAssignment;
}
function isDeclarationWithExplicitTypeAnnotation(node) {
@@ -64347,7 +64523,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isDeclarationWithExplicitTypeAnnotation(declaration)) {
return getTypeOfSymbol(symbol);
}
- if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) {
+ if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 253 /* ForOfStatement */) {
const statement = declaration.parent.parent;
const expressionType = getTypeOfDottedName(statement.expression, void 0);
if (expressionType) {
@@ -64371,7 +64547,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getExplicitThisType(node);
case 107 /* SuperKeyword */:
return checkSuperExpression(node);
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const type = getTypeOfDottedName(node.expression, diagnostic);
if (type) {
const name = node.name;
@@ -64388,7 +64564,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return void 0;
}
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return getTypeOfDottedName(node.expression, diagnostic);
}
}
@@ -64398,7 +64574,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let signature = links.effectsSignature;
if (signature === void 0) {
let funcType;
- if (node.parent.kind === 245 /* ExpressionStatement */) {
+ if (node.parent.kind === 247 /* ExpressionStatement */) {
funcType = getTypeOfDottedName(node.expression, void 0);
} else if (node.expression.kind !== 107 /* SuperKeyword */) {
if (isOptionalChain(node)) {
@@ -64440,7 +64616,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isFalseExpression(expr) {
const node = skipParentheses(expr, true);
- return node.kind === 96 /* FalseKeyword */ || node.kind === 227 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right));
+ return node.kind === 96 /* FalseKeyword */ || node.kind === 229 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right));
}
function isReachableFlowNodeWorker(flow, noCacheCheck) {
while (true) {
@@ -64539,8 +64715,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const symbol = getResolvedSymbol(node);
return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
}
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
}
return false;
@@ -64560,7 +64736,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode));
sharedFlowCount = sharedFlowStart;
const resultType = getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
- if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 236 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
+ if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 238 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
return declaredType;
}
return resultType === nonNullUnknownType ? unknownType : resultType;
@@ -64629,7 +64805,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
target.antecedents = saveAntecedents;
} else if (flags & 2 /* Start */) {
const container = flow.node;
- if (container && container !== flowContainer && reference.kind !== 211 /* PropertyAccessExpression */ && reference.kind !== 212 /* ElementAccessExpression */ && reference.kind !== 109 /* ThisKeyword */) {
+ if (container && container !== flowContainer && reference.kind !== 213 /* PropertyAccessExpression */ && reference.kind !== 214 /* ElementAccessExpression */ && reference.kind !== 109 /* ThisKeyword */) {
flow = container.flowNode;
continue;
}
@@ -64648,7 +64824,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getInitialOrAssignedType(flow) {
const node = flow.node;
- return getNarrowableTypeForReference(node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference);
+ return getNarrowableTypeForReference(node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference);
}
function getTypeAtFlowAssignment(flow) {
const node = flow.node;
@@ -64678,13 +64854,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (isVariableDeclaration(node) && (isInJSFile(node) || isVarConst(node))) {
const init = getDeclaredExpandoInitializer(node);
- if (init && (init.kind === 218 /* FunctionExpression */ || init.kind === 219 /* ArrowFunction */)) {
+ if (init && (init.kind === 220 /* FunctionExpression */ || init.kind === 221 /* ArrowFunction */)) {
return getTypeAtFlowNode(flow.antecedent);
}
}
return declaredType;
}
- if (isVariableDeclaration(node) && node.parent.parent.kind === 250 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
+ if (isVariableDeclaration(node) && node.parent.parent.kind === 252 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))));
}
return void 0;
@@ -64694,7 +64870,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.kind === 96 /* FalseKeyword */) {
return unreachableNeverType;
}
- if (node.kind === 227 /* BinaryExpression */) {
+ if (node.kind === 229 /* BinaryExpression */) {
if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) {
return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right);
}
@@ -64723,13 +64899,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeAtFlowArrayMutation(flow) {
if (declaredType === autoType || declaredType === autoArrayType) {
const node = flow.node;
- const expr = node.kind === 213 /* CallExpression */ ? node.expression.expression : node.left.expression;
+ const expr = node.kind === 215 /* CallExpression */ ? node.expression.expression : node.left.expression;
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
const flowType = getTypeAtFlowNode(flow.antecedent);
const type = getTypeFromFlowType(flowType);
if (getObjectFlags(type) & 256 /* EvolvingArray */) {
let evolvedType2 = type;
- if (node.kind === 213 /* CallExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
for (const arg of node.arguments) {
evolvedType2 = addEvolvingArrayElementType(evolvedType2, arg);
}
@@ -64766,7 +64942,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let type = getTypeFromFlowType(flowType);
if (isMatchingReference(reference, expr)) {
type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
- } else if (expr.kind === 222 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
+ } else if (expr.kind === 224 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
} else {
if (strictNullChecks) {
@@ -64778,7 +64954,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
flow.clauseEnd,
(t) => !(t.flags & (32768 /* Undefined */ | 131072 /* Never */))
);
- } else if (expr.kind === 222 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) {
+ } else if (expr.kind === 224 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) {
type = narrowTypeBySwitchOptionalChainContainment(
type,
flow.switchStatement,
@@ -65027,10 +65203,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const operator = expr.operatorToken.kind;
const left = getReferenceCandidate(expr.left);
const right = getReferenceCandidate(expr.right);
- if (left.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(right)) {
+ if (left.kind === 224 /* TypeOfExpression */ && isStringLiteralLike(right)) {
return narrowTypeByTypeof(type, left, operator, right, assumeTrue);
}
- if (right.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(left)) {
+ if (right.kind === 224 /* TypeOfExpression */ && isStringLiteralLike(left)) {
return narrowTypeByTypeof(type, right, operator, left, assumeTrue);
}
if (isMatchingReference(reference, left)) {
@@ -65228,7 +65404,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!witnesses) {
return type;
}
- const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 299 /* DefaultClause */);
+ const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 302 /* DefaultClause */);
const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd;
if (hasDefaultClause) {
const notEqualFacts = getNotEqualFactsFromTypeofSwitch(clauseStart, clauseEnd, witnesses);
@@ -65381,17 +65557,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
case 109 /* ThisKeyword */:
case 107 /* SuperKeyword */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return narrowTypeByTruthiness(type, expr, assumeTrue);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return narrowTypeByCallExpression(type, expr, assumeTrue);
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return narrowType(type, expr.expression, assumeTrue);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
if (expr.operator === 53 /* ExclamationToken */) {
return narrowType(type, expr.operand, !assumeTrue);
}
@@ -65429,7 +65605,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getNonMissingTypeOfSymbol(symbol);
}
function getControlFlowContainer(node) {
- return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 271 /* ModuleBlock */ || node2.kind === 314 /* SourceFile */ || node2.kind === 171 /* PropertyDeclaration */ || node2.kind === 172 /* AnnotationPropertyDeclaration */);
+ return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 274 /* ModuleBlock */ || node2.kind === 317 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */ || node2.kind === 173 /* AnnotationPropertyDeclaration */);
}
function isSymbolAssigned(symbol) {
if (!symbol.valueDeclaration) {
@@ -65465,7 +65641,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function removeOptionalityFromDeclaredType(declaredType, declaration) {
if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) {
- const annotationIncludesUndefined = strictNullChecks && declaration.kind === 168 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
+ const annotationIncludesUndefined = strictNullChecks && declaration.kind === 169 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
popTypeResolution();
return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
} else {
@@ -65475,7 +65651,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isConstraintPosition(type, node) {
const parent2 = node.parent;
- return parent2.kind === 211 /* PropertyAccessExpression */ || parent2.kind === 165 /* QualifiedName */ || parent2.kind === 213 /* CallExpression */ && parent2.expression === node || parent2.kind === 212 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression)));
+ return parent2.kind === 213 /* PropertyAccessExpression */ || parent2.kind === 166 /* QualifiedName */ || parent2.kind === 215 /* CallExpression */ && parent2.expression === node || parent2.kind === 214 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression)));
}
function isGenericTypeWithUnionConstraint(type) {
return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithUnionConstraint) : !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */));
@@ -65523,14 +65699,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (declaration) {
if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
const parent2 = declaration.parent.parent;
- if (parent2.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent2.kind === 168 /* Parameter */) {
+ if (parent2.kind === 263 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent2.kind === 169 /* Parameter */) {
const links = getNodeLinks(parent2);
if (!(links.flags & 268435456 /* InCheckIdentifier */)) {
links.flags |= 268435456 /* InCheckIdentifier */;
const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
links.flags &= ~268435456 /* InCheckIdentifier */;
- if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 168 /* Parameter */ && isSymbolAssigned(symbol))) {
+ if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
const pattern = declaration.parent;
const narrowedType = getFlowTypeOfReference(pattern, parentTypeConstraint, parentTypeConstraint, void 0, location.flowNode);
if (narrowedType.flags & 131072 /* Never */) {
@@ -65573,7 +65749,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const container = getContainingFunction(node);
if (languageVersion < 2 /* ES2015 */) {
- if (container.kind === 219 /* ArrowFunction */) {
+ if (container.kind === 221 /* ArrowFunction */) {
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
} else if (hasSyntacticModifier(container, 512 /* Async */)) {
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
@@ -65594,7 +65770,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let declaration = localOrExportSymbol.valueDeclaration;
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
- if (declaration.kind === 264 /* ClassDeclaration */ && nodeIsDecorated(declaration)) {
+ if (declaration.kind === 266 /* ClassDeclaration */ && nodeIsDecorated(declaration)) {
let container = getContainingClass(node);
while (container !== void 0) {
if (container === declaration && container.name !== node) {
@@ -65604,9 +65780,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
container = getContainingClass(container);
}
- } else if (declaration.kind === 232 /* ClassExpression */) {
+ } else if (declaration.kind === 234 /* ClassExpression */) {
let container = getThisContainer(node, false);
- while (container.kind !== 314 /* SourceFile */) {
+ while (container.kind !== 317 /* SourceFile */) {
if (container.parent === declaration) {
if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */;
@@ -65654,16 +65830,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type;
}
type = getNarrowableTypeForReference(type, node, checkMode);
- const isParameter2 = getRootDeclaration(declaration).kind === 168 /* Parameter */;
+ const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */;
const declarationContainer = getControlFlowContainer(declaration);
let flowContainer = getControlFlowContainer(node);
const isOuterVariable = flowContainer !== declarationContainer;
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
- while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 220 /* FunctionExpression */ || flowContainer.kind === 221 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
flowContainer = getControlFlowContainer(flowContainer);
}
- const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || node.parent.kind === 284 /* ExportSpecifier */) || node.parent.kind === 236 /* NonNullExpression */ || declaration.kind === 261 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
+ const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || node.parent.kind === 287 /* ExportSpecifier */) || node.parent.kind === 238 /* NonNullExpression */ || declaration.kind === 263 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
@@ -65713,7 +65889,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return findAncestor(node, (n) => !n || nodeStartsNewLexicalEnvironment(n) ? "quit" : isIterationStatement(n, false));
}
function checkNestedBlockScopedBinding(node, symbol) {
- if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 301 /* CatchClause */) {
+ if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 304 /* CatchClause */) {
return;
}
const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration);
@@ -65723,7 +65899,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isCaptured) {
let capturesBlockScopeBindingInLoopBody = true;
if (isForStatement(container)) {
- const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */);
+ const varDeclList = getAncestor(symbol.valueDeclaration, 264 /* VariableDeclarationList */);
if (varDeclList && varDeclList.parent === container) {
const part = getPartOfForStatementContainingNode(node.parent, container);
if (part) {
@@ -65742,7 +65918,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
if (isForStatement(container)) {
- const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */);
+ const varDeclList = getAncestor(symbol.valueDeclaration, 264 /* VariableDeclarationList */);
if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */;
}
@@ -65759,13 +65935,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isAssignedInBodyOfForStatement(node, container) {
let current = node;
- while (current.parent.kind === 217 /* ParenthesizedExpression */) {
+ while (current.parent.kind === 219 /* ParenthesizedExpression */) {
current = current.parent;
}
let isAssigned = false;
if (isAssignmentTarget(current)) {
isAssigned = true;
- } else if (current.parent.kind === 225 /* PrefixUnaryExpression */ || current.parent.kind === 226 /* PostfixUnaryExpression */) {
+ } else if (current.parent.kind === 227 /* PrefixUnaryExpression */ || current.parent.kind === 228 /* PostfixUnaryExpression */) {
const expr = current.parent;
isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */;
}
@@ -65776,7 +65952,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function captureLexicalThis(node, container) {
getNodeLinks(node).flags |= 2 /* LexicalThis */;
- if (container.kind === 171 /* PropertyDeclaration */ || container.kind === 176 /* Constructor */) {
+ if (container.kind === 172 /* PropertyDeclaration */ || container.kind === 178 /* Constructor */) {
const classNode = container.parent;
getNodeLinks(classNode).flags |= 4 /* CaptureThis */;
} else {
@@ -65810,27 +65986,27 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const isNodeInTypeQuery = isInTypeQuery(node);
let container = getThisContainer(node, true);
let capturedByArrowFunction = false;
- if (container.kind === 176 /* Constructor */) {
+ if (container.kind === 178 /* Constructor */) {
checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class);
}
- if (container.kind === 219 /* ArrowFunction */) {
+ if (container.kind === 221 /* ArrowFunction */) {
container = getThisContainer(container, false);
capturedByArrowFunction = true;
}
checkThisInStaticClassFieldInitializerInDecoratedClass(node, container);
switch (container.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
error(node, Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
error(node, Diagnostics.this_cannot_be_referenced_in_current_location);
break;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
if (isInConstructorArgumentInitializer(node, container)) {
error(node, Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
}
break;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
error(node, Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);
break;
}
@@ -65904,13 +66080,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getClassNameFromPrototypeMethod(container) {
- if (container.kind === 218 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) {
+ if (container.kind === 220 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) {
return container.parent.left.expression.expression;
- } else if (container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) {
+ } else if (container.kind === 176 /* MethodDeclaration */ && container.parent.kind === 212 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) {
return container.parent.parent.left.expression;
- } else if (container.kind === 218 /* FunctionExpression */ && container.parent.kind === 305 /* PropertyAssignment */ && container.parent.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) {
+ } else if (container.kind === 220 /* FunctionExpression */ && container.parent.kind === 308 /* PropertyAssignment */ && container.parent.parent.kind === 212 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) {
return container.parent.parent.parent.left.expression;
- } else if (container.kind === 218 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {
+ } else if (container.kind === 220 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {
return container.parent.parent.parent.arguments[0].expression;
} else if (isMethodDeclaration(container) && isIdentifier(container.name) && (container.name.escapedText === "value" || container.name.escapedText === "get" || container.name.escapedText === "set") && isObjectLiteralExpression(container.parent) && isCallExpression(container.parent.parent) && container.parent.parent.arguments[2] === container.parent && getAssignmentDeclarationKind(container.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {
return container.parent.parent.arguments[0].expression;
@@ -65918,7 +66094,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTypeForThisExpressionFromJSDoc(node) {
const jsdocType = getJSDocType(node);
- if (jsdocType && jsdocType.kind === 326 /* JSDocFunctionType */) {
+ if (jsdocType && jsdocType.kind === 329 /* JSDocFunctionType */) {
const jsDocFunctionType = jsdocType;
if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && jsDocFunctionType.parameters[0].name.escapedText === "this" /* This */) {
return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type);
@@ -65930,16 +66106,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isInConstructorArgumentInitializer(node, constructorDecl) {
- return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 168 /* Parameter */ && n.parent === constructorDecl);
+ return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 169 /* Parameter */ && n.parent === constructorDecl);
}
function checkSuperExpression(node) {
- const isCallExpression2 = node.parent.kind === 213 /* CallExpression */ && node.parent.expression === node;
+ const isCallExpression2 = node.parent.kind === 215 /* CallExpression */ && node.parent.expression === node;
const immediateContainer = getSuperContainer(node, true);
let container = immediateContainer;
let needToCaptureLexicalThis = false;
let inAsyncFunction = false;
if (!isCallExpression2) {
- while (container && container.kind === 219 /* ArrowFunction */) {
+ while (container && container.kind === 221 /* ArrowFunction */) {
if (hasSyntacticModifier(container, 512 /* Async */))
inAsyncFunction = true;
container = getSuperContainer(container, true);
@@ -65951,19 +66127,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const canUseSuperExpression = isLegalUsageOfSuperExpression(container);
let nodeCheckFlag = 0;
if (!canUseSuperExpression) {
- const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 166 /* ComputedPropertyName */);
- if (current && current.kind === 166 /* ComputedPropertyName */) {
+ const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 167 /* ComputedPropertyName */);
+ if (current && current.kind === 167 /* ComputedPropertyName */) {
error(node, Diagnostics.super_cannot_be_referenced_in_a_computed_property_name);
} else if (isCallExpression2) {
error(node, Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors);
- } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 210 /* ObjectLiteralExpression */)) {
+ } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 212 /* ObjectLiteralExpression */)) {
error(node, Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions);
} else {
error(node, Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class);
}
return errorType;
}
- if (!isCallExpression2 && immediateContainer.kind === 176 /* Constructor */) {
+ if (!isCallExpression2 && immediateContainer.kind === 178 /* Constructor */) {
checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class);
}
if (isStatic(container) || isCallExpression2) {
@@ -65979,7 +66155,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
nodeCheckFlag = 256 /* SuperInstance */;
}
getNodeLinks(node).flags |= nodeCheckFlag;
- if (container.kind === 174 /* MethodDeclaration */ && inAsyncFunction) {
+ if (container.kind === 176 /* MethodDeclaration */ && inAsyncFunction) {
if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) {
getNodeLinks(container).flags |= 4096 /* MethodWithSuperPropertyAssignmentInAsync */;
} else {
@@ -65989,7 +66165,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (needToCaptureLexicalThis) {
captureLexicalThis(node.parent, container);
}
- if (container.parent.kind === 210 /* ObjectLiteralExpression */) {
+ if (container.parent.kind === 212 /* ObjectLiteralExpression */) {
if (languageVersion < 2 /* ES2015 */) {
error(node, Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);
return errorType;
@@ -66007,7 +66183,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!baseClassType) {
return errorType;
}
- if (container.kind === 176 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) {
+ if (container.kind === 178 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) {
error(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
return errorType;
}
@@ -66017,13 +66193,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
if (isCallExpression2) {
- return container2.kind === 176 /* Constructor */;
+ return container2.kind === 178 /* Constructor */;
} else {
- if (isClassLike(container2.parent) || container2.parent.kind === 210 /* ObjectLiteralExpression */) {
+ if (isClassLike(container2.parent) || container2.parent.kind === 212 /* ObjectLiteralExpression */) {
if (isStatic(container2)) {
- return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 171 /* PropertyDeclaration */ || container2.kind === 175 /* ClassStaticBlockDeclaration */;
+ return container2.kind === 176 /* MethodDeclaration */ || container2.kind === 175 /* MethodSignature */ || container2.kind === 179 /* GetAccessor */ || container2.kind === 180 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 177 /* ClassStaticBlockDeclaration */;
} else {
- return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 171 /* PropertyDeclaration */ || container2.kind === 170 /* PropertySignature */ || container2.kind === 176 /* Constructor */;
+ return container2.kind === 176 /* MethodDeclaration */ || container2.kind === 175 /* MethodSignature */ || container2.kind === 179 /* GetAccessor */ || container2.kind === 180 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 171 /* PropertySignature */ || container2.kind === 178 /* Constructor */;
}
}
}
@@ -66031,7 +66207,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getContainingObjectLiteral(func) {
- return (func.kind === 174 /* MethodDeclaration */ || func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) && func.parent.kind === 210 /* ObjectLiteralExpression */ ? func.parent : func.kind === 218 /* FunctionExpression */ && func.parent.kind === 305 /* PropertyAssignment */ ? func.parent.parent : void 0;
+ return (func.kind === 176 /* MethodDeclaration */ || func.kind === 179 /* GetAccessor */ || func.kind === 180 /* SetAccessor */) && func.parent.kind === 212 /* ObjectLiteralExpression */ ? func.parent : func.kind === 220 /* FunctionExpression */ && func.parent.kind === 308 /* PropertyAssignment */ ? func.parent.parent : void 0;
}
function getThisTypeArgument(type) {
return getObjectFlags(type) & 4 /* Reference */ && type.target === globalThisType ? getTypeArguments(type)[0] : void 0;
@@ -66042,7 +66218,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
}
function getContextualThisParameterType(func) {
- if (func.kind === 219 /* ArrowFunction */) {
+ if (func.kind === 221 /* ArrowFunction */) {
return void 0;
}
if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
@@ -66066,7 +66242,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (thisType) {
return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral)));
}
- if (literal.parent.kind !== 305 /* PropertyAssignment */) {
+ if (literal.parent.kind !== 308 /* PropertyAssignment */) {
break;
}
literal = literal.parent.parent;
@@ -66075,7 +66251,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getWidenedType(contextualType ? getNonNullableType3(contextualType) : checkExpressionCached(containingLiteral));
}
const parent2 = walkUpParenthesizedExpressions(func.parent);
- if (parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 63 /* EqualsToken */) {
+ if (parent2.kind === 229 /* BinaryExpression */ && parent2.operatorToken.kind === 63 /* EqualsToken */) {
const target = parent2.left;
if (isAccessExpression(target)) {
const { expression } = target;
@@ -66122,11 +66298,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getTypeFromTypeNode(typeNode);
}
switch (declaration.kind) {
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return getContextuallyTypedParameterType(declaration);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getContextualTypeForBindingElement(declaration, contextFlags);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (isStatic(declaration)) {
return getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags);
}
@@ -66135,10 +66311,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getContextualTypeForBindingElement(declaration, contextFlags) {
const parent2 = declaration.parent.parent;
const name = declaration.propertyName || declaration.name;
- const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 208 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */);
+ const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 210 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */);
if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name))
return void 0;
- if (parent2.name.kind === 207 /* ArrayBindingPattern */) {
+ if (parent2.name.kind === 209 /* ArrayBindingPattern */) {
const index = indexOfNode(declaration.parent.elements, declaration);
if (index < 0)
return void 0;
@@ -66271,7 +66447,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return signatureHasRestParameter(signature) && argIndex >= restIndex ? getIndexedAccessType(getTypeOfSymbol(signature.parameters[restIndex]), getNumberLiteralType(argIndex - restIndex), 256 /* Contextual */) : getTypeAtPosition(signature, argIndex);
}
function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {
- if (template.parent.kind === 215 /* TaggedTemplateExpression */) {
+ if (template.parent.kind === 217 /* TaggedTemplateExpression */) {
return getContextualTypeForArgument(template.parent, substitutionExpression);
}
return void 0;
@@ -66530,10 +66706,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
case 157 /* UndefinedKeyword */:
return true;
- case 211 /* PropertyAccessExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 219 /* ParenthesizedExpression */:
return isPossiblyDiscriminantValue(node.expression);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return !node.expression || isPossiblyDiscriminantValue(node.expression);
}
return false;
@@ -66543,7 +66719,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
contextualType,
concatenate(
map(
- filter(node.properties, (p) => !!p.symbol && p.kind === 305 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName)),
+ filter(node.properties, (p) => !!p.symbol && p.kind === 308 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName)),
(prop) => [() => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
),
map(
@@ -66563,7 +66739,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
contextualType,
concatenate(
map(
- filter(node.properties, (p) => !!p.symbol && p.kind === 294 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))),
+ filter(node.properties, (p) => !!p.symbol && p.kind === 297 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))),
(prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
),
map(
@@ -66620,63 +66796,63 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 210 /* BindingElement */:
return getContextualTypeForInitializerExpression(node, contextFlags);
- case 219 /* ArrowFunction */:
- case 254 /* ReturnStatement */:
+ case 221 /* ArrowFunction */:
+ case 256 /* ReturnStatement */:
return getContextualTypeForReturnExpression(node, contextFlags);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return getContextualTypeForYieldOperand(parent2, contextFlags);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return getContextualTypeForAwaitOperand(parent2, contextFlags);
- case 213 /* CallExpression */:
- case 220 /* EtsComponentExpression */:
+ case 215 /* CallExpression */:
+ case 222 /* EtsComponentExpression */:
if (isInEtsFile(parent2) && parent2.expression.kind === 101 /* ImportKeyword */) {
return stringType;
}
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return getContextualTypeForArgument(parent2, node);
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return isConstTypeReference(parent2.type) ? tryFindWhenConstTypeReference(parent2) : getTypeFromTypeNode(parent2.type);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return getContextualTypeForBinaryOperand(node, contextFlags);
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return getContextualTypeForObjectLiteralElement(parent2, contextFlags);
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return getContextualType2(parent2.parent, contextFlags);
- case 209 /* ArrayLiteralExpression */: {
+ case 211 /* ArrayLiteralExpression */: {
const arrayLiteral = parent2;
const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags);
return getContextualTypeForElementExpression(type, indexOfNode(arrayLiteral.elements, node));
}
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return getContextualTypeForConditionalOperand(node, contextFlags);
- case 240 /* TemplateSpan */:
- Debug.assert(parent2.parent.kind === 229 /* TemplateExpression */);
+ case 242 /* TemplateSpan */:
+ Debug.assert(parent2.parent.kind === 231 /* TemplateExpression */);
return getContextualTypeForSubstitutionExpression(parent2.parent, node);
- case 217 /* ParenthesizedExpression */: {
+ case 219 /* ParenthesizedExpression */: {
const tag = isInJSFile(parent2) ? getJSDocTypeTag(parent2) : void 0;
return !tag ? getContextualType2(parent2, contextFlags) : isJSDocTypeTag(tag) && isConstTypeReference(tag.typeExpression.type) ? tryFindWhenConstTypeReference(parent2) : getTypeFromTypeNode(tag.typeExpression.type);
}
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return getContextualType2(parent2, contextFlags);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return getTypeFromTypeNode(parent2.type);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return tryGetTypeFromEffectiveTypeNode(parent2);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return getContextualTypeForJsxExpression(parent2, contextFlags);
- case 294 /* JsxAttribute */:
- case 296 /* JsxSpreadAttribute */:
+ case 297 /* JsxAttribute */:
+ case 299 /* JsxSpreadAttribute */:
return getContextualTypeForJsxAttribute(parent2, contextFlags);
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return getContextualJsxElementAttributesType(parent2, contextFlags);
}
return void 0;
@@ -66898,7 +67074,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return isFunctionExpressionOrArrowFunction(node) || isObjectLiteralMethod(node) ? getContextualSignature(node) : void 0;
}
function getContextualSignature(node) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
const typeTagSignature = getSignatureOfTypeTag(node);
if (typeTagSignature) {
return typeTagSignature;
@@ -66939,7 +67115,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type;
}
function hasDefaultValue(node) {
- return node.kind === 208 /* BindingElement */ && !!node.initializer || node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */;
+ return node.kind === 210 /* BindingElement */ && !!node.initializer || node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */;
}
function checkArrayLiteral(node, checkMode, forceTuple) {
const elements = node.elements;
@@ -66952,7 +67128,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let hasOmittedExpression = false;
for (let i = 0; i < elementCount; i++) {
const e = elements[i];
- if (e.kind === 231 /* SpreadElement */) {
+ if (e.kind === 233 /* SpreadElement */) {
if (languageVersion < 2 /* ES2015 */) {
checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
}
@@ -66968,7 +67144,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
elementTypes.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, e.expression));
elementFlags.push(4 /* Rest */);
}
- } else if (exactOptionalPropertyTypes && e.kind === 233 /* OmittedExpression */) {
+ } else if (exactOptionalPropertyTypes && e.kind === 235 /* OmittedExpression */) {
hasOmittedExpression = true;
elementTypes.push(missingType);
elementFlags.push(2 /* Optional */);
@@ -67005,7 +67181,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isNumericName(name) {
switch (name.kind) {
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return isNumericComputedName(name);
case 79 /* Identifier */:
return isNumericLiteralName(name.escapedText);
@@ -67022,7 +67198,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkComputedPropertyName(node) {
const links = getNodeLinks(node.expression);
if (!links.resolvedType) {
- if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 102 /* InKeyword */ && node.parent.kind !== 177 /* GetAccessor */ && node.parent.kind !== 178 /* SetAccessor */) {
+ if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 102 /* InKeyword */ && node.parent.kind !== 179 /* GetAccessor */ && node.parent.kind !== 180 /* SetAccessor */) {
return links.resolvedType = errorType;
}
links.resolvedType = checkExpression(node.expression);
@@ -67081,7 +67257,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let propertiesArray = [];
let spread = emptyObjectType;
const contextualType = getApparentTypeOfContextualType(node, void 0);
- const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 206 /* ObjectBindingPattern */ || contextualType.pattern.kind === 210 /* ObjectLiteralExpression */);
+ const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 208 /* ObjectBindingPattern */ || contextualType.pattern.kind === 212 /* ObjectLiteralExpression */);
const inConstContext = isConstContext(node);
const checkFlags = inConstContext ? 8 /* Readonly */ : 0;
const isInJavascript = isInJSFile(node) && !isInJsonFile(node);
@@ -67100,9 +67276,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let offset = 0;
for (const memberDecl of node.properties) {
let member = getSymbolOfNode(memberDecl);
- const computedNameType = memberDecl.name && memberDecl.name.kind === 166 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
- if (memberDecl.kind === 305 /* PropertyAssignment */ || memberDecl.kind === 306 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
- let type = memberDecl.kind === 305 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : memberDecl.kind === 306 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode);
+ const computedNameType = memberDecl.name && memberDecl.name.kind === 167 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
+ if (memberDecl.kind === 308 /* PropertyAssignment */ || memberDecl.kind === 309 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
+ let type = memberDecl.kind === 308 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : memberDecl.kind === 309 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode);
if (isInJavascript) {
const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
if (jsDocType) {
@@ -67119,7 +67295,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
prop.nameType = nameType;
}
if (inDestructuringPattern) {
- const isOptional = memberDecl.kind === 305 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 306 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer;
+ const isOptional = memberDecl.kind === 308 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 309 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer;
if (isOptional) {
prop.flags |= 16777216 /* Optional */;
}
@@ -67145,16 +67321,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
prop.target = member;
member = prop;
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
- if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 305 /* PropertyAssignment */ || memberDecl.kind === 174 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
+ if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 308 /* PropertyAssignment */ || memberDecl.kind === 176 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
const inferenceContext = getInferenceContext(node);
Debug.assert(inferenceContext);
- const inferenceNode = memberDecl.kind === 305 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
+ const inferenceNode = memberDecl.kind === 308 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type);
}
if (type.symbol && type.symbol.flags & 268435456 /* Annotation */) {
error(memberDecl, Diagnostics.Annotation_cannot_be_used_as_a_value);
}
- } else if (memberDecl.kind === 307 /* SpreadAssignment */) {
+ } else if (memberDecl.kind === 310 /* SpreadAssignment */) {
if (languageVersion < 2 /* ES2015 */) {
checkExternalEmitHelpers(memberDecl, 2 /* Assign */);
}
@@ -67183,7 +67359,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
continue;
} else {
- Debug.assert(memberDecl.kind === 177 /* GetAccessor */ || memberDecl.kind === 178 /* SetAccessor */);
+ Debug.assert(memberDecl.kind === 179 /* GetAccessor */ || memberDecl.kind === 180 /* SetAccessor */);
checkNodeDeferred(memberDecl);
}
if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) {
@@ -67207,13 +67383,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (contextualTypeHasPattern) {
const rootPatternParent = findAncestor(
contextualType.pattern.parent,
- (n) => n.kind === 261 /* VariableDeclaration */ || n.kind === 227 /* BinaryExpression */ || n.kind === 168 /* Parameter */
+ (n) => n.kind === 263 /* VariableDeclaration */ || n.kind === 229 /* BinaryExpression */ || n.kind === 169 /* Parameter */
);
const spreadOrOutsideRootObject = findAncestor(
node,
- (n) => n === rootPatternParent || n.kind === 307 /* SpreadAssignment */
+ (n) => n === rootPatternParent || n.kind === 310 /* SpreadAssignment */
);
- if (spreadOrOutsideRootObject.kind !== 307 /* SpreadAssignment */) {
+ if (spreadOrOutsideRootObject.kind !== 310 /* SpreadAssignment */) {
for (const prop of getPropertiesOfType(contextualType)) {
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
if (!(prop.flags & 16777216 /* Optional */)) {
@@ -67342,7 +67518,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
} else {
- Debug.assert(attributeDecl.kind === 296 /* JsxSpreadAttribute */);
+ Debug.assert(attributeDecl.kind === 299 /* JsxSpreadAttribute */);
if (attributesTable.size > 0) {
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false);
attributesTable = createSymbolTable();
@@ -67367,7 +67543,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false);
}
}
- const parent2 = openingLikeElement.parent.kind === 287 /* JsxElement */ ? openingLikeElement.parent : void 0;
+ const parent2 = openingLikeElement.parent.kind === 290 /* JsxElement */ ? openingLikeElement.parent : void 0;
if (parent2 && parent2.openingElement === openingLikeElement && parent2.children.length > 0) {
const childrenTypes = checkJsxChildren(parent2, checkMode);
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
@@ -67413,7 +67589,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!child.containsOnlyTriviaWhiteSpaces) {
childrenTypes.push(stringType);
}
- } else if (child.kind === 297 /* JsxExpression */ && !child.expression) {
+ } else if (child.kind === 300 /* JsxExpression */ && !child.expression) {
continue;
} else {
childrenTypes.push(checkExpressionForMutableLocation(child, checkMode));
@@ -67730,7 +67906,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkPropertyAccessibility(node, isSuper, writing, type, prop, reportError = true) {
- const errorNode = !reportError ? void 0 : node.kind === 165 /* QualifiedName */ ? node.right : node.kind === 205 /* ImportType */ ? node : node.kind === 208 /* BindingElement */ && node.propertyName ? node.propertyName : node.name;
+ const errorNode = !reportError ? void 0 : node.kind === 166 /* QualifiedName */ ? node.right : node.kind === 207 /* ImportType */ ? node : node.kind === 210 /* BindingElement */ && node.propertyName ? node.propertyName : node.name;
return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode);
}
function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) {
@@ -67943,7 +68119,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return checkPropertyAccessExpressionOrQualifiedName(node, node.left, leftType, node.right, checkMode);
}
function isMethodAccessForCall(node) {
- while (node.parent.kind === 217 /* ParenthesizedExpression */) {
+ while (node.parent.kind === 219 /* ParenthesizedExpression */) {
node = node.parent;
}
return isCallOrNewExpression(node.parent) && node.parent.expression === node;
@@ -68098,7 +68274,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return isErrorType(apparentType) ? errorType : apparentType;
}
- prop = getPropertyOfType(apparentType, right.escapedText, false, node.kind === 165 /* QualifiedName */);
+ prop = getPropertyOfType(apparentType, right.escapedText, false, node.kind === 166 /* QualifiedName */);
if (!prop) {
const etsComponentExpressionNode = getEtsComponentExpressionInnerCallExpressionNode(node) || getRootEtsComponentInnerCallExpressionNode(node);
const locals = getSourceFileOfNode(node).locals;
@@ -68123,7 +68299,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 308 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {
+ if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 311 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {
markAliasReferenced(parentSymbol, node);
}
let propType;
@@ -68221,7 +68397,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (declaration && isPropertyWithoutInitializer(declaration)) {
if (!isStatic(declaration)) {
const flowContainer = getControlFlowContainer(node);
- if (flowContainer.kind === 176 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 16777216 /* Ambient */)) {
+ if (flowContainer.kind === 178 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 16777216 /* Ambient */)) {
assumeUninitialized = true;
}
}
@@ -68265,7 +68441,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!needInitialization && !(hasRequireDecorator && checkStructPropertyPosition(valueDeclaration, node))) {
diagnosticMessage = error(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
}
- } else if (valueDeclaration.kind === 264 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 16777216 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
+ } else if (valueDeclaration.kind === 266 /* ClassDeclaration */ && node.parent.kind !== 185 /* TypeReference */ && !(valueDeclaration.flags & 16777216 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
diagnosticMessage = error(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
}
if (diagnosticMessage) {
@@ -68278,25 +68454,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isInPropertyInitializerOrClassStaticBlock(node) {
return !!findAncestor(node, (node2) => {
switch (node2.kind) {
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return true;
- case 305 /* PropertyAssignment */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 307 /* SpreadAssignment */:
- case 166 /* ComputedPropertyName */:
- case 240 /* TemplateSpan */:
- case 297 /* JsxExpression */:
- case 294 /* JsxAttribute */:
- case 295 /* JsxAttributes */:
- case 296 /* JsxSpreadAttribute */:
- case 289 /* JsxOpeningElement */:
- case 234 /* ExpressionWithTypeArguments */:
- case 300 /* HeritageClause */:
+ case 308 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 310 /* SpreadAssignment */:
+ case 167 /* ComputedPropertyName */:
+ case 242 /* TemplateSpan */:
+ case 300 /* JsxExpression */:
+ case 297 /* JsxAttribute */:
+ case 298 /* JsxAttributes */:
+ case 299 /* JsxSpreadAttribute */:
+ case 292 /* JsxOpeningElement */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 303 /* HeritageClause */:
return false;
- case 219 /* ArrowFunction */:
- case 245 /* ExpressionStatement */:
+ case 221 /* ArrowFunction */:
+ case 247 /* ExpressionStatement */:
return isBlock(node2.parent) && isClassStaticBlockDeclaration(node2.parent.parent) ? true : "quit";
default:
return isExpressionNode(node2) ? false : "quit";
@@ -68531,18 +68707,18 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isValidPropertyAccess(node, propertyName) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return isValidPropertyAccessWithType(node, node.expression.kind === 107 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression)));
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return isValidPropertyAccessWithType(node, false, propertyName, getWidenedType(checkExpression(node.left)));
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return isValidPropertyAccessWithType(node, false, propertyName, getTypeFromTypeNode(node));
}
}
function isValidPropertyAccessForCompletions(node, type, property) {
return isPropertyAccessible(
node,
- node.kind === 211 /* PropertyAccessExpression */ && node.expression.kind === 107 /* SuperKeyword */,
+ node.kind === 213 /* PropertyAccessExpression */ && node.expression.kind === 107 /* SuperKeyword */,
false,
type,
property
@@ -68567,7 +68743,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getForInVariableSymbol(node) {
const initializer = node.initializer;
- if (initializer.kind === 262 /* VariableDeclarationList */) {
+ if (initializer.kind === 264 /* VariableDeclarationList */) {
const variable = initializer.declarations[0];
if (variable && !isBindingPattern(variable.name)) {
return getSymbolOfNode(variable);
@@ -68588,7 +68764,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let child = expr;
let node = expr.parent;
while (node) {
- if (node.kind === 250 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
+ if (node.kind === 252 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
return true;
}
child = node;
@@ -68632,11 +68808,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (callLikeExpressionMayHaveTypeArguments(node)) {
forEach(node.typeArguments, checkSourceElement);
}
- if (node.kind === 215 /* TaggedTemplateExpression */) {
+ if (node.kind === 217 /* TaggedTemplateExpression */) {
checkExpression(node.template);
} else if (isJsxOpeningLikeElement(node)) {
checkExpression(node.attributes);
- } else if (node.kind !== 169 /* Decorator */) {
+ } else if (node.kind !== 170 /* Decorator */) {
forEach(node.arguments, (argument) => {
checkExpression(argument);
});
@@ -68681,7 +68857,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isSpreadArgument(arg) {
- return !!arg && (arg.kind === 231 /* SpreadElement */ || arg.kind === 238 /* SyntheticExpression */ && arg.isSpread);
+ return !!arg && (arg.kind === 233 /* SpreadElement */ || arg.kind === 240 /* SyntheticExpression */ && arg.isSpread);
}
function getSpreadArgumentIndex(args) {
return findIndex(args, isSpreadArgument);
@@ -68697,9 +68873,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let callIsIncomplete = false;
let effectiveParameterCount = getParameterCount(signature);
let effectiveMinimumArguments = getMinArgumentCount(signature);
- if (node.kind === 215 /* TaggedTemplateExpression */) {
+ if (node.kind === 217 /* TaggedTemplateExpression */) {
argCount = args.length;
- if (node.template.kind === 229 /* TemplateExpression */) {
+ if (node.template.kind === 231 /* TemplateExpression */) {
const lastSpan = last(node.template.templateSpans);
callIsIncomplete = nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated;
} else {
@@ -68707,7 +68883,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
Debug.assert(templateLiteral.kind === 14 /* NoSubstitutionTemplateLiteral */);
callIsIncomplete = !!templateLiteral.isUnterminated;
}
- } else if (node.kind === 169 /* Decorator */) {
+ } else if (node.kind === 170 /* Decorator */) {
argCount = getDecoratorArgumentCount(node, signature);
} else if (isJsxOpeningLikeElement(node)) {
callIsIncomplete = node.attributes.end === node.end;
@@ -68718,7 +68894,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
effectiveParameterCount = args.length === 0 ? effectiveParameterCount : 1;
effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1);
} else if (!node.arguments) {
- Debug.assert(node.kind === 214 /* NewExpression */);
+ Debug.assert(node.kind === 216 /* NewExpression */);
return getMinArgumentCount(signature) === 0;
} else {
argCount = signatureHelpTrailingComma ? args.length + 1 : args.length;
@@ -68799,7 +68975,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isJsxOpeningLikeElement(node)) {
return inferJsxTypeArguments(node, signature, checkMode, context);
}
- if (node.kind !== 169 /* Decorator */) {
+ if (node.kind !== 170 /* Decorator */) {
const skipBindingPatterns = every(signature.typeParameters, (p) => !!getDefaultFromTypeParameter(p));
const contextualType = getContextualType2(node, skipBindingPatterns ? 8 /* SkipBindingPatterns */ : 0 /* None */);
if (contextualType) {
@@ -68836,7 +69012,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
for (let i = 0; i < argCount; i++) {
const arg = args[i];
- if (arg.kind !== 233 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
+ if (arg.kind !== 235 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
const paramType = getTypeAtPosition(signature, i);
if (couldContainTypeVariables(paramType)) {
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -68857,7 +69033,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (index >= argCount - 1) {
const arg = args[argCount - 1];
if (isSpreadArgument(arg)) {
- return getMutableArrayOrTupleType(arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode));
+ return getMutableArrayOrTupleType(arg.kind === 240 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode));
}
}
const types = [];
@@ -68866,12 +69042,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
for (let i = index; i < argCount; i++) {
const arg = args[i];
if (isSpreadArgument(arg)) {
- const spreadType = arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression);
+ const spreadType = arg.kind === 240 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression);
if (isArrayLikeType2(spreadType)) {
types.push(spreadType);
flags.push(8 /* Variadic */);
} else {
- types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 231 /* SpreadElement */ ? arg.expression : arg));
+ types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 233 /* SpreadElement */ ? arg.expression : arg));
flags.push(4 /* Rest */);
}
} else {
@@ -68881,7 +69057,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType));
flags.push(1 /* Required */);
}
- if (arg.kind === 238 /* SyntheticExpression */ && arg.tupleNameSource) {
+ if (arg.kind === 240 /* SyntheticExpression */ && arg.tupleNameSource) {
names.push(arg.tupleNameSource);
}
}
@@ -69024,7 +69200,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
const thisType = getThisTypeOfSignature(signature);
- if (thisType && thisType !== voidType && node.kind !== 214 /* NewExpression */) {
+ if (thisType && thisType !== voidType && node.kind !== 216 /* NewExpression */) {
const thisArgumentNode = getThisArgumentOfCall(node);
const thisArgumentType = getThisArgumentType(thisArgumentNode);
const errorNode = reportErrors2 ? thisArgumentNode || node : void 0;
@@ -69039,7 +69215,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length;
for (let i = 0; i < argCount; i++) {
const arg = args[i];
- if (arg.kind !== 233 /* OmittedExpression */) {
+ if (arg.kind !== 235 /* OmittedExpression */) {
const paramType = getTypeAtPosition(signature, i);
const argType = checkExpressionWithContextualType(arg, paramType, void 0, checkMode);
const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;
@@ -69074,7 +69250,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getThisArgumentOfCall(node) {
- const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : void 0;
+ const expression = node.kind === 215 /* CallExpression */ ? node.expression : node.kind === 217 /* TaggedTemplateExpression */ ? node.tag : void 0;
if (expression) {
const callee = skipOuterExpressions(expression);
if (isAccessExpression(callee)) {
@@ -69089,17 +69265,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
}
function getEffectiveCallArguments(node) {
- if (node.kind === 215 /* TaggedTemplateExpression */) {
+ if (node.kind === 217 /* TaggedTemplateExpression */) {
const template = node.template;
const args2 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())];
- if (template.kind === 229 /* TemplateExpression */) {
+ if (template.kind === 231 /* TemplateExpression */) {
forEach(template.templateSpans, (span) => {
args2.push(span.expression);
});
}
return args2;
}
- if (node.kind === 169 /* Decorator */) {
+ if (node.kind === 170 /* Decorator */) {
return getEffectiveDecoratorArguments(node);
}
if (isJsxOpeningLikeElement(node)) {
@@ -69111,7 +69287,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const effectiveArgs = args.slice(0, spreadIndex);
for (let i = spreadIndex; i < args.length; i++) {
const arg = args[i];
- const spreadType = arg.kind === 231 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
+ const spreadType = arg.kind === 233 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
if (spreadType && isTupleType(spreadType)) {
forEach(getTypeArguments(spreadType), (t, i2) => {
var _a2;
@@ -69136,30 +69312,30 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const parent2 = node.parent;
const expr = node.expression;
switch (parent2.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return [
createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent2)))
];
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
const func = parent2.parent;
return [
- createSyntheticExpression(expr, parent2.parent.kind === 176 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),
+ createSyntheticExpression(expr, parent2.parent.kind === 178 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),
createSyntheticExpression(expr, anyType),
createSyntheticExpression(expr, numberType)
];
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent2) || hasAccessorModifier(parent2));
return [
createSyntheticExpression(expr, getParentTypeOfClassElement(parent2)),
createSyntheticExpression(expr, getClassElementPropertyKeyType(parent2)),
createSyntheticExpression(expr, hasPropDesc ? createTypedPropertyDescriptorType(getTypeOfNode(parent2)) : anyType)
];
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (isEtsFunctionDecorators(getNameOfDecorator(node), compilerOptions)) {
const symbol = getSymbolOfNode(expr);
return symbol ? [
@@ -69172,19 +69348,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getDecoratorArgumentCount(node, signature) {
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return 1;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return hasAccessorModifier(node.parent) ? 3 : 2;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return 3;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (isEtsFunctionDecorators(getNameOfDecorator(node), compilerOptions)) {
return isCallExpression(node.expression) ? 1 : 0;
}
@@ -69311,10 +69487,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
}
function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) {
- const isTaggedTemplate = node.kind === 215 /* TaggedTemplateExpression */;
- const isDecorator2 = node.kind === 169 /* Decorator */;
+ const isTaggedTemplate = node.kind === 217 /* TaggedTemplateExpression */;
+ const isDecorator2 = node.kind === 170 /* Decorator */;
const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
- const isEtsComponentExpression2 = node.kind === 220 /* EtsComponentExpression */;
+ const isEtsComponentExpression2 = node.kind === 222 /* EtsComponentExpression */;
const reportErrors2 = !candidatesOutArray;
let typeArguments;
let virtual;
@@ -69344,7 +69520,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let candidateForArgumentArityError;
let candidateForTypeArgumentError;
let result;
- const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 213 /* CallExpression */ && node.arguments.hasTrailingComma;
+ const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 215 /* CallExpression */ && node.arguments.hasTrailingComma;
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
}
@@ -69794,7 +69970,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const declaration = signature.declaration;
const modifiers = getSelectedEffectiveModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */);
- if (!modifiers || declaration.kind !== 176 /* Constructor */) {
+ if (!modifiers || declaration.kind !== 178 /* Constructor */) {
return true;
}
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol);
@@ -69936,19 +70112,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getDiagnosticHeadMessageForDecoratorResolution(node) {
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
const decoratorName = getNameOfDecorator(node);
if (isEtsFunctionDecorators(decoratorName, compilerOptions)) {
return Diagnostics.Unable_to_resolve_signature_of_function_decorator_when_decorators_are_not_valid;
@@ -70108,20 +70284,20 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function resolveSignature(node, candidatesOutArray, checkMode) {
switch (node.kind) {
- case 213 /* CallExpression */:
- case 220 /* EtsComponentExpression */:
+ case 215 /* CallExpression */:
+ case 222 /* EtsComponentExpression */:
return resolveCallExpression(node, candidatesOutArray, checkMode);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return resolveNewExpression(node, candidatesOutArray, checkMode);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
if (isAnnotation(node)) {
return resolveAnnotation(node);
}
return resolveDecorator(node, candidatesOutArray, checkMode);
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode);
}
}
@@ -70226,7 +70402,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
let parent2 = node.parent;
- while (parent2 && parent2.kind === 211 /* PropertyAccessExpression */) {
+ while (parent2 && parent2.kind === 213 /* PropertyAccessExpression */) {
parent2 = parent2.parent;
}
if (parent2 && isBinaryExpression(parent2) && isPrototypeAccess(parent2.left) && parent2.operatorToken.kind === 63 /* EqualsToken */) {
@@ -70245,9 +70421,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.expression.kind === 107 /* SuperKeyword */) {
return voidType;
}
- if (node.kind === 214 /* NewExpression */) {
+ if (node.kind === 216 /* NewExpression */) {
const declaration = signature.declaration;
- if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
+ if (declaration && declaration.kind !== 178 /* Constructor */ && declaration.kind !== 182 /* ConstructSignature */ && declaration.kind !== 187 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
if (noImplicitAny) {
error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);
}
@@ -70261,7 +70437,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) {
return getESSymbolLikeTypeForNode(walkUpParenthesizedExpressions(node.parent));
}
- if (node.kind === 213 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 245 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) {
+ if (node.kind === 215 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 247 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) {
if (!isDottedName(node.expression)) {
error(node.expression, Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);
} else if (!getEffectsSignature(node)) {
@@ -70281,7 +70457,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.expression, Diagnostics.UI_component_0_cannot_be_used_in_this_place, diagnosticName(node.expression));
}
const signatureDeclaration = signature.declaration;
- if (node.kind === 213 /* CallExpression */ && signatureDeclaration && !isJSDocSignature(signatureDeclaration) && (isMethodDeclaration(signatureDeclaration) || isMethodSignature(signatureDeclaration) || isFunctionDeclaration(signatureDeclaration))) {
+ if (node.kind === 215 /* CallExpression */ && signatureDeclaration && !isJSDocSignature(signatureDeclaration) && (isMethodDeclaration(signatureDeclaration) || isMethodSignature(signatureDeclaration) || isFunctionDeclaration(signatureDeclaration))) {
if (shouldCheckThrows(signatureDeclaration) && !hasAsyncErrorCallbacks(signatureDeclaration)) {
checkThrowableFunction(node);
}
@@ -70621,20 +70797,20 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getDeprecatedSuggestionNode(node) {
node = skipParentheses(node);
switch (node.kind) {
- case 213 /* CallExpression */:
- case 169 /* Decorator */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 170 /* Decorator */:
+ case 216 /* NewExpression */:
return getDeprecatedSuggestionNode(node.expression);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return getDeprecatedSuggestionNode(node.tag);
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return getDeprecatedSuggestionNode(node.tagName);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return node.argumentExpression;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return node.name;
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
const typeReference = node;
return isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference;
default:
@@ -70743,7 +70919,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (resolvedRequire.flags & 2097152 /* Alias */) {
return false;
}
- const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 263 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 261 /* VariableDeclaration */ : 0 /* Unknown */;
+ const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 265 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 263 /* VariableDeclaration */ : 0 /* Unknown */;
if (targetDeclarationKind !== 0 /* Unknown */) {
const decl = getDeclarationOfKind(resolvedRequire, targetDeclarationKind);
return !!decl && !!(decl.flags & 16777216 /* Ambient */);
@@ -70761,7 +70937,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getReturnTypeOfSignature(signature);
}
function checkAssertion(node) {
- if (node.kind === 216 /* TypeAssertionExpression */) {
+ if (node.kind === 218 /* TypeAssertionExpression */) {
const file = getSourceFileOfNode(node);
if (file && fileExtensionIsOneOf(file.fileName, [".cts" /* Cts */, ".mts" /* Mts */])) {
grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
@@ -70777,18 +70953,18 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 9 /* BigIntLiteral */:
case 111 /* TrueKeyword */:
case 96 /* FalseKeyword */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 229 /* TemplateExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 231 /* TemplateExpression */:
return true;
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isValidConstAssertionArgument(node.expression);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const op = node.operator;
const arg = node.operand;
return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = node.expression;
let symbol = getTypeOfNode(expr).symbol;
if (symbol && symbol.flags & 2097152 /* Alias */) {
@@ -70834,7 +71010,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkExpressionWithTypeArguments(node) {
checkGrammarExpressionWithTypeArguments(node);
- const exprType = node.kind === 234 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
+ const exprType = node.kind === 236 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
const typeArguments = node.typeArguments;
if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) {
return exprType;
@@ -70929,7 +71105,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!container) {
error(node, Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target");
return errorType;
- } else if (container.kind === 176 /* Constructor */) {
+ } else if (container.kind === 178 /* Constructor */) {
const symbol = getSymbolOfNode(container.parent);
return getTypeOfSymbol(symbol);
} else {
@@ -70979,7 +71155,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getParameterIdentifierNameAtPosition(signature, pos) {
var _a2;
- if (((_a2 = signature.declaration) == null ? void 0 : _a2.kind) === 326 /* JSDocFunctionType */) {
+ if (((_a2 = signature.declaration) == null ? void 0 : _a2.kind) === 329 /* JSDocFunctionType */) {
return void 0;
}
const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
@@ -71011,7 +71187,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return symbol.valueDeclaration && isParameter(symbol.valueDeclaration) && isIdentifier(symbol.valueDeclaration.name);
}
function isValidDeclarationForTupleLabel(d) {
- return d.kind === 202 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name);
+ return d.kind === 204 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name);
}
function getNameableDeclarationAtPosition(signature, pos) {
const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
@@ -71270,7 +71446,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let yieldType;
let nextType;
let fallbackReturnType = voidType;
- if (func.body.kind !== 242 /* Block */) {
+ if (func.body.kind !== 244 /* Block */) {
returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */);
if (isAsync) {
returnType = unwrapAwaitedType(checkAwaitedType(returnType, false, func, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member));
@@ -71404,7 +71580,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return links.isExhaustive;
}
function computeExhaustiveSwitchStatement(node) {
- if (node.expression.kind === 222 /* TypeOfExpression */) {
+ if (node.expression.kind === 224 /* TypeOfExpression */) {
const witnesses = getSwitchClauseTypeOfWitnesses(node);
if (!witnesses) {
return false;
@@ -71459,11 +71635,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function mayReturnNever(func) {
switch (func.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
- case 174 /* MethodDeclaration */:
- return func.parent.kind === 210 /* ObjectLiteralExpression */;
+ case 176 /* MethodDeclaration */:
+ return func.parent.kind === 212 /* ObjectLiteralExpression */;
default:
return false;
}
@@ -71505,7 +71681,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return judgeReturnTypeOfStyles();
}
}
- if (func.kind === 173 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 242 /* Block */ || !functionHasImplicitReturn(func)) {
+ if (func.kind === 175 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 244 /* Block */ || !functionHasImplicitReturn(func)) {
return;
}
const hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */;
@@ -71541,7 +71717,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
checkNodeDeferred(node);
if (isFunctionExpression(node)) {
checkCollisionsForDeclarationName(node, node.name);
@@ -71564,7 +71740,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return anyFunctionType;
}
const hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
- if (!hasGrammarError && node.kind === 218 /* FunctionExpression */) {
+ if (!hasGrammarError && node.kind === 220 /* FunctionExpression */) {
checkGrammarForGenerator(node);
}
contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -71608,7 +71784,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
const functionFlags = getFunctionFlags(node);
const returnType = getReturnTypeFromAnnotation(node);
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
@@ -71616,7 +71792,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!getEffectiveReturnTypeNode(node)) {
getReturnTypeOfSignature(getSignatureFromDeclaration(node));
}
- if (node.body.kind === 242 /* Block */) {
+ if (node.body.kind === 244 /* Block */) {
checkSourceElement(node.body);
} else {
const exprType = checkExpression(node.body);
@@ -71682,7 +71858,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isReadonlySymbol(symbol)) {
if (symbol.flags & 4 /* Property */ && isAccessExpression(expr) && expr.expression.kind === 109 /* ThisKeyword */) {
const ctor = getContainingFunction(expr);
- if (!(ctor && (ctor.kind === 176 /* Constructor */ || isJSConstructor(ctor)))) {
+ if (!(ctor && (ctor.kind === 178 /* Constructor */ || isJSConstructor(ctor)))) {
return true;
}
if (symbol.valueDeclaration) {
@@ -71703,7 +71879,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const symbol2 = getNodeLinks(node).resolvedSymbol;
if (symbol2.flags & 2097152 /* Alias */) {
const declaration = getDeclarationOfAliasSymbol(symbol2);
- return !!declaration && declaration.kind === 277 /* NamespaceImport */;
+ return !!declaration && declaration.kind === 280 /* NamespaceImport */;
}
}
}
@@ -71808,7 +71984,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!hasParseDiagnostics(sourceFile)) {
const span = getSpanOfTokenAtPosition(sourceFile, node.pos);
const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);
- if (container && container.kind !== 176 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) {
+ if (container && container.kind !== 178 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) {
const relatedInfo = createDiagnosticForNode(container, Diagnostics.Did_you_mean_to_mark_this_function_as_async);
addRelatedInfo(diagnostic, relatedInfo);
}
@@ -72001,7 +72177,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis = false) {
const properties = node.properties;
const property = properties[propertyIndex];
- if (property.kind === 305 /* PropertyAssignment */ || property.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (property.kind === 308 /* PropertyAssignment */ || property.kind === 309 /* ShorthandPropertyAssignment */) {
const name = property.name;
const exprType = getLiteralTypeFromPropertyName(name);
if (isTypeUsableAsPropertyName(exprType)) {
@@ -72014,8 +72190,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const elementType = getIndexedAccessType(objectLiteralType, exprType, 32 /* ExpressionPosition */, name);
const type = getFlowTypeOfDestructuring(property, elementType);
- return checkDestructuringAssignment(property.kind === 306 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);
- } else if (property.kind === 307 /* SpreadAssignment */) {
+ return checkDestructuringAssignment(property.kind === 309 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);
+ } else if (property.kind === 310 /* SpreadAssignment */) {
if (propertyIndex < properties.length - 1) {
error(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
} else {
@@ -72047,7 +72223,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let inBoundsType = compilerOptions.noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType;
for (let i = 0; i < elements.length; i++) {
let type = possiblyOutOfBoundsType;
- if (node.elements[i].kind === 231 /* SpreadElement */) {
+ if (node.elements[i].kind === 233 /* SpreadElement */) {
type = inBoundsType = inBoundsType != null ? inBoundsType : checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType;
}
checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode);
@@ -72057,8 +72233,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) {
const elements = node.elements;
const element = elements[elementIndex];
- if (element.kind !== 233 /* OmittedExpression */) {
- if (element.kind !== 231 /* SpreadElement */) {
+ if (element.kind !== 235 /* OmittedExpression */) {
+ if (element.kind !== 233 /* SpreadElement */) {
const indexType = getNumberLiteralType(elementIndex);
if (isArrayLikeType2(sourceType)) {
const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(element) ? 16 /* NoTupleBoundsCheck */ : 0);
@@ -72073,7 +72249,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
} else {
const restExpression = element.expression;
- if (restExpression.kind === 227 /* BinaryExpression */ && restExpression.operatorToken.kind === 63 /* EqualsToken */) {
+ if (restExpression.kind === 229 /* BinaryExpression */ && restExpression.operatorToken.kind === 63 /* EqualsToken */) {
error(restExpression.operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer);
} else {
checkGrammarForDisallowedTrailingComma(node.elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);
@@ -72086,7 +72262,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) {
let target;
- if (exprOrAssignment.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (exprOrAssignment.kind === 309 /* ShorthandPropertyAssignment */) {
const prop = exprOrAssignment;
if (prop.objectAssignmentInitializer) {
if (strictNullChecks && !(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216 /* IsUndefined */)) {
@@ -72098,25 +72274,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
target = exprOrAssignment;
}
- if (target.kind === 227 /* BinaryExpression */ && target.operatorToken.kind === 63 /* EqualsToken */) {
+ if (target.kind === 229 /* BinaryExpression */ && target.operatorToken.kind === 63 /* EqualsToken */) {
checkBinaryExpression(target, checkMode);
target = target.left;
if (strictNullChecks) {
sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);
}
}
- if (target.kind === 210 /* ObjectLiteralExpression */) {
+ if (target.kind === 212 /* ObjectLiteralExpression */) {
return checkObjectLiteralAssignment(target, sourceType, rightIsThis);
}
- if (target.kind === 209 /* ArrayLiteralExpression */) {
+ if (target.kind === 211 /* ArrayLiteralExpression */) {
return checkArrayLiteralAssignment(target, sourceType, checkMode);
}
return checkReferenceAssignment(target, sourceType, checkMode);
}
function checkReferenceAssignment(target, sourceType, checkMode) {
const targetType = checkExpression(target, checkMode);
- const error2 = target.parent.kind === 307 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;
- const optionalError = target.parent.kind === 307 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;
+ const error2 = target.parent.kind === 310 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;
+ const optionalError = target.parent.kind === 310 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;
if (checkReferenceExpression(target, error2, optionalError)) {
checkTypeAssignableToAndOptionallyElaborate(sourceType, targetType, target, target);
}
@@ -72131,8 +72307,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
case 10 /* StringLiteral */:
case 13 /* RegularExpressionLiteral */:
- case 215 /* TaggedTemplateExpression */:
- case 229 /* TemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 231 /* TemplateExpression */:
case 14 /* NoSubstitutionTemplateLiteral */:
case 8 /* NumericLiteral */:
case 9 /* BigIntLiteral */:
@@ -72140,25 +72316,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 96 /* FalseKeyword */:
case 105 /* NullKeyword */:
case 157 /* UndefinedKeyword */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
- case 219 /* ArrowFunction */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 222 /* TypeOfExpression */:
- case 236 /* NonNullExpression */:
- case 288 /* JsxSelfClosingElement */:
- case 287 /* JsxElement */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 224 /* TypeOfExpression */:
+ case 238 /* NonNullExpression */:
+ case 291 /* JsxSelfClosingElement */:
+ case 290 /* JsxElement */:
return true;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isAssignmentOperator(node.operatorToken.kind)) {
return false;
}
return isSideEffectFree(node.left) && isSideEffectFree(node.right);
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
switch (node.operator) {
case 53 /* ExclamationToken */:
case 39 /* PlusToken */:
@@ -72167,9 +72343,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
return false;
- case 223 /* VoidExpression */:
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 225 /* VoidExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
default:
return false;
}
@@ -72205,7 +72381,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
checkGrammarNullishCoalesceWithLogicalExpression(node);
const operator = node.operatorToken.kind;
- if (operator === 63 /* EqualsToken */ && (node.left.kind === 210 /* ObjectLiteralExpression */ || node.left.kind === 209 /* ArrayLiteralExpression */)) {
+ if (operator === 63 /* EqualsToken */ && (node.left.kind === 212 /* ObjectLiteralExpression */ || node.left.kind === 211 /* ArrayLiteralExpression */)) {
state.skip = true;
setLastResult(state, checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 109 /* ThisKeyword */));
return state;
@@ -72227,7 +72403,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) {
if (operator === 55 /* AmpersandAmpersandToken */) {
let parent2 = node.parent;
- while (parent2.kind === 217 /* ParenthesizedExpression */ || isBinaryExpression(parent2) && (parent2.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || parent2.operatorToken.kind === 56 /* BarBarToken */)) {
+ while (parent2.kind === 219 /* ParenthesizedExpression */ || isBinaryExpression(parent2) && (parent2.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || parent2.operatorToken.kind === 56 /* BarBarToken */)) {
parent2 = parent2.parent;
}
checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent2) ? parent2.thenStatement : void 0);
@@ -72294,7 +72470,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) {
const operator = operatorToken.kind;
- if (operator === 63 /* EqualsToken */ && (left.kind === 210 /* ObjectLiteralExpression */ || left.kind === 209 /* ArrayLiteralExpression */)) {
+ if (operator === 63 /* EqualsToken */ && (left.kind === 212 /* ObjectLiteralExpression */ || left.kind === 211 /* ArrayLiteralExpression */)) {
return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 109 /* ThisKeyword */);
}
let leftType;
@@ -72732,7 +72908,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */));
}
function getContextNode2(node) {
- if (node.kind === 295 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) {
+ if (node.kind === 298 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) {
return node.parent.parent;
}
return node;
@@ -72773,12 +72949,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isTypeAssertion3(node) {
node = skipParentheses(node, true);
- return node.kind === 216 /* TypeAssertionExpression */ || node.kind === 235 /* AsExpression */ || isJSDocTypeAssertion(node);
+ return node.kind === 218 /* TypeAssertionExpression */ || node.kind === 237 /* AsExpression */ || isJSDocTypeAssertion(node);
}
function checkDeclarationInitializer(declaration, checkMode, contextualType) {
const initializer = getEffectiveInitializer(declaration);
const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, void 0, checkMode || 0 /* Normal */) : checkExpressionCached(initializer, checkMode));
- return isParameter(declaration) && declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type;
+ return isParameter(declaration) && declaration.name.kind === 209 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type;
}
function padTupleType(type, pattern) {
const patternElements = pattern.elements;
@@ -72786,7 +72962,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const elementFlags = type.target.elementFlags.slice();
for (let i = getTypeReferenceArity(type); i < patternElements.length; i++) {
const e = patternElements[i];
- if (i < patternElements.length - 1 || !(e.kind === 208 /* BindingElement */ && e.dotDotDotToken)) {
+ if (i < patternElements.length - 1 || !(e.kind === 210 /* BindingElement */ && e.dotDotDotToken)) {
elementTypes.push(!isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, false, false) : anyType);
elementFlags.push(2 /* Optional */);
if (!isOmittedExpression(e) && !hasDefaultValue(e)) {
@@ -72832,14 +73008,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) : isTypeAssertion3(node) ? type : getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType2(node, void 0) : contextualType, node, void 0));
}
function checkPropertyAssignment(node, checkMode) {
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
return checkExpressionForMutableLocation(node.initializer, checkMode);
}
function checkObjectLiteralMethod(node, checkMode) {
checkGrammarMethod(node);
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
const uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -73045,7 +73221,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type;
}
function checkConstEnumAccess(node, type) {
- const ok = node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 79 /* Identifier */ || node.kind === 165 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 186 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 284 /* ExportSpecifier */;
+ const ok = node.parent.kind === 213 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 214 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 79 /* Identifier */ || node.kind === 166 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 188 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 287 /* ExportSpecifier */;
if (!ok) {
error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);
}
@@ -73068,9 +73244,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
}
@@ -73101,87 +73277,87 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return trueType;
case 96 /* FalseKeyword */:
return falseType;
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return checkTemplateExpression(node);
case 13 /* RegularExpressionLiteral */:
return globalRegExpType;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return checkArrayLiteral(node, checkMode, forceTuple);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return checkObjectLiteral(node, checkMode);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return checkPropertyAccessExpression(node, checkMode);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return checkQualifiedName(node, checkMode);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return checkIndexedAccess(node, checkMode);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (node.expression.kind === 101 /* ImportKeyword */) {
return checkImportCallExpression(node);
}
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return checkCallExpression(node, checkMode);
- case 220 /* EtsComponentExpression */:
+ case 222 /* EtsComponentExpression */:
const newNode = node;
if (newNode.body && newNode.body.statements.length) {
traverseEtsComponentStatements(newNode.body.statements, checkMode);
}
return checkCallExpression(node, checkMode);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return checkTaggedTemplateExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return checkParenthesizedExpression(node, checkMode);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return checkClassExpression(node);
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return checkTypeOfExpression(node);
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return checkAssertion(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return checkNonNullAssertion(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return checkExpressionWithTypeArguments(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return checkSatisfiesExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return checkMetaProperty(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return checkDeleteExpression(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return checkVoidExpression(node);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return checkAwaitExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return checkPrefixUnaryExpression(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return checkPostfixUnaryExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return checkBinaryExpression(node, checkMode);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return checkConditionalExpression(node, checkMode);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return checkSpreadExpression(node, checkMode);
- case 233 /* OmittedExpression */:
+ case 235 /* OmittedExpression */:
return undefinedWideningType;
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return checkYieldExpression(node);
- case 238 /* SyntheticExpression */:
+ case 240 /* SyntheticExpression */:
return checkSyntheticExpression(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return checkJsxExpression(node, checkMode);
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return checkJsxElement(node, checkMode);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return checkJsxSelfClosingElement(node, checkMode);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return checkJsxFragment(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return checkJsxAttributes(node, checkMode);
- case 289 /* JsxOpeningElement */:
+ case 292 /* JsxOpeningElement */:
Debug.fail("Shouldn't ever directly check a JsxOpeningElement");
}
return errorType;
@@ -73266,10 +73442,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkVariableLikeDeclaration(node);
const func = getContainingFunction(node);
if (hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) {
- if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) {
+ if (!(func.kind === 178 /* Constructor */ && nodeIsPresent(func.body))) {
error(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
}
- if (func.kind === 176 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") {
+ if (func.kind === 178 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") {
error(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name);
}
}
@@ -73280,13 +73456,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (func.parameters.indexOf(node) !== 0) {
error(node, Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText);
}
- if (func.kind === 176 /* Constructor */ || func.kind === 180 /* ConstructSignature */ || func.kind === 185 /* ConstructorType */) {
+ if (func.kind === 178 /* Constructor */ || func.kind === 182 /* ConstructSignature */ || func.kind === 187 /* ConstructorType */) {
error(node, Diagnostics.A_constructor_cannot_have_a_this_parameter);
}
- if (func.kind === 219 /* ArrowFunction */) {
+ if (func.kind === 221 /* ArrowFunction */) {
error(node, Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
}
- if (func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) {
+ if (func.kind === 179 /* GetAccessor */ || func.kind === 180 /* SetAccessor */) {
error(node, Diagnostics.get_and_set_accessors_cannot_declare_this_parameters);
}
}
@@ -73341,13 +73517,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTypePredicateParent(node) {
switch (node.parent.kind) {
- case 219 /* ArrowFunction */:
- case 179 /* CallSignature */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 184 /* FunctionType */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 221 /* ArrowFunction */:
+ case 181 /* CallSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 186 /* FunctionType */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
const parent2 = node.parent;
if (node === parent2.type) {
return parent2;
@@ -73367,7 +73543,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
predicateVariableName
);
return true;
- } else if (name.kind === 207 /* ArrayBindingPattern */ || name.kind === 206 /* ObjectBindingPattern */) {
+ } else if (name.kind === 209 /* ArrayBindingPattern */ || name.kind === 208 /* ObjectBindingPattern */) {
if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(
name,
predicateVariableNode,
@@ -73379,9 +73555,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkSignatureDeclaration(node) {
- if (node.kind === 181 /* IndexSignature */) {
+ if (node.kind === 183 /* IndexSignature */) {
checkGrammarIndexSignature(node);
- } else if (node.kind === 184 /* FunctionType */ || node.kind === 263 /* FunctionDeclaration */ || node.kind === 185 /* ConstructorType */ || node.kind === 179 /* CallSignature */ || node.kind === 176 /* Constructor */ || node.kind === 180 /* ConstructSignature */) {
+ } else if (node.kind === 186 /* FunctionType */ || node.kind === 265 /* FunctionDeclaration */ || node.kind === 187 /* ConstructorType */ || node.kind === 181 /* CallSignature */ || node.kind === 178 /* Constructor */ || node.kind === 182 /* ConstructSignature */) {
checkGrammarFunctionLikeDeclaration(node);
}
const functionFlags = getFunctionFlags(node);
@@ -73408,10 +73584,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const returnTypeNode = getEffectiveReturnTypeNode(node);
if (noImplicitAny && !returnTypeNode) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
error(node, Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
error(node, Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
}
@@ -73433,7 +73609,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkAsyncFunctionReturnType(node, returnTypeNode);
}
}
- if (node.kind !== 181 /* IndexSignature */ && node.kind !== 326 /* JSDocFunctionType */) {
+ if (node.kind !== 183 /* IndexSignature */ && node.kind !== 329 /* JSDocFunctionType */) {
registerForUnusedIdentifiersCheck(node);
}
}
@@ -73443,7 +73619,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const staticNames = new Map2();
const privateIdentifiers = new Map2();
for (const member of node.members) {
- if (member.kind === 176 /* Constructor */) {
+ if (member.kind === 178 /* Constructor */) {
for (const param of member.parameters) {
if (isParameterPropertyDeclaration(param, member) && !isBindingPattern(param.name)) {
addName(instanceNames, param.name, param.name.escapedText, 3 /* GetOrSetAccessor */);
@@ -73461,19 +73637,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const memberName = name && getPropertyNameForPropertyNameNode(name);
if (memberName) {
switch (member.kind) {
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
addName(names, name, memberName, 1 /* GetAccessor */ | privateStaticFlags);
break;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
addName(names, name, memberName, 2 /* SetAccessor */ | privateStaticFlags);
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags);
break;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags);
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
addName(names, name, memberName, 8 /* Method */ | privateStaticFlags);
break;
}
@@ -73526,7 +73702,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkObjectTypeForDuplicateDeclarations(node) {
const names = new Map2();
for (const member of node.members) {
- if (member.kind === 170 /* PropertySignature */) {
+ if (member.kind === 171 /* PropertySignature */) {
let memberName;
const name = member.name;
switch (name.kind) {
@@ -73550,7 +73726,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkTypeForDuplicateIndexSignatures(node) {
- if (node.kind === 267 /* InterfaceDeclaration */) {
+ if (node.kind === 270 /* InterfaceDeclaration */) {
const nodeSymbol = getSymbolOfNode(node);
if (nodeSymbol.declarations && nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {
return;
@@ -73586,7 +73762,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (type.symbol.declarations) {
for (const decl of type.symbol.declarations) {
- if (decl.kind === 269 /* EnumDeclaration */) {
+ if (decl.kind === 272 /* EnumDeclaration */) {
const members = decl.members;
for (let i = 0; i < members.length; ++i) {
if (i > 1 && typeof getConstantValue2(members[i - 1]) !== typeof getConstantValue2(members[i])) {
@@ -73658,7 +73834,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function evaluateAnnotationPropertyConstantExpression(expr) {
switch (expr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const value = evaluateAnnotationPropertyConstantExpression(expr.operand);
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean") {
switch (expr.operator) {
@@ -73677,7 +73853,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const left = evaluateAnnotationPropertyConstantExpression(expr.left);
const right = evaluateAnnotationPropertyConstantExpression(expr.right);
if (left !== void 0 && right !== void 0 && typeof left === typeof right) {
@@ -73746,7 +73922,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
const elements = expr.elements;
const result = new Array(elements.length);
for (let i = 0; i < elements.length; ++i) {
@@ -73770,7 +73946,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
checkGrammarNumericLiteral(expr);
return +expr.text;
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return evaluateAnnotationPropertyConstantExpression(expr.expression);
case 79 /* Identifier */:
if (isInfinityOrNaNString(expr.escapedText)) {
@@ -73784,7 +73960,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return evaluateAnnotationPropertyConstantExpression(symbol.valueDeclaration.initializer);
}
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isConstantMemberAccess(expr)) {
return getConstantValue2(expr);
}
@@ -73803,7 +73979,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
checkVariableLikeDeclaration(node);
setNodeLinksForPrivateIdentifierScope(node);
- if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 171 /* PropertyDeclaration */ && node.initializer) {
+ if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 172 /* PropertyDeclaration */ && node.initializer) {
error(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name));
}
if (isAnnotationPropertyDeclaration(node)) {
@@ -73894,7 +74070,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.name, Diagnostics.Class_constructor_may_not_be_a_generator);
}
checkFunctionOrMethodDeclaration(node);
- if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 174 /* MethodDeclaration */ && node.body) {
+ if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 176 /* MethodDeclaration */ && node.body) {
error(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name));
}
if (isPrivateIdentifier(node.name) && !getContainingClass(node)) {
@@ -73942,7 +74118,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isPrivateIdentifierClassElementDeclaration(n)) {
return true;
}
- return n.kind === 171 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer;
+ return n.kind === 172 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer;
}
function checkConstructorDeclarationDiagnostics() {
const containingClassDecl = node.parent;
@@ -74005,20 +74181,20 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkGrammarComputedPropertyName(node.name);
checkDecorators(node);
checkSignatureDeclaration(node);
- if (node.kind === 177 /* GetAccessor */) {
+ if (node.kind === 179 /* GetAccessor */) {
if (!(node.flags & 16777216 /* Ambient */) && nodeIsPresent(node.body) && node.flags & 256 /* HasImplicitReturn */) {
if (!(node.flags & 512 /* HasExplicitReturn */)) {
error(node.name, Diagnostics.A_get_accessor_must_return_a_value);
}
}
}
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
if (hasBindableName(node)) {
const symbol = getSymbolOfNode(node);
- const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */);
- const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */);
+ const getter = getDeclarationOfKind(symbol, 179 /* GetAccessor */);
+ const setter = getDeclarationOfKind(symbol, 180 /* SetAccessor */);
if (getter && setter && !(getNodeCheckFlags(getter) & 1 /* TypeChecked */)) {
getNodeLinks(getter).flags |= 1 /* TypeChecked */;
const getterFlags = getEffectiveModifierFlags(getter);
@@ -74039,7 +74215,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
const returnType = getTypeOfAccessors(getSymbolOfNode(node));
- if (node.kind === 177 /* GetAccessor */) {
+ if (node.kind === 179 /* GetAccessor */) {
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
}
}
@@ -74094,7 +74270,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkTypeReferenceNode(node) {
checkGrammarTypeArguments(node, node.typeArguments);
- if (node.kind === 183 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) {
+ if (node.kind === 185 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) {
grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
}
forEach(node.typeArguments, checkSourceElement);
@@ -74158,7 +74334,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let seenRestElement = false;
const hasNamedElement = some(elementTypes, isNamedTupleMember);
for (const e of elementTypes) {
- if (e.kind !== 202 /* NamedTupleMember */ && hasNamedElement) {
+ if (e.kind !== 204 /* NamedTupleMember */ && hasNamedElement) {
grammarErrorOnNode(e, Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names);
break;
}
@@ -74203,7 +74379,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const objectType = type.objectType;
const indexType = type.indexType;
if (isTypeAssignableTo(indexType, getIndexType(objectType, false))) {
- if (accessNode.kind === 212 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
+ if (accessNode.kind === 214 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
}
return type;
@@ -74264,7 +74440,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
forEachChild(node, checkSourceElement);
}
function checkInferType(node) {
- if (!findAncestor(node, (n) => n.parent && n.parent.kind === 194 /* ConditionalType */ && n.parent.extendsType === n)) {
+ if (!findAncestor(node, (n) => n.parent && n.parent.kind === 196 /* ConditionalType */ && n.parent.extendsType === n)) {
grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
}
checkSourceElement(node.typeParameter);
@@ -74274,7 +74450,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!links.typeParametersChecked) {
links.typeParametersChecked = true;
const typeParameter = getDeclaredTypeOfTypeParameter(symbol);
- const declarations = getDeclarationsOfKind(symbol, 167 /* TypeParameter */);
+ const declarations = getDeclarationsOfKind(symbol, 168 /* TypeParameter */);
if (!areTypeParametersIdentical(declarations, [typeParameter], (decl) => [decl])) {
const name = symbolToString(symbol);
for (const declaration of declarations) {
@@ -74312,10 +74488,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.dotDotDotToken && node.questionToken) {
grammarErrorOnNode(node, Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest);
}
- if (node.type.kind === 190 /* OptionalType */) {
+ if (node.type.kind === 192 /* OptionalType */) {
grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type);
}
- if (node.type.kind === 191 /* RestType */) {
+ if (node.type.kind === 193 /* RestType */) {
grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type);
}
checkSourceElement(node.type);
@@ -74326,7 +74502,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getEffectiveDeclarationFlags(n, flagsToCheck) {
let flags = getCombinedModifierFlags(n);
- if (n.parent.kind !== 267 /* InterfaceDeclaration */ && n.parent.kind !== 264 /* ClassDeclaration */ && n.parent.kind !== 232 /* ClassExpression */ && n.flags & 16777216 /* Ambient */) {
+ if (n.parent.kind !== 270 /* InterfaceDeclaration */ && n.parent.kind !== 266 /* ClassDeclaration */ && n.parent.kind !== 234 /* ClassExpression */ && n.flags & 16777216 /* Ambient */) {
if (!(flags & 2 /* Ambient */) && !(isModuleBlock(n.parent) && isModuleDeclaration(n.parent.parent) && isGlobalScopeAugmentation(n.parent.parent))) {
flags |= 1 /* Export */;
}
@@ -74399,7 +74575,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const errorNode2 = subsequentNode.name || subsequentNode;
const subsequentName = subsequentNode.name;
if (node.name && subsequentName && (isPrivateIdentifier(node.name) && isPrivateIdentifier(subsequentName) && node.name.escapedText === subsequentName.escapedText || isComputedPropertyName(node.name) && isComputedPropertyName(subsequentName) || isPropertyNameLiteral(node.name) && isPropertyNameLiteral(subsequentName) && getEscapedTextOfIdentifierOrLiteral(node.name) === getEscapedTextOfIdentifierOrLiteral(subsequentName))) {
- const reportError = (node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode);
+ const reportError = (node.kind === 176 /* MethodDeclaration */ || node.kind === 175 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode);
if (reportError) {
const diagnostic = isStatic(node) ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static;
error(errorNode2, diagnostic);
@@ -74431,14 +74607,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
for (const current of declarations) {
const node = current;
const inAmbientContext = node.flags & 16777216 /* Ambient */;
- const inAmbientContextOrInterface = node.parent && (node.parent.kind === 267 /* InterfaceDeclaration */ || node.parent.kind === 187 /* TypeLiteral */) || inAmbientContext;
+ const inAmbientContextOrInterface = node.parent && (node.parent.kind === 270 /* InterfaceDeclaration */ || node.parent.kind === 189 /* TypeLiteral */) || inAmbientContext;
if (inAmbientContextOrInterface) {
previousDeclaration = void 0;
}
- if ((node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */) && !inAmbientContext) {
+ if ((node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */) && !inAmbientContext) {
hasNonAmbientClass = true;
}
- if (node.kind === 263 /* FunctionDeclaration */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 176 /* Constructor */) {
+ if (node.kind === 265 /* FunctionDeclaration */ || node.kind === 176 /* MethodDeclaration */ || node.kind === 175 /* MethodSignature */ || node.kind === 178 /* Constructor */) {
functionDeclarations.push(node);
const currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);
someNodeFlags |= currentNodeFlags;
@@ -74480,9 +74656,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
}
if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 /* Function */ && declarations) {
- const relatedDiagnostics = filter(declarations, (d) => d.kind === 264 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class));
+ const relatedDiagnostics = filter(declarations, (d) => d.kind === 266 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class));
forEach(declarations, (declaration) => {
- const diagnostic = declaration.kind === 264 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 263 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0;
+ const diagnostic = declaration.kind === 266 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 265 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0;
if (diagnostic) {
addRelatedInfo(
error(getNameOfDeclaration(declaration) || declaration, diagnostic, symbolName(symbol)),
@@ -74561,43 +74737,43 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getDeclarationSpaces(decl) {
let d = decl;
switch (d.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return 2 /* ExportType */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return isAmbientModule(d) || getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */;
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
return 2 /* ExportType */ | 1 /* ExportValue */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */;
- case 280 /* ExportAssignment */:
- case 227 /* BinaryExpression */:
+ case 283 /* ExportAssignment */:
+ case 229 /* BinaryExpression */:
const node2 = d;
const expression = isExportAssignment(node2) ? node2.expression : node2.right;
if (!isEntityNameExpression(expression)) {
return 1 /* ExportValue */;
}
d = expression;
- case 274 /* ImportEqualsDeclaration */:
- case 277 /* NamespaceImport */:
- case 276 /* ImportClause */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 280 /* NamespaceImport */:
+ case 279 /* ImportClause */:
let result = 0 /* None */;
const target = resolveAlias(getSymbolOfNode(d));
forEach(target.declarations, (d2) => {
result |= getDeclarationSpaces(d2);
});
return result;
- case 261 /* VariableDeclaration */:
- case 208 /* BindingElement */:
- case 263 /* FunctionDeclaration */:
- case 279 /* ImportSpecifier */:
+ case 263 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 265 /* FunctionDeclaration */:
+ case 282 /* ImportSpecifier */:
case 79 /* Identifier */:
return 1 /* ExportValue */;
default:
@@ -74848,21 +75024,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let headMessage;
let expectedReturnType;
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
const classSymbol = getSymbolOfNode(node.parent);
const classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
expectedReturnType = voidType;
break;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
const methodType = getTypeOfNode(node.parent);
const descriptorType = createTypedPropertyDescriptorType(methodType);
@@ -74908,15 +75084,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getEntityNameForDecoratorMetadata(node) {
if (node) {
switch (node.kind) {
- case 193 /* IntersectionType */:
- case 192 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 194 /* UnionType */:
return getEntityNameForDecoratorMetadataFromTypeList(node.types);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]);
- case 196 /* ParenthesizedType */:
- case 202 /* NamedTupleMember */:
+ case 198 /* ParenthesizedType */:
+ case 204 /* NamedTupleMember */:
return getEntityNameForDecoratorMetadata(node.type);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return node.typeName;
}
}
@@ -74924,13 +75100,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getEntityNameForDecoratorMetadataFromTypeList(types) {
let commonEntityName;
for (let typeNode of types) {
- while (typeNode.kind === 196 /* ParenthesizedType */ || typeNode.kind === 202 /* NamedTupleMember */) {
+ while (typeNode.kind === 198 /* ParenthesizedType */ || typeNode.kind === 204 /* NamedTupleMember */) {
typeNode = typeNode.type;
}
if (typeNode.kind === 145 /* NeverKeyword */) {
continue;
}
- if (!strictNullChecks && (typeNode.kind === 201 /* LiteralType */ && typeNode.literal.kind === 105 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) {
+ if (!strictNullChecks && (typeNode.kind === 203 /* LiteralType */ && typeNode.literal.kind === 105 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) {
continue;
}
const individualEntityName = getEntityNameForDecoratorMetadata(typeNode);
@@ -74990,9 +75166,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
switch (annotatedDecl.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
const enclosingDecl = annotatedDecl.parent;
Debug.assert(isClassDeclaration(enclosingDecl));
if (hasSyntacticModifier(enclosingDecl, 256 /* Abstract */)) {
@@ -75023,10 +75199,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
ident = da.expression;
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
ident = da.expression;
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
ident = getIdentifierFromEntityNameExpression(da.expression.expression);
break;
default:
@@ -75081,13 +75257,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */);
- if (node.kind === 168 /* Parameter */) {
+ if (node.kind === 169 /* Parameter */) {
checkExternalEmitHelpers(firstDecorator, 32 /* Param */);
}
if (compilerOptions.emitDecoratorMetadata) {
checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */);
switch (node.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const constructor = getFirstConstructorWithBody(node);
if (constructor) {
for (const parameter of constructor.parameters) {
@@ -75095,22 +75271,22 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- const otherKind = node.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */;
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ const otherKind = node.kind === 179 /* GetAccessor */ ? 180 /* SetAccessor */ : 179 /* GetAccessor */;
const otherAccessor = getDeclarationOfKind(getSymbolOfNode(node), otherKind);
markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
for (const parameter of node.parameters) {
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
}
markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(node));
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveTypeAnnotationNode(node));
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node));
const containingSignature = node.parent;
for (const parameter of containingSignature.parameters) {
@@ -75208,7 +75384,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
return node;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return node.name;
default:
return void 0;
@@ -75219,7 +75395,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkDecorators(node);
checkSignatureDeclaration(node);
const functionFlags = getFunctionFlags(node);
- if (node.name && node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name && node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
if (hasBindableName(node)) {
@@ -75235,7 +75411,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkFunctionOrConstructorSymbol(symbol);
}
}
- const body = node.kind === 173 /* MethodSignature */ ? void 0 : node.body;
+ const body = node.kind === 175 /* MethodSignature */ ? void 0 : node.body;
checkSourceElement(body);
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node));
addLazyDiagnostic(checkFunctionOrMethodDeclarationDiagnostics);
@@ -75271,43 +75447,43 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) {
for (const node of potentiallyUnusedIdentifiers) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
checkUnusedClassMembers(node, addDiagnostic);
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 314 /* SourceFile */:
- case 270 /* ModuleDeclaration */:
- case 242 /* Block */:
- case 272 /* CaseBlock */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 317 /* SourceFile */:
+ case 273 /* ModuleDeclaration */:
+ case 244 /* Block */:
+ case 275 /* CaseBlock */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
checkUnusedLocalsAndParameters(node, addDiagnostic);
break;
- case 176 /* Constructor */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
if (node.body) {
checkUnusedLocalsAndParameters(node, addDiagnostic);
}
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 195 /* InferType */:
+ case 197 /* InferType */:
checkUnusedInferTypeParameter(node, addDiagnostic);
break;
default:
@@ -75326,11 +75502,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkUnusedClassMembers(node, addDiagnostic) {
for (const member of node.members) {
switch (member.kind) {
- case 174 /* MethodDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- if (member.kind === 178 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) {
+ case 176 /* MethodDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ if (member.kind === 180 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) {
break;
}
const symbol = getSymbolOfNode(member);
@@ -75338,16 +75514,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
addDiagnostic(member, 0 /* Local */, createDiagnosticForNode(member.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
}
break;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
for (const parameter of member.parameters) {
if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter, 8 /* Private */)) {
addDiagnostic(parameter, 0 /* Local */, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol)));
}
}
break;
- case 181 /* IndexSignature */:
- case 241 /* SemicolonClassElement */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 183 /* IndexSignature */:
+ case 243 /* SemicolonClassElement */:
+ case 177 /* ClassStaticBlockDeclaration */:
break;
default:
Debug.fail("Unexpected class member");
@@ -75371,7 +75547,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
const name = idText(typeParameter.name);
const { parent: parent2 } = typeParameter;
- if (parent2.kind !== 195 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) {
+ if (parent2.kind !== 197 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) {
if (tryAddToSet(seenParentsWithEveryUnused, parent2)) {
const sourceFile = getSourceFileOfNode(parent2);
const range = isJSDocTemplateTag(parent2) ? rangeOfNode(parent2) : rangeOfTypeParameters(sourceFile, parent2.typeParameters);
@@ -75451,7 +75627,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
unusedImports.forEach(([importClause, unuseds]) => {
const importDecl = importClause.parent;
- const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 277 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0);
+ const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 280 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0);
if (nDeclarations === unuseds.length) {
addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 ? createDiagnosticForNode(importDecl, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(first(unuseds).name)) : createDiagnosticForNode(importDecl, Diagnostics.All_imports_in_import_declaration_are_unused));
} else {
@@ -75462,7 +75638,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
unusedDestructures.forEach(([bindingPattern, bindingElements]) => {
const kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */;
if (bindingPattern.elements.length === bindingElements.length) {
- if (bindingElements.length === 1 && bindingPattern.parent.kind === 261 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 262 /* VariableDeclarationList */) {
+ if (bindingElements.length === 1 && bindingPattern.parent.kind === 263 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 264 /* VariableDeclarationList */) {
addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId);
} else {
addDiagnostic(bindingPattern, kind, bindingElements.length === 1 ? createDiagnosticForNode(bindingPattern, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(bindingElements).name)) : createDiagnosticForNode(bindingPattern, Diagnostics.All_destructured_elements_are_unused));
@@ -75475,7 +75651,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
unusedVariables.forEach(([declarationList, declarations]) => {
if (declarationList.declarations.length === declarations.length) {
- addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 244 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused));
+ addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 246 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused));
} else {
for (const decl of declarations) {
addDiagnostic(decl, 0 /* Local */, createDiagnosticForNode(decl, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(decl.name)));
@@ -75504,21 +75680,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (name.kind) {
case 79 /* Identifier */:
return idText(name);
- case 207 /* ArrayBindingPattern */:
- case 206 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
return bindingNameText(cast(first(name.elements), isBindingElement).name);
default:
return Debug.assertNever(name);
}
}
function isImportedDeclaration(node) {
- return node.kind === 276 /* ImportClause */ || node.kind === 279 /* ImportSpecifier */ || node.kind === 277 /* NamespaceImport */;
+ return node.kind === 279 /* ImportClause */ || node.kind === 282 /* ImportSpecifier */ || node.kind === 280 /* NamespaceImport */;
}
function importClauseFromImported(decl) {
- return decl.kind === 276 /* ImportClause */ ? decl : decl.kind === 277 /* NamespaceImport */ ? decl.parent : decl.parent.parent;
+ return decl.kind === 279 /* ImportClause */ ? decl : decl.kind === 280 /* NamespaceImport */ ? decl.parent : decl.parent.parent;
}
function checkBlock(node) {
- if (node.kind === 242 /* Block */) {
+ if (node.kind === 244 /* Block */) {
checkGrammarStatementInAmbientContext(node);
}
if (isFunctionOrModuleBlock(node)) {
@@ -75546,7 +75722,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if ((identifier == null ? void 0 : identifier.escapedText) !== name) {
return false;
}
- if (node.kind === 171 /* PropertyDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */ || node.kind === 305 /* PropertyAssignment */) {
+ if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 176 /* MethodDeclaration */ || node.kind === 175 /* MethodSignature */ || node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */ || node.kind === 308 /* PropertyAssignment */) {
return false;
}
if (node.flags & 16777216 /* Ambient */) {
@@ -75602,7 +75778,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const parent2 = getDeclarationContainer(node);
- if (parent2.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(parent2)) {
+ if (parent2.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(parent2)) {
errorSkippedOn(
"noEmit",
name,
@@ -75620,7 +75796,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const parent2 = getDeclarationContainer(node);
- if (parent2.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(parent2) && parent2.flags & 2048 /* HasAsyncFunctions */) {
+ if (parent2.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(parent2) && parent2.flags & 2048 /* HasAsyncFunctions */) {
errorSkippedOn(
"noEmit",
name,
@@ -75702,7 +75878,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if ((getCombinedNodeFlags(node) & 3 /* BlockScoped */) !== 0 || isParameterDeclaration(node)) {
return;
}
- if (node.kind === 261 /* VariableDeclaration */ && !node.initializer) {
+ if (node.kind === 263 /* VariableDeclaration */ && !node.initializer) {
return;
}
const symbol = getSymbolOfNode(node);
@@ -75712,9 +75888,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const localDeclarationSymbol = resolveName(node, node.name.escapedText, 3 /* Variable */, void 0, void 0, false);
if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) {
if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) {
- const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 262 /* VariableDeclarationList */);
- const container = varDeclList.parent.kind === 244 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0;
- const namesShareScope = container && (container.kind === 242 /* Block */ && isFunctionLike(container.parent) || container.kind === 271 /* ModuleBlock */ || container.kind === 270 /* ModuleDeclaration */ || container.kind === 314 /* SourceFile */);
+ const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 264 /* VariableDeclarationList */);
+ const container = varDeclList.parent.kind === 246 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0;
+ const namesShareScope = container && (container.kind === 244 /* Block */ && isFunctionLike(container.parent) || container.kind === 274 /* ModuleBlock */ || container.kind === 273 /* ModuleDeclaration */ || container.kind === 317 /* SourceFile */);
if (!namesShareScope) {
const name = symbolToString(localDeclarationSymbol);
error(node, Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name);
@@ -75735,7 +75911,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!node.name) {
return;
}
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
if (hasOnlyExpressionInitializer(node) && node.initializer) {
checkExpressionCached(node.initializer);
@@ -75749,7 +75925,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ES2018 */) {
checkExternalEmitHelpers(node, 4 /* Rest */);
}
- if (node.propertyName && node.propertyName.kind === 166 /* ComputedPropertyName */) {
+ if (node.propertyName && node.propertyName.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.propertyName);
}
const parent2 = node.parent.parent;
@@ -75769,7 +75945,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
if (isBindingPattern(node.name)) {
- if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
+ if (node.name.kind === 209 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
checkExternalEmitHelpers(node, 512 /* Read */);
}
forEach(node.name.elements, checkSourceElement);
@@ -75779,7 +75955,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
if (isBindingPattern(node.name)) {
- const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 250 /* ForInStatement */;
+ const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 252 /* ForInStatement */;
const needCheckWidenedType = !some(node.name.elements, not(isOmittedExpression));
if (needCheckInitializer || needCheckWidenedType) {
const widenedType = getWidenedTypeForVariableLikeDeclaration(node);
@@ -75802,7 +75978,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const symbol = getSymbolOfNode(node);
- if (symbol.flags & 2097152 /* Alias */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 208 /* BindingElement */ ? node.parent.parent : node)) {
+ if (symbol.flags & 2097152 /* Alias */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 210 /* BindingElement */ ? node.parent.parent : node)) {
checkAliasSymbol(node);
return;
}
@@ -75811,7 +75987,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const initializer = hasOnlyExpressionInitializer(node) && getEffectiveInitializer(node);
if (initializer) {
const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((_a2 = symbol.exports) == null ? void 0 : _a2.size);
- if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 250 /* ForInStatement */) {
+ if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 252 /* ForInStatement */) {
checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, void 0);
}
}
@@ -75832,9 +76008,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name));
}
}
- if (node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 170 /* PropertySignature */ && node.kind !== 172 /* AnnotationPropertyDeclaration */) {
+ if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 173 /* AnnotationPropertyDeclaration */) {
checkExportsOnMergedDeclarations(node);
- if (node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
+ if (node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */) {
checkVarDeclaredNamesNotShadowed(node);
}
checkCollisionsForDeclarationName(node, node.name);
@@ -75842,7 +76018,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) {
const nextDeclarationName = getNameOfDeclaration(nextDeclaration);
- const message = nextDeclaration.kind === 171 /* PropertyDeclaration */ || nextDeclaration.kind === 170 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;
+ const message = nextDeclaration.kind === 172 /* PropertyDeclaration */ || nextDeclaration.kind === 171 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;
const declName = declarationNameToString(nextDeclarationName);
const err = error(
nextDeclarationName,
@@ -75859,7 +76035,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function areDeclarationFlagsIdentical(left, right) {
- if (left.kind === 168 /* Parameter */ && right.kind === 261 /* VariableDeclaration */ || left.kind === 261 /* VariableDeclaration */ && right.kind === 168 /* Parameter */) {
+ if (left.kind === 169 /* Parameter */ && right.kind === 263 /* VariableDeclaration */ || left.kind === 263 /* VariableDeclaration */ && right.kind === 169 /* Parameter */) {
return true;
}
if (hasQuestionToken(left) !== hasQuestionToken(right)) {
@@ -75895,7 +76071,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const type = checkTruthinessExpression(node.expression);
checkTestingKnownTruthyCallableOrAwaitableType(node.expression, type, node.thenStatement);
checkSourceElement(node.thenStatement);
- if (node.thenStatement.kind === 243 /* EmptyStatement */) {
+ if (node.thenStatement.kind === 245 /* EmptyStatement */) {
error(node.thenStatement, Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
}
checkSourceElement(node.elseStatement);
@@ -76011,12 +76187,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkForStatement(node) {
if (!checkGrammarStatementInAmbientContext(node)) {
- if (node.initializer && node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer && node.initializer.kind === 264 /* VariableDeclarationList */) {
checkGrammarVariableDeclarationList(node.initializer);
}
}
if (node.initializer) {
- if (node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind === 264 /* VariableDeclarationList */) {
forEach(node.initializer.declarations, checkVariableDeclaration);
} else {
checkExpression(node.initializer);
@@ -76046,12 +76222,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ES2015 */) {
checkExternalEmitHelpers(node, 256 /* ForOfIncludes */);
}
- if (node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind === 264 /* VariableDeclarationList */) {
checkForInOrForOfVariableDeclaration(node);
} else {
const varExpr = node.initializer;
const iteratedType = checkRightHandSideOfForOf(node);
- if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) {
+ if (varExpr.kind === 211 /* ArrayLiteralExpression */ || varExpr.kind === 212 /* ObjectLiteralExpression */) {
checkDestructuringAssignment(varExpr, iteratedType || errorType);
} else {
const leftType = checkExpression(varExpr);
@@ -76073,7 +76249,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkForInStatement(node) {
checkGrammarForInOrForOfStatement(node);
const rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression));
- if (node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind === 264 /* VariableDeclarationList */) {
const variable = node.initializer.declarations[0];
if (variable && isBindingPattern(variable.name)) {
error(variable.name, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
@@ -76082,7 +76258,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
const varExpr = node.initializer;
const leftType = checkExpression(varExpr);
- if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) {
+ if (varExpr.kind === 211 /* ArrayLiteralExpression */ || varExpr.kind === 212 /* ObjectLiteralExpression */) {
error(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
} else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) {
error(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any);
@@ -76639,11 +76815,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const functionFlags = getFunctionFlags(container);
if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) {
const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
- if (container.kind === 178 /* SetAccessor */) {
+ if (container.kind === 180 /* SetAccessor */) {
if (node.expression) {
error(node, Diagnostics.Setters_cannot_return_a_value);
}
- } else if (container.kind === 176 /* Constructor */) {
+ } else if (container.kind === 178 /* Constructor */) {
if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) {
error(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
}
@@ -76654,7 +76830,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression);
}
}
- } else if (container.kind !== 176 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) {
+ } else if (container.kind !== 178 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) {
error(node, Diagnostics.Not_all_code_paths_return_a_value);
}
}
@@ -76679,7 +76855,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const expressionType = checkExpression(node.expression);
const expressionIsLiteral = isLiteralType3(expressionType);
forEach(node.caseBlock.clauses, (clause) => {
- if (clause.kind === 299 /* DefaultClause */ && !hasDuplicateDefaultClause) {
+ if (clause.kind === 302 /* DefaultClause */ && !hasDuplicateDefaultClause) {
if (firstDefaultClause === void 0) {
firstDefaultClause = clause;
} else {
@@ -76687,7 +76863,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
hasDuplicateDefaultClause = true;
}
}
- if (clause.kind === 298 /* CaseClause */) {
+ if (clause.kind === 301 /* CaseClause */) {
addLazyDiagnostic(createLazyCaseClauseDiagnostics(clause));
}
forEach(clause.statements, checkSourceElement);
@@ -76719,7 +76895,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isFunctionLike(current)) {
return "quit";
}
- if (current.kind === 257 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) {
+ if (current.kind === 259 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) {
grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNode(node.label));
return true;
}
@@ -76803,8 +76979,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const indexInfos = getApplicableIndexInfos(type, propNameType);
- const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 267 /* InterfaceDeclaration */) : void 0;
- const propDeclaration = declaration && declaration.kind === 227 /* BinaryExpression */ || name && name.kind === 166 /* ComputedPropertyName */ ? declaration : void 0;
+ const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 270 /* InterfaceDeclaration */) : void 0;
+ const propDeclaration = declaration && declaration.kind === 229 /* BinaryExpression */ || name && name.kind === 167 /* ComputedPropertyName */ ? declaration : void 0;
const localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : void 0;
for (const info of indexInfos) {
const localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : void 0;
@@ -76828,7 +77004,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkIndexConstraintForIndexSignature(type, checkInfo) {
const declaration = checkInfo.declaration;
const indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
- const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 267 /* InterfaceDeclaration */) : void 0;
+ const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 270 /* InterfaceDeclaration */) : void 0;
const localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : void 0;
for (const info of indexInfos) {
if (info === checkInfo)
@@ -76933,7 +77109,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkTypeParametersNotReferenced(root, typeParameters, index) {
visit(root);
function visit(node) {
- if (node.kind === 183 /* TypeReference */) {
+ if (node.kind === 185 /* TypeReference */) {
const type = getTypeFromTypeReference(node);
if (type.flags & 262144 /* TypeParameter */) {
for (let i = index; i < typeParameters.length; i++) {
@@ -77360,7 +77536,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getCheckFlags(s) & 1 /* Instantiated */ ? s.target : s;
}
function getClassOrInterfaceDeclarationsOfSymbol(symbol) {
- return filter(symbol.declarations, (d) => d.kind === 264 /* ClassDeclaration */ || d.kind === 267 /* InterfaceDeclaration */);
+ return filter(symbol.declarations, (d) => d.kind === 266 /* ClassDeclaration */ || d.kind === 270 /* InterfaceDeclaration */);
}
function checkKindsOfPropertyMemberOverrides(type, baseType) {
var _a2, _b, _c, _d;
@@ -77390,7 +77566,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue basePropertyCheck;
}
}
- if (derivedClassDecl.kind === 232 /* ClassExpression */) {
+ if (derivedClassDecl.kind === 234 /* ClassExpression */) {
error(
derivedClassDecl,
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
@@ -77425,7 +77601,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
} else if (useDefineForClassFields) {
- const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 171 /* PropertyDeclaration */ && !d.initializer);
+ const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer);
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_d = derived.declarations) == null ? void 0 : _d.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
const propName = uninitialized.name;
@@ -77528,7 +77704,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isPropertyWithoutInitializer(node) {
- return node.kind === 171 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer;
+ return node.kind === 172 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer;
}
function isPropertyInitializedInStaticBlocks(propName, propType, staticBlocks, startPos, endPos) {
for (const staticBlock of staticBlocks) {
@@ -77562,7 +77738,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkExportsOnMergedDeclarations(node);
const symbol = getSymbolOfNode(node);
checkTypeParameterListsIdentical(symbol);
- const firstInterfaceDecl = getDeclarationOfKind(symbol, 267 /* InterfaceDeclaration */);
+ const firstInterfaceDecl = getDeclarationOfKind(symbol, 270 /* InterfaceDeclaration */);
if (node === firstInterfaceDecl) {
const type = getDeclaredTypeOfSymbol(symbol);
const typeWithThis = getTypeWithThisArgument(type);
@@ -77661,7 +77837,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return value;
function evaluate(expr) {
switch (expr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const value2 = evaluate(expr.operand);
if (typeof value2 === "number") {
switch (expr.operator) {
@@ -77674,7 +77850,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const left = evaluate(expr.left);
const right = evaluate(expr.right);
if (typeof left === "number" && typeof right === "number") {
@@ -77714,7 +77890,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
checkGrammarNumericLiteral(expr);
return +expr.text;
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return evaluate(expr.expression);
case 79 /* Identifier */:
const identifier = expr;
@@ -77722,13 +77898,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return +identifier.escapedText;
}
return nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isConstantMemberAccess(expr)) {
const type = getTypeOfExpression(expr.expression);
if (type.symbol && type.symbol.flags & 384 /* Enum */) {
let name;
- if (expr.kind === 211 /* PropertyAccessExpression */) {
+ if (expr.kind === 213 /* PropertyAccessExpression */) {
name = expr.name.escapedText;
} else {
name = escapeLeadingUnderscores(cast(expr.argumentExpression, isLiteralExpression).text);
@@ -77762,7 +77938,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (type === errorType) {
return false;
}
- return node.kind === 79 /* Identifier */ || node.kind === 211 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || node.kind === 212 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && isStringLiteralLike(node.argumentExpression);
+ return node.kind === 79 /* Identifier */ || node.kind === 213 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || node.kind === 214 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && isStringLiteralLike(node.argumentExpression);
}
function checkEnumDeclaration(node) {
addLazyDiagnostic(() => checkEnumDeclarationWorker(node));
@@ -77786,7 +77962,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let seenEnumMissingInitialInitializer = false;
forEach(enumSymbol.declarations, (declaration) => {
- if (declaration.kind !== 269 /* EnumDeclaration */) {
+ if (declaration.kind !== 272 /* EnumDeclaration */) {
return false;
}
const enumDeclaration = declaration;
@@ -77813,7 +77989,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const declarations = symbol.declarations;
if (declarations) {
for (const declaration of declarations) {
- if ((declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 263 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 16777216 /* Ambient */)) {
+ if ((declaration.kind === 266 /* ClassDeclaration */ || declaration.kind === 265 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 16777216 /* Ambient */)) {
return declaration;
}
}
@@ -77869,7 +78045,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged);
}
}
- const mergedClass = getDeclarationOfKind(symbol, 264 /* ClassDeclaration */);
+ const mergedClass = getDeclarationOfKind(symbol, 266 /* ClassDeclaration */);
if (mergedClass && inSameLexicalScope(node, mergedClass)) {
getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */;
}
@@ -77900,21 +78076,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkModuleAugmentationElement(node, isGlobalAugmentation) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
for (const decl of node.declarationList.declarations) {
checkModuleAugmentationElement(decl, isGlobalAugmentation);
}
break;
- case 280 /* ExportAssignment */:
- case 281 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 284 /* ExportDeclaration */:
grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
break;
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
break;
- case 208 /* BindingElement */:
- case 261 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
const name = node.name;
if (isBindingPattern(name)) {
for (const el of name.elements) {
@@ -77922,12 +78098,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
break;
}
- case 264 /* ClassDeclaration */:
- case 269 /* EnumDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
if (isGlobalAugmentation) {
return;
}
@@ -77938,12 +78114,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
return node;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
do {
node = node.left;
} while (node.kind !== 79 /* Identifier */);
return node;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
do {
if (isModuleExportsAccessExpression(node.expression) && !isPrivateIdentifier(node.name)) {
return node.name;
@@ -77962,9 +78138,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(moduleName, Diagnostics.String_literal_expected);
return false;
}
- const inAmbientExternalModule = node.parent.kind === 271 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
- if (node.parent.kind !== 314 /* SourceFile */ && !inAmbientExternalModule) {
- error(moduleName, node.kind === 281 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
+ const inAmbientExternalModule = node.parent.kind === 274 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
+ if (node.parent.kind !== 317 /* SourceFile */ && !inAmbientExternalModule) {
+ error(moduleName, node.kind === 284 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
return false;
}
if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) {
@@ -77993,8 +78169,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
symbol = getMergedSymbol(symbol.exportSymbol || symbol);
if (isInJSFile(node) && !(target.flags & 111551 /* Value */) && !isTypeOnlyImportOrExportDeclaration(node)) {
const errorNode = isImportOrExportSpecifier(node) ? node.propertyName || node.name : isNamedDeclaration(node) ? node.name : node;
- Debug.assert(node.kind !== 283 /* NamespaceExport */);
- if (node.kind === 284 /* ExportSpecifier */) {
+ Debug.assert(node.kind !== 286 /* NamespaceExport */);
+ if (node.kind === 287 /* ExportSpecifier */) {
const diag2 = error(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
const alreadyExportedSymbol = (_b = (_a2 = getSourceFileOfNode(node).symbol) == null ? void 0 : _a2.exports) == null ? void 0 : _b.get((node.propertyName || node.name).escapedText);
if (alreadyExportedSymbol === target) {
@@ -78008,7 +78184,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
} else {
- Debug.assert(node.kind !== 261 /* VariableDeclaration */);
+ Debug.assert(node.kind !== 263 /* VariableDeclaration */);
const importDeclaration = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration));
const moduleSpecifier = (_e = importDeclaration && ((_d = tryGetModuleSpecifierFromDeclaration(importDeclaration)) == null ? void 0 : _d.text)) != null ? _e : "...";
const importedIdentifier = unescapeLeadingUnderscores(isIdentifier(errorNode) ? errorNode.escapedText : symbol.escapedName);
@@ -78024,7 +78200,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const targetFlags = getAllSymbolFlags(target);
const excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) | (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0);
if (targetFlags & excludedMeanings) {
- const message = node.kind === 284 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
+ const message = node.kind === 287 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
error(node, message, symbolToString(symbol));
}
if (compilerOptions.isolatedModules && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216 /* Ambient */)) {
@@ -78032,25 +78208,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const isType3 = !(targetFlags & 111551 /* Value */);
if (isType3 || typeOnlyAlias) {
switch (node.kind) {
- case 276 /* ImportClause */:
- case 279 /* ImportSpecifier */:
- case 274 /* ImportEqualsDeclaration */: {
+ case 279 /* ImportClause */:
+ case 282 /* ImportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */: {
if (compilerOptions.preserveValueImports) {
Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name");
const message = isType3 ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled;
- const name = idText(node.kind === 279 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
+ const name = idText(node.kind === 282 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
addTypeOnlyDeclarationRelatedInfo(
error(node, message, name),
isType3 ? void 0 : typeOnlyAlias,
name
);
}
- if (isType3 && node.kind === 274 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) {
+ if (isType3 && node.kind === 277 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) {
error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided);
}
break;
}
- case 284 /* ExportSpecifier */: {
+ case 287 /* ExportSpecifier */: {
if (getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) {
const message = isType3 ? Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled;
const name = idText(node.propertyName || node.name);
@@ -78119,7 +78295,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkImportBinding(node) {
checkCollisionsForDeclarationName(node, node.name);
checkAliasSymbol(node);
- if (node.kind === 279 /* ImportSpecifier */ && idText(node.propertyName || node.name) === "default" && getESModuleInterop(compilerOptions) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
+ if (node.kind === 282 /* ImportSpecifier */ && idText(node.propertyName || node.name) === "default" && getESModuleInterop(compilerOptions) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
}
}
@@ -78166,7 +78342,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkImportBinding(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (importClause.namedBindings.kind === 280 /* NamespaceImport */) {
checkImportBinding(importClause.namedBindings);
if (moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && getESModuleInterop(compilerOptions)) {
checkExternalEmitHelpers(node, 65536 /* ImportStar */);
@@ -78192,7 +78368,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (hasSyntacticModifier(node, 1 /* Export */)) {
markExportAsReferenced(node);
}
- if (node.moduleReference.kind !== 286 /* ExternalModuleReference */) {
+ if (node.moduleReference.kind !== 289 /* ExternalModuleReference */) {
const target = resolveAlias(getSymbolOfNode(node));
if (target !== unknownSymbol) {
const targetFlags = getAllSymbolFlags(target);
@@ -78230,9 +78406,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
if (node.exportClause && !isNamespaceExport(node.exportClause)) {
forEach(node.exportClause.elements, checkExportSpecifier);
- const inAmbientExternalModule = node.parent.kind === 271 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
- const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 271 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 16777216 /* Ambient */;
- if (node.parent.kind !== 314 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
+ const inAmbientExternalModule = node.parent.kind === 274 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
+ const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 274 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 16777216 /* Ambient */;
+ if (node.parent.kind !== 317 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
error(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
}
} else {
@@ -78258,7 +78434,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkGrammarExportDeclaration(node) {
var _a2;
if (node.isTypeOnly) {
- if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 282 /* NamedExports */) {
+ if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 285 /* NamedExports */) {
return checkGrammarNamedImportsOrExports(node.exportClause);
} else {
return grammarErrorOnNode(node, Diagnostics.Only_named_exports_may_use_export_type);
@@ -78267,7 +78443,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function checkGrammarModuleElementContext(node, errorMessage) {
- const isInAppropriateContext = node.parent.kind === 314 /* SourceFile */ || node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 270 /* ModuleDeclaration */;
+ const isInAppropriateContext = node.parent.kind === 317 /* SourceFile */ || node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 273 /* ModuleDeclaration */;
if (!isInAppropriateContext) {
grammarErrorOnFirstToken(node, errorMessage);
}
@@ -78340,7 +78516,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
ident = node.expression;
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
ident = node.expression;
break;
default:
@@ -78365,8 +78541,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
return;
}
- const container = node.parent.kind === 314 /* SourceFile */ ? node.parent : node.parent.parent;
- if (container.kind === 270 /* ModuleDeclaration */ && !isAmbientModule(container)) {
+ const container = node.parent.kind === 317 /* SourceFile */ ? node.parent : node.parent.parent;
+ if (container.kind === 273 /* ModuleDeclaration */ && !isAmbientModule(container)) {
if (node.isExportEquals) {
error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
} else {
@@ -78478,186 +78654,188 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
cancellationToken.throwIfCancellationRequested();
}
}
- if (kind >= 244 /* FirstStatement */ && kind <= 260 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) {
+ if (kind >= 246 /* FirstStatement */ && kind <= 262 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) {
errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, Diagnostics.Unreachable_code_detected);
}
switch (kind) {
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return checkTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return checkParameter(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return checkPropertyDeclaration(node);
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
return checkPropertySignature(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return checkPropertyDeclaration(node);
- case 185 /* ConstructorType */:
- case 184 /* FunctionType */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 187 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return checkSignatureDeclaration(node);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return checkMethodDeclaration(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return checkClassStaticBlockDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return checkConstructorDeclaration(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return checkAccessorDeclaration(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return checkTypeReferenceNode(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return checkTypePredicate(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return checkTypeQuery(node);
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return checkTypeLiteral(node);
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return checkArrayType(node);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
return checkTupleType(node);
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return checkUnionOrIntersectionType(node);
- case 196 /* ParenthesizedType */:
- case 190 /* OptionalType */:
- case 191 /* RestType */:
+ case 198 /* ParenthesizedType */:
+ case 192 /* OptionalType */:
+ case 193 /* RestType */:
return checkSourceElement(node.type);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return checkThisType(node);
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return checkTypeOperator(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return checkConditionalType(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return checkInferType(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return checkTemplateLiteralType(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return checkImportType(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return checkNamedTupleMember(node);
- case 337 /* JSDocAugmentsTag */:
+ case 340 /* JSDocAugmentsTag */:
return checkJSDocAugmentsTag(node);
- case 338 /* JSDocImplementsTag */:
+ case 341 /* JSDocImplementsTag */:
return checkJSDocImplementsTag(node);
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return checkJSDocTypeAliasTag(node);
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return checkJSDocTemplateTag(node);
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return checkJSDocTypeTag(node);
- case 333 /* JSDocLink */:
- case 334 /* JSDocLinkCode */:
- case 335 /* JSDocLinkPlain */:
+ case 336 /* JSDocLink */:
+ case 337 /* JSDocLinkCode */:
+ case 338 /* JSDocLinkPlain */:
return checkJSDocLinkLikeTag(node);
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
return checkJSDocParameterTag(node);
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
return checkJSDocPropertyTag(node);
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
checkJSDocFunctionType(node);
- case 324 /* JSDocNonNullableType */:
- case 323 /* JSDocNullableType */:
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
- case 331 /* JSDocTypeLiteral */:
+ case 327 /* JSDocNonNullableType */:
+ case 326 /* JSDocNullableType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
+ case 334 /* JSDocTypeLiteral */:
checkJSDocTypeIsInJsFile(node);
forEachChild(node, checkSourceElement);
return;
- case 327 /* JSDocVariadicType */:
+ case 330 /* JSDocVariadicType */:
checkJSDocVariadicType(node);
return;
- case 318 /* JSDocTypeExpression */:
+ case 321 /* JSDocTypeExpression */:
return checkSourceElement(node.type);
- case 342 /* JSDocPublicTag */:
- case 344 /* JSDocProtectedTag */:
- case 343 /* JSDocPrivateTag */:
+ case 345 /* JSDocPublicTag */:
+ case 347 /* JSDocProtectedTag */:
+ case 346 /* JSDocPrivateTag */:
return checkJSDocAccessibilityModifiers(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return checkIndexedAccessType(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return checkMappedType(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return checkFunctionDeclaration(node);
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
return checkBlock(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return checkVariableStatement(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return checkExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return checkIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return checkDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return checkWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return checkForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return checkForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return checkForOfStatement(node);
- case 252 /* ContinueStatement */:
- case 253 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
return checkBreakOrContinueStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return checkReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return checkWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return checkSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return checkLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return checkThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return checkTryStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return checkVariableDeclaration(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return checkBindingElement(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return checkClassDeclaration(node);
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return checkStructDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return checkAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return;
+ case 270 /* InterfaceDeclaration */:
return checkInterfaceDeclaration(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return checkTypeAliasDeclaration(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return checkEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return checkModuleDeclaration(node);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return checkImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return checkImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return checkExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return checkExportAssignment(node);
- case 243 /* EmptyStatement */:
- case 260 /* DebuggerStatement */:
+ case 245 /* EmptyStatement */:
+ case 262 /* DebuggerStatement */:
checkGrammarStatementInAmbientContext(node);
return;
- case 285 /* MissingDeclaration */:
+ case 288 /* MissingDeclaration */:
return checkMissingDeclaration(node);
}
}
@@ -78744,33 +78922,33 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
currentNode = node;
instantiationCount = 0;
switch (node.kind) {
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 215 /* TaggedTemplateExpression */:
- case 169 /* Decorator */:
- case 289 /* JsxOpeningElement */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 170 /* Decorator */:
+ case 292 /* JsxOpeningElement */:
resolveUntypedCall(node);
break;
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
checkFunctionExpressionOrObjectLiteralMethodDeferred(node);
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
checkAccessorDeclaration(node);
break;
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
checkClassExpressionDeferred(node);
break;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
checkTypeParameterDeferred(node);
break;
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
checkJsxSelfClosingElementDeferred(node);
break;
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
checkJsxElementDeferred(node);
break;
}
@@ -78934,27 +79112,27 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
copySymbols(location.locals, meaning);
}
switch (location.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (!isExternalModule(location))
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
copyLocallyVisibleExportSymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */);
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */);
break;
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
const className = location.name;
if (className) {
copySymbol(location.symbol, meaning);
}
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
if (!isStaticSymbol) {
copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */);
}
break;
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
const funcName = location.name;
if (funcName) {
copySymbol(location.symbol, meaning);
@@ -78987,7 +79165,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function copyLocallyVisibleExportSymbols(source, meaning2) {
if (meaning2) {
source.forEach((symbol) => {
- if (!getDeclarationOfKind(symbol, 284 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 283 /* NamespaceExport */)) {
+ if (!getDeclarationOfKind(symbol, 287 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 286 /* NamespaceExport */)) {
copySymbol(symbol, meaning2);
}
});
@@ -78998,16 +79176,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return name.kind === 79 /* Identifier */ && isTypeDeclaration(name.parent) && getNameOfDeclaration(name.parent) === name;
}
function isTypeReferenceIdentifier(node) {
- while (node.parent.kind === 165 /* QualifiedName */) {
+ while (node.parent.kind === 166 /* QualifiedName */) {
node = node.parent;
}
- return node.parent.kind === 183 /* TypeReference */;
+ return node.parent.kind === 185 /* TypeReference */;
}
function isHeritageClauseElementIdentifier(node) {
- while (node.parent.kind === 211 /* PropertyAccessExpression */) {
+ while (node.parent.kind === 213 /* PropertyAccessExpression */) {
node = node.parent;
}
- return node.parent.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.parent.kind === 236 /* ExpressionWithTypeArguments */;
}
function forEachEnclosingClass(node, callback) {
let result;
@@ -79034,13 +79212,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return !!forEachEnclosingClass(node, (n) => n === classDeclaration);
}
function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {
- while (nodeOnRightSide.parent.kind === 165 /* QualifiedName */) {
+ while (nodeOnRightSide.parent.kind === 166 /* QualifiedName */) {
nodeOnRightSide = nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 274 /* ImportEqualsDeclaration */) {
+ if (nodeOnRightSide.parent.kind === 277 /* ImportEqualsDeclaration */) {
return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : void 0;
}
- if (nodeOnRightSide.parent.kind === 280 /* ExportAssignment */) {
+ if (nodeOnRightSide.parent.kind === 283 /* ExportAssignment */) {
return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : void 0;
}
return void 0;
@@ -79066,7 +79244,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
node = parent2;
parent2 = parent2.parent;
}
- if (parent2 && parent2.kind === 205 /* ImportType */ && parent2.qualifier === node) {
+ if (parent2 && parent2.kind === 207 /* ImportType */ && parent2.qualifier === node) {
return parent2;
}
return void 0;
@@ -79075,7 +79253,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isDeclarationName(name)) {
return getSymbolOfNode(name.parent);
}
- if (isInJSFile(name) && name.parent.kind === 211 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) {
+ if (isInJSFile(name) && name.parent.kind === 213 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) {
if (!isPrivateIdentifier(name) && !isJSDocMemberName(name)) {
const specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name);
if (specialPropertyAssignmentSymbol) {
@@ -79083,7 +79261,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (name.parent.kind === 280 /* ExportAssignment */ && isEntityNameExpression(name)) {
+ if (name.parent.kind === 283 /* ExportAssignment */ && isEntityNameExpression(name)) {
const success = resolveEntityName(
name,
111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */,
@@ -79093,7 +79271,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return success;
}
} else if (isEntityName(name) && isInRightSideOfImportOrExportAssignment(name)) {
- const importEqualsDeclaration = getAncestor(name, 274 /* ImportEqualsDeclaration */);
+ const importEqualsDeclaration = getAncestor(name, 277 /* ImportEqualsDeclaration */);
Debug.assert(importEqualsDeclaration !== void 0);
return getSymbolOfPartOfRightHandSideOfImportEquals(name, true);
}
@@ -79110,7 +79288,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (isHeritageClauseElementIdentifier(name)) {
let meaning = 0 /* None */;
- if (name.parent.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (name.parent.kind === 236 /* ExpressionWithTypeArguments */) {
meaning = 788968 /* Type */;
if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) {
meaning |= 111551 /* Value */;
@@ -79124,10 +79302,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return entityNameSymbol;
}
}
- if (name.parent.kind === 349 /* JSDocParameterTag */) {
+ if (name.parent.kind === 352 /* JSDocParameterTag */) {
return getParameterSymbolFromJSDoc(name.parent);
}
- if (name.parent.kind === 167 /* TypeParameter */ && name.parent.parent.kind === 353 /* JSDocTemplateTag */) {
+ if (name.parent.kind === 168 /* TypeParameter */ && name.parent.parent.kind === 356 /* JSDocTemplateTag */) {
Debug.assert(!isInJSFile(name));
const typeParameter = getTypeParameterFromJsDoc(name.parent);
return typeParameter && typeParameter.symbol;
@@ -79159,12 +79337,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
} else if (isPrivateIdentifier(name)) {
return getSymbolForPrivateIdentifierExpression(name);
- } else if (name.kind === 211 /* PropertyAccessExpression */ || name.kind === 165 /* QualifiedName */) {
+ } else if (name.kind === 213 /* PropertyAccessExpression */ || name.kind === 166 /* QualifiedName */) {
const links = getNodeLinks(name);
if (links.resolvedSymbol) {
return links.resolvedSymbol;
}
- if (name.kind === 211 /* PropertyAccessExpression */) {
+ if (name.kind === 213 /* PropertyAccessExpression */) {
checkPropertyAccessExpression(name, 0 /* Normal */);
if (!links.resolvedSymbol) {
const expressionType = checkExpressionCached(name.expression);
@@ -79204,11 +79382,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return resolveJSDocMemberName(name);
}
} else if (isTypeReferenceIdentifier(name)) {
- const meaning = name.parent.kind === 183 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */;
+ const meaning = name.parent.kind === 185 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */;
const symbol = resolveEntityName(name, meaning, true, true);
return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name);
}
- if (name.parent.kind === 182 /* TypePredicate */) {
+ if (name.parent.kind === 184 /* TypePredicate */) {
return resolveEntityName(name, 1 /* FunctionScopedVariable */, true);
}
return void 0;
@@ -79233,7 +79411,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getSymbolAtLocation(node, ignoreErrors) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return isExternalModule(node) ? getMergedSymbol(node.symbol) : void 0;
}
const { parent: parent2 } = node;
@@ -79250,7 +79428,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.kind === 79 /* Identifier */) {
if (isInRightSideOfImportOrExportAssignment(node)) {
return getSymbolOfNameOrPropertyAccessExpression(node);
- } else if (parent2.kind === 208 /* BindingElement */ && grandParent.kind === 206 /* ObjectBindingPattern */ && node === parent2.propertyName) {
+ } else if (parent2.kind === 210 /* BindingElement */ && grandParent.kind === 208 /* ObjectBindingPattern */ && node === parent2.propertyName) {
const typeOfPattern = getTypeOfNode(grandParent);
const propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText);
if (propertyDeclaration) {
@@ -79269,8 +79447,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
- case 211 /* PropertyAccessExpression */:
- case 165 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
if (!isThisInTypeQuery(node)) {
return getSymbolOfNameOrPropertyAccessExpression(node);
}
@@ -79285,19 +79463,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isInExpressionContext(node)) {
return checkExpression(node).symbol;
}
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return getTypeFromThisTypeNode(node).symbol;
case 107 /* SuperKeyword */:
return checkExpression(node).symbol;
case 136 /* ConstructorKeyword */:
const constructorDeclaration = node.parent;
- if (constructorDeclaration && constructorDeclaration.kind === 176 /* Constructor */) {
+ if (constructorDeclaration && constructorDeclaration.kind === 178 /* Constructor */) {
return constructorDeclaration.parent.symbol;
}
return void 0;
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 275 /* ImportDeclaration */ || node.parent.kind === 281 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(node.parent, false) || isImportCall(node.parent)) || isLiteralTypeNode(node.parent) && isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent) {
+ if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 278 /* ImportDeclaration */ || node.parent.kind === 284 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(node.parent, false) || isImportCall(node.parent)) || isLiteralTypeNode(node.parent) && isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent) {
return resolveExternalModuleName(node, node, ignoreErrors);
}
if (isCallExpression(parent2) && isBindableObjectDefinePropertyCall(parent2) && parent2.arguments[1] === node) {
@@ -79311,14 +79489,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 38 /* EqualsGreaterThanToken */:
case 84 /* ClassKeyword */:
return getSymbolOfNode(node.parent);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : void 0;
case 94 /* ExportKeyword */:
return isExportAssignment(node.parent) ? Debug.checkDefined(node.parent.symbol) : void 0;
case 101 /* ImportKeyword */:
case 104 /* NewKeyword */:
return isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : void 0;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return checkExpression(node).symbol;
default:
return void 0;
@@ -79334,7 +79512,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
function getShorthandAssignmentValueSymbol(location) {
- if (location && location.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (location && location.kind === 309 /* ShorthandPropertyAssignment */) {
return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */, true);
}
return void 0;
@@ -79419,16 +79597,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getTypeOfNode(node);
}
function getTypeOfAssignmentPattern(expr) {
- Debug.assert(expr.kind === 210 /* ObjectLiteralExpression */ || expr.kind === 209 /* ArrayLiteralExpression */);
- if (expr.parent.kind === 251 /* ForOfStatement */) {
+ Debug.assert(expr.kind === 212 /* ObjectLiteralExpression */ || expr.kind === 211 /* ArrayLiteralExpression */);
+ if (expr.parent.kind === 253 /* ForOfStatement */) {
const iteratedType = checkRightHandSideOfForOf(expr.parent);
return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 227 /* BinaryExpression */) {
+ if (expr.parent.kind === 229 /* BinaryExpression */) {
const iteratedType = getTypeOfExpression(expr.parent.right);
return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 305 /* PropertyAssignment */) {
+ if (expr.parent.kind === 308 /* PropertyAssignment */) {
const node2 = cast(expr.parent.parent, isObjectLiteralExpression);
const typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node2) || errorType;
const propertyIndex = indexOfNode(node2.properties, expr.parent);
@@ -79461,7 +79639,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
case 10 /* StringLiteral */:
return getStringLiteralType(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
const nameType = checkComputedPropertyName(name);
return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType;
default:
@@ -79552,7 +79730,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const parentSymbol = getParentOfSymbol(symbol);
if (parentSymbol) {
- if (parentSymbol.flags & 512 /* ValueModule */ && ((_a2 = parentSymbol.valueDeclaration) == null ? void 0 : _a2.kind) === 314 /* SourceFile */) {
+ if (parentSymbol.flags & 512 /* ValueModule */ && ((_a2 = parentSymbol.valueDeclaration) == null ? void 0 : _a2.kind) === 317 /* SourceFile */) {
const symbolFile = parentSymbol.valueDeclaration;
const referenceFile = getSourceFileOfNode(node);
const symbolIsUmdExport = symbolFile !== referenceFile;
@@ -79577,7 +79755,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
function isSymbolOfDestructuredElementOfCatchBinding(symbol) {
- return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 301 /* CatchClause */;
+ return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 304 /* CatchClause */;
}
function isSymbolOfDeclarationWithCollidingName(symbol) {
if (symbol.flags & 418 /* BlockScoped */ && symbol.valueDeclaration && !isSourceFile(symbol.valueDeclaration)) {
@@ -79591,7 +79769,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else if (nodeLinks2.flags & 262144 /* CapturedBlockScopedBinding */) {
const isDeclaredInLoop = nodeLinks2.flags & 524288 /* BlockScopedBindingInLoop */;
const inLoopInitializer = isIterationStatement(container, false);
- const inLoopBodyBlock = container.kind === 242 /* Block */ && isIterationStatement(container.parent, false);
+ const inLoopBodyBlock = container.kind === 244 /* Block */ && isIterationStatement(container.parent, false);
links.isDeclarationWithCollidingName = !isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || !inLoopInitializer && !inLoopBodyBlock);
} else {
links.isDeclarationWithCollidingName = false;
@@ -79626,25 +79804,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isValueAliasDeclaration(node) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return isAliasResolvedToValue(getSymbolOfNode(node));
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
const symbol = getSymbolOfNode(node);
return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportClause = node.exportClause;
return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return node.expression && node.expression.kind === 79 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true;
}
return false;
}
function isTopLevelValueImportEqualsWithEntityName(nodeIn) {
const node = getParseTreeNode(nodeIn, isImportEqualsDeclaration);
- if (node === void 0 || node.parent.kind !== 314 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) {
+ if (node === void 0 || node.parent.kind !== 317 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) {
return false;
}
const isValue = isAliasResolvedToValue(getSymbolOfNode(node));
@@ -79733,15 +79911,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function canHaveConstantValue(node) {
switch (node.kind) {
- case 308 /* EnumMember */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 311 /* EnumMember */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return true;
}
return false;
}
function getConstantValue2(node) {
- if (node.kind === 308 /* EnumMember */) {
+ if (node.kind === 311 /* EnumMember */) {
return getEnumMemberValue(node);
}
const symbol = getNodeLinks(node).resolvedSymbol;
@@ -79939,7 +80117,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
ident = node.expression;
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
ident = node.expression;
break;
default:
@@ -80046,12 +80224,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
getJsxFragmentFactoryEntity,
getAllAccessorDeclarations(accessor) {
accessor = getParseTreeNode(accessor, isGetOrSetAccessorDeclaration);
- const otherKind = accessor.kind === 178 /* SetAccessor */ ? 177 /* GetAccessor */ : 178 /* SetAccessor */;
+ const otherKind = accessor.kind === 180 /* SetAccessor */ ? 179 /* GetAccessor */ : 180 /* SetAccessor */;
const otherAccessor = getDeclarationOfKind(getSymbolOfNode(accessor), otherKind);
const firstAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? otherAccessor : accessor;
const secondAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? accessor : otherAccessor;
- const setAccessor = accessor.kind === 178 /* SetAccessor */ ? accessor : otherAccessor;
- const getAccessor = accessor.kind === 177 /* GetAccessor */ ? accessor : otherAccessor;
+ const setAccessor = accessor.kind === 180 /* SetAccessor */ ? accessor : otherAccessor;
+ const getAccessor = accessor.kind === 179 /* GetAccessor */ ? accessor : otherAccessor;
return {
firstAccessor,
secondAccessor,
@@ -80067,7 +80245,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
},
getDeclarationStatementsForSourceFile: (node, flags, tracker, bundled) => {
const n = getParseTreeNode(node);
- Debug.assert(n && n.kind === 314 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
+ Debug.assert(n && n.kind === 317 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
const sym = getSymbolOfNode(node);
if (!sym) {
return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled);
@@ -80179,18 +80357,18 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function isInHeritageClause(node) {
- return node.parent && node.parent.kind === 234 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 300 /* HeritageClause */;
+ return node.parent && node.parent.kind === 236 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 303 /* HeritageClause */;
}
function getTypeReferenceDirectivesForEntityName(node) {
if (!fileToDirective) {
return void 0;
}
let meaning;
- if (node.parent.kind === 166 /* ComputedPropertyName */) {
+ if (node.parent.kind === 167 /* ComputedPropertyName */) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
} else {
meaning = 788968 /* Type */ | 1920 /* Namespace */;
- if (node.kind === 79 /* Identifier */ && isInTypeQuery(node) || node.kind === 211 /* PropertyAccessExpression */ && !isInHeritageClause(node)) {
+ if (node.kind === 79 /* Identifier */ && isInTypeQuery(node) || node.kind === 213 /* PropertyAccessExpression */ && !isInHeritageClause(node)) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
}
}
@@ -80228,7 +80406,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
}
- if (current.valueDeclaration && current.valueDeclaration.kind === 314 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
+ if (current.valueDeclaration && current.valueDeclaration.kind === 317 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
return false;
}
for (const decl of symbol.declarations) {
@@ -80253,12 +80431,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getExternalModuleFileFromDeclaration(declaration) {
- const specifier = declaration.kind === 270 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration);
+ const specifier = declaration.kind === 273 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration);
const moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, void 0);
if (!moduleSymbol) {
return void 0;
}
- return getDeclarationOfKind(moduleSymbol, 314 /* SourceFile */);
+ return getDeclarationOfKind(moduleSymbol, 317 /* SourceFile */);
}
function initializeTypeChecker() {
for (const file of host.getSourceFiles()) {
@@ -80487,7 +80665,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
if (!nodeCanBeDecorated(node, node.parent, node.parent.parent, compilerOptions)) {
- const isMethodDeclarationAndNodeIsNotPresent = node.kind === 174 /* MethodDeclaration */ && !nodeIsPresent(node.body);
+ const isMethodDeclarationAndNodeIsNotPresent = node.kind === 176 /* MethodDeclaration */ && !nodeIsPresent(node.body);
const message = isMethodDeclarationAndNodeIsNotPresent ? Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload : Diagnostics.Decorators_are_not_valid_here;
for (const decorator of decorators) {
if (!grammarErrorOnNode(decorator, message)) {
@@ -80495,7 +80673,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
return true;
- } else if (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */) {
+ } else if (node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */) {
const accessors = getAllAccessorDeclarations(node.parent.members, node);
if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) {
return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
@@ -80515,21 +80693,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
}
if (modifier.kind !== 147 /* ReadonlyKeyword */) {
- if (node.kind === 170 /* PropertySignature */ || node.kind === 173 /* MethodSignature */) {
+ if (node.kind === 171 /* PropertySignature */ || node.kind === 175 /* MethodSignature */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind));
}
- if (node.kind === 181 /* IndexSignature */ && (modifier.kind !== 125 /* StaticKeyword */ || !isClassLike(node.parent))) {
+ if (node.kind === 183 /* IndexSignature */ && (modifier.kind !== 125 /* StaticKeyword */ || !isClassLike(node.parent))) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind));
}
}
if (modifier.kind !== 102 /* InKeyword */ && modifier.kind !== 146 /* OutKeyword */) {
- if (node.kind === 167 /* TypeParameter */) {
+ if (node.kind === 168 /* TypeParameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind));
}
}
switch (modifier.kind) {
case 86 /* ConstKeyword */:
- if (node.kind !== 269 /* EnumDeclaration */) {
+ if (node.kind !== 272 /* EnumDeclaration */) {
return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(86 /* ConstKeyword */));
}
break;
@@ -80564,7 +80742,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly");
} else if (flags & 512 /* Async */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
- } else if (node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ } else if (node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
} else if (flags & 256 /* Abstract */) {
if (modifier.kind === 122 /* PrivateKeyword */) {
@@ -80586,9 +80764,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
} else if (flags & 128 /* Accessor */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor");
- } else if (node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ } else if (node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
} else if (flags & 256 /* Abstract */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
@@ -80605,7 +80783,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly");
} else if (flags & 2 /* Ambient */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare");
- } else if (node.kind !== 171 /* PropertyDeclaration */) {
+ } else if (node.kind !== 172 /* PropertyDeclaration */) {
return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration);
}
flags |= 128 /* Accessor */;
@@ -80613,7 +80791,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 147 /* ReadonlyKeyword */:
if (flags & 64 /* Readonly */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly");
- } else if (node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 170 /* PropertySignature */ && node.kind !== 181 /* IndexSignature */ && node.kind !== 168 /* Parameter */) {
+ } else if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 183 /* IndexSignature */ && node.kind !== 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
}
flags |= 64 /* Readonly */;
@@ -80629,14 +80807,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
} else if (isClassLike(node.parent)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export");
}
flags |= 1 /* Export */;
break;
case 89 /* DefaultKeyword */:
- const container = node.parent.kind === 314 /* SourceFile */ ? node.parent : node.parent.parent;
- if (container.kind === 270 /* ModuleDeclaration */ && !isAmbientModule(container)) {
+ const container = node.parent.kind === 317 /* SourceFile */ ? node.parent : node.parent.parent;
+ if (container.kind === 273 /* ModuleDeclaration */ && !isAmbientModule(container)) {
return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
} else if (!(flags & 1 /* Export */)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default");
@@ -80652,9 +80830,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override");
} else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
- } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 271 /* ModuleBlock */) {
+ } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 274 /* ModuleBlock */) {
return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
} else if (isPrivateIdentifierClassElementDeclaration(node)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
@@ -80666,11 +80844,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (flags & 256 /* Abstract */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract");
}
- if (node.kind !== 264 /* ClassDeclaration */ && node.kind !== 185 /* ConstructorType */) {
- if (node.kind !== 174 /* MethodDeclaration */ && node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 177 /* GetAccessor */ && node.kind !== 178 /* SetAccessor */) {
+ if (node.kind !== 266 /* ClassDeclaration */ && node.kind !== 187 /* ConstructorType */) {
+ if (node.kind !== 176 /* MethodDeclaration */ && node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 179 /* GetAccessor */ && node.kind !== 180 /* SetAccessor */) {
return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
}
- if (!(node.parent.kind === 264 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) {
+ if (!(node.parent.kind === 266 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) {
return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);
}
if (flags & 32 /* Static */) {
@@ -80699,7 +80877,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async");
} else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
}
if (flags & 256 /* Abstract */) {
@@ -80712,7 +80890,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 146 /* OutKeyword */:
const inOutFlag = modifier.kind === 102 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */;
const inOutText = modifier.kind === 102 /* InKeyword */ ? "in" : "out";
- if (node.kind !== 167 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
+ if (node.kind !== 168 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
}
if (flags & inOutFlag) {
@@ -80725,7 +80903,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
}
- if (node.kind === 176 /* Constructor */) {
+ if (node.kind === 178 /* Constructor */) {
if (flags & 32 /* Static */) {
return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
}
@@ -80736,11 +80914,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async");
}
return false;
- } else if ((node.kind === 275 /* ImportDeclaration */ || node.kind === 274 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) {
+ } else if ((node.kind === 278 /* ImportDeclaration */ || node.kind === 277 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) {
return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
- } else if (node.kind === 168 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) {
+ } else if (node.kind === 169 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) {
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
- } else if (node.kind === 168 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && node.dotDotDotToken) {
+ } else if (node.kind === 169 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && node.dotDotDotToken) {
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
}
if (flags & 512 /* Async */) {
@@ -80753,49 +80931,51 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function shouldReportBadModifier(node) {
switch (node.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 270 /* ModuleDeclaration */:
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 168 /* Parameter */:
- case 167 /* TypeParameter */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 273 /* ModuleDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 169 /* Parameter */:
+ case 168 /* TypeParameter */:
return false;
- case 175 /* ClassStaticBlockDeclaration */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 273 /* NamespaceExportDeclaration */:
- case 184 /* FunctionType */:
- case 285 /* MissingDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 276 /* NamespaceExportDeclaration */:
+ case 186 /* FunctionType */:
+ case 288 /* MissingDeclaration */:
return true;
default:
- if (node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ if (node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
return false;
}
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return nodeHasAnyModifiersExcept(node, 133 /* AsyncKeyword */);
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 185 /* ConstructorType */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 187 /* ConstructorType */:
return nodeHasAnyModifiersExcept(node, 127 /* AbstractKeyword */);
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 244 /* VariableStatement */:
- case 268 /* TypeAliasDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 246 /* VariableStatement */:
+ case 271 /* TypeAliasDeclaration */:
return true;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return nodeHasAnyModifiersExcept(node, 86 /* ConstKeyword */);
default:
Debug.assertNever(node);
@@ -80813,10 +80993,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkGrammarAsyncModifier(node, asyncModifier) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return false;
}
return grammarErrorOnNode(asyncModifier, Diagnostics._0_modifier_cannot_be_used_here, "async");
@@ -81029,11 +81209,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function checkGrammarComputedPropertyName(node) {
- if (node.kind !== 166 /* ComputedPropertyName */) {
+ if (node.kind !== 167 /* ComputedPropertyName */) {
return false;
}
const computedPropertyName = node;
- if (computedPropertyName.expression.kind === 227 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) {
+ if (computedPropertyName.expression.kind === 229 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) {
return grammarErrorOnNode(computedPropertyName.expression, Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name);
}
return false;
@@ -81041,7 +81221,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkGrammarForGenerator(node) {
if (node.asteriskToken) {
Debug.assert(
- node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */ || node.kind === 174 /* MethodDeclaration */
+ node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */ || node.kind === 176 /* MethodDeclaration */
);
if (node.flags & 16777216 /* Ambient */) {
return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
@@ -81060,7 +81240,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkGrammarObjectLiteralExpression(node, inDestructuring) {
const seen = new Map2();
for (const prop of node.properties) {
- if (prop.kind === 307 /* SpreadAssignment */) {
+ if (prop.kind === 310 /* SpreadAssignment */) {
if (inDestructuring) {
const expression = skipParentheses(prop.expression);
if (isArrayLiteralExpression(expression) || isObjectLiteralExpression(expression)) {
@@ -81070,10 +81250,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
}
const name = prop.name;
- if (name.kind === 166 /* ComputedPropertyName */) {
+ if (name.kind === 167 /* ComputedPropertyName */) {
checkGrammarComputedPropertyName(name);
}
- if (prop.kind === 306 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
+ if (prop.kind === 309 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
grammarErrorOnNode(prop.equalsToken, Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);
}
if (name.kind === 80 /* PrivateIdentifier */) {
@@ -81081,7 +81261,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (canHaveModifiers(prop) && prop.modifiers) {
for (const mod of prop.modifiers) {
- if (isModifier(mod) && (mod.kind !== 133 /* AsyncKeyword */ || prop.kind !== 174 /* MethodDeclaration */)) {
+ if (isModifier(mod) && (mod.kind !== 133 /* AsyncKeyword */ || prop.kind !== 176 /* MethodDeclaration */)) {
grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod));
}
}
@@ -81092,8 +81272,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let currentKind;
switch (prop.kind) {
- case 306 /* ShorthandPropertyAssignment */:
- case 305 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
checkGrammarForInvalidExclamationToken(prop.exclamationToken, Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);
checkGrammarForInvalidQuestionMark(prop.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional);
if (name.kind === 8 /* NumericLiteral */) {
@@ -81101,13 +81281,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
currentKind = 4 /* PropertyAssignment */;
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
currentKind = 8 /* Method */;
break;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
currentKind = 1 /* GetAccessor */;
break;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
currentKind = 2 /* SetAccessor */;
break;
default:
@@ -81144,7 +81324,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkGrammarTypeArguments(node, node.typeArguments);
const seen = new Map2();
for (const attr of node.attributes.properties) {
- if (attr.kind === 296 /* JsxSpreadAttribute */) {
+ if (attr.kind === 299 /* JsxSpreadAttribute */) {
continue;
}
const { name, initializer } = attr;
@@ -81153,7 +81333,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
return grammarErrorOnNode(name, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
}
- if (initializer && initializer.kind === 297 /* JsxExpression */ && !initializer.expression) {
+ if (initializer && initializer.kind === 300 /* JsxExpression */ && !initializer.expression) {
return grammarErrorOnNode(initializer, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression);
}
}
@@ -81188,7 +81368,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) {
return true;
}
- if (forInOrOfStatement.kind === 251 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) {
+ if (forInOrOfStatement.kind === 253 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) {
if (!(forInOrOfStatement.flags & 32768 /* AwaitContext */)) {
const sourceFile = getSourceFileOfNode(forInOrOfStatement);
if (isInTopLevelContext(forInOrOfStatement)) {
@@ -81228,7 +81408,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!hasParseDiagnostics(sourceFile)) {
const diagnostic = createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);
const func = getContainingFunction(forInOrOfStatement);
- if (func && func.kind !== 176 /* Constructor */) {
+ if (func && func.kind !== 178 /* Constructor */) {
Debug.assert((getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function.");
const relatedInfo = createDiagnosticForNode(func, Diagnostics.Did_you_mean_to_mark_this_function_as_async);
addRelatedInfo(diagnostic, relatedInfo);
@@ -81244,7 +81424,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
grammarErrorOnNode(forInOrOfStatement.initializer, Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async);
return false;
}
- if (forInOrOfStatement.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (forInOrOfStatement.initializer.kind === 264 /* VariableDeclarationList */) {
const variableList = forInOrOfStatement.initializer;
if (!checkGrammarVariableDeclarationList(variableList)) {
const declarations = variableList.declarations;
@@ -81252,16 +81432,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
if (declarations.length > 1) {
- const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
+ const diagnostic = forInOrOfStatement.kind === 252 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic);
}
const firstDeclaration = declarations[0];
if (firstDeclaration.initializer) {
- const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
+ const diagnostic = forInOrOfStatement.kind === 252 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
return grammarErrorOnNode(firstDeclaration.name, diagnostic);
}
if (firstDeclaration.type) {
- const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
+ const diagnostic = forInOrOfStatement.kind === 252 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
return grammarErrorOnNode(firstDeclaration, diagnostic);
}
}
@@ -81269,7 +81449,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function checkGrammarAccessor(accessor) {
- if (!(accessor.flags & 16777216 /* Ambient */) && accessor.parent.kind !== 187 /* TypeLiteral */ && accessor.parent.kind !== 267 /* InterfaceDeclaration */) {
+ if (!(accessor.flags & 16777216 /* Ambient */) && accessor.parent.kind !== 189 /* TypeLiteral */ && accessor.parent.kind !== 270 /* InterfaceDeclaration */) {
if (languageVersion < 1 /* ES5 */) {
return grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);
}
@@ -81284,7 +81464,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (hasSyntacticModifier(accessor, 256 /* Abstract */)) {
return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation);
}
- if (accessor.parent.kind === 187 /* TypeLiteral */ || accessor.parent.kind === 267 /* InterfaceDeclaration */) {
+ if (accessor.parent.kind === 189 /* TypeLiteral */ || accessor.parent.kind === 270 /* InterfaceDeclaration */) {
return grammarErrorOnNode(accessor.body, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
}
@@ -81294,10 +81474,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!doesAccessorHaveCorrectParameterCount(accessor)) {
return grammarErrorOnNode(
accessor.name,
- accessor.kind === 177 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter
+ accessor.kind === 179 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter
);
}
- if (accessor.kind === 178 /* SetAccessor */) {
+ if (accessor.kind === 180 /* SetAccessor */) {
if (accessor.type) {
return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);
}
@@ -81315,10 +81495,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function doesAccessorHaveCorrectParameterCount(accessor) {
- return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 0 : 1);
+ return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 179 /* GetAccessor */ ? 0 : 1);
}
function getAccessorThisParameter(accessor) {
- if (accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 1 : 2)) {
+ if (accessor.parameters.length === (accessor.kind === 179 /* GetAccessor */ ? 1 : 2)) {
return getThisParameter(accessor);
}
}
@@ -81335,7 +81515,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
switch (parent2.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
const decl = parent2;
if (decl.name.kind !== 79 /* Identifier */) {
return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);
@@ -81347,12 +81527,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(parent2.name, Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (!isStatic(parent2) || !hasEffectiveReadonlyModifier(parent2)) {
return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);
}
break;
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
if (!hasSyntacticModifier(parent2, 64 /* Readonly */)) {
return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);
}
@@ -81361,7 +81541,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_here);
}
} else if (node.operator === 147 /* ReadonlyKeyword */) {
- if (node.type.kind !== 188 /* ArrayType */ && node.type.kind !== 189 /* TupleType */) {
+ if (node.type.kind !== 190 /* ArrayType */ && node.type.kind !== 191 /* TupleType */) {
return grammarErrorOnFirstToken(node, Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, tokenToString(154 /* SymbolKeyword */));
}
}
@@ -81375,8 +81555,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (checkGrammarFunctionLikeDeclaration(node)) {
return true;
}
- if (node.kind === 174 /* MethodDeclaration */) {
- if (node.parent.kind === 210 /* ObjectLiteralExpression */) {
+ if (node.kind === 176 /* MethodDeclaration */) {
+ if (node.parent.kind === 212 /* ObjectLiteralExpression */) {
if (node.modifiers && !(node.modifiers.length === 1 && first(node.modifiers).kind === 133 /* AsyncKeyword */)) {
return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here);
} else if (checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional)) {
@@ -81397,12 +81577,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (node.flags & 16777216 /* Ambient */) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
- } else if (node.kind === 174 /* MethodDeclaration */ && !node.body) {
+ } else if (node.kind === 176 /* MethodDeclaration */ && !node.body) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
}
- } else if (node.parent.kind === 267 /* InterfaceDeclaration */) {
+ } else if (node.parent.kind === 270 /* InterfaceDeclaration */) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
- } else if (node.parent.kind === 187 /* TypeLiteral */) {
+ } else if (node.parent.kind === 189 /* TypeLiteral */) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
}
}
@@ -81413,17 +81593,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary);
}
switch (current.kind) {
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
if (node.label && current.label.escapedText === node.label.escapedText) {
- const isMisplacedContinueLabel = node.kind === 252 /* ContinueStatement */ && !isIterationStatement(current.statement, true);
+ const isMisplacedContinueLabel = node.kind === 254 /* ContinueStatement */ && !isIterationStatement(current.statement, true);
if (isMisplacedContinueLabel) {
return grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);
}
return false;
}
break;
- case 256 /* SwitchStatement */:
- if (node.kind === 253 /* BreakStatement */ && !node.label) {
+ case 258 /* SwitchStatement */:
+ if (node.kind === 255 /* BreakStatement */ && !node.label) {
return false;
}
break;
@@ -81436,10 +81616,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
current = current.parent;
}
if (node.label) {
- const message = node.kind === 253 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
+ const message = node.kind === 255 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
} else {
- const message = node.kind === 253 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
+ const message = node.kind === 255 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
}
}
@@ -81459,10 +81639,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isStringOrNumberLiteralExpression(expr) {
- return isStringOrNumericLiteralLike(expr) || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */;
+ return isStringOrNumericLiteralLike(expr) || expr.kind === 227 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */;
}
function isBigIntLiteralExpression(expr) {
- return expr.kind === 9 /* BigIntLiteral */ || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */;
+ return expr.kind === 9 /* BigIntLiteral */ || expr.kind === 227 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */;
}
function isSimpleLiteralEnumReference(expr) {
if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) {
@@ -81484,7 +81664,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkGrammarVariableDeclaration(node) {
- if (node.parent.parent.kind !== 250 /* ForInStatement */ && node.parent.parent.kind !== 251 /* ForOfStatement */) {
+ if (node.parent.parent.kind !== 252 /* ForInStatement */ && node.parent.parent.kind !== 253 /* ForOfStatement */) {
if (node.flags & 16777216 /* Ambient */) {
checkAmbientInitializer(node);
} else if (!node.initializer) {
@@ -81496,7 +81676,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (node.exclamationToken && (node.parent.parent.kind !== 244 /* VariableStatement */ || !node.type || node.initializer || node.flags & 16777216 /* Ambient */)) {
+ if (node.exclamationToken && (node.parent.parent.kind !== 246 /* VariableStatement */ || !node.type || node.initializer || node.flags & 16777216 /* Ambient */)) {
const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context;
return grammarErrorOnNode(node.exclamationToken, message);
}
@@ -81548,15 +81728,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function allowLetAndConstDeclarations(parent2) {
switch (parent2.kind) {
- case 246 /* IfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 255 /* WithStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 248 /* IfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 257 /* WithStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
return false;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return allowLetAndConstDeclarations(parent2.parent);
}
return true;
@@ -81658,7 +81838,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isAutoAccessorPropertyDeclaration(node) && checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_accessor_property_cannot_be_declared_optional)) {
return true;
}
- } else if (node.parent.kind === 267 /* InterfaceDeclaration */) {
+ } else if (node.parent.kind === 270 /* InterfaceDeclaration */) {
if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) {
return true;
}
@@ -81684,14 +81864,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
- if (node.kind === 267 /* InterfaceDeclaration */ || node.kind === 268 /* TypeAliasDeclaration */ || node.kind === 275 /* ImportDeclaration */ || node.kind === 274 /* ImportEqualsDeclaration */ || node.kind === 281 /* ExportDeclaration */ || node.kind === 280 /* ExportAssignment */ || node.kind === 273 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 1024 /* Default */)) {
+ if (node.kind === 270 /* InterfaceDeclaration */ || node.kind === 271 /* TypeAliasDeclaration */ || node.kind === 278 /* ImportDeclaration */ || node.kind === 277 /* ImportEqualsDeclaration */ || node.kind === 284 /* ExportDeclaration */ || node.kind === 283 /* ExportAssignment */ || node.kind === 276 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 1024 /* Default */)) {
return false;
}
return grammarErrorOnFirstToken(node, Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier);
}
function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) {
for (const decl of file.statements) {
- if (isDeclaration(decl) || decl.kind === 244 /* VariableStatement */) {
+ if (isDeclaration(decl) || decl.kind === 246 /* VariableStatement */) {
if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) {
return true;
}
@@ -81708,7 +81888,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!links.hasReportedStatementInAmbientContext && (isFunctionLike(node.parent) || isAccessor(node.parent))) {
return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
- if (node.parent.kind === 242 /* Block */ || node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ if (node.parent.kind === 244 /* Block */ || node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
const links2 = getNodeLinks(node.parent);
if (!links2.hasReportedStatementInAmbientContext) {
return links2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts);
@@ -81723,9 +81903,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let diagnosticMessage;
if (languageVersion >= 1 /* ES5 */) {
diagnosticMessage = Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0;
- } else if (isChildOfNodeWithKind(node, 201 /* LiteralType */)) {
+ } else if (isChildOfNodeWithKind(node, 203 /* LiteralType */)) {
diagnosticMessage = Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;
- } else if (isChildOfNodeWithKind(node, 308 /* EnumMember */)) {
+ } else if (isChildOfNodeWithKind(node, 311 /* EnumMember */)) {
diagnosticMessage = Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0;
}
if (diagnosticMessage) {
@@ -81785,7 +81965,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.isTypeOnly && node.name && node.namedBindings) {
return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);
}
- if (node.isTypeOnly && ((_a2 = node.namedBindings) == null ? void 0 : _a2.kind) === 278 /* NamedImports */) {
+ if (node.isTypeOnly && ((_a2 = node.namedBindings) == null ? void 0 : _a2.kind) === 281 /* NamedImports */) {
return checkGrammarNamedImportsOrExports(node.namedBindings);
}
return false;
@@ -81795,7 +81975,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (specifier.isTypeOnly) {
return grammarErrorOnFirstToken(
specifier,
- specifier.kind === 279 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement
+ specifier.kind === 282 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement
);
}
});
@@ -81904,12 +82084,12 @@ function isNotAccessor(declaration) {
return !isAccessor(declaration);
}
function isNotOverload(declaration) {
- return declaration.kind !== 263 /* FunctionDeclaration */ && declaration.kind !== 174 /* MethodDeclaration */ || !!declaration.body;
+ return declaration.kind !== 265 /* FunctionDeclaration */ && declaration.kind !== 176 /* MethodDeclaration */ || !!declaration.body;
}
function isDeclarationNameOrImportPropertyName(name) {
switch (name.parent.kind) {
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return isIdentifier(name);
default:
return isDeclarationName(name);
@@ -82187,20 +82367,20 @@ var visitEachChildTable = {
nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)
);
},
- [165 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [166 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateQualifiedName(
node,
nodeVisitor(node.left, visitor, isEntityName),
nodeVisitor(node.right, visitor, isIdentifier)
);
},
- [166 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [167 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateComputedPropertyName(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [167 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [168 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeParameterDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82209,7 +82389,7 @@ var visitEachChildTable = {
nodeVisitor(node.default, visitor, isTypeNode)
);
},
- [168 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [169 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateParameterDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -82220,14 +82400,14 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [169 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [170 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDecorator(
node,
nodeVisitor(node.expression, visitor, isExpression),
node.annotationDeclaration
);
},
- [170 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [171 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updatePropertySignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82236,7 +82416,16 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [171 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [174 /* OverloadPropertyDeclaration */]: function visitEachChildOfOverloadPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ return context.factory.updateOverloadPropertyDeclaration(
+ node,
+ nodesVisitor(node.modifiers, visitor, isModifier),
+ nodeVisitor(node.name, visitor, isPropertyName),
+ nodeVisitor(node.questionToken, tokenVisitor, isToken),
+ nodeVisitor(node.type, visitor, isTypeNode)
+ );
+ },
+ [172 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
var _a2;
return context.factory.updatePropertyDeclaration(
node,
@@ -82247,7 +82436,7 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [172 /* AnnotationPropertyDeclaration */]: function visitEachChildOfAnnotationPropertyDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [173 /* AnnotationPropertyDeclaration */]: function visitEachChildOfAnnotationPropertyDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAnnotationPropertyDeclaration(
node,
nodeVisitor(node.name, visitor, isPropertyName),
@@ -82255,7 +82444,7 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [173 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [175 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMethodSignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82266,7 +82455,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [174 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [176 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMethodDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -82279,7 +82468,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [176 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [178 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructorDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82287,7 +82476,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [177 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [179 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
if (context.isLexicalEnvironmentSuspended && context.isLexicalEnvironmentSuspended()) {
return context.factory.updateGetAccessorDeclaration(
node,
@@ -82308,7 +82497,7 @@ var visitEachChildTable = {
);
}
},
- [178 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [180 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
if (context.isLexicalEnvironmentSuspended && context.isLexicalEnvironmentSuspended()) {
return context.factory.updateSetAccessorDeclaration(
node,
@@ -82327,7 +82516,7 @@ var visitEachChildTable = {
);
}
},
- [175 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [177 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
context.startLexicalEnvironment();
context.suspendLexicalEnvironment();
return context.factory.updateClassStaticBlockDeclaration(
@@ -82335,7 +82524,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [179 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [181 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCallSignature(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -82343,7 +82532,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [180 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [182 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructSignature(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -82351,7 +82540,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [181 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [183 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIndexSignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82359,7 +82548,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [182 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [184 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypePredicateNode(
node,
nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword),
@@ -82367,14 +82556,14 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [183 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [185 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeReferenceNode(
node,
nodeVisitor(node.typeName, visitor, isEntityName),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [184 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [186 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateFunctionTypeNode(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -82382,7 +82571,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [185 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [187 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructorTypeNode(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82391,56 +82580,56 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [186 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [188 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeQueryNode(
node,
nodeVisitor(node.exprName, visitor, isEntityName),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [187 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [189 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeLiteralNode(
node,
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [188 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [190 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayTypeNode(
node,
nodeVisitor(node.elementType, visitor, isTypeNode)
);
},
- [189 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [191 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateTupleTypeNode(
node,
nodesVisitor(node.elements, visitor, isTypeNode)
);
},
- [190 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [192 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateOptionalTypeNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [191 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [193 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateRestTypeNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [192 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [194 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateUnionTypeNode(
node,
nodesVisitor(node.types, visitor, isTypeNode)
);
},
- [193 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [195 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateIntersectionTypeNode(
node,
nodesVisitor(node.types, visitor, isTypeNode)
);
},
- [194 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [196 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConditionalTypeNode(
node,
nodeVisitor(node.checkType, visitor, isTypeNode),
@@ -82449,13 +82638,13 @@ var visitEachChildTable = {
nodeVisitor(node.falseType, visitor, isTypeNode)
);
},
- [195 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [197 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateInferTypeNode(
node,
nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)
);
},
- [205 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [207 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportTypeNode(
node,
nodeVisitor(node.argument, visitor, isTypeNode),
@@ -82465,14 +82654,14 @@ var visitEachChildTable = {
node.isTypeOf
);
},
- [304 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [307 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportTypeAssertionContainer(
node,
nodeVisitor(node.assertClause, visitor, isAssertClause),
node.multiLine
);
},
- [202 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [204 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateNamedTupleMember(
node,
nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken),
@@ -82481,26 +82670,26 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [196 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [198 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateParenthesizedType(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [198 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [200 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeOperatorNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [199 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [201 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIndexedAccessTypeNode(
node,
nodeVisitor(node.objectType, visitor, isTypeNode),
nodeVisitor(node.indexType, visitor, isTypeNode)
);
},
- [200 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [202 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMappedTypeNode(
node,
nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken),
@@ -82511,39 +82700,39 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [201 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [203 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateLiteralTypeNode(
node,
nodeVisitor(node.literal, visitor, isExpression)
);
},
- [203 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [205 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateLiteralType(
node,
nodeVisitor(node.head, visitor, isTemplateHead),
nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan)
);
},
- [204 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [206 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateLiteralTypeSpan(
node,
nodeVisitor(node.type, visitor, isTypeNode),
nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)
);
},
- [206 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [208 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateObjectBindingPattern(
node,
nodesVisitor(node.elements, visitor, isBindingElement)
);
},
- [207 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [209 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayBindingPattern(
node,
nodesVisitor(node.elements, visitor, isArrayBindingElement)
);
},
- [208 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [210 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateBindingElement(
node,
nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken),
@@ -82552,19 +82741,19 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [209 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [211 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayLiteralExpression(
node,
nodesVisitor(node.elements, visitor, isExpression)
);
},
- [210 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [212 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateObjectLiteralExpression(
node,
nodesVisitor(node.properties, visitor, isObjectLiteralElementLike)
);
},
- [211 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [213 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82576,7 +82765,7 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isMemberName)
);
},
- [212 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [214 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return isElementAccessChain(node) ? context.factory.updateElementAccessChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82588,7 +82777,7 @@ var visitEachChildTable = {
nodeVisitor(node.argumentExpression, visitor, isExpression)
);
},
- [213 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [215 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return isCallChain(node) ? context.factory.updateCallChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82602,7 +82791,7 @@ var visitEachChildTable = {
nodesVisitor(node.arguments, visitor, isExpression)
);
},
- [220 /* EtsComponentExpression */]: function visitEachChildOfEtsComponentExpression(node, visitor, context, nodesVisitor, nodeVisitor) {
+ [222 /* EtsComponentExpression */]: function visitEachChildOfEtsComponentExpression(node, visitor, context, nodesVisitor, nodeVisitor) {
return context.factory.updateEtsComponentExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82610,7 +82799,7 @@ var visitEachChildTable = {
nodeVisitor(node.body, visitor, isBlock)
);
},
- [214 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [216 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNewExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82618,7 +82807,7 @@ var visitEachChildTable = {
nodesVisitor(node.arguments, visitor, isExpression)
);
},
- [215 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [217 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTaggedTemplateExpression(
node,
nodeVisitor(node.tag, visitor, isExpression),
@@ -82626,20 +82815,20 @@ var visitEachChildTable = {
nodeVisitor(node.template, visitor, isTemplateLiteral)
);
},
- [216 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [218 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeAssertion(
node,
nodeVisitor(node.type, visitor, isTypeNode),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [217 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [219 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateParenthesizedExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [218 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [220 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateFunctionExpression(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82651,7 +82840,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [219 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [221 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateArrowFunction(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82662,43 +82851,43 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [221 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [223 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDeleteExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [222 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [224 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeOfExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [223 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [225 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateVoidExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [224 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [226 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAwaitExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [225 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [227 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePrefixUnaryExpression(
node,
nodeVisitor(node.operand, visitor, isExpression)
);
},
- [226 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [228 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePostfixUnaryExpression(
node,
nodeVisitor(node.operand, visitor, isExpression)
);
},
- [227 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [229 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateBinaryExpression(
node,
nodeVisitor(node.left, visitor, isExpression),
@@ -82706,7 +82895,7 @@ var visitEachChildTable = {
nodeVisitor(node.right, visitor, isExpression)
);
},
- [228 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [230 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateConditionalExpression(
node,
nodeVisitor(node.condition, visitor, isExpression),
@@ -82716,27 +82905,27 @@ var visitEachChildTable = {
nodeVisitor(node.whenFalse, visitor, isExpression)
);
},
- [229 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [231 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateExpression(
node,
nodeVisitor(node.head, visitor, isTemplateHead),
nodesVisitor(node.templateSpans, visitor, isTemplateSpan)
);
},
- [230 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [232 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateYieldExpression(
node,
nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [231 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [233 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSpreadElement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [232 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [234 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateClassExpression(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -82746,28 +82935,28 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [234 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [236 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExpressionWithTypeArguments(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [235 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [237 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAsExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [239 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [241 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSatisfiesExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [236 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [238 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return isOptionalChain(node) ? context.factory.updateNonNullChain(
node,
nodeVisitor(node.expression, visitor, isExpression)
@@ -82776,39 +82965,39 @@ var visitEachChildTable = {
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [237 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [239 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateMetaProperty(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [240 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [242 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateSpan(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)
);
},
- [242 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [244 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateBlock(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [244 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [246 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateVariableStatement(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)
);
},
- [245 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [247 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExpressionStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [246 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [248 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIfStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82816,21 +83005,21 @@ var visitEachChildTable = {
nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [247 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [249 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDoStatement(
node,
visitIterationBody(node.statement, visitor, context, nodeVisitor),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [248 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [250 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateWhileStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [249 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [251 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateForStatement(
node,
nodeVisitor(node.initializer, visitor, isForInitializer),
@@ -82839,7 +83028,7 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [250 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [252 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateForInStatement(
node,
nodeVisitor(node.initializer, visitor, isForInitializer),
@@ -82847,7 +83036,7 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [251 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [253 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateForOfStatement(
node,
nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword),
@@ -82856,52 +83045,52 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [252 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [254 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateContinueStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier)
);
},
- [253 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [255 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateBreakStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier)
);
},
- [254 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [256 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateReturnStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [255 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [257 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateWithStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [256 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [258 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSwitchStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.caseBlock, visitor, isCaseBlock)
);
},
- [257 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [259 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateLabeledStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier),
nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [258 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [260 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateThrowStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [259 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [261 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTryStatement(
node,
nodeVisitor(node.tryBlock, visitor, isBlock),
@@ -82909,7 +83098,7 @@ var visitEachChildTable = {
nodeVisitor(node.finallyBlock, visitor, isBlock)
);
},
- [261 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [263 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateVariableDeclaration(
node,
nodeVisitor(node.name, visitor, isBindingName),
@@ -82918,13 +83107,13 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [262 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [264 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateVariableDeclarationList(
node,
nodesVisitor(node.declarations, visitor, isVariableDeclaration)
);
},
- [263 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [265 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateFunctionDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82936,7 +83125,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [264 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [266 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateClassDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -82946,7 +83135,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [265 /* StructDeclaration */]: function visitEachChildOfStructDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [267 /* StructDeclaration */]: function visitEachChildOfStructDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateStructDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82956,7 +83145,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [266 /* AnnotationDeclaration */]: function visitEachChildOfAnnotationDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [268 /* AnnotationDeclaration */]: function visitEachChildOfAnnotationDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAnnotationDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82964,7 +83153,15 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isAnnotationElement)
);
},
- [267 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [269 /* OverloadDeclaration */]: function visitEachChildOfOverloadDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ return context.factory.updateOverloadDeclaration(
+ node,
+ nodesVisitor(node.modifiers, visitor, isModifier),
+ nodeVisitor(node.name, visitor, isIdentifier),
+ nodesVisitor(node.members, visitor, isOverloadElement)
+ );
+ },
+ [270 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateInterfaceDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82974,7 +83171,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [268 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [271 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeAliasDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82983,7 +83180,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [269 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [272 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateEnumDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82991,7 +83188,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isEnumMember)
);
},
- [270 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [273 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateModuleDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82999,25 +83196,25 @@ var visitEachChildTable = {
nodeVisitor(node.body, visitor, isModuleBody)
);
},
- [271 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [274 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateModuleBlock(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [272 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [275 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateCaseBlock(
node,
nodesVisitor(node.clauses, visitor, isCaseOrDefaultClause)
);
},
- [273 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [276 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceExportDeclaration(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [274 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [277 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportEqualsDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83026,7 +83223,7 @@ var visitEachChildTable = {
nodeVisitor(node.moduleReference, visitor, isModuleReference)
);
},
- [275 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [278 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83035,21 +83232,21 @@ var visitEachChildTable = {
nodeVisitor(node.assertClause, visitor, isAssertClause)
);
},
- [302 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [305 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateAssertClause(
node,
nodesVisitor(node.elements, visitor, isAssertEntry),
node.multiLine
);
},
- [303 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [306 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAssertEntry(
node,
nodeVisitor(node.name, visitor, isAssertionKey),
nodeVisitor(node.value, visitor, isExpression)
);
},
- [276 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [279 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportClause(
node,
node.isTypeOnly,
@@ -83057,25 +83254,25 @@ var visitEachChildTable = {
nodeVisitor(node.namedBindings, visitor, isNamedImportBindings)
);
},
- [277 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [280 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceImport(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [283 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [286 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceExport(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [278 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [281 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateNamedImports(
node,
nodesVisitor(node.elements, visitor, isImportSpecifier)
);
},
- [279 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [282 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportSpecifier(
node,
node.isTypeOnly,
@@ -83083,14 +83280,14 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [280 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [283 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportAssignment(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [281 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [284 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83100,13 +83297,13 @@ var visitEachChildTable = {
nodeVisitor(node.assertClause, visitor, isAssertClause)
);
},
- [282 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [285 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateNamedExports(
node,
nodesVisitor(node.elements, visitor, isExportSpecifier)
);
},
- [284 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [287 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportSpecifier(
node,
node.isTypeOnly,
@@ -83114,13 +83311,13 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [286 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [289 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExternalModuleReference(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [287 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [290 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxElement(
node,
nodeVisitor(node.openingElement, visitor, isJsxOpeningElement),
@@ -83128,7 +83325,7 @@ var visitEachChildTable = {
nodeVisitor(node.closingElement, visitor, isJsxClosingElement)
);
},
- [288 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [291 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxSelfClosingElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression),
@@ -83136,7 +83333,7 @@ var visitEachChildTable = {
nodeVisitor(node.attributes, visitor, isJsxAttributes)
);
},
- [289 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [292 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxOpeningElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression),
@@ -83144,13 +83341,13 @@ var visitEachChildTable = {
nodeVisitor(node.attributes, visitor, isJsxAttributes)
);
},
- [290 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [293 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxClosingElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)
);
},
- [291 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [294 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxFragment(
node,
nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment),
@@ -83158,97 +83355,97 @@ var visitEachChildTable = {
nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)
);
},
- [294 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [297 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxAttribute(
node,
nodeVisitor(node.name, visitor, isIdentifier),
nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression)
);
},
- [295 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [298 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxAttributes(
node,
nodesVisitor(node.properties, visitor, isJsxAttributeLike)
);
},
- [296 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [299 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxSpreadAttribute(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [297 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [300 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [298 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [301 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCaseClause(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [299 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [302 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateDefaultClause(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [300 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [303 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateHeritageClause(
node,
nodesVisitor(node.types, visitor, isExpressionWithTypeArguments)
);
},
- [301 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [304 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCatchClause(
node,
nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration),
nodeVisitor(node.block, visitor, isBlock)
);
},
- [305 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [308 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePropertyAssignment(
node,
nodeVisitor(node.name, visitor, isPropertyName),
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [306 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [309 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateShorthandPropertyAssignment(
node,
nodeVisitor(node.name, visitor, isIdentifier),
nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression)
);
},
- [307 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [310 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSpreadAssignment(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [308 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [311 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateEnumMember(
node,
nodeVisitor(node.name, visitor, isPropertyName),
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [314 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [317 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateSourceFile(
node,
visitLexicalEnvironment(node.statements, visitor, context)
);
},
- [359 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [362 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePartiallyEmittedExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [360 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [363 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateCommaListExpression(
node,
nodesVisitor(node.elements, visitor, isExpression)
@@ -83822,7 +84019,7 @@ function isNamedDefaultReference(e) {
function chainBundle(context, transformSourceFile) {
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- return node.kind === 314 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
+ return node.kind === 317 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
}
function transformBundle(node) {
return context.factory.createBundle(map(node.sourceFiles, transformSourceFile), node.prepends);
@@ -83865,7 +84062,7 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
let hasImportDefault = false;
for (const node of sourceFile.statements) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
externalImports.push(node);
if (!hasImportStar && getImportNeedsImportStarHelper(node)) {
hasImportStar = true;
@@ -83874,12 +84071,12 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
hasImportDefault = true;
}
break;
- case 274 /* ImportEqualsDeclaration */:
- if (node.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ case 277 /* ImportEqualsDeclaration */:
+ if (node.moduleReference.kind === 289 /* ExternalModuleReference */) {
externalImports.push(node);
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
if (node.moduleSpecifier) {
if (!node.exportClause) {
externalImports.push(node);
@@ -83902,19 +84099,19 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
addExportedNamesForExportDeclaration(node);
}
break;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
if (node.isExportEquals && !exportEquals) {
exportEquals = node;
}
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (hasSyntacticModifier(node, 1 /* Export */)) {
for (const decl of node.declarationList.declarations) {
exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames);
}
}
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (hasSyntacticModifier(node, 1 /* Export */)) {
if (hasSyntacticModifier(node, 1024 /* Default */)) {
if (!hasExportDefault) {
@@ -83931,7 +84128,7 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
}
}
break;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
if (hasSyntacticModifier(node, 1 /* Export */)) {
if (hasSyntacticModifier(node, 1024 /* Default */)) {
if (!hasExportDefault) {
@@ -84075,7 +84272,7 @@ function isStaticPropertyDeclaration(member) {
return isPropertyDeclaration(member) && hasStaticModifier(member);
}
function isInitializedProperty(member) {
- return member.kind === 171 /* PropertyDeclaration */ && member.initializer !== void 0;
+ return member.kind === 172 /* PropertyDeclaration */ && member.initializer !== void 0;
}
function isNonStaticMethodOrAccessorWithPrivateName(member) {
return !isStatic(member) && (isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member)) && isPrivateIdentifier(member.name);
@@ -84112,12 +84309,12 @@ function getAllDecoratorsOfClass(node) {
}
function getAllDecoratorsOfClassElement(member, parent2) {
switch (member.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return getAllDecoratorsOfAccessors(member, parent2);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return getAllDecoratorsOfMethod(member);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return getAllDecoratorsOfProperty(member);
default:
return void 0;
@@ -84589,8 +84786,8 @@ function transformTypeScript(context) {
const previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(212 /* ElementAccessExpression */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(214 /* ElementAccessExpression */);
let currentSourceFile;
let currentNamespace;
let currentNamespaceContainerName;
@@ -84601,14 +84798,14 @@ function transformTypeScript(context) {
let applicableSubstitutions;
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- if (node.kind === 315 /* Bundle */) {
+ if (node.kind === 318 /* Bundle */) {
return transformBundle(node);
}
return transformSourceFile(node);
}
function transformBundle(node) {
return factory2.createBundle(node.sourceFiles.map(transformSourceFile), mapDefined(node.prepends, (prepend) => {
- if (prepend.kind === 317 /* InputFiles */) {
+ if (prepend.kind === 320 /* InputFiles */) {
return createUnparsedSourceFile(prepend, "js");
}
return prepend;
@@ -84639,22 +84836,22 @@ function transformTypeScript(context) {
}
function onBeforeVisitNode(node) {
switch (node.kind) {
- case 314 /* SourceFile */:
- case 272 /* CaseBlock */:
- case 271 /* ModuleBlock */:
- case 242 /* Block */:
+ case 317 /* SourceFile */:
+ case 275 /* CaseBlock */:
+ case 274 /* ModuleBlock */:
+ case 244 /* Block */:
currentLexicalScope = node;
currentScopeFirstDeclarationsOfName = void 0;
break;
- case 264 /* ClassDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (hasSyntacticModifier(node, 2 /* Ambient */)) {
break;
}
if (node.name) {
recordEmittedDeclarationInScope(node);
} else {
- Debug.assert(node.kind === 264 /* ClassDeclaration */ || hasSyntacticModifier(node, 1024 /* Default */));
+ Debug.assert(node.kind === 266 /* ClassDeclaration */ || hasSyntacticModifier(node, 1024 /* Default */));
}
break;
}
@@ -84673,10 +84870,10 @@ function transformTypeScript(context) {
}
function sourceElementVisitorWorker(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 280 /* ExportAssignment */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 284 /* ExportDeclaration */:
return visitElidableStatement(node);
default:
return visitorWorker(node);
@@ -84694,13 +84891,13 @@ function transformTypeScript(context) {
return node;
}
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
default:
Debug.fail("Unhandled ellided statement");
@@ -84710,7 +84907,7 @@ function transformTypeScript(context) {
return saveStateAndInvoke(node, namespaceElementVisitorWorker);
}
function namespaceElementVisitorWorker(node) {
- if (node.kind === 281 /* ExportDeclaration */ || node.kind === 275 /* ImportDeclaration */ || node.kind === 276 /* ImportClause */ || node.kind === 274 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ if (node.kind === 284 /* ExportDeclaration */ || node.kind === 278 /* ImportDeclaration */ || node.kind === 279 /* ImportClause */ || node.kind === 277 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 289 /* ExternalModuleReference */) {
return void 0;
} else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 1 /* Export */)) {
return visitTypeScript(node);
@@ -84722,21 +84919,21 @@ function transformTypeScript(context) {
}
function classElementVisitorWorker(node, parent2) {
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return visitConstructor(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return visitPropertyDeclaration(node, parent2);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return visitGetAccessor(node, parent2);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return visitSetAccessor(node, parent2);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node, parent2);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return visitEachChild(node, visitor, context);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return node;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return;
default:
return Debug.failBadSyntaxKind(node);
@@ -84747,15 +84944,15 @@ function transformTypeScript(context) {
}
function objectLiteralElementVisitorWorker(node, parent2) {
switch (node.kind) {
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return visitor(node);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return visitGetAccessor(node, parent2);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return visitSetAccessor(node, parent2);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node, parent2);
default:
return Debug.failBadSyntaxKind(node);
@@ -84790,13 +84987,13 @@ function transformTypeScript(context) {
case 147 /* ReadonlyKeyword */:
case 102 /* InKeyword */:
case 146 /* OutKeyword */:
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
- case 190 /* OptionalType */:
- case 191 /* RestType */:
- case 187 /* TypeLiteral */:
- case 182 /* TypePredicate */:
- case 167 /* TypeParameter */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
+ case 192 /* OptionalType */:
+ case 193 /* RestType */:
+ case 189 /* TypeLiteral */:
+ case 184 /* TypePredicate */:
+ case 168 /* TypeParameter */:
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
case 135 /* BooleanKeyword */:
@@ -84805,83 +85002,86 @@ function transformTypeScript(context) {
case 145 /* NeverKeyword */:
case 115 /* VoidKeyword */:
case 154 /* SymbolKeyword */:
- case 185 /* ConstructorType */:
- case 184 /* FunctionType */:
- case 186 /* TypeQuery */:
- case 183 /* TypeReference */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 194 /* ConditionalType */:
- case 196 /* ParenthesizedType */:
- case 197 /* ThisType */:
- case 198 /* TypeOperator */:
- case 199 /* IndexedAccessType */:
- case 200 /* MappedType */:
- case 201 /* LiteralType */:
- case 181 /* IndexSignature */:
+ case 187 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 188 /* TypeQuery */:
+ case 185 /* TypeReference */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 196 /* ConditionalType */:
+ case 198 /* ParenthesizedType */:
+ case 199 /* ThisType */:
+ case 200 /* TypeOperator */:
+ case 201 /* IndexedAccessType */:
+ case 202 /* MappedType */:
+ case 203 /* LiteralType */:
+ case 183 /* IndexSignature */:
return void 0;
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return factory2.createNotEmittedStatement(node);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return void 0;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return factory2.createNotEmittedStatement(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ return factory2.createNotEmittedStatement(node);
+ case 269 /* OverloadDeclaration */:
return factory2.createNotEmittedStatement(node);
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return visitHeritageClause(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return visitExpressionWithTypeArguments(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
return Debug.fail("Class and object literal elements must be visited with their respective visitors");
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return visitArrowFunction(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameter(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node);
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return visitAssertionExpression(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return visitSatisfiesExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return visitNewExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return visitNonNullExpression(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return visitEnumDeclaration(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return visitVariableDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return visitModuleDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return visitJsxSelfClosingElement(node);
- case 289 /* JsxOpeningElement */:
+ case 292 /* JsxOpeningElement */:
return visitJsxJsxOpeningElement(node);
default:
return visitEachChild(node, visitor, context);
@@ -85113,19 +85313,19 @@ function transformTypeScript(context) {
}
function shouldAddTypeMetadata(node) {
const kind = node.kind;
- return kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 171 /* PropertyDeclaration */;
+ return kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 172 /* PropertyDeclaration */;
}
function shouldAddReturnTypeMetadata(node) {
- return node.kind === 174 /* MethodDeclaration */;
+ return node.kind === 176 /* MethodDeclaration */;
}
function shouldAddParamTypesMetadata(node) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return getFirstConstructorWithBody(node) !== void 0;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
}
return false;
@@ -85658,12 +85858,12 @@ function transformTypeScript(context) {
factory2.createVariableDeclaration(
factory2.getLocalName(node, false, true)
)
- ], currentLexicalScope.kind === 314 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)
+ ], currentLexicalScope.kind === 317 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)
);
setOriginalNode(statement, node);
recordEmittedDeclarationInScope(node);
if (isFirstEmittedDeclarationInScope(node)) {
- if (node.kind === 269 /* EnumDeclaration */) {
+ if (node.kind === 272 /* EnumDeclaration */) {
setSourceMapRange(statement.declarationList, node);
} else {
setSourceMapRange(statement, node);
@@ -85745,7 +85945,7 @@ function transformTypeScript(context) {
let statementsLocation;
let blockLocation;
if (node.body) {
- if (node.body.kind === 271 /* ModuleBlock */) {
+ if (node.body.kind === 274 /* ModuleBlock */) {
saveStateAndInvoke(node.body, (body) => addRange(statements, visitNodes2(body.statements, namespaceElementVisitor, isStatement)));
statementsLocation = node.body.statements;
blockLocation = node.body;
@@ -85774,13 +85974,13 @@ function transformTypeScript(context) {
true
);
setTextRange(block, blockLocation);
- if (!node.body || node.body.kind !== 271 /* ModuleBlock */) {
+ if (!node.body || node.body.kind !== 274 /* ModuleBlock */) {
setEmitFlags(block, getEmitFlags(block) | 1536 /* NoComments */);
}
return block;
}
function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) {
- if (moduleDeclaration.body.kind === 270 /* ModuleDeclaration */) {
+ if (moduleDeclaration.body.kind === 273 /* ModuleDeclaration */) {
const recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body);
return recursiveInnerModule || moduleDeclaration.body;
}
@@ -85808,7 +86008,7 @@ function transformTypeScript(context) {
return name || namedBindings ? factory2.updateImportClause(node, false, name, namedBindings) : void 0;
}
function visitNamedImportBindings(node) {
- if (node.kind === 277 /* NamespaceImport */) {
+ if (node.kind === 280 /* NamespaceImport */) {
return shouldEmitAliasDeclaration(node) ? node : void 0;
} else {
const allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */);
@@ -85978,15 +86178,15 @@ function transformTypeScript(context) {
if ((enabledSubstitutions & 2 /* NamespaceExports */) === 0) {
enabledSubstitutions |= 2 /* NamespaceExports */;
context.enableSubstitution(79 /* Identifier */);
- context.enableSubstitution(306 /* ShorthandPropertyAssignment */);
- context.enableEmitNotification(270 /* ModuleDeclaration */);
+ context.enableSubstitution(309 /* ShorthandPropertyAssignment */);
+ context.enableEmitNotification(273 /* ModuleDeclaration */);
}
}
function isTransformedModuleDeclaration(node) {
- return getOriginalNode(node).kind === 270 /* ModuleDeclaration */;
+ return getOriginalNode(node).kind === 273 /* ModuleDeclaration */;
}
function isTransformedEnumDeclaration(node) {
- return getOriginalNode(node).kind === 269 /* EnumDeclaration */;
+ return getOriginalNode(node).kind === 272 /* EnumDeclaration */;
}
function onEmitNode(hint, node, emitCallback) {
const savedApplicableSubstitutions = applicableSubstitutions;
@@ -86031,9 +86231,9 @@ function transformTypeScript(context) {
switch (node.kind) {
case 79 /* Identifier */:
return substituteExpressionIdentifier(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return substitutePropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return substituteElementAccessExpression(node);
}
return node;
@@ -86044,8 +86244,8 @@ function transformTypeScript(context) {
function trySubstituteNamespaceExportedName(node) {
if (enabledSubstitutions & applicableSubstitutions && !isGeneratedIdentifier(node) && !isLocalName(node)) {
const container = resolver.getReferencedExportContainer(node, false);
- if (container && container.kind !== 314 /* SourceFile */) {
- const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 270 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 269 /* EnumDeclaration */;
+ if (container && container.kind !== 317 /* SourceFile */) {
+ const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 273 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 272 /* EnumDeclaration */;
if (substitute) {
return setTextRange(
factory2.createPropertyAccessExpression(factory2.getGeneratedNameForNode(container), node),
@@ -86147,45 +86347,49 @@ function transformClassFields(context) {
switch (node.kind) {
case 128 /* AccessorKeyword */:
return shouldTransformAutoAccessors ? void 0 : node;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return void 0;
- case 232 /* ClassExpression */:
+ case 269 /* OverloadDeclaration */:
+ return void 0;
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return visitClassStaticBlockDeclaration(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return visitPropertyDeclaration(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ return void 0;
+ case 174 /* OverloadPropertyDeclaration */:
return void 0;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
case 80 /* PrivateIdentifier */:
return visitPrivateIdentifier(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return visitPropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitElementAccessExpression(node);
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPreOrPostfixUnaryExpression(node, false);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, false);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */: {
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */: {
return setCurrentStaticPropertyDeclarationOrStaticBlockAnd(
void 0,
fallbackVisitor,
@@ -86201,10 +86405,10 @@ function transformClassFields(context) {
}
function discardedValueVisitor(node) {
switch (node.kind) {
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPreOrPostfixUnaryExpression(node, true);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, true);
default:
return visitor(node);
@@ -86212,9 +86416,9 @@ function transformClassFields(context) {
}
function heritageClauseVisitor(node) {
switch (node.kind) {
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return visitEachChild(node, heritageClauseVisitor, context);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return visitExpressionWithTypeArgumentsInHeritageClause(node);
default:
return visitor(node);
@@ -86222,8 +86426,8 @@ function transformClassFields(context) {
}
function assignmentTargetVisitor(node) {
switch (node.kind) {
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return visitAssignmentPattern(node);
default:
return visitor(node);
@@ -86231,25 +86435,25 @@ function transformClassFields(context) {
}
function classElementVisitor(node) {
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return visitConstructorDeclaration(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
return setCurrentStaticPropertyDeclarationOrStaticBlockAnd(
void 0,
visitMethodOrAccessorDeclaration,
node
);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return setCurrentStaticPropertyDeclarationOrStaticBlockAnd(
void 0,
visitPropertyDeclaration,
node
);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return visitComputedPropertyName(node);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return node;
default:
return visitor(node);
@@ -86257,10 +86461,10 @@ function transformClassFields(context) {
}
function accessorFieldResultVisitor(node) {
switch (node.kind) {
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return transformFieldInitializer(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return classElementVisitor(node);
default:
Debug.assertMissingNode(node, "Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration");
@@ -87344,14 +87548,14 @@ function transformClassFields(context) {
if ((enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */) === 0) {
enabledSubstitutions |= 2 /* ClassStaticThisOrSuperReference */;
context.enableSubstitution(109 /* ThisKeyword */);
- context.enableEmitNotification(263 /* FunctionDeclaration */);
- context.enableEmitNotification(218 /* FunctionExpression */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(171 /* PropertyDeclaration */);
- context.enableEmitNotification(166 /* ComputedPropertyName */);
+ context.enableEmitNotification(265 /* FunctionDeclaration */);
+ context.enableEmitNotification(220 /* FunctionExpression */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(172 /* PropertyDeclaration */);
+ context.enableEmitNotification(167 /* ComputedPropertyName */);
}
}
function addMethodStatements(statements, methods, receiver) {
@@ -87393,12 +87597,12 @@ function transformClassFields(context) {
}
}
switch (node.kind) {
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
if (isArrowFunction(original) || getEmitFlags(node) & 262144 /* AsyncFunctionBody */) {
break;
}
- case 263 /* FunctionDeclaration */:
- case 176 /* Constructor */: {
+ case 265 /* FunctionDeclaration */:
+ case 178 /* Constructor */: {
const savedClassLexicalEnvironment = currentClassLexicalEnvironment;
const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
currentClassLexicalEnvironment = void 0;
@@ -87408,10 +87612,10 @@ function transformClassFields(context) {
currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment;
return;
}
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- case 171 /* PropertyDeclaration */: {
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 172 /* PropertyDeclaration */: {
const savedClassLexicalEnvironment = currentClassLexicalEnvironment;
const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
currentComputedPropertyNameClassLexicalEnvironment = currentClassLexicalEnvironment;
@@ -87421,7 +87625,7 @@ function transformClassFields(context) {
currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment;
return;
}
- case 166 /* ComputedPropertyName */: {
+ case 167 /* ComputedPropertyName */: {
const savedClassLexicalEnvironment = currentClassLexicalEnvironment;
const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
currentClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
@@ -87895,15 +88099,15 @@ function createRuntimeTypeSerializer(context) {
}
function serializeTypeOfNode(node) {
switch (node.kind) {
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
return serializeTypeNode(node.type);
- case 178 /* SetAccessor */:
- case 177 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 179 /* GetAccessor */:
return serializeTypeNode(getAccessorTypeNode(node));
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 174 /* MethodDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 176 /* MethodDeclaration */:
return factory.createIdentifier("Function");
default:
return factory.createVoidZero();
@@ -87930,7 +88134,7 @@ function createRuntimeTypeSerializer(context) {
return factory.createArrayLiteralExpression(expressions);
}
function getParametersOfDecoratedDeclaration(node, container) {
- if (container && node.kind === 177 /* GetAccessor */) {
+ if (container && node.kind === 179 /* GetAccessor */) {
const { setAccessor } = getAllAccessorDeclarations(container.members, node);
if (setAccessor) {
return setAccessor.parameters;
@@ -87956,22 +88160,22 @@ function createRuntimeTypeSerializer(context) {
case 157 /* UndefinedKeyword */:
case 145 /* NeverKeyword */:
return factory.createVoidZero();
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return factory.createIdentifier("Function");
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
return factory.createIdentifier("Array");
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return node.assertsModifier ? factory.createVoidZero() : factory.createIdentifier("Boolean");
case 135 /* BooleanKeyword */:
return factory.createIdentifier("Boolean");
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
case 153 /* StringKeyword */:
return factory.createIdentifier("String");
case 150 /* ObjectKeyword */:
return factory.createIdentifier("Object");
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return serializeLiteralOfLiteralTypeNode(node.literal);
case 149 /* NumberKeyword */:
return factory.createIdentifier("Number");
@@ -87979,37 +88183,37 @@ function createRuntimeTypeSerializer(context) {
return getGlobalConstructor("BigInt", 7 /* ES2020 */);
case 154 /* SymbolKeyword */:
return getGlobalConstructor("Symbol", 2 /* ES2015 */);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return serializeTypeReferenceNode(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return serializeUnionOrIntersectionConstituents(node.types, true);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return serializeUnionOrIntersectionConstituents(node.types, false);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return serializeUnionOrIntersectionConstituents([node.trueType, node.falseType], false);
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
if (node.operator === 147 /* ReadonlyKeyword */) {
return serializeTypeNode(node.type);
}
break;
- case 186 /* TypeQuery */:
- case 199 /* IndexedAccessType */:
- case 200 /* MappedType */:
- case 187 /* TypeLiteral */:
+ case 188 /* TypeQuery */:
+ case 201 /* IndexedAccessType */:
+ case 202 /* MappedType */:
+ case 189 /* TypeLiteral */:
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
- case 197 /* ThisType */:
- case 205 /* ImportType */:
+ case 199 /* ThisType */:
+ case 207 /* ImportType */:
break;
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
- case 326 /* JSDocFunctionType */:
- case 327 /* JSDocVariadicType */:
- case 328 /* JSDocNamepathType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
+ case 329 /* JSDocFunctionType */:
+ case 330 /* JSDocVariadicType */:
+ case 331 /* JSDocNamepathType */:
break;
- case 323 /* JSDocNullableType */:
- case 324 /* JSDocNonNullableType */:
- case 325 /* JSDocOptionalType */:
+ case 326 /* JSDocNullableType */:
+ case 327 /* JSDocNonNullableType */:
+ case 328 /* JSDocOptionalType */:
return serializeTypeNode(node.type);
default:
return Debug.failBadSyntaxKind(node);
@@ -88021,7 +88225,7 @@ function createRuntimeTypeSerializer(context) {
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return factory.createIdentifier("String");
- case 225 /* PrefixUnaryExpression */: {
+ case 227 /* PrefixUnaryExpression */: {
const operand = node.operand;
switch (operand.kind) {
case 8 /* NumericLiteral */:
@@ -88154,7 +88358,7 @@ function createRuntimeTypeSerializer(context) {
name.original = void 0;
setParent(name, getParseTreeNode(currentLexicalScope));
return name;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return serializeQualifiedNameAsExpression(node);
}
}
@@ -88202,23 +88406,23 @@ function transformLegacyDecorators(context) {
return node;
}
switch (node.kind) {
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return void 0;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return visitConstructorDeclaration(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return visitSetAccessorDeclaration(node);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return visitGetAccessorDeclaration(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return visitPropertyDeclaration(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameterDeclaration(node);
default:
return visitEachChild(node, visitor, context);
@@ -88627,34 +88831,34 @@ function transformES2017(context) {
switch (node.kind) {
case 133 /* AsyncKeyword */:
return void 0;
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return visitAwaitExpression(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 107 /* SuperKeyword */) {
capturedSuperProperties.add(node.name.escapedText);
}
return visitEachChild(node, visitor, context);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (capturedSuperProperties && node.expression.kind === 107 /* SuperKeyword */) {
hasSuperElementAccess = true;
}
return visitEachChild(node, visitor, context);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitGetAccessorDeclaration, node);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitSetAccessorDeclaration, node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitConstructorDeclaration, node);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node);
default:
return visitEachChild(node, visitor, context);
@@ -88663,27 +88867,27 @@ function transformES2017(context) {
function asyncBodyVisitor(node) {
if (isNodeWithPossibleHoistedDeclaration(node)) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatementInAsyncBody(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatementInAsyncBody(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatementInAsyncBody(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatementInAsyncBody(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClauseInAsyncBody(node);
- case 242 /* Block */:
- case 256 /* SwitchStatement */:
- case 272 /* CaseBlock */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 259 /* TryStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 246 /* IfStatement */:
- case 255 /* WithStatement */:
- case 257 /* LabeledStatement */:
+ case 244 /* Block */:
+ case 258 /* SwitchStatement */:
+ case 275 /* CaseBlock */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 261 /* TryStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 248 /* IfStatement */:
+ case 257 /* WithStatement */:
+ case 259 /* LabeledStatement */:
return visitEachChild(node, asyncBodyVisitor, context);
default:
return Debug.assertNever(node, "Unhandled node.");
@@ -88933,7 +89137,7 @@ function transformES2017(context) {
const original = getOriginalNode(node, isFunctionLike);
const nodeType = original.type;
const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
- const isArrowFunction2 = node.kind === 219 /* ArrowFunction */;
+ const isArrowFunction2 = node.kind === 221 /* ArrowFunction */;
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0;
const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
enclosingFunctionParameterNames = new Set2();
@@ -89022,15 +89226,15 @@ function transformES2017(context) {
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) {
enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */;
- context.enableSubstitution(213 /* CallExpression */);
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(212 /* ElementAccessExpression */);
- context.enableEmitNotification(264 /* ClassDeclaration */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(244 /* VariableStatement */);
+ context.enableSubstitution(215 /* CallExpression */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(214 /* ElementAccessExpression */);
+ context.enableEmitNotification(266 /* ClassDeclaration */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(246 /* VariableStatement */);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -89061,11 +89265,11 @@ function transformES2017(context) {
}
function substituteExpression(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return substitutePropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return substituteElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return substituteCallExpression(node);
}
return node;
@@ -89108,7 +89312,7 @@ function transformES2017(context) {
}
function isSuperContainer(node) {
const kind = node.kind;
- return kind === 264 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 266 /* ClassDeclaration */ || kind === 178 /* Constructor */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
if (enclosingSuperContainerFlags & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
@@ -89315,115 +89519,115 @@ function transformES2018(context) {
return node;
}
switch (node.kind) {
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return visitAwaitExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return visitYieldExpression(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitReturnStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, expressionResultIsUnused2);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return visitCommaListExpression(node, expressionResultIsUnused2);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return visitVariableDeclaration(node);
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 250 /* ForInStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 252 /* ForInStatement */:
return doWithHierarchyFacts(
visitDefault,
node,
0 /* IterationStatementExcludes */,
2 /* IterationStatementIncludes */
);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node, void 0);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return doWithHierarchyFacts(
visitForStatement,
node,
0 /* IterationStatementExcludes */,
2 /* IterationStatementIncludes */
);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return visitVoidExpression(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return doWithHierarchyFacts(
visitConstructorDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return doWithHierarchyFacts(
visitMethodDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return doWithHierarchyFacts(
visitGetAccessorDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return doWithHierarchyFacts(
visitSetAccessorDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return doWithHierarchyFacts(
visitFunctionDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return doWithHierarchyFacts(
visitFunctionExpression,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return doWithHierarchyFacts(
visitArrowFunction,
node,
2 /* ArrowFunctionExcludes */,
0 /* ArrowFunctionIncludes */
);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameter(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, expressionResultIsUnused2);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 107 /* SuperKeyword */) {
capturedSuperProperties.add(node.name.escapedText);
}
return visitEachChild(node, visitor, context);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (capturedSuperProperties && node.expression.kind === 107 /* SuperKeyword */) {
hasSuperElementAccess = true;
}
return visitEachChild(node, visitor, context);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return doWithHierarchyFacts(
visitDefault,
node,
@@ -89501,7 +89705,7 @@ function transformES2018(context) {
function visitLabeledStatement(node) {
if (enclosingFunctionFlags & 2 /* Async */) {
const statement = unwrapInnermostStatementOfLabel(node);
- if (statement.kind === 251 /* ForOfStatement */ && statement.awaitModifier) {
+ if (statement.kind === 253 /* ForOfStatement */ && statement.awaitModifier) {
return visitForOfStatement(statement, node);
}
return factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node);
@@ -89512,7 +89716,7 @@ function transformES2018(context) {
let chunkObject;
const objects = [];
for (const e of elements) {
- if (e.kind === 307 /* SpreadAssignment */) {
+ if (e.kind === 310 /* SpreadAssignment */) {
if (chunkObject) {
objects.push(factory2.createObjectLiteralExpression(chunkObject));
chunkObject = void 0;
@@ -89520,7 +89724,7 @@ function transformES2018(context) {
const target = e.expression;
objects.push(visitNode(target, visitor, isExpression));
} else {
- chunkObject = append(chunkObject, e.kind === 305 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike));
+ chunkObject = append(chunkObject, e.kind === 308 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike));
}
}
if (chunkObject) {
@@ -89531,7 +89735,7 @@ function transformES2018(context) {
function visitObjectLiteralExpression(node) {
if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) {
const objects = chunkObjectLiteralElements(node.properties);
- if (objects.length && objects[0].kind !== 210 /* ObjectLiteralExpression */) {
+ if (objects.length && objects[0].kind !== 212 /* ObjectLiteralExpression */) {
objects.unshift(factory2.createObjectLiteralExpression());
}
let expression = objects[0];
@@ -90184,15 +90388,15 @@ function transformES2018(context) {
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) {
enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */;
- context.enableSubstitution(213 /* CallExpression */);
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(212 /* ElementAccessExpression */);
- context.enableEmitNotification(264 /* ClassDeclaration */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(244 /* VariableStatement */);
+ context.enableSubstitution(215 /* CallExpression */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(214 /* ElementAccessExpression */);
+ context.enableEmitNotification(266 /* ClassDeclaration */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(246 /* VariableStatement */);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -90223,11 +90427,11 @@ function transformES2018(context) {
}
function substituteExpression(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return substitutePropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return substituteElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return substituteCallExpression(node);
}
return node;
@@ -90270,7 +90474,7 @@ function transformES2018(context) {
}
function isSuperContainer(node) {
const kind = node.kind;
- return kind === 264 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 266 /* ClassDeclaration */ || kind === 178 /* Constructor */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
if (enclosingSuperContainerFlags & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
@@ -90313,7 +90517,7 @@ function transformES2019(context) {
return node;
}
switch (node.kind) {
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
default:
return visitEachChild(node, visitor, context);
@@ -90349,25 +90553,25 @@ function transformES2020(context) {
return node;
}
switch (node.kind) {
- case 213 /* CallExpression */: {
+ case 215 /* CallExpression */: {
const updated = visitNonOptionalCallExpression(node, false);
Debug.assertNotNode(updated, isSyntheticReference);
return updated;
}
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (isOptionalChain(node)) {
const updated = visitOptionalExpression(node, false, false);
Debug.assertNotNode(updated, isSyntheticReference);
return updated;
}
return visitEachChild(node, visitor, context);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) {
return transformNullishCoalescingExpression(node);
}
return visitEachChild(node, visitor, context);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return visitDeleteExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -90405,7 +90609,7 @@ function transformES2020(context) {
thisArg = expression;
}
}
- expression = node.kind === 211 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression));
+ expression = node.kind === 213 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression));
return thisArg ? factory2.createSyntheticReferenceExpression(expression, thisArg) : expression;
}
function visitNonOptionalCallExpression(node, captureThisArg) {
@@ -90424,12 +90628,12 @@ function transformES2020(context) {
}
function visitNonOptionalExpression(node, captureThisArg, isDelete) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitNonOptionalCallExpression(node, captureThisArg);
default:
return visitNode(node, visitor, isExpression);
@@ -90450,8 +90654,8 @@ function transformES2020(context) {
for (let i = 0; i < chain.length; i++) {
const segment = chain[i];
switch (segment.kind) {
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (i === chain.length - 1 && captureThisArg) {
if (!isSimpleCopiableExpression(rightExpression)) {
thisArg = factory2.createTempVariable(hoistVariableDeclaration);
@@ -90460,9 +90664,9 @@ function transformES2020(context) {
thisArg = rightExpression;
}
}
- rightExpression = segment.kind === 211 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression));
+ rightExpression = segment.kind === 213 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression));
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (i === 0 && leftThisArg) {
if (!isGeneratedIdentifier(leftThisArg)) {
leftThisArg = factory2.cloneNode(leftThisArg);
@@ -90541,7 +90745,7 @@ function transformES2021(context) {
return node;
}
switch (node.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const binaryExpression = node;
if (isLogicalOrCoalescingAssignmentExpression(binaryExpression)) {
return transformLogicalAssignment(binaryExpression);
@@ -90719,13 +90923,13 @@ function transformJsx(context) {
}
function visitorWorker(node) {
switch (node.kind) {
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return visitJsxElement(node, false);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return visitJsxSelfClosingElement(node, false);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return visitJsxFragment(node, false);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return visitJsxExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -90735,13 +90939,13 @@ function transformJsx(context) {
switch (node.kind) {
case 11 /* JsxText */:
return visitJsxText(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return visitJsxExpression(node);
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return visitJsxElement(node, true);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return visitJsxSelfClosingElement(node, true);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return visitJsxFragment(node, true);
default:
return Debug.failBadSyntaxKind(node);
@@ -90936,7 +91140,7 @@ function transformJsx(context) {
const literal = factory2.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote);
return setTextRange(literal, node);
}
- if (node.kind === 297 /* JsxExpression */) {
+ if (node.kind === 300 /* JsxExpression */) {
if (node.expression === void 0) {
return factory2.createTrue();
}
@@ -90998,7 +91202,7 @@ function transformJsx(context) {
return decoded === text ? void 0 : decoded;
}
function getTagName(node) {
- if (node.kind === 287 /* JsxElement */) {
+ if (node.kind === 290 /* JsxElement */) {
return getTagName(node.openingElement);
} else {
const name = node.tagName;
@@ -91297,7 +91501,7 @@ function transformES2016(context) {
return node;
}
switch (node.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -91425,7 +91629,7 @@ function transformES2015(context) {
hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -32768 /* SubtreeFactsMask */ | ancestorFacts;
}
function isReturnVoidStatementInConstructorWithCapturedSuper(node) {
- return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 && node.kind === 254 /* ReturnStatement */ && !node.expression;
+ return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 && node.kind === 256 /* ReturnStatement */ && !node.expression;
}
function isOrMayContainReturnCompletion(node) {
return node.transformFlags & 4194304 /* ContainsHoistedDeclarationOrCompletion */ && (isReturnStatement(node) || isIfStatement(node) || isWithStatement(node) || isSwitchStatement(node) || isCaseBlock(node) || isCaseClause(node) || isDefaultClause(node) || isTryStatement(node) || isCatchClause(node) || isLabeledStatement(node) || isIterationStatement(node, false) || isBlock(node));
@@ -91465,65 +91669,65 @@ function transformES2015(context) {
switch (node.kind) {
case 125 /* StaticKeyword */:
return void 0;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameter(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return visitArrowFunction(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return visitVariableDeclaration(node);
case 79 /* Identifier */:
return visitIdentifier(node);
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return visitVariableDeclarationList(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return visitSwitchStatement(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return visitCaseBlock(node);
- case 242 /* Block */:
+ case 244 /* Block */:
return visitBlock(node, false);
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
return visitBreakOrContinueStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return visitDoOrWhileStatement(node, void 0);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, void 0);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node, void 0);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node, void 0);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return visitShorthandPropertyAssignment(node);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return visitComputedPropertyName(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return visitArrayLiteralExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return visitNewExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, expressionResultIsUnused2);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, expressionResultIsUnused2);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return visitCommaListExpression(node, expressionResultIsUnused2);
case 14 /* NoSubstitutionTemplateLiteral */:
case 15 /* TemplateHead */:
@@ -91534,30 +91738,30 @@ function transformES2015(context) {
return visitStringLiteral(node);
case 8 /* NumericLiteral */:
return visitNumericLiteral(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return visitTemplateExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return visitYieldExpression(node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return visitSpreadElement(node);
case 107 /* SuperKeyword */:
return visitSuperKeyword(false);
case 109 /* ThisKeyword */:
return visitThisKeyword(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return visitMetaProperty(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return visitAccessorDeclaration(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitReturnStatement(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return visitVoidExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -91658,13 +91862,13 @@ function transformES2015(context) {
}
function visitBreakOrContinueStatement(node) {
if (convertedLoopState) {
- const jump = node.kind === 253 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */;
+ const jump = node.kind === 255 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */;
const canUseBreakOrContinue = node.label && convertedLoopState.labels && convertedLoopState.labels.get(idText(node.label)) || !node.label && convertedLoopState.allowedNonLabeledJumps & jump;
if (!canUseBreakOrContinue) {
let labelMarker;
const label = node.label;
if (!label) {
- if (node.kind === 253 /* BreakStatement */) {
+ if (node.kind === 255 /* BreakStatement */) {
convertedLoopState.nonLocalJumps |= 2 /* Break */;
labelMarker = "break";
} else {
@@ -91672,7 +91876,7 @@ function transformES2015(context) {
labelMarker = "continue";
}
} else {
- if (node.kind === 253 /* BreakStatement */) {
+ if (node.kind === 255 /* BreakStatement */) {
labelMarker = `break-${label.escapedText}`;
setLabeledJump(convertedLoopState, true, idText(label), labelMarker);
} else {
@@ -91916,14 +92120,14 @@ function transformES2015(context) {
};
}
function isSufficientlyCoveredByReturnStatements(statement) {
- if (statement.kind === 254 /* ReturnStatement */) {
+ if (statement.kind === 256 /* ReturnStatement */) {
return true;
- } else if (statement.kind === 246 /* IfStatement */) {
+ } else if (statement.kind === 248 /* IfStatement */) {
const ifStatement = statement;
if (ifStatement.elseStatement) {
return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement);
}
- } else if (statement.kind === 242 /* Block */) {
+ } else if (statement.kind === 244 /* Block */) {
const lastStatement = lastOrUndefined(statement.statements);
if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {
return true;
@@ -92165,7 +92369,7 @@ function transformES2015(context) {
return true;
}
function insertCaptureThisForNodeIfNeeded(statements, node) {
- if (hierarchyFacts & 65536 /* CapturedLexicalThis */ && node.kind !== 219 /* ArrowFunction */) {
+ if (hierarchyFacts & 65536 /* CapturedLexicalThis */ && node.kind !== 221 /* ArrowFunction */) {
insertCaptureThisForNode(statements, node, factory2.createThis());
return true;
}
@@ -92204,21 +92408,21 @@ function transformES2015(context) {
if (hierarchyFacts & 32768 /* NewTarget */) {
let newTarget;
switch (node.kind) {
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return statements;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
newTarget = factory2.createVoidZero();
break;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
newTarget = factory2.createPropertyAccessExpression(
setEmitFlags(factory2.createThis(), 4 /* NoSubstitution */),
"constructor"
);
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
newTarget = factory2.createConditionalExpression(
factory2.createLogicalAnd(
setEmitFlags(factory2.createThis(), 4 /* NoSubstitution */),
@@ -92262,21 +92466,21 @@ function transformES2015(context) {
function addClassMembers(statements, node) {
for (const member of node.members) {
switch (member.kind) {
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
statements.push(transformSemicolonClassElementToStatement(member));
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node));
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
const accessors = getAllAccessorDeclarations(node.members, member);
if (member === accessors.firstAccessor) {
statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node));
}
break;
- case 176 /* Constructor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 177 /* ClassStaticBlockDeclaration */:
break;
default:
Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName);
@@ -92429,7 +92633,7 @@ function transformES2015(context) {
const ancestorFacts = container && isClassLike(container) && !isStatic(node) ? enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */) : enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */);
const parameters = visitParameterList(node.parameters, visitor, context);
const body = transformFunctionBody2(node);
- if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) {
+ if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */)) {
name = factory2.getGeneratedNameForNode(node);
}
exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */);
@@ -92475,7 +92679,7 @@ function transformES2015(context) {
multiLine = true;
}
} else {
- Debug.assert(node.kind === 219 /* ArrowFunction */);
+ Debug.assert(node.kind === 221 /* ArrowFunction */);
statementsLocation = moveRangeEnd(body, -1);
const equalsGreaterThanToken = node.equalsGreaterThanToken;
if (!nodeIsSynthesized(equalsGreaterThanToken) && !nodeIsSynthesized(body)) {
@@ -92678,14 +92882,14 @@ function transformES2015(context) {
}
function visitIterationStatement(node, outermostLabeledStatement) {
switch (node.kind) {
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return visitDoOrWhileStatement(node, outermostLabeledStatement);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, outermostLabeledStatement);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node, outermostLabeledStatement);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node, outermostLabeledStatement);
}
}
@@ -92962,7 +93166,7 @@ function transformES2015(context) {
let numInitialProperties = -1, hasComputed = false;
for (let i = 0; i < properties.length; i++) {
const property = properties[i];
- if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 166 /* ComputedPropertyName */)) {
+ if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 167 /* ComputedPropertyName */)) {
numInitialProperties = i;
break;
}
@@ -93074,15 +93278,15 @@ function transformES2015(context) {
}
function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) {
switch (node.kind) {
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return convertForStatement(node, initializerFunction, convertedLoopBody);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return convertForInStatement(node, convertedLoopBody);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return convertForOfStatement(node, convertedLoopBody);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return convertDoStatement(node, convertedLoopBody);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return convertWhileStatement(node, convertedLoopBody);
default:
return Debug.failBadSyntaxKind(node, "IterationStatement expected");
@@ -93133,11 +93337,11 @@ function transformES2015(context) {
function createConvertedLoopState(node) {
let loopInitializer;
switch (node.kind) {
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
const initializer = node.initializer;
- if (initializer && initializer.kind === 262 /* VariableDeclarationList */) {
+ if (initializer && initializer.kind === 264 /* VariableDeclarationList */) {
loopInitializer = initializer;
}
break;
@@ -93491,20 +93695,20 @@ function transformES2015(context) {
for (let i = start; i < numProperties; i++) {
const property = properties[i];
switch (property.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
const accessors = getAllAccessorDeclarations(node.properties, property);
if (property === accessors.firstAccessor) {
expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine));
}
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine));
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
default:
@@ -93607,7 +93811,7 @@ function transformES2015(context) {
let updated;
const parameters = visitParameterList(node.parameters, visitor, context);
const body = transformFunctionBody2(node);
- if (node.kind === 177 /* GetAccessor */) {
+ if (node.kind === 179 /* GetAccessor */) {
updated = factory2.updateGetAccessorDeclaration(node, node.modifiers, node.name, parameters, node.type, body);
} else {
updated = factory2.updateSetAccessorDeclaration(node, node.modifiers, node.name, parameters, body);
@@ -93909,13 +94113,13 @@ function transformES2015(context) {
if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) {
enabledSubstitutions |= 1 /* CapturedThis */;
context.enableSubstitution(109 /* ThisKeyword */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(219 /* ArrowFunction */);
- context.enableEmitNotification(218 /* FunctionExpression */);
- context.enableEmitNotification(263 /* FunctionDeclaration */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(221 /* ArrowFunction */);
+ context.enableEmitNotification(220 /* FunctionExpression */);
+ context.enableEmitNotification(265 /* FunctionDeclaration */);
}
}
function onSubstituteNode(hint, node) {
@@ -93939,10 +94143,10 @@ function transformES2015(context) {
}
function isNameOfDeclarationWithCollidingName(node) {
switch (node.parent.kind) {
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
- case 269 /* EnumDeclaration */:
- case 261 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 263 /* VariableDeclaration */:
return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent);
}
return false;
@@ -93999,11 +94203,11 @@ function transformES2015(context) {
return false;
}
const statement = firstOrUndefined(constructor.body.statements);
- if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 245 /* ExpressionStatement */) {
+ if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 247 /* ExpressionStatement */) {
return false;
}
const statementExpression = statement.expression;
- if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 213 /* CallExpression */) {
+ if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 215 /* CallExpression */) {
return false;
}
const callTarget = statementExpression.expression;
@@ -94011,7 +94215,7 @@ function transformES2015(context) {
return false;
}
const callArgument = singleOrUndefined(statementExpression.arguments);
- if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 231 /* SpreadElement */) {
+ if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 233 /* SpreadElement */) {
return false;
}
const expression = callArgument.expression;
@@ -94028,24 +94232,24 @@ function transformES5(context) {
if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) {
previousOnEmitNode = context.onEmitNode;
context.onEmitNode = onEmitNode;
- context.enableEmitNotification(289 /* JsxOpeningElement */);
- context.enableEmitNotification(290 /* JsxClosingElement */);
- context.enableEmitNotification(288 /* JsxSelfClosingElement */);
+ context.enableEmitNotification(292 /* JsxOpeningElement */);
+ context.enableEmitNotification(293 /* JsxClosingElement */);
+ context.enableEmitNotification(291 /* JsxSelfClosingElement */);
noSubstitution = [];
}
const previousOnSubstituteNode = context.onSubstituteNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(305 /* PropertyAssignment */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(308 /* PropertyAssignment */);
return chainBundle(context, transformSourceFile);
function transformSourceFile(node) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
switch (node.kind) {
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
const tagName = node.tagName;
noSubstitution[getOriginalNodeId(tagName)] = true;
break;
@@ -94171,13 +94375,13 @@ function transformGenerators(context) {
}
function visitJavaScriptInStatementContainingYield(node) {
switch (node.kind) {
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return visitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return visitWhileStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return visitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
default:
return visitJavaScriptInGeneratorFunctionBody(node);
@@ -94185,24 +94389,24 @@ function transformGenerators(context) {
}
function visitJavaScriptInGeneratorFunctionBody(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return visitAccessorDeclaration(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return visitBreakStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return visitContinueStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitReturnStatement(node);
default:
if (node.transformFlags & 1048576 /* ContainsYield */) {
@@ -94216,23 +94420,23 @@ function transformGenerators(context) {
}
function visitJavaScriptContainingYield(node) {
switch (node.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return visitCommaListExpression(node);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return visitConditionalExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return visitYieldExpression(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return visitArrayLiteralExpression(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return visitNewExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -94240,9 +94444,9 @@ function transformGenerators(context) {
}
function visitGenerator(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
default:
return Debug.failBadSyntaxKind(node);
@@ -94409,14 +94613,14 @@ function transformGenerators(context) {
if (containsYield(right)) {
let target;
switch (left.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
target = factory2.updatePropertyAccessExpression(
left,
cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)),
left.name
);
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
target = factory2.updateElementAccessExpression(
left,
cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)),
@@ -94688,35 +94892,35 @@ function transformGenerators(context) {
}
function transformAndEmitStatementWorker(node) {
switch (node.kind) {
- case 242 /* Block */:
+ case 244 /* Block */:
return transformAndEmitBlock(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return transformAndEmitExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return transformAndEmitIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return transformAndEmitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return transformAndEmitWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return transformAndEmitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return transformAndEmitForInStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return transformAndEmitContinueStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return transformAndEmitBreakStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return transformAndEmitReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return transformAndEmitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return transformAndEmitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return transformAndEmitLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return transformAndEmitThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return transformAndEmitTryStatement(node);
default:
return emitStatement(visitNode(node, visitor, isStatement));
@@ -95041,7 +95245,7 @@ function transformGenerators(context) {
for (let i = 0; i < numClauses; i++) {
const clause = caseBlock.clauses[i];
clauseLabels.push(defineLabel());
- if (clause.kind === 299 /* DefaultClause */ && defaultClauseIndex === -1) {
+ if (clause.kind === 302 /* DefaultClause */ && defaultClauseIndex === -1) {
defaultClauseIndex = i;
}
}
@@ -95051,7 +95255,7 @@ function transformGenerators(context) {
let defaultClausesSkipped = 0;
for (let i = clausesWritten; i < numClauses; i++) {
const clause = caseBlock.clauses[i];
- if (clause.kind === 298 /* CaseClause */) {
+ if (clause.kind === 301 /* CaseClause */) {
if (containsYield(clause.expression) && pendingClauses.length > 0) {
break;
}
@@ -95976,12 +96180,12 @@ function transformModule(context) {
const previousOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(213 /* CallExpression */);
- context.enableSubstitution(215 /* TaggedTemplateExpression */);
+ context.enableSubstitution(215 /* CallExpression */);
+ context.enableSubstitution(217 /* TaggedTemplateExpression */);
context.enableSubstitution(79 /* Identifier */);
- context.enableSubstitution(227 /* BinaryExpression */);
- context.enableSubstitution(306 /* ShorthandPropertyAssignment */);
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableSubstitution(229 /* BinaryExpression */);
+ context.enableSubstitution(309 /* ShorthandPropertyAssignment */);
+ context.enableEmitNotification(317 /* SourceFile */);
const moduleInfoMap = [];
const deferredExports = [];
let currentSourceFile;
@@ -96289,23 +96493,23 @@ function transformModule(context) {
}
function topLevelVisitor(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 361 /* MergeDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return visitMergeDeclarationMarker(node);
- case 362 /* EndOfDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return visitEndOfDeclarationMarker(node);
default:
return visitor(node);
@@ -96316,26 +96520,26 @@ function transformModule(context) {
return node;
}
switch (node.kind) {
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, valueIsDiscarded);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
return visitImportCallExpression(node);
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
return visitDestructuringAssignment(node, valueIsDiscarded);
}
break;
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPreOrPostfixUnaryExpression(node, valueIsDiscarded);
}
return visitEachChild(node, visitor, context);
@@ -96350,24 +96554,24 @@ function transformModule(context) {
if (isObjectLiteralExpression(node)) {
for (const elem of node.properties) {
switch (elem.kind) {
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (destructuringNeedsFlattening(elem.initializer)) {
return true;
}
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
if (destructuringNeedsFlattening(elem.name)) {
return true;
}
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
if (destructuringNeedsFlattening(elem.expression)) {
return true;
}
break;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return false;
default:
Debug.assertNever(elem, "Unhandled object member kind");
@@ -97024,7 +97228,7 @@ function transformModule(context) {
}
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 244 /* VariableStatement */) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 246 /* VariableStatement */) {
const id = getOriginalNodeId(node);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original);
}
@@ -97056,10 +97260,10 @@ function transformModule(context) {
const namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
for (const importBinding of namedBindings.elements) {
statements = appendExportsOfDeclaration(statements, importBinding, true);
}
@@ -97203,7 +97407,7 @@ function transformModule(context) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
currentSourceFile = node;
currentModuleInfo = moduleInfoMap[getOriginalNodeId(currentSourceFile)];
previousOnEmitNode(hint, node, emitCallback);
@@ -97241,11 +97445,11 @@ function transformModule(context) {
switch (node.kind) {
case 79 /* Identifier */:
return substituteExpressionIdentifier(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return substituteCallExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return substituteTaggedTemplateExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return substituteBinaryExpression(node);
}
return node;
@@ -97296,7 +97500,7 @@ function transformModule(context) {
return node;
} else if (!(isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node));
- if (exportContainer && exportContainer.kind === 314 /* SourceFile */) {
+ if (exportContainer && exportContainer.kind === 317 /* SourceFile */) {
return setTextRange(
factory2.createPropertyAccessExpression(
factory2.createIdentifier("exports"),
@@ -97375,10 +97579,10 @@ function transformSystemModule(context) {
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
context.enableSubstitution(79 /* Identifier */);
- context.enableSubstitution(306 /* ShorthandPropertyAssignment */);
- context.enableSubstitution(227 /* BinaryExpression */);
- context.enableSubstitution(237 /* MetaProperty */);
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableSubstitution(309 /* ShorthandPropertyAssignment */);
+ context.enableSubstitution(229 /* BinaryExpression */);
+ context.enableSubstitution(239 /* MetaProperty */);
+ context.enableEmitNotification(317 /* SourceFile */);
const moduleInfoMap = [];
const deferredExports = [];
const exportFunctionsMap = [];
@@ -97528,7 +97732,7 @@ function transformSystemModule(context) {
if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) {
let hasExportDeclarationWithExportClause = false;
for (const externalImport of moduleInfo.externalImports) {
- if (externalImport.kind === 281 /* ExportDeclaration */ && externalImport.exportClause) {
+ if (externalImport.kind === 284 /* ExportDeclaration */ && externalImport.exportClause) {
hasExportDeclarationWithExportClause = true;
break;
}
@@ -97647,11 +97851,11 @@ function transformSystemModule(context) {
for (const entry of group2.externalImports) {
const importVariableName = getLocalNameForExternalImport(factory2, entry, currentSourceFile);
switch (entry.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
if (!entry.importClause) {
break;
}
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
Debug.assert(importVariableName !== void 0);
statements.push(
factory2.createExpressionStatement(
@@ -97673,7 +97877,7 @@ function transformSystemModule(context) {
);
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
Debug.assert(importVariableName !== void 0);
if (entry.exportClause) {
if (isNamedExports(entry.exportClause)) {
@@ -97742,13 +97946,13 @@ function transformSystemModule(context) {
}
function topLevelVisitor(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
default:
return topLevelNestedVisitor(node);
@@ -97893,7 +98097,7 @@ function transformSystemModule(context) {
}
}
function shouldHoistVariableDeclarationList(node) {
- return (getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 314 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);
+ return (getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 317 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);
}
function transformInitializedVariable(node, isExportedDeclaration) {
const createAssignment3 = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment;
@@ -97917,7 +98121,7 @@ function transformSystemModule(context) {
return isExportedDeclaration ? createExportExpression(name, preventSubstitution(setTextRange(factory2.createAssignment(name, value), location))) : preventSubstitution(setTextRange(factory2.createAssignment(name, value), location));
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 244 /* VariableStatement */) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 246 /* VariableStatement */) {
const id = getOriginalNodeId(node);
const isExportedDeclaration = hasSyntacticModifier(node.original, 1 /* Export */);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration);
@@ -97955,10 +98159,10 @@ function transformSystemModule(context) {
const namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
for (const importBinding of namedBindings.elements) {
statements = appendExportsOfDeclaration(statements, importBinding);
}
@@ -98053,43 +98257,43 @@ function transformSystemModule(context) {
}
function topLevelNestedVisitor(node) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, true);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return visitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return visitWhileStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return visitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return visitSwitchStatement(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return visitCaseBlock(node);
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
return visitCaseClause(node);
- case 299 /* DefaultClause */:
+ case 302 /* DefaultClause */:
return visitDefaultClause(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return visitTryStatement(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
- case 242 /* Block */:
+ case 244 /* Block */:
return visitBlock(node);
- case 361 /* MergeDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return visitMergeDeclarationMarker(node);
- case 362 /* EndOfDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return visitEndOfDeclarationMarker(node);
default:
return visitor(node);
@@ -98231,26 +98435,26 @@ function transformSystemModule(context) {
return node;
}
switch (node.kind) {
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, false);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, valueIsDiscarded);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
return visitDestructuringAssignment(node, valueIsDiscarded);
}
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isImportCall(node)) {
return visitImportCallExpression(node);
}
break;
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded);
}
return visitEachChild(node, visitor, context);
@@ -98310,7 +98514,7 @@ function transformSystemModule(context) {
return hasExportedReferenceInDestructuringTarget(node.initializer);
} else if (isIdentifier(node)) {
const container = resolver.getReferencedExportContainer(node);
- return container !== void 0 && container.kind === 314 /* SourceFile */;
+ return container !== void 0 && container.kind === 317 /* SourceFile */;
} else {
return false;
}
@@ -98354,7 +98558,7 @@ function transformSystemModule(context) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
const id = getOriginalNodeId(node);
currentSourceFile = node;
moduleInfo = moduleInfoMap[id];
@@ -98388,7 +98592,7 @@ function transformSystemModule(context) {
}
function substituteUnspecified(node) {
switch (node.kind) {
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return substituteShorthandPropertyAssignment(node);
}
return node;
@@ -98430,9 +98634,9 @@ function transformSystemModule(context) {
switch (node.kind) {
case 79 /* Identifier */:
return substituteExpressionIdentifier(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return substituteBinaryExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return substituteMetaProperty(node);
}
return node;
@@ -98495,7 +98699,7 @@ function transformSystemModule(context) {
const valueDeclaration = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name);
if (valueDeclaration) {
const exportContainer = resolver.getReferencedExportContainer(name, false);
- if (exportContainer && exportContainer.kind === 314 /* SourceFile */) {
+ if (exportContainer && exportContainer.kind === 317 /* SourceFile */) {
exportedNames = append(exportedNames, factory2.getDeclarationName(valueDeclaration));
}
exportedNames = addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[getOriginalNodeId(valueDeclaration)]);
@@ -98528,7 +98732,7 @@ function transformECMAScriptModule(context) {
const previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableEmitNotification(317 /* SourceFile */);
context.enableSubstitution(79 /* Identifier */);
let helperNameSubstitutions;
let currentSourceFile;
@@ -98579,11 +98783,11 @@ function transformECMAScriptModule(context) {
}
function visitor(node) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return getEmitModuleKind(compilerOptions) >= 100 /* Node16 */ ? visitImportEqualsDeclaration(node) : void 0;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportDecl = node;
return visitExportDeclaration(exportDecl);
}
@@ -98745,8 +98949,8 @@ function transformNodeModule(context) {
const cjsOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(314 /* SourceFile */);
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableSubstitution(317 /* SourceFile */);
+ context.enableEmitNotification(317 /* SourceFile */);
let currentSourceFile;
return transformSourceFileOrBundle;
function onSubstituteNode(hint, node) {
@@ -98789,7 +98993,7 @@ function transformNodeModule(context) {
return result;
}
function transformSourceFileOrBundle(node) {
- return node.kind === 314 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
+ return node.kind === 317 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
}
function transformBundle(node) {
return context.factory.createBundle(map(node.sourceFiles, transformSourceFile), node.prepends);
@@ -98819,7 +99023,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
function getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (isStatic(node)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1;
@@ -98836,7 +99040,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
function getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (isStatic(node)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1;
@@ -98844,7 +99048,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
}
}
function createGetSymbolAccessibilityDiagnosticForNode(node) {
- if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isAnnotationPropertyDeclaration(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
+ if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isAnnotationPropertyDeclaration(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node) || isOverloadPropertyDeclaration(node)) {
return getVariableDeclarationTypeVisibilityError;
} else if (isSetAccessor(node) || isGetAccessor(node)) {
return getAccessorDeclarationTypeVisibilityError;
@@ -98867,12 +99071,12 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
return Debug.assertNever(node, `Attempted to set a declaration diagnostic context for unhandled node kind: ${Debug.formatSyntaxKind(node.kind)}`);
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
- if (node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
+ if (node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
- } else if (node.kind === 171 /* PropertyDeclaration */ || node.kind === 211 /* PropertyAccessExpression */ || node.kind === 170 /* PropertySignature */ || node.kind === 168 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
+ } else if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 213 /* PropertyAccessExpression */ || node.kind === 171 /* PropertySignature */ || node.kind === 169 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
if (isStatic(node)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.kind === 264 /* ClassDeclaration */ || node.kind === 168 /* Parameter */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */ || node.kind === 169 /* Parameter */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1;
@@ -98889,7 +99093,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
}
function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) {
let diagnosticMessage;
- if (node.kind === 178 /* SetAccessor */) {
+ if (node.kind === 180 /* SetAccessor */) {
if (isStatic(node)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1;
} else {
@@ -98911,26 +99115,26 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
function getReturnTypeVisibilityError(symbolAccessibilityResult) {
let diagnosticMessage;
switch (node.kind) {
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isStatic(node)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0;
- } else if (node.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0;
} else {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;
}
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;
break;
default:
@@ -98951,29 +99155,29 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
}
function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
switch (node.parent.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;
- case 180 /* ConstructSignature */:
- case 185 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isStatic(node.parent)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.parent.kind === 266 /* ClassDeclaration */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
- case 263 /* FunctionDeclaration */:
- case 184 /* FunctionType */:
+ case 265 /* FunctionDeclaration */:
+ case 186 /* FunctionType */:
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1;
- case 178 /* SetAccessor */:
- case 177 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 179 /* GetAccessor */:
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
default:
return Debug.fail(`Unknown parent for parameter: ${Debug.formatSyntaxKind(node.parent.kind)}`);
@@ -98982,37 +99186,37 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
function getTypeParameterConstraintVisibilityError() {
let diagnosticMessage;
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;
break;
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;
break;
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isStatic(node.parent)) {
diagnosticMessage = Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.parent.kind === 266 /* ClassDeclaration */) {
diagnosticMessage = Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
} else {
diagnosticMessage = Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
break;
- case 184 /* FunctionType */:
- case 263 /* FunctionDeclaration */:
+ case 186 /* FunctionType */:
+ case 265 /* FunctionDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
break;
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
break;
default:
@@ -99065,7 +99269,7 @@ function hasInternalAnnotation(range, currentSourceFile) {
}
function isInternalDeclaration(node, currentSourceFile) {
const parseTreeNode = getParseTreeNode(node);
- if (parseTreeNode && parseTreeNode.kind === 168 /* Parameter */) {
+ if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
const text = currentSourceFile.text;
@@ -99274,10 +99478,10 @@ function transformDeclarations(context) {
return result;
}
function transformRoot(node) {
- if (node.kind === 314 /* SourceFile */ && node.isDeclarationFile) {
+ if (node.kind === 317 /* SourceFile */ && node.isDeclarationFile) {
return node;
}
- if (node.kind === 315 /* Bundle */) {
+ if (node.kind === 318 /* Bundle */) {
isBundledEmit = true;
refs = new Map2();
libs2 = new Map2();
@@ -99314,7 +99518,7 @@ function transformDeclarations(context) {
return factory2.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated2), true, [], [], false, []);
}
), mapDefined(node.prepends, (prepend) => {
- if (prepend.kind === 317 /* InputFiles */) {
+ if (prepend.kind === 320 /* InputFiles */) {
const sourceFile = createUnparsedSourceFile(prepend, "dts", stripInternal);
hasNoDefaultLib = hasNoDefaultLib || !!sourceFile.hasNoDefaultLib;
collectReferences(sourceFile, refs);
@@ -99456,14 +99660,14 @@ function transformDeclarations(context) {
if (name.kind === 79 /* Identifier */) {
return name;
} else {
- if (name.kind === 207 /* ArrayBindingPattern */) {
+ if (name.kind === 209 /* ArrayBindingPattern */) {
return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement));
} else {
return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement));
}
}
function visitBindingElement(elem) {
- if (elem.kind === 233 /* OmittedExpression */) {
+ if (elem.kind === 235 /* OmittedExpression */) {
return elem;
}
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced) {
@@ -99523,14 +99727,14 @@ function transformDeclarations(context) {
if (type !== void 0 && isTypeReferenceNode(type) && type.typeName.virtual) {
return;
}
- const shouldUseResolverType = node.kind === 168 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node));
+ const shouldUseResolverType = node.kind === 169 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node));
if (type && !shouldUseResolverType) {
return visitNode(type, visitDeclarationSubtree);
}
if (!getParseTreeNode(node)) {
return type ? visitNode(type, visitDeclarationSubtree) : factory2.createKeywordTypeNode(132 /* AnyKeyword */);
}
- if (node.kind === 178 /* SetAccessor */) {
+ if (node.kind === 180 /* SetAccessor */) {
return factory2.createKeywordTypeNode(132 /* AnyKeyword */);
}
errorNameNode = node.name;
@@ -99539,10 +99743,10 @@ function transformDeclarations(context) {
oldDiag = getSymbolAccessibilityDiagnostic;
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(node);
}
- if (node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
+ if (node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */) {
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
}
- if (node.kind === 168 /* Parameter */ || node.kind === 171 /* PropertyDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 172 /* AnnotationPropertyDeclaration */) {
+ if (node.kind === 169 /* Parameter */ || node.kind === 172 /* PropertyDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 173 /* AnnotationPropertyDeclaration */ || node.kind === 174 /* OverloadPropertyDeclaration */) {
if (isPropertySignature(node) || !node.initializer)
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType));
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
@@ -99559,23 +99763,23 @@ function transformDeclarations(context) {
function isDeclarationAndNotVisible(node) {
node = getParseTreeNode(node);
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return !resolver.isDeclarationVisible(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return !getBindingNameVisible(node);
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
return false;
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return true;
}
return false;
@@ -99640,7 +99844,7 @@ function transformDeclarations(context) {
return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree);
}
function isEnclosingDeclaration(node) {
- return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isStructDeclaration(node) || isAnnotationDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node);
+ return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isStructDeclaration(node) || isAnnotationDeclaration(node) || isOverloadDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node);
}
function checkEntityNameVisibility(entityName, enclosingDeclaration2) {
const visibilityResult = resolver.isEntityNameVisible(entityName, enclosingDeclaration2);
@@ -99656,7 +99860,7 @@ function transformDeclarations(context) {
function rewriteModuleSpecifier(parent2, input) {
if (!input)
return void 0;
- resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 270 /* ModuleDeclaration */ && parent2.kind !== 205 /* ImportType */;
+ resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 273 /* ModuleDeclaration */ && parent2.kind !== 207 /* ImportType */;
if (isStringLiteralLike(input)) {
if (isBundledEmit) {
const newName = getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent2);
@@ -99675,7 +99879,7 @@ function transformDeclarations(context) {
function transformImportEqualsDeclaration(decl) {
if (!resolver.isDeclarationVisible(decl))
return;
- if (decl.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ if (decl.moduleReference.kind === 289 /* ExternalModuleReference */) {
const specifier = getExternalModuleImportEqualsDeclarationExpression(decl);
return factory2.updateImportEqualsDeclaration(
decl,
@@ -99711,7 +99915,7 @@ function transformDeclarations(context) {
void 0
), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
}
- if (decl.importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (decl.importClause.namedBindings.kind === 280 /* NamespaceImport */) {
const namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : void 0;
return visibleDefaultBinding || namedBindings ? factory2.updateImportDeclaration(decl, decl.modifiers, factory2.updateImportClause(
decl.importClause,
@@ -99822,7 +100026,7 @@ function transformDeclarations(context) {
const oldDiag = getSymbolAccessibilityDiagnostic;
const canProduceDiagnostic = canProduceDiagnostics(input);
const oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
- let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 187 /* TypeLiteral */ || input.kind === 200 /* MappedType */) && input.parent.kind !== 268 /* TypeAliasDeclaration */;
+ let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 189 /* TypeLiteral */ || input.kind === 202 /* MappedType */) && input.parent.kind !== 271 /* TypeAliasDeclaration */;
if (isMethodDeclaration(input) || isMethodSignature(input)) {
if (hasEffectiveModifier(input, 8 /* Private */)) {
if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input)
@@ -99841,26 +100045,26 @@ function transformDeclarations(context) {
}
if (isProcessedComponent(input)) {
switch (input.kind) {
- case 234 /* ExpressionWithTypeArguments */: {
+ case 236 /* ExpressionWithTypeArguments */: {
if (isEntityName(input.expression) || isEntityNameExpression(input.expression)) {
checkEntityNameVisibility(input.expression, enclosingDeclaration);
}
const node = visitEachChild(input, visitDeclarationSubtree, context);
return cleanup(factory2.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments));
}
- case 183 /* TypeReference */: {
+ case 185 /* TypeReference */: {
checkEntityNameVisibility(input.typeName, enclosingDeclaration);
const node = visitEachChild(input, visitDeclarationSubtree, context);
return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments));
}
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return cleanup(factory2.updateConstructSignature(
input,
ensureTypeParams(input, input.typeParameters),
updateParamsList(input, input.parameters),
ensureType(input, input.type)
));
- case 176 /* Constructor */: {
+ case 178 /* Constructor */: {
const ctor = factory2.createConstructorDeclaration(
ensureModifiers(input),
updateParamsList(input, input.parameters, 0 /* None */),
@@ -99868,7 +100072,7 @@ function transformDeclarations(context) {
);
return cleanup(ctor);
}
- case 174 /* MethodDeclaration */: {
+ case 176 /* MethodDeclaration */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -99886,7 +100090,7 @@ function transformDeclarations(context) {
);
return cleanup(sig);
}
- case 177 /* GetAccessor */: {
+ case 179 /* GetAccessor */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -99900,7 +100104,7 @@ function transformDeclarations(context) {
void 0
));
}
- case 178 /* SetAccessor */: {
+ case 180 /* SetAccessor */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -99912,7 +100116,7 @@ function transformDeclarations(context) {
void 0
));
}
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -99925,14 +100129,14 @@ function transformDeclarations(context) {
ensureType(input, input.type),
ensureNoInitializer(input)
));
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return cleanup(factory2.updateAnnotationPropertyDeclaration(
input,
input.name,
ensureType(input, input.type),
input.initializer
));
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -99943,7 +100147,18 @@ function transformDeclarations(context) {
input.questionToken,
ensureType(input, input.type)
));
- case 173 /* MethodSignature */: {
+ case 174 /* OverloadPropertyDeclaration */:
+ if (isPrivateIdentifier(input.name)) {
+ return cleanup(void 0);
+ }
+ return cleanup(factory2.updateOverloadPropertyDeclaration(
+ input,
+ ensureModifiers(input),
+ input.name,
+ input.questionToken,
+ ensureType(input, input.type)
+ ));
+ case 175 /* MethodSignature */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -99957,7 +100172,7 @@ function transformDeclarations(context) {
ensureType(input, input.type)
));
}
- case 179 /* CallSignature */: {
+ case 181 /* CallSignature */: {
return cleanup(factory2.updateCallSignature(
input,
ensureTypeParams(input, input.typeParameters),
@@ -99965,7 +100180,7 @@ function transformDeclarations(context) {
ensureType(input, input.type)
));
}
- case 181 /* IndexSignature */: {
+ case 183 /* IndexSignature */: {
return cleanup(factory2.updateIndexSignature(
input,
ensureModifiers(input),
@@ -99973,7 +100188,7 @@ function transformDeclarations(context) {
visitNode(input.type, visitDeclarationSubtree) || factory2.createKeywordTypeNode(132 /* AnyKeyword */)
));
}
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
if (isBindingPattern(input.name)) {
return recreateBindingPattern(input.name);
}
@@ -99981,13 +100196,13 @@ function transformDeclarations(context) {
suppressNewDiagnosticContexts = true;
return cleanup(factory2.updateVariableDeclaration(input, input.name, void 0, ensureType(input, input.type), ensureNoInitializer(input)));
}
- case 167 /* TypeParameter */: {
+ case 168 /* TypeParameter */: {
if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) {
return cleanup(factory2.updateTypeParameterDeclaration(input, input.modifiers, input.name, void 0, void 0));
}
return cleanup(visitEachChild(input, visitDeclarationSubtree, context));
}
- case 194 /* ConditionalType */: {
+ case 196 /* ConditionalType */: {
const checkType = visitNode(input.checkType, visitDeclarationSubtree);
const extendsType = visitNode(input.extendsType, visitDeclarationSubtree);
const oldEnclosingDecl = enclosingDeclaration;
@@ -99997,13 +100212,13 @@ function transformDeclarations(context) {
const falseType = visitNode(input.falseType, visitDeclarationSubtree);
return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
}
- case 184 /* FunctionType */: {
+ case 186 /* FunctionType */: {
return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
- case 185 /* ConstructorType */: {
+ case 187 /* ConstructorType */: {
return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
- case 205 /* ImportType */: {
+ case 207 /* ImportType */: {
if (!isLiteralImportTypeNode(input))
return cleanup(input);
return cleanup(factory2.updateImportTypeNode(
@@ -100043,7 +100258,7 @@ function transformDeclarations(context) {
}
}
function isPrivateMethodTypeParameter(node) {
- return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 8 /* Private */);
+ return node.parent.kind === 176 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 8 /* Private */);
}
function visitDeclarationStatements(input) {
if (!isPreservedDeclarationStatement(input)) {
@@ -100052,7 +100267,7 @@ function transformDeclarations(context) {
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 281 /* ExportDeclaration */: {
+ case 284 /* ExportDeclaration */: {
if (isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
}
@@ -100066,7 +100281,7 @@ function transformDeclarations(context) {
getResolutionModeOverrideForClause(input.assertClause) ? input.assertClause : void 0
);
}
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
if (isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
}
@@ -100108,10 +100323,10 @@ function transformDeclarations(context) {
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 274 /* ImportEqualsDeclaration */: {
+ case 277 /* ImportEqualsDeclaration */: {
return transformImportEqualsDeclaration(input);
}
- case 275 /* ImportDeclaration */: {
+ case 278 /* ImportDeclaration */: {
return transformImportDeclaration(input);
}
}
@@ -100131,7 +100346,7 @@ function transformDeclarations(context) {
}
const previousNeedsDeclare = needsDeclare;
switch (input.kind) {
- case 268 /* TypeAliasDeclaration */: {
+ case 271 /* TypeAliasDeclaration */: {
needsDeclare = false;
const clean2 = cleanup(factory2.updateTypeAliasDeclaration(
input,
@@ -100146,7 +100361,7 @@ function transformDeclarations(context) {
needsDeclare = previousNeedsDeclare;
return clean2;
}
- case 267 /* InterfaceDeclaration */: {
+ case 270 /* InterfaceDeclaration */: {
return cleanup(factory2.updateInterfaceDeclaration(
input,
ensureModifiers(input),
@@ -100156,7 +100371,7 @@ function transformDeclarations(context) {
visitNodes2(input.members, visitDeclarationSubtree)
));
}
- case 263 /* FunctionDeclaration */: {
+ case 265 /* FunctionDeclaration */: {
const clean2 = cleanup(factory2.updateFunctionDeclaration(
input,
ensureModifiers(input),
@@ -100246,10 +100461,10 @@ function transformDeclarations(context) {
return clean2;
}
}
- case 270 /* ModuleDeclaration */: {
+ case 273 /* ModuleDeclaration */: {
needsDeclare = false;
const inner = input.body;
- if (inner && inner.kind === 271 /* ModuleBlock */) {
+ if (inner && inner.kind === 274 /* ModuleBlock */) {
const oldNeedsScopeFix = needsScopeFixMarker;
const oldHasScopeFix = resultHasScopeMarker;
resultHasScopeMarker = false;
@@ -100293,7 +100508,7 @@ function transformDeclarations(context) {
));
}
}
- case 265 /* StructDeclaration */: {
+ case 267 /* StructDeclaration */: {
errorNameNode = input.name;
errorFallbackNode = input;
const decorators = ensureEtsDecorators(input, host);
@@ -100310,7 +100525,7 @@ function transformDeclarations(context) {
members
));
}
- case 266 /* AnnotationDeclaration */: {
+ case 268 /* AnnotationDeclaration */: {
errorNameNode = input.name;
errorFallbackNode = input;
const modifiers = factory2.createNodeArray(ensureModifiers(input));
@@ -100323,7 +100538,20 @@ function transformDeclarations(context) {
members
));
}
- case 264 /* ClassDeclaration */: {
+ case 269 /* OverloadDeclaration */: {
+ errorNameNode = input.name;
+ errorFallbackNode = input;
+ const modifiers = factory2.createNodeArray(ensureModifiers(input));
+ const memberNodes = visitNodes2(input.members, visitDeclarationSubtree);
+ const members = factory2.createNodeArray(memberNodes);
+ return cleanup(factory2.updateOverloadDeclaration(
+ input,
+ modifiers,
+ input.name,
+ members
+ ));
+ }
+ case 266 /* ClassDeclaration */: {
errorNameNode = input.name;
errorFallbackNode = input;
const modifiers = factory2.createNodeArray(ensureModifiers(input));
@@ -100426,10 +100654,10 @@ function transformDeclarations(context) {
));
}
}
- case 244 /* VariableStatement */: {
+ case 246 /* VariableStatement */: {
return cleanup(transformVariableStatement(input));
}
- case 269 /* EnumDeclaration */: {
+ case 272 /* EnumDeclaration */: {
return cleanup(factory2.updateEnumDeclaration(input, factory2.createNodeArray(ensureModifiers(input)), input.name, factory2.createNodeArray(mapDefined(input.members, (m) => {
if (shouldStripInternal(m))
return;
@@ -100445,7 +100673,7 @@ function transformDeclarations(context) {
if (canProdiceDiagnostic) {
getSymbolAccessibilityDiagnostic = oldDiag;
}
- if (input.kind === 270 /* ModuleDeclaration */) {
+ if (input.kind === 273 /* ModuleDeclaration */) {
needsDeclare = previousNeedsDeclare;
}
if (node === input) {
@@ -100468,7 +100696,7 @@ function transformDeclarations(context) {
return flatten(mapDefined(d.elements, (e) => recreateBindingElement(e)));
}
function recreateBindingElement(e) {
- if (e.kind === 233 /* OmittedExpression */) {
+ if (e.kind === 235 /* OmittedExpression */) {
return;
}
if (e.name) {
@@ -100517,7 +100745,7 @@ function transformDeclarations(context) {
function ensureModifierFlags(node) {
let mask2 = 258047 /* All */ ^ (4 /* Public */ | 512 /* Async */ | 16384 /* Override */);
let additions = needsDeclare && !isAlwaysType(node) ? 2 /* Ambient */ : 0 /* None */;
- const parentIsFile = node.parent.kind === 314 /* SourceFile */;
+ const parentIsFile = node.parent.kind === 317 /* SourceFile */;
if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) {
mask2 ^= 2 /* Ambient */;
additions = 0 /* None */;
@@ -100543,7 +100771,7 @@ function transformDeclarations(context) {
}
}
function isAlwaysType(node) {
- if (node.kind === 267 /* InterfaceDeclaration */) {
+ if (node.kind === 270 /* InterfaceDeclaration */) {
return true;
}
return false;
@@ -100563,60 +100791,62 @@ function maskModifierFlags(node, modifierMask = 258047 /* All */ ^ 4 /* Public *
}
function getTypeAnnotationFromAccessor(accessor) {
if (accessor) {
- return accessor.kind === 177 /* GetAccessor */ ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : void 0;
+ return accessor.kind === 179 /* GetAccessor */ ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : void 0;
}
}
function canHaveLiteralInitializer(node) {
switch (node.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return !hasEffectiveModifier(node, 8 /* Private */);
- case 168 /* Parameter */:
- case 261 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 263 /* VariableDeclaration */:
return true;
}
return false;
}
function isPreservedDeclarationStatement(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 244 /* VariableStatement */:
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
+ case 265 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 246 /* VariableStatement */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
return true;
}
return false;
}
function isProcessedComponent(node) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 181 /* IndexSignature */:
- case 261 /* VariableDeclaration */:
- case 167 /* TypeParameter */:
- case 234 /* ExpressionWithTypeArguments */:
- case 183 /* TypeReference */:
- case 194 /* ConditionalType */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 205 /* ImportType */:
+ case 182 /* ConstructSignature */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 183 /* IndexSignature */:
+ case 263 /* VariableDeclaration */:
+ case 168 /* TypeParameter */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 185 /* TypeReference */:
+ case 196 /* ConditionalType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 207 /* ImportType */:
return true;
}
return false;
@@ -100720,7 +100950,7 @@ function noEmitNotification(hint, node, callback) {
}
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
var _a2, _b;
- const enabledSyntaxKindFeatures = new Array(364 /* Count */);
+ const enabledSyntaxKindFeatures = new Array(367 /* Count */);
let lexicalEnvironmentVariableDeclarations;
let lexicalEnvironmentFunctionDeclarations;
let lexicalEnvironmentStatements;
@@ -100799,7 +101029,7 @@ function transformNodes(resolver, host, factory2, options, nodes, transformers,
state = 1 /* Initialized */;
const transformed = [];
for (const node of nodes) {
- (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Emit, "transformNodes", node.kind === 314 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
+ (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Emit, "transformNodes", node.kind === 317 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
PerformanceDotting.start("transformRoot");
transformed.push((allowDtsFiles ? transformation : transformRoot)(node));
PerformanceDotting.stop("transformRoot");
@@ -101116,7 +101346,7 @@ function getOutputPathsForBundle(options, forceDtsPaths) {
}
function getOutputPathsFor(sourceFile, host, forceDtsPaths) {
const options = host.getCompilerOptions();
- if (sourceFile.kind === 315 /* Bundle */) {
+ if (sourceFile.kind === 318 /* Bundle */) {
return getOutputPathsForBundle(options, forceDtsPaths);
} else {
const ownOutputFilePath = getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile.fileName, options));
@@ -101489,8 +101719,8 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
}
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform2, printer3, mapOptions) {
const sourceFileOrBundle = transform2.transformed[0];
- const bundle = sourceFileOrBundle.kind === 315 /* Bundle */ ? sourceFileOrBundle : void 0;
- const sourceFile = sourceFileOrBundle.kind === 314 /* SourceFile */ ? sourceFileOrBundle : void 0;
+ const bundle = sourceFileOrBundle.kind === 318 /* Bundle */ ? sourceFileOrBundle : void 0;
+ const sourceFile = sourceFileOrBundle.kind === 317 /* SourceFile */ ? sourceFileOrBundle : void 0;
const sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];
let sourceMapGenerator;
if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) {
@@ -101544,7 +101774,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
writer.clear();
}
function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
- return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 314 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
+ return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 317 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
}
function getSourceRoot(mapOptions) {
const sourceRoot = normalizeSlashes(mapOptions.sourceRoot || "");
@@ -101895,11 +102125,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
break;
}
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return printFile(node);
- case 315 /* Bundle */:
+ case 318 /* Bundle */:
return printBundle(node);
- case 316 /* UnparsedSource */:
+ case 319 /* UnparsedSource */:
return printUnparsedSource(node);
}
writeNode(hint, node, sourceFile, beginPrint());
@@ -102213,300 +102443,304 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return emitIdentifier(node);
case 80 /* PrivateIdentifier */:
return emitPrivateIdentifier(node);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return emitQualifiedName(node);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return emitComputedPropertyName(node);
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return emitTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return emitParameter(node);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return emitDecorator(node);
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
return emitPropertySignature(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return emitPropertyDeclaration(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return emitAnnotationPropertyDeclaration(node);
- case 173 /* MethodSignature */:
+ case 174 /* OverloadPropertyDeclaration */:
+ return emitOverloadPropertyDeclaration(node);
+ case 175 /* MethodSignature */:
return emitMethodSignature(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return emitMethodDeclaration(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return emitClassStaticBlockDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return emitConstructor(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return emitAccessorDeclaration(node);
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return emitCallSignature(node);
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return emitConstructSignature(node);
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return emitIndexSignature(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return emitTypePredicate(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return emitTypeReference(node);
- case 184 /* FunctionType */:
+ case 186 /* FunctionType */:
return emitFunctionType(node);
- case 185 /* ConstructorType */:
+ case 187 /* ConstructorType */:
return emitConstructorType(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return emitTypeQuery(node);
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return emitTypeLiteral(node);
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return emitArrayType(node);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
return emitTupleType(node);
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return emitOptionalType(node);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return emitUnionType(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return emitIntersectionType(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return emitConditionalType(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return emitInferType(node);
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return emitParenthesizedType(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return emitExpressionWithTypeArguments(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return emitThisType();
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return emitTypeOperator(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return emitIndexedAccessType(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return emitMappedType(node);
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return emitLiteralType(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return emitNamedTupleMember(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return emitTemplateType(node);
- case 204 /* TemplateLiteralTypeSpan */:
+ case 206 /* TemplateLiteralTypeSpan */:
return emitTemplateTypeSpan(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return emitImportTypeNode(node);
- case 206 /* ObjectBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
return emitObjectBindingPattern(node);
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return emitArrayBindingPattern(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return emitBindingElement(node);
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return emitTemplateSpan(node);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return emitSemicolonClassElement();
- case 242 /* Block */:
+ case 244 /* Block */:
return emitBlock(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return emitVariableStatement(node);
- case 243 /* EmptyStatement */:
+ case 245 /* EmptyStatement */:
return emitEmptyStatement(false);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return emitExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return emitIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return emitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return emitWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return emitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return emitForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return emitForOfStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return emitContinueStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return emitBreakStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return emitReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return emitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return emitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return emitLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return emitThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return emitTryStatement(node);
- case 260 /* DebuggerStatement */:
+ case 262 /* DebuggerStatement */:
return emitDebuggerStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return emitVariableDeclaration(node);
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return emitVariableDeclarationList(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return emitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return emitClassOrStructDeclaration(node);
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return emitClassOrStructDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return emitAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return emitOverloadDeclaration(node);
+ case 270 /* InterfaceDeclaration */:
return emitInterfaceDeclaration(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return emitTypeAliasDeclaration(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return emitEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return emitModuleDeclaration(node);
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return emitModuleBlock(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return emitCaseBlock(node);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return emitNamespaceExportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return emitImportEqualsDeclaration(node);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return emitImportDeclaration(node);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return emitImportClause(node);
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return emitNamespaceImport(node);
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
return emitNamespaceExport(node);
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
return emitNamedImports(node);
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return emitImportSpecifier(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return emitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return emitExportDeclaration(node);
- case 282 /* NamedExports */:
+ case 285 /* NamedExports */:
return emitNamedExports(node);
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return emitExportSpecifier(node);
- case 302 /* AssertClause */:
+ case 305 /* AssertClause */:
return emitAssertClause(node);
- case 303 /* AssertEntry */:
+ case 306 /* AssertEntry */:
return emitAssertEntry(node);
- case 285 /* MissingDeclaration */:
+ case 288 /* MissingDeclaration */:
return;
- case 286 /* ExternalModuleReference */:
+ case 289 /* ExternalModuleReference */:
return emitExternalModuleReference(node);
case 11 /* JsxText */:
return emitJsxText(node);
- case 289 /* JsxOpeningElement */:
- case 292 /* JsxOpeningFragment */:
+ case 292 /* JsxOpeningElement */:
+ case 295 /* JsxOpeningFragment */:
return emitJsxOpeningElementOrFragment(node);
- case 290 /* JsxClosingElement */:
- case 293 /* JsxClosingFragment */:
+ case 293 /* JsxClosingElement */:
+ case 296 /* JsxClosingFragment */:
return emitJsxClosingElementOrFragment(node);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return emitJsxAttribute(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return emitJsxAttributes(node);
- case 296 /* JsxSpreadAttribute */:
+ case 299 /* JsxSpreadAttribute */:
return emitJsxSpreadAttribute(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return emitJsxExpression(node);
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
return emitCaseClause(node);
- case 299 /* DefaultClause */:
+ case 302 /* DefaultClause */:
return emitDefaultClause(node);
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return emitHeritageClause(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return emitCatchClause(node);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return emitPropertyAssignment(node);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return emitShorthandPropertyAssignment(node);
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return emitSpreadAssignment(node);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return emitEnumMember(node);
- case 309 /* UnparsedPrologue */:
+ case 312 /* UnparsedPrologue */:
return writeUnparsedNode(node);
- case 316 /* UnparsedSource */:
- case 310 /* UnparsedPrepend */:
+ case 319 /* UnparsedSource */:
+ case 313 /* UnparsedPrepend */:
return emitUnparsedSourceOrPrepend(node);
- case 311 /* UnparsedText */:
- case 312 /* UnparsedInternalText */:
+ case 314 /* UnparsedText */:
+ case 315 /* UnparsedInternalText */:
return emitUnparsedTextLike(node);
- case 313 /* UnparsedSyntheticReference */:
+ case 316 /* UnparsedSyntheticReference */:
return emitUnparsedSyntheticReference(node);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return emitSourceFile(node);
- case 315 /* Bundle */:
+ case 318 /* Bundle */:
return Debug.fail("Bundles should be printed using printBundle");
- case 317 /* InputFiles */:
+ case 320 /* InputFiles */:
return Debug.fail("InputFiles should not be printed");
- case 318 /* JSDocTypeExpression */:
+ case 321 /* JSDocTypeExpression */:
return emitJSDocTypeExpression(node);
- case 319 /* JSDocNameReference */:
+ case 322 /* JSDocNameReference */:
return emitJSDocNameReference(node);
- case 321 /* JSDocAllType */:
+ case 324 /* JSDocAllType */:
return writePunctuation("*");
- case 322 /* JSDocUnknownType */:
+ case 325 /* JSDocUnknownType */:
return writePunctuation("?");
- case 323 /* JSDocNullableType */:
+ case 326 /* JSDocNullableType */:
return emitJSDocNullableType(node);
- case 324 /* JSDocNonNullableType */:
+ case 327 /* JSDocNonNullableType */:
return emitJSDocNonNullableType(node);
- case 325 /* JSDocOptionalType */:
+ case 328 /* JSDocOptionalType */:
return emitJSDocOptionalType(node);
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return emitJSDocFunctionType(node);
- case 191 /* RestType */:
- case 327 /* JSDocVariadicType */:
+ case 193 /* RestType */:
+ case 330 /* JSDocVariadicType */:
return emitRestOrJSDocVariadicType(node);
- case 328 /* JSDocNamepathType */:
+ case 331 /* JSDocNamepathType */:
return;
- case 329 /* JSDoc */:
+ case 332 /* JSDoc */:
return emitJSDoc(node);
- case 331 /* JSDocTypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
return emitJSDocTypeLiteral(node);
- case 332 /* JSDocSignature */:
+ case 335 /* JSDocSignature */:
return emitJSDocSignature(node);
- case 336 /* JSDocTag */:
- case 341 /* JSDocClassTag */:
- case 346 /* JSDocOverrideTag */:
+ case 339 /* JSDocTag */:
+ case 344 /* JSDocClassTag */:
+ case 349 /* JSDocOverrideTag */:
return emitJSDocSimpleTag(node);
- case 337 /* JSDocAugmentsTag */:
- case 338 /* JSDocImplementsTag */:
+ case 340 /* JSDocAugmentsTag */:
+ case 341 /* JSDocImplementsTag */:
return emitJSDocHeritageTag(node);
- case 339 /* JSDocAuthorTag */:
- case 340 /* JSDocDeprecatedTag */:
+ case 342 /* JSDocAuthorTag */:
+ case 343 /* JSDocDeprecatedTag */:
return;
- case 342 /* JSDocPublicTag */:
- case 343 /* JSDocPrivateTag */:
- case 344 /* JSDocProtectedTag */:
- case 345 /* JSDocReadonlyTag */:
+ case 345 /* JSDocPublicTag */:
+ case 346 /* JSDocPrivateTag */:
+ case 347 /* JSDocProtectedTag */:
+ case 348 /* JSDocReadonlyTag */:
return;
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
return emitJSDocCallbackTag(node);
- case 349 /* JSDocParameterTag */:
- case 356 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
+ case 359 /* JSDocPropertyTag */:
return emitJSDocPropertyLikeTag(node);
- case 348 /* JSDocEnumTag */:
- case 350 /* JSDocReturnTag */:
- case 351 /* JSDocThisTag */:
- case 352 /* JSDocTypeTag */:
+ case 351 /* JSDocEnumTag */:
+ case 353 /* JSDocReturnTag */:
+ case 354 /* JSDocThisTag */:
+ case 355 /* JSDocTypeTag */:
return emitJSDocSimpleTypedTag(node);
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return emitJSDocTemplateTag(node);
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return emitJSDocTypedefTag(node);
- case 355 /* JSDocSeeTag */:
+ case 358 /* JSDocSeeTag */:
return emitJSDocSeeTag(node);
- case 358 /* NotEmittedStatement */:
- case 362 /* EndOfDeclarationMarker */:
- case 361 /* MergeDeclarationMarker */:
+ case 361 /* NotEmittedStatement */:
+ case 365 /* EndOfDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return;
}
if (isExpression(node)) {
@@ -102535,84 +102769,84 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return emitIdentifier(node);
case 80 /* PrivateIdentifier */:
return emitPrivateIdentifier(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return emitArrayLiteralExpression(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return emitObjectLiteralExpression(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return emitPropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return emitElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return emitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return emitNewExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return emitTaggedTemplateExpression(node);
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return emitTypeAssertionExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return emitParenthesizedExpression(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return emitFunctionExpression(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return emitArrowFunction(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return emitDeleteExpression(node);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return emitTypeOfExpression(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return emitVoidExpression(node);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return emitAwaitExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return emitPrefixUnaryExpression(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return emitPostfixUnaryExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return emitBinaryExpression(node);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return emitConditionalExpression(node);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return emitTemplateExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return emitYieldExpression(node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return emitSpreadElement(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return emitClassExpression(node);
- case 233 /* OmittedExpression */:
+ case 235 /* OmittedExpression */:
return;
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return emitAsExpression(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return emitNonNullExpression(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return emitExpressionWithTypeArguments(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return emitSatisfiesExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return emitMetaProperty(node);
- case 238 /* SyntheticExpression */:
+ case 240 /* SyntheticExpression */:
return Debug.fail("SyntheticExpression should never be printed.");
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return emitJsxElement(node);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return emitJsxSelfClosingElement(node);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return emitJsxFragment(node);
- case 357 /* SyntaxList */:
+ case 360 /* SyntaxList */:
return Debug.fail("SyntaxList should not be printed");
- case 358 /* NotEmittedStatement */:
+ case 361 /* NotEmittedStatement */:
return;
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return emitPartiallyEmittedExpression(node);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return emitCommaList(node);
- case 361 /* MergeDeclarationMarker */:
- case 362 /* EndOfDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return;
- case 363 /* SyntheticReferenceExpression */:
+ case 366 /* SyntheticReferenceExpression */:
return Debug.fail("SyntheticReferenceExpression should not be printed");
}
}
@@ -102663,7 +102897,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitHelpers(node) {
let helpersEmitted = false;
- const bundle = node.kind === 315 /* Bundle */ ? node : void 0;
+ const bundle = node.kind === 318 /* Bundle */ ? node : void 0;
if (bundle && moduleKind === 0 /* None */) {
return;
}
@@ -102734,7 +102968,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
updateOrPushBundleFileTextLike(
pos,
writer.getTextPos(),
- unparsed.kind === 311 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */
+ unparsed.kind === 314 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */
);
}
}
@@ -102765,7 +102999,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitTabStop(hint, node, snippet) {
Debug.assert(
- node.kind === 243 /* EmptyStatement */,
+ node.kind === 245 /* EmptyStatement */,
`A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`
);
Debug.assert(
@@ -102821,7 +103055,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(node.dotDotDotToken);
emitNodeWithWriter(node.name, writeParameter);
emit(node.questionToken);
- if (node.parent && node.parent.kind === 326 /* JSDocFunctionType */ && !node.name) {
+ if (node.parent && node.parent.kind === 329 /* JSDocFunctionType */ && !node.name) {
emit(node.type);
} else {
emitTypeAnnotation(node.type);
@@ -102839,6 +103073,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitTypeAnnotation(node.type);
writeTrailingSemicolon();
}
+ function emitOverloadPropertyDeclaration(node) {
+ emitModifiers(node, node.modifiers);
+ emitNodeWithWriter(node.name, writeProperty);
+ emit(node.questionToken);
+ }
function emitPropertyDeclaration(node) {
emitDecoratorsAndModifiers(node, node.modifiers);
emit(node.name);
@@ -102883,7 +103122,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitAccessorDeclaration(node) {
emitDecoratorsAndModifiers(node, node.modifiers);
- writeKeyword(node.kind === 177 /* GetAccessor */ ? "get" : "set");
+ writeKeyword(node.kind === 179 /* GetAccessor */ ? "get" : "set");
writeSpace();
emit(node.name);
emitSignatureAndBody(node, emitSignatureHead);
@@ -103312,7 +103551,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function shouldEmitWhitespaceBeforeOperand(node) {
const operand = node.operand;
- return operand.kind === 225 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */));
+ return operand.kind === 227 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */));
}
function emitPostfixUnaryExpression(node) {
emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary);
@@ -103508,7 +103747,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (node.elseStatement) {
writeLineOrSpace(node, node.thenStatement, node.elseStatement);
emitTokenWithComment(92 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node);
- if (node.elseStatement.kind === 246 /* IfStatement */) {
+ if (node.elseStatement.kind === 248 /* IfStatement */) {
writeSpace();
emit(node.elseStatement);
} else {
@@ -103569,7 +103808,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);
emitForBinding(node.initializer);
writeSpace();
- emitTokenWithComment(164 /* OfKeyword */, node.initializer.end, writeKeyword, node);
+ emitTokenWithComment(165 /* OfKeyword */, node.initializer.end, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);
@@ -103577,7 +103816,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitForBinding(node) {
if (node !== void 0) {
- if (node.kind === 262 /* VariableDeclarationList */) {
+ if (node.kind === 264 /* VariableDeclarationList */) {
emit(node);
} else {
emitExpression(node);
@@ -103613,7 +103852,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
pos = writeTokenText(token, writer2, pos);
if (isSimilarNode && contextNode.end !== pos) {
- const isJsxExprContext = contextNode.kind === 297 /* JsxExpression */;
+ const isJsxExprContext = contextNode.kind === 300 /* JsxExpression */;
emitTrailingCommentsOfPosition(pos, !isJsxExprContext, isJsxExprContext);
}
return pos;
@@ -103872,6 +104111,25 @@ function createPrinter(printerOptions = {}, handlers = {}) {
decreaseIndent();
}
}
+ function emitOverloadDeclaration(node) {
+ emitDecoratorsAndModifiers(node, node.modifiers);
+ writeKeyword("overload");
+ if (node.name) {
+ writeSpace();
+ emitIdentifierName(node.name);
+ }
+ const indentedFlag = getEmitFlags(node) & 65536 /* Indented */;
+ if (indentedFlag) {
+ increaseIndent();
+ }
+ writeSpace();
+ writePunctuation("{");
+ emitList(node, node.members, 145 /* EnumMembers */);
+ writePunctuation("}");
+ if (indentedFlag) {
+ decreaseIndent();
+ }
+ }
function emitTypeAliasDeclaration(node) {
if (isSendableFunctionOrType(node, true)) {
emitDecorators(node, node.illegalDecorators);
@@ -104269,7 +104527,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
}
if (node.tags) {
- if (node.tags.length === 1 && node.tags[0].kind === 352 /* JSDocTypeTag */ && !node.comment) {
+ if (node.tags.length === 1 && node.tags[0].kind === 355 /* JSDocTypeTag */ && !node.comment) {
writeSpace();
emit(node.tags[0]);
} else {
@@ -104313,7 +104571,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitJSDocTypedefTag(tag) {
emitJSDocTagName(tag.tagName);
if (tag.typeExpression) {
- if (tag.typeExpression.kind === 318 /* JSDocTypeExpression */) {
+ if (tag.typeExpression.kind === 321 /* JSDocTypeExpression */) {
emitJSDocTypeExpression(tag.typeExpression);
} else {
writeSpace();
@@ -104331,7 +104589,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(tag.fullName);
}
emitJSDocComment(tag.comment);
- if (tag.typeExpression && tag.typeExpression.kind === 331 /* JSDocTypeLiteral */) {
+ if (tag.typeExpression && tag.typeExpression.kind === 334 /* JSDocTypeLiteral */) {
emitJSDocTypeLiteral(tag.typeExpression);
}
}
@@ -105147,7 +105405,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile));
}
function skipSynthesizedParentheses(node) {
- while (node.kind === 217 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) {
+ while (node.kind === 219 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) {
node = node.expression;
}
return node;
@@ -105217,84 +105475,84 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (!node)
return;
switch (node.kind) {
- case 242 /* Block */:
+ case 244 /* Block */:
forEach(node.statements, generateNames);
break;
- case 257 /* LabeledStatement */:
- case 255 /* WithStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 259 /* LabeledStatement */:
+ case 257 /* WithStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
generateNames(node.statement);
break;
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
generateNames(node.thenStatement);
generateNames(node.elseStatement);
break;
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
generateNames(node.initializer);
generateNames(node.statement);
break;
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
generateNames(node.caseBlock);
break;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
forEach(node.clauses, generateNames);
break;
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
forEach(node.statements, generateNames);
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
generateNames(node.tryBlock);
generateNames(node.catchClause);
generateNames(node.finallyBlock);
break;
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
generateNames(node.variableDeclaration);
generateNames(node.block);
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
generateNames(node.declarationList);
break;
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
forEach(node.declarations, generateNames);
break;
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
generateNameIfNeeded(node.name);
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
generateNameIfNeeded(node.name);
if (getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) {
forEach(node.parameters, generateNames);
generateNames(node.body);
}
break;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
forEach(node.elements, generateNames);
break;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
generateNames(node.importClause);
break;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
generateNameIfNeeded(node.name);
generateNames(node.namedBindings);
break;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
generateNameIfNeeded(node.name);
break;
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
generateNameIfNeeded(node.name);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
forEach(node.elements, generateNames);
break;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
generateNameIfNeeded(node.propertyName || node.name);
break;
}
@@ -105303,13 +105561,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (!node)
return;
switch (node.kind) {
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
generateNameIfNeeded(node.name);
break;
}
@@ -105483,27 +105741,27 @@ function createPrinter(printerOptions = {}, handlers = {}) {
prefix,
suffix
);
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForModuleOrEnum(node);
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForImportOrExportDeclaration(node);
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 280 /* ExportAssignment */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 283 /* ExportAssignment */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForExportDefault();
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForClassExpression();
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return generateNameForMethodOrAccessor(node, privateName, prefix, suffix);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return makeTempVariableName(TempFlags.Auto, true, privateName, prefix, suffix);
default:
return makeTempVariableName(TempFlags.Auto, false, privateName, prefix, suffix);
@@ -105594,14 +105852,14 @@ function createPrinter(printerOptions = {}, handlers = {}) {
const skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;
if ((pos > 0 || end > 0) && pos !== end) {
if (!skipLeadingComments) {
- emitLeadingComments(pos, node.kind !== 358 /* NotEmittedStatement */);
+ emitLeadingComments(pos, node.kind !== 361 /* NotEmittedStatement */);
}
if (!skipLeadingComments || pos >= 0 && (emitFlags & 512 /* NoLeadingComments */) !== 0) {
containerPos = pos;
}
if (!skipTrailingComments || end >= 0 && (emitFlags & 1024 /* NoTrailingComments */) !== 0) {
containerEnd = end;
- if (node.kind === 262 /* VariableDeclarationList */) {
+ if (node.kind === 264 /* VariableDeclarationList */) {
declarationListContainerEnd = end;
}
}
@@ -105617,7 +105875,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
containerPos = savedContainerPos;
containerEnd = savedContainerEnd;
declarationListContainerEnd = savedDeclarationListContainerEnd;
- if (!skipTrailingComments && node.kind !== 358 /* NotEmittedStatement */) {
+ if (!skipTrailingComments && node.kind !== 361 /* NotEmittedStatement */) {
emitTrailingComments(end);
}
}
@@ -105869,7 +106127,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
} else {
const source = sourceMapRange.source || sourceMapSource;
- if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
+ if (node.kind !== 361 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
}
if (emitFlags & 64 /* NoNestedSourceMaps */) {
@@ -105884,7 +106142,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (emitFlags & 64 /* NoNestedSourceMaps */) {
sourceMapsDisabled = false;
}
- if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
+ if (node.kind !== 361 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
}
}
@@ -108287,89 +108545,89 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
return diagnostics;
function walk(node, parent2) {
switch (parent2.kind) {
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
if (parent2.questionToken === node) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?"));
return "skip";
}
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
- case 261 /* VariableDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 263 /* VariableDeclaration */:
if (parent2.type === node) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files));
return "skip";
}
}
switch (node.kind) {
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
if (node.isTypeOnly) {
diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type"));
return "skip";
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
if (node.isTypeOnly) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type"));
return "skip";
}
break;
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
if (node.isTypeOnly) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, isImportSpecifier(node) ? "import...type" : "export...type"));
return "skip";
}
break;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.import_can_only_be_used_in_TypeScript_files));
return "skip";
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
if (node.isExportEquals) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.export_can_only_be_used_in_TypeScript_files));
return "skip";
}
break;
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
const heritageClause = node;
if (heritageClause.token === 118 /* ImplementsKeyword */) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files));
return "skip";
}
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
const interfaceKeyword = tokenToString(119 /* InterfaceKeyword */);
Debug.assertIsDefined(interfaceKeyword);
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword));
return "skip";
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const moduleKeyword = node.flags & 16 /* Namespace */ ? tokenToString(144 /* NamespaceKeyword */) : tokenToString(143 /* ModuleKeyword */);
Debug.assertIsDefined(moduleKeyword);
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword));
return "skip";
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files));
return "skip";
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
const enumKeyword = Debug.checkDefined(tokenToString(93 /* EnumKeyword */));
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword));
return "skip";
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files));
return "skip";
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files));
return "skip";
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files));
return "skip";
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
Debug.fail();
}
}
@@ -108378,27 +108636,27 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning));
}
switch (parent2.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
if (nodes === parent2.typeParameters) {
diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files));
return "skip";
}
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (nodes === parent2.modifiers) {
- checkModifiers(parent2.modifiers, parent2.kind === 244 /* VariableStatement */);
+ checkModifiers(parent2.modifiers, parent2.kind === 246 /* VariableStatement */);
return "skip";
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (nodes === parent2.modifiers) {
for (const modifier of nodes) {
if (isModifier(modifier) && modifier.kind !== 125 /* StaticKeyword */ && modifier.kind !== 128 /* AccessorKeyword */) {
@@ -108408,18 +108666,18 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
return "skip";
}
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (nodes === parent2.modifiers && some(nodes, isModifier)) {
diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files));
return "skip";
}
break;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 234 /* ExpressionWithTypeArguments */:
- case 288 /* JsxSelfClosingElement */:
- case 289 /* JsxOpeningElement */:
- case 215 /* TaggedTemplateExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 291 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 217 /* TaggedTemplateExpression */:
if (nodes === parent2.typeArguments) {
diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files));
return "skip";
@@ -116214,39 +116472,39 @@ var SemanticMeaning = /* @__PURE__ */ ((SemanticMeaning3) => {
})(SemanticMeaning || {});
function getMeaningFromDeclaration(node) {
switch (node.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return isInJSFile(node) && getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */;
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 301 /* CatchClause */:
- case 294 /* JsxAttribute */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 304 /* CatchClause */:
+ case 297 /* JsxAttribute */:
return 1 /* Value */;
- case 167 /* TypeParameter */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 187 /* TypeLiteral */:
+ case 168 /* TypeParameter */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 189 /* TypeLiteral */:
return 2 /* Type */;
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return node.name === void 0 ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */;
- case 308 /* EnumMember */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 311 /* EnumMember */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
return 1 /* Value */ | 2 /* Type */;
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return 2 /* Type */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (isAmbientModule(node)) {
return 4 /* Namespace */ | 1 /* Value */;
} else if (getModuleInstanceState(node) === 1 /* Instantiated */) {
@@ -116254,15 +116512,15 @@ function getMeaningFromDeclaration(node) {
} else {
return 4 /* Namespace */;
}
- case 269 /* EnumDeclaration */:
- case 278 /* NamedImports */:
- case 279 /* ImportSpecifier */:
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
- case 280 /* ExportAssignment */:
- case 281 /* ExportDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 281 /* NamedImports */:
+ case 282 /* ImportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 284 /* ExportDeclaration */:
return 7 /* All */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return 4 /* Namespace */ | 1 /* Value */;
}
return 7 /* All */;
@@ -116270,7 +116528,7 @@ function getMeaningFromDeclaration(node) {
function getMeaningFromLocation(node) {
node = getAdjustedReferenceLocation(node);
const parent2 = node.parent;
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return 1 /* Value */;
} else if (isExportAssignment(parent2) || isExportSpecifier(parent2) || isExternalModuleReference(parent2) || isImportSpecifier(parent2) || isImportClause(parent2) || isImportEqualsDeclaration(parent2) && node === parent2.name) {
return 7 /* All */;
@@ -116294,11 +116552,11 @@ function getMeaningFromLocation(node) {
}
}
function getMeaningFromRightHandSideOfImportEquals(node) {
- const name = node.kind === 165 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0;
- return name && name.parent.kind === 274 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */;
+ const name = node.kind === 166 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0;
+ return name && name.parent.kind === 277 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */;
}
function isInRightSideOfInternalImportEqualsDeclaration(node) {
- while (node.parent.kind === 165 /* QualifiedName */) {
+ while (node.parent.kind === 166 /* QualifiedName */) {
node = node.parent;
}
return isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node;
@@ -116309,26 +116567,26 @@ function isNamespaceReference(node) {
function isQualifiedNameNamespaceReference(node) {
let root = node;
let isLastClause = true;
- if (root.parent.kind === 165 /* QualifiedName */) {
- while (root.parent && root.parent.kind === 165 /* QualifiedName */) {
+ if (root.parent.kind === 166 /* QualifiedName */) {
+ while (root.parent && root.parent.kind === 166 /* QualifiedName */) {
root = root.parent;
}
isLastClause = root.right === node;
}
- return root.parent.kind === 183 /* TypeReference */ && !isLastClause;
+ return root.parent.kind === 185 /* TypeReference */ && !isLastClause;
}
function isPropertyAccessNamespaceReference(node) {
let root = node;
let isLastClause = true;
- if (root.parent.kind === 211 /* PropertyAccessExpression */) {
- while (root.parent && root.parent.kind === 211 /* PropertyAccessExpression */) {
+ if (root.parent.kind === 213 /* PropertyAccessExpression */) {
+ while (root.parent && root.parent.kind === 213 /* PropertyAccessExpression */) {
root = root.parent;
}
isLastClause = root.name === node;
}
- if (!isLastClause && root.parent.kind === 234 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 300 /* HeritageClause */) {
+ if (!isLastClause && root.parent.kind === 236 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 303 /* HeritageClause */) {
const decl = root.parent.parent.parent;
- return (decl.kind === 264 /* ClassDeclaration */ || decl.kind === 265 /* StructDeclaration */) && root.parent.parent.token === 118 /* ImplementsKeyword */ || decl.kind === 267 /* InterfaceDeclaration */ && root.parent.parent.token === 95 /* ExtendsKeyword */;
+ return (decl.kind === 266 /* ClassDeclaration */ || decl.kind === 267 /* StructDeclaration */) && root.parent.parent.token === 118 /* ImplementsKeyword */ || decl.kind === 270 /* InterfaceDeclaration */ && root.parent.parent.token === 95 /* ExtendsKeyword */;
}
return false;
}
@@ -116339,15 +116597,15 @@ function isTypeReference(node) {
switch (node.kind) {
case 109 /* ThisKeyword */:
return !isExpressionNode(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return true;
}
switch (node.parent.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return true;
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return !node.parent.isTypeOf;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return isPartOfTypeNode(node.parent);
}
return false;
@@ -116394,7 +116652,7 @@ function climbPastPropertyOrElementAccess(node) {
}
function getTargetLabel(referenceNode, labelName) {
while (referenceNode) {
- if (referenceNode.kind === 257 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) {
+ if (referenceNode.kind === 259 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) {
return referenceNode.label;
}
referenceNode = referenceNode.parent;
@@ -116444,22 +116702,22 @@ function isNameOfFunctionDeclaration(node) {
}
function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) {
switch (node.parent.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 305 /* PropertyAssignment */:
- case 308 /* EnumMember */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 270 /* ModuleDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 308 /* PropertyAssignment */:
+ case 311 /* EnumMember */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 273 /* ModuleDeclaration */:
return getNameOfDeclaration(node.parent) === node;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return node.parent.argumentExpression === node;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return true;
- case 201 /* LiteralType */:
- return node.parent.parent.kind === 199 /* IndexedAccessType */;
+ case 203 /* LiteralType */:
+ return node.parent.parent.kind === 201 /* IndexedAccessType */;
default:
return false;
}
@@ -116477,86 +116735,86 @@ function getContainerNode(node) {
return void 0;
}
switch (node.kind) {
- case 314 /* SourceFile */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 317 /* SourceFile */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
return node;
}
}
}
function getNodeKind(node) {
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return "module" /* moduleElement */;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return "class" /* classElement */;
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return "struct" /* structElement */;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return "interface" /* interfaceElement */;
- case 268 /* TypeAliasDeclaration */:
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
+ case 271 /* TypeAliasDeclaration */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
return "type" /* typeElement */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return "enum" /* enumElement */;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return getKindOfVariableDeclaration(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getKindOfVariableDeclaration(getRootDeclaration(node));
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return "function" /* functionElement */;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return "getter" /* memberGetAccessorElement */;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return "setter" /* memberSetAccessorElement */;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return "method" /* memberFunctionElement */;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
const { initializer } = node;
return isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */;
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return "property" /* memberVariableElement */;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return "index" /* indexSignatureElement */;
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return "construct" /* constructSignatureElement */;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return "call" /* callSignatureElement */;
- case 176 /* Constructor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 177 /* ClassStaticBlockDeclaration */:
return "constructor" /* constructorImplementationElement */;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return "type parameter" /* typeParameterElement */;
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return "enum member" /* enumMemberElement */;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */;
- case 274 /* ImportEqualsDeclaration */:
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
- case 277 /* NamespaceImport */:
- case 283 /* NamespaceExport */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
+ case 280 /* NamespaceImport */:
+ case 286 /* NamespaceExport */:
return "alias" /* alias */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const kind = getAssignmentDeclarationKind(node);
const { right } = node;
switch (kind) {
@@ -116584,7 +116842,7 @@ function getNodeKind(node) {
}
case 79 /* Identifier */:
return isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
const scriptKind = getNodeKind(node.expression);
return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind;
default:
@@ -116599,7 +116857,7 @@ function isThis(node) {
case 109 /* ThisKeyword */:
return true;
case 79 /* Identifier */:
- return identifierIsThisKeyword(node) && node.parent.kind === 168 /* Parameter */;
+ return identifierIsThisKeyword(node) && node.parent.kind === 169 /* Parameter */;
default:
return false;
}
@@ -116648,42 +116906,42 @@ function isCompletedNode(n, sourceFile) {
return false;
}
switch (n.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 210 /* ObjectLiteralExpression */:
- case 206 /* ObjectBindingPattern */:
- case 187 /* TypeLiteral */:
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
- case 272 /* CaseBlock */:
- case 278 /* NamedImports */:
- case 282 /* NamedExports */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 212 /* ObjectLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 189 /* TypeLiteral */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
+ case 275 /* CaseBlock */:
+ case 281 /* NamedImports */:
+ case 285 /* NamedExports */:
return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return isCompletedNode(n.block, sourceFile);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
if (!n.arguments) {
return true;
}
- case 213 /* CallExpression */:
- case 217 /* ParenthesizedExpression */:
- case 196 /* ParenthesizedType */:
+ case 215 /* CallExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 198 /* ParenthesizedType */:
return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return isCompletedNode(n.type, sourceFile);
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 180 /* ConstructSignature */:
- case 179 /* CallSignature */:
- case 219 /* ArrowFunction */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 182 /* ConstructSignature */:
+ case 181 /* CallSignature */:
+ case 221 /* ArrowFunction */:
if (n.body) {
return isCompletedNode(n.body, sourceFile);
}
@@ -116691,60 +116949,60 @@ function isCompletedNode(n, sourceFile) {
return isCompletedNode(n.type, sourceFile);
}
return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return !!n.body && isCompletedNode(n.body, sourceFile);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
if (n.elseStatement) {
return isCompletedNode(n.elseStatement, sourceFile);
}
return isCompletedNode(n.thenStatement, sourceFile);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile);
- case 209 /* ArrayLiteralExpression */:
- case 207 /* ArrayBindingPattern */:
- case 212 /* ElementAccessExpression */:
- case 166 /* ComputedPropertyName */:
- case 189 /* TupleType */:
+ case 211 /* ArrayLiteralExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 214 /* ElementAccessExpression */:
+ case 167 /* ComputedPropertyName */:
+ case 191 /* TupleType */:
return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile);
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
if (n.type) {
return isCompletedNode(n.type, sourceFile);
}
return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return false;
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 248 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 250 /* WhileStatement */:
return isCompletedNode(n.statement, sourceFile);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return hasChildOfKind(n, 116 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return isCompletedNode(n.exprName, sourceFile);
- case 222 /* TypeOfExpression */:
- case 221 /* DeleteExpression */:
- case 223 /* VoidExpression */:
- case 230 /* YieldExpression */:
- case 231 /* SpreadElement */:
+ case 224 /* TypeOfExpression */:
+ case 223 /* DeleteExpression */:
+ case 225 /* VoidExpression */:
+ case 232 /* YieldExpression */:
+ case 233 /* SpreadElement */:
const unaryWordExpression = n;
return isCompletedNode(unaryWordExpression.expression, sourceFile);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return isCompletedNode(n.template, sourceFile);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
const lastSpan = lastOrUndefined(n.templateSpans);
return isCompletedNode(lastSpan, sourceFile);
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return nodeIsPresent(n.literal);
- case 281 /* ExportDeclaration */:
- case 275 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
return nodeIsPresent(n.moduleSpecifier);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return isCompletedNode(n.operand, sourceFile);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isCompletedNode(n.right, sourceFile);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isCompletedNode(n.whenFalse, sourceFile);
default:
return true;
@@ -116846,14 +117104,14 @@ function getContextualTypeFromParentOrAncestorTypeNode(node, checker) {
function getAdjustedLocationForDeclaration(node, forRename) {
if (!forRename) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return getAdjustedLocationForClass(node);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return getAdjustedLocationForFunction(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return node;
}
}
@@ -117003,7 +117261,7 @@ function getAdjustedLocation(node, forRename) {
if (node.kind === 129 /* AsKeyword */ && isAsExpression(parent2) && isTypeReferenceNode(parent2.type)) {
return parent2.type.typeName;
}
- if (node.kind === 102 /* InKeyword */ && isForInStatement(parent2) || node.kind === 164 /* OfKeyword */ && isForOfStatement(parent2)) {
+ if (node.kind === 102 /* InKeyword */ && isForInStatement(parent2) || node.kind === 165 /* OfKeyword */ && isForOfStatement(parent2)) {
return skipOuterExpressions(parent2.expression);
}
}
@@ -117142,7 +117400,7 @@ function findPrecedingToken(position, sourceFile, startNode2, excludeJsdoc) {
}
}
}
- Debug.assert(startNode2 !== void 0 || n.kind === 314 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n));
+ Debug.assert(startNode2 !== void 0 || n.kind === 317 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n));
const candidate = findRightmostChildNodeWithTokens(children, children.length, sourceFile, n.kind);
return candidate && findRightmostToken(candidate, sourceFile);
}
@@ -117165,7 +117423,7 @@ function findRightmostChildNodeWithTokens(children, exclusiveStartPosition, sour
for (let i = exclusiveStartPosition - 1; i >= 0; i--) {
const child = children[i];
if (isWhiteSpaceOnlyJsxText(child)) {
- if (i === 0 && (parentKind === 11 /* JsxText */ || parentKind === 288 /* JsxSelfClosingElement */)) {
+ if (i === 0 && (parentKind === 11 /* JsxText */ || parentKind === 291 /* JsxSelfClosingElement */)) {
Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");
}
} else if (nodeHasTokens(children[i], sourceFile)) {
@@ -117197,13 +117455,13 @@ function isInsideJsxElementOrAttribute(sourceFile, position) {
if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 11 /* JsxText */) {
return true;
}
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 297 /* JsxExpression */) {
+ if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 300 /* JsxExpression */) {
return true;
}
- if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 297 /* JsxExpression */) {
+ if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 300 /* JsxExpression */) {
return true;
}
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 290 /* JsxClosingElement */) {
+ if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 293 /* JsxClosingElement */) {
return true;
}
return false;
@@ -117231,9 +117489,9 @@ function isInJSXText(sourceFile, position) {
function isInsideJsxElement(sourceFile, position) {
function isInsideJsxElementTraversal(node) {
while (node) {
- if (node.kind >= 288 /* JsxSelfClosingElement */ && node.kind <= 297 /* JsxExpression */ || node.kind === 11 /* JsxText */ || node.kind === 29 /* LessThanToken */ || node.kind === 31 /* GreaterThanToken */ || node.kind === 79 /* Identifier */ || node.kind === 19 /* CloseBraceToken */ || node.kind === 18 /* OpenBraceToken */ || node.kind === 43 /* SlashToken */) {
+ if (node.kind >= 291 /* JsxSelfClosingElement */ && node.kind <= 300 /* JsxExpression */ || node.kind === 11 /* JsxText */ || node.kind === 29 /* LessThanToken */ || node.kind === 31 /* GreaterThanToken */ || node.kind === 79 /* Identifier */ || node.kind === 19 /* CloseBraceToken */ || node.kind === 18 /* OpenBraceToken */ || node.kind === 43 /* SlashToken */) {
node = node.parent;
- } else if (node.kind === 287 /* JsxElement */) {
+ } else if (node.kind === 290 /* JsxElement */) {
if (position > node.getStart(sourceFile))
return true;
node = node.parent;
@@ -117394,15 +117652,15 @@ function getNodeModifiers(node, excludeFlags = 0 /* None */) {
result.push("deprecated" /* deprecatedModifier */);
if (node.flags & 16777216 /* Ambient */)
result.push("declare" /* ambientModifier */);
- if (node.kind === 280 /* ExportAssignment */)
+ if (node.kind === 283 /* ExportAssignment */)
result.push("export" /* exportedModifier */);
return result.length > 0 ? result.join(",") : "" /* none */;
}
function getTypeArgumentOrTypeParameterList(node) {
- if (node.kind === 183 /* TypeReference */ || node.kind === 213 /* CallExpression */) {
+ if (node.kind === 185 /* TypeReference */ || node.kind === 215 /* CallExpression */) {
return node.typeArguments;
}
- if (isFunctionLike(node) || node.kind === 264 /* ClassDeclaration */ || node.kind === 267 /* InterfaceDeclaration */) {
+ if (isFunctionLike(node) || node.kind === 266 /* ClassDeclaration */ || node.kind === 270 /* InterfaceDeclaration */) {
return node.typeParameters;
}
return void 0;
@@ -117437,14 +117695,14 @@ function cloneCompilerOptions(options) {
return result;
}
function isArrayLiteralOrObjectLiteralDestructuringPattern(node) {
- if (node.kind === 209 /* ArrayLiteralExpression */ || node.kind === 210 /* ObjectLiteralExpression */) {
- if (node.parent.kind === 227 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */) {
+ if (node.kind === 211 /* ArrayLiteralExpression */ || node.kind === 212 /* ObjectLiteralExpression */) {
+ if (node.parent.kind === 229 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */) {
return true;
}
- if (node.parent.kind === 251 /* ForOfStatement */ && node.parent.initializer === node) {
+ if (node.parent.kind === 253 /* ForOfStatement */ && node.parent.initializer === node) {
return true;
}
- if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 305 /* PropertyAssignment */ ? node.parent.parent : node.parent)) {
+ if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 308 /* PropertyAssignment */ ? node.parent.parent : node.parent)) {
return true;
}
}
@@ -117548,7 +117806,7 @@ function skipConstraint(type) {
return type.isTypeParameter() ? type.getConstraint() || type : type;
}
function getNameFromPropertyName(name) {
- return name.kind === 166 /* ComputedPropertyName */ ? isStringOrNumericLiteralLike(name.expression) ? name.expression.text : void 0 : isPrivateIdentifier(name) ? idText(name) : getTextOfIdentifierOrLiteral(name);
+ return name.kind === 167 /* ComputedPropertyName */ ? isStringOrNumericLiteralLike(name.expression) ? name.expression.text : void 0 : isPrivateIdentifier(name) ? idText(name) : getTextOfIdentifierOrLiteral(name);
}
function programContainsModules(program) {
return program.getSourceFiles().some((s) => !s.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s) && !!(s.externalModuleIndicator || s.commonJsModuleIndicator));
@@ -117672,7 +117930,7 @@ function findModifier(node, kind) {
}
function insertImports(changes, sourceFile, imports, blankLineBetween) {
const decl = isArray(imports) ? imports[0] : imports;
- const importKindPredicate = decl.kind === 244 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax;
+ const importKindPredicate = decl.kind === 246 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax;
const existingImportStatements = filter(sourceFile.statements, importKindPredicate);
const sortedNewImports = isArray(imports) ? stableSort(imports, ts_OrganizeImports_exports.compareImportsOrRequireStatements) : [imports];
if (!existingImportStatements.length) {
@@ -118213,13 +118471,13 @@ function needsParentheses(expression) {
function getContextualTypeFromParent(node, checker) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return checker.getContextualType(parent2);
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const { left, operatorToken, right } = parent2;
return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node);
}
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
return parent2.expression === node ? getSwitchedType(parent2, checker) : void 0;
default:
return checker.getContextualType(node);
@@ -118245,8 +118503,8 @@ function isStringLiteralOrTemplate(node) {
switch (node.kind) {
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
- case 215 /* TaggedTemplateExpression */:
+ case 231 /* TemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return true;
default:
return false;
@@ -118276,16 +118534,16 @@ function getTypeNodeIfAccessible(type, enclosingScope, program, host) {
return typeIsAccessible ? res : void 0;
}
function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) {
- return kind === 179 /* CallSignature */ || kind === 180 /* ConstructSignature */ || kind === 181 /* IndexSignature */ || kind === 170 /* PropertySignature */ || kind === 173 /* MethodSignature */;
+ return kind === 181 /* CallSignature */ || kind === 182 /* ConstructSignature */ || kind === 183 /* IndexSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */;
}
function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) {
- return kind === 263 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 265 /* FunctionDeclaration */ || kind === 178 /* Constructor */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) {
- return kind === 270 /* ModuleDeclaration */;
+ return kind === 273 /* ModuleDeclaration */;
}
function syntaxRequiresTrailingSemicolonOrASI(kind) {
- return kind === 244 /* VariableStatement */ || kind === 245 /* ExpressionStatement */ || kind === 247 /* DoStatement */ || kind === 252 /* ContinueStatement */ || kind === 253 /* BreakStatement */ || kind === 254 /* ReturnStatement */ || kind === 258 /* ThrowStatement */ || kind === 260 /* DebuggerStatement */ || kind === 171 /* PropertyDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 280 /* ExportAssignment */;
+ return kind === 246 /* VariableStatement */ || kind === 247 /* ExpressionStatement */ || kind === 249 /* DoStatement */ || kind === 254 /* ContinueStatement */ || kind === 255 /* BreakStatement */ || kind === 256 /* ReturnStatement */ || kind === 260 /* ThrowStatement */ || kind === 262 /* DebuggerStatement */ || kind === 172 /* PropertyDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 283 /* ExportAssignment */;
}
var syntaxMayBeASICandidate = or(
syntaxRequiresTrailingCommaOrSemicolonOrASI,
@@ -118315,7 +118573,7 @@ function nodeIsASICandidate(node, sourceFile) {
} else if (!syntaxRequiresTrailingSemicolonOrASI(node.kind)) {
return false;
}
- if (node.kind === 247 /* DoStatement */) {
+ if (node.kind === 249 /* DoStatement */) {
return true;
}
const topNode = findAncestor(node, (ancestor) => !ancestor.parent);
@@ -119477,13 +119735,13 @@ function getSemanticClassifications(typeChecker3, cancellationToken, sourceFile,
}
function checkForClassificationCancellation(cancellationToken, kind) {
switch (kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
}
@@ -119687,46 +119945,46 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
pos = tag.tagName.end;
let commentStart = tag.tagName.end;
switch (tag.kind) {
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
const param = tag;
processJSDocParameterTag(param);
commentStart = param.isNameFirst && ((_a2 = param.typeExpression) == null ? void 0 : _a2.end) || param.name.end;
break;
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
const prop = tag;
commentStart = prop.isNameFirst && ((_b = prop.typeExpression) == null ? void 0 : _b.end) || prop.name.end;
break;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
processJSDocTemplateTag(tag);
pos = tag.end;
commentStart = tag.typeParameters.end;
break;
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
const type = tag;
- commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 318 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart;
+ commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 321 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart;
break;
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
commentStart = tag.typeExpression.end;
break;
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
processElement(tag.typeExpression);
pos = tag.end;
commentStart = tag.typeExpression.end;
break;
- case 351 /* JSDocThisTag */:
- case 348 /* JSDocEnumTag */:
+ case 354 /* JSDocThisTag */:
+ case 351 /* JSDocEnumTag */:
commentStart = tag.typeExpression.end;
break;
- case 350 /* JSDocReturnTag */:
+ case 353 /* JSDocReturnTag */:
processElement(tag.typeExpression);
pos = tag.end;
commentStart = ((_f = tag.typeExpression) == null ? void 0 : _f.end) || commentStart;
break;
- case 355 /* JSDocSeeTag */:
+ case 358 /* JSDocSeeTag */:
commentStart = ((_g = tag.name) == null ? void 0 : _g.end) || commentStart;
break;
- case 337 /* JSDocAugmentsTag */:
- case 338 /* JSDocImplementsTag */:
+ case 340 /* JSDocAugmentsTag */:
+ case 341 /* JSDocImplementsTag */:
commentStart = tag.class.end;
break;
}
@@ -119869,22 +120127,22 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
}
function tryClassifyJsxElementName(token) {
switch (token.parent && token.parent.kind) {
- case 289 /* JsxOpeningElement */:
+ case 292 /* JsxOpeningElement */:
if (token.parent.tagName === token) {
return 19 /* jsxOpenTagName */;
}
break;
- case 290 /* JsxClosingElement */:
+ case 293 /* JsxClosingElement */:
if (token.parent.tagName === token) {
return 20 /* jsxCloseTagName */;
}
break;
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
if (token.parent.tagName === token) {
return 21 /* jsxSelfClosingTagName */;
}
break;
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
if (token.parent.name === token) {
return 22 /* jsxAttribute */;
}
@@ -119905,11 +120163,11 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
if (token) {
const parent2 = token.parent;
if (tokenKind === 63 /* EqualsToken */) {
- if (parent2.kind === 261 /* VariableDeclaration */ || parent2.kind === 171 /* PropertyDeclaration */ || parent2.kind === 168 /* Parameter */ || parent2.kind === 294 /* JsxAttribute */) {
+ if (parent2.kind === 263 /* VariableDeclaration */ || parent2.kind === 172 /* PropertyDeclaration */ || parent2.kind === 169 /* Parameter */ || parent2.kind === 297 /* JsxAttribute */) {
return 5 /* operator */;
}
}
- if (parent2.kind === 227 /* BinaryExpression */ || parent2.kind === 225 /* PrefixUnaryExpression */ || parent2.kind === 226 /* PostfixUnaryExpression */ || parent2.kind === 228 /* ConditionalExpression */) {
+ if (parent2.kind === 229 /* BinaryExpression */ || parent2.kind === 227 /* PrefixUnaryExpression */ || parent2.kind === 228 /* PostfixUnaryExpression */ || parent2.kind === 230 /* ConditionalExpression */) {
return 5 /* operator */;
}
}
@@ -119919,7 +120177,7 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
} else if (tokenKind === 9 /* BigIntLiteral */) {
return 25 /* bigintLiteral */;
} else if (tokenKind === 10 /* StringLiteral */) {
- return token && token.parent.kind === 294 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */;
+ return token && token.parent.kind === 297 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */;
} else if (tokenKind === 13 /* RegularExpressionLiteral */) {
return 6 /* stringLiteral */;
} else if (isTemplateLiteralKind(tokenKind)) {
@@ -119929,32 +120187,32 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
} else if (tokenKind === 79 /* Identifier */) {
if (token) {
switch (token.parent.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
if (token.parent.name === token) {
return 11 /* className */;
}
return;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
if (token.parent.name === token) {
return 15 /* typeParameterName */;
}
return;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
if (token.parent.name === token) {
return 13 /* interfaceName */;
}
return;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (token.parent.name === token) {
return 12 /* enumName */;
}
return;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (token.parent.name === token) {
return 14 /* moduleName */;
}
return;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (token.parent.name === token) {
return isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */;
}
@@ -120097,7 +120355,7 @@ var DocumentHighlights;
let child = throwStatement;
while (child.parent) {
const parent2 = child.parent;
- if (isFunctionBlock(parent2) || parent2.kind === 314 /* SourceFile */) {
+ if (isFunctionBlock(parent2) || parent2.kind === 317 /* SourceFile */) {
return parent2;
}
if (isTryStatement(parent2) && parent2.tryBlock === child && parent2.catchClause) {
@@ -120127,15 +120385,15 @@ var DocumentHighlights;
function getBreakOrContinueOwner(statement) {
return findAncestor(statement, (node) => {
switch (node.kind) {
- case 256 /* SwitchStatement */:
- if (statement.kind === 252 /* ContinueStatement */) {
+ case 258 /* SwitchStatement */:
+ if (statement.kind === 254 /* ContinueStatement */) {
return false;
}
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 248 /* WhileStatement */:
- case 247 /* DoStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 250 /* WhileStatement */:
+ case 249 /* DoStatement */:
return !statement.label || isLabeledBy(node, statement.label.escapedText);
default:
return isFunctionLike(node) && "quit";
@@ -120148,25 +120406,25 @@ var DocumentHighlights;
function getNodesToSearchForModifier(declaration, modifierFlag) {
const container = declaration.parent;
switch (container.kind) {
- case 271 /* ModuleBlock */:
- case 314 /* SourceFile */:
- case 242 /* Block */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 274 /* ModuleBlock */:
+ case 317 /* SourceFile */:
+ case 244 /* Block */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
if (modifierFlag & 256 /* Abstract */ && isClassDeclaration(declaration)) {
return [...declaration.members, declaration];
} else {
return container.statements;
}
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
return [...container.parameters, ...isClassLike(container.parent) ? container.parent.members : []];
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 187 /* TypeLiteral */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 189 /* TypeLiteral */:
const nodes = container.members;
if (modifierFlag & (28 /* AccessibilityModifier */ | 64 /* Readonly */)) {
const constructor = find(container.members, isConstructorDeclaration);
@@ -120177,7 +120435,7 @@ var DocumentHighlights;
return [...nodes, container];
}
return nodes;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return void 0;
default:
Debug.assertNever(container, "Invalid container kind.");
@@ -120193,7 +120451,7 @@ var DocumentHighlights;
function getLoopBreakContinueOccurrences(loopNode) {
const keywords = [];
if (pushKeywordIf(keywords, loopNode.getFirstToken(), 98 /* ForKeyword */, 116 /* WhileKeyword */, 91 /* DoKeyword */)) {
- if (loopNode.kind === 247 /* DoStatement */) {
+ if (loopNode.kind === 249 /* DoStatement */) {
const loopTokens = loopNode.getChildren();
for (let i = loopTokens.length - 1; i >= 0; i--) {
if (pushKeywordIf(keywords, loopTokens[i], 116 /* WhileKeyword */)) {
@@ -120213,13 +120471,13 @@ var DocumentHighlights;
const owner = getBreakOrContinueOwner(breakOrContinueStatement);
if (owner) {
switch (owner.kind) {
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return getLoopBreakContinueOccurrences(owner);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return getSwitchCaseDefaultOccurrences(owner);
}
}
@@ -121595,9 +121853,9 @@ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {
function containsTopLevelCommonjs(sourceFile) {
return sourceFile.statements.some((statement) => {
switch (statement.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return statement.declarationList.declarations.some((decl) => !!decl.initializer && isRequireCall(propertyAccessLeftHandSide(decl.initializer), true));
- case 245 /* ExpressionStatement */: {
+ case 247 /* ExpressionStatement */: {
const { expression } = statement;
if (!isBinaryExpression(expression))
return isRequireCall(expression, true);
@@ -121614,10 +121872,10 @@ function propertyAccessLeftHandSide(node) {
}
function importNameForConvertToDefaultImport(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
const { importClause, moduleSpecifier } = node;
- return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 277 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0;
- case 274 /* ImportEqualsDeclaration */:
+ return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 280 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0;
+ case 277 /* ImportEqualsDeclaration */:
return node.name;
default:
return void 0;
@@ -121681,18 +121939,18 @@ function hasSupportedNumberOfArguments(node) {
}
function isFixablePromiseArgument(arg, checker) {
switch (arg.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
const functionFlags = getFunctionFlags(arg);
if (functionFlags & 1 /* Generator */) {
return false;
}
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true);
case 105 /* NullKeyword */:
return true;
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const symbol = checker.getSymbolAtLocation(arg);
if (!symbol) {
return false;
@@ -121708,24 +121966,24 @@ function getKeyFromNode(exp) {
}
function canBeConvertedToClass(node, checker) {
var _a2, _b, _c, _d;
- if (node.kind === 218 /* FunctionExpression */) {
+ if (node.kind === 220 /* FunctionExpression */) {
if (isVariableDeclaration(node.parent) && ((_a2 = node.symbol.members) == null ? void 0 : _a2.size)) {
return true;
}
const symbol = checker.getSymbolOfExpando(node, false);
return !!(symbol && (((_b = symbol.exports) == null ? void 0 : _b.size) || ((_c = symbol.members) == null ? void 0 : _c.size)));
}
- if (node.kind === 263 /* FunctionDeclaration */) {
+ if (node.kind === 265 /* FunctionDeclaration */) {
return !!((_d = node.symbol.members) == null ? void 0 : _d.size);
}
return false;
}
function canBeConvertedToAsync(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
default:
return false;
@@ -121870,9 +122128,9 @@ function getItemsFromNamedDeclaration(patternMatcher, name, declarations, checke
}
function shouldKeepItem(declaration, checker) {
switch (declaration.kind) {
- case 276 /* ImportClause */:
- case 279 /* ImportSpecifier */:
- case 274 /* ImportEqualsDeclaration */:
+ case 279 /* ImportClause */:
+ case 282 /* ImportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
const importer = checker.getSymbolAtLocation(declaration.name);
const imported = checker.getAliasedSymbol(importer);
return importer.escapedName !== imported.escapedName;
@@ -121882,7 +122140,7 @@ function shouldKeepItem(declaration, checker) {
}
function tryAddSingleDeclarationName(declaration, containers) {
const name = getNameOfDeclaration(declaration);
- return !!name && (pushLiteral(name, containers) || name.kind === 166 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers));
+ return !!name && (pushLiteral(name, containers) || name.kind === 167 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers));
}
function tryAddComputedPropertyName(expression, containers) {
return pushLiteral(expression, containers) || isPropertyAccessExpression(expression) && (containers.push(expression.name.text), true) && tryAddComputedPropertyName(expression.expression, containers);
@@ -121893,7 +122151,7 @@ function pushLiteral(node, containers) {
function getContainers(declaration) {
const containers = [];
const name = getNameOfDeclaration(declaration);
- if (name && name.kind === 166 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) {
+ if (name && name.kind === 167 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) {
return emptyArray;
}
containers.shift();
@@ -122063,7 +122321,7 @@ function addNodeWithRecursiveInitializer(node) {
}
}
function hasNavigationBarName(node) {
- return !hasDynamicName(node) || node.kind !== 227 /* BinaryExpression */ && isPropertyAccessExpression(node.name.expression) && isIdentifier(node.name.expression.expression) && idText(node.name.expression.expression) === "Symbol";
+ return !hasDynamicName(node) || node.kind !== 229 /* BinaryExpression */ && isPropertyAccessExpression(node.name.expression) && isIdentifier(node.name.expression.expression) && idText(node.name.expression.expression) === "Symbol";
}
function addChildrenRecursively(node) {
curCancellationToken.throwIfCancellationRequested();
@@ -122071,7 +122329,7 @@ function addChildrenRecursively(node) {
return;
}
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
const ctr = node;
addNodeWithRecursiveChild(ctr, ctr.body);
for (const param of ctr.parameters) {
@@ -122080,32 +122338,32 @@ function addChildrenRecursively(node) {
}
}
break;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 175 /* MethodSignature */:
if (hasNavigationBarName(node)) {
addNodeWithRecursiveChild(node, node.body);
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (hasNavigationBarName(node)) {
addNodeWithRecursiveInitializer(node);
}
break;
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
if (hasNavigationBarName(node)) {
addLeafNode(node);
}
break;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
const importClause = node;
if (importClause.name) {
addLeafNode(importClause.name);
}
const { namedBindings } = importClause;
if (namedBindings) {
- if (namedBindings.kind === 277 /* NamespaceImport */) {
+ if (namedBindings.kind === 280 /* NamespaceImport */) {
addLeafNode(namedBindings);
} else {
for (const element of namedBindings.elements) {
@@ -122114,16 +122372,16 @@ function addChildrenRecursively(node) {
}
}
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
addNodeWithRecursiveChild(node, node.name);
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
const { expression } = node;
isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node);
break;
- case 208 /* BindingElement */:
- case 305 /* PropertyAssignment */:
- case 261 /* VariableDeclaration */: {
+ case 210 /* BindingElement */:
+ case 308 /* PropertyAssignment */:
+ case 263 /* VariableDeclaration */: {
const child = node;
if (isBindingPattern(child.name)) {
addChildrenRecursively(child.name);
@@ -122132,18 +122390,18 @@ function addChildrenRecursively(node) {
}
break;
}
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
const nameNode = node.name;
if (nameNode && isIdentifier(nameNode)) {
addTrackedEs5Class(nameNode.text);
}
addNodeWithRecursiveChild(node, node.body);
break;
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
addNodeWithRecursiveChild(node, node.body);
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
startNode(node);
for (const member of node.members) {
if (!isComputedProperty(member)) {
@@ -122152,20 +122410,20 @@ function addChildrenRecursively(node) {
}
endNode();
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
startNode(node);
for (const member of node.members) {
addChildrenRecursively(member);
}
endNode();
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
addNodeWithRecursiveChild(node, getInteriorModule(node).body);
break;
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
const expression2 = node.expression;
const child = isObjectLiteralExpression(expression2) || isCallExpression(expression2) ? expression2 : isArrowFunction(expression2) || isFunctionExpression(expression2) ? expression2.body : void 0;
if (child) {
@@ -122177,16 +122435,16 @@ function addChildrenRecursively(node) {
}
break;
}
- case 284 /* ExportSpecifier */:
- case 274 /* ImportEqualsDeclaration */:
- case 181 /* IndexSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 268 /* TypeAliasDeclaration */:
+ case 287 /* ExportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 183 /* IndexSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 271 /* TypeAliasDeclaration */:
addLeafNode(node);
break;
- case 213 /* CallExpression */:
- case 227 /* BinaryExpression */: {
+ case 215 /* CallExpression */:
+ case 229 /* BinaryExpression */: {
const special = getAssignmentDeclarationKind(node);
switch (special) {
case 1 /* ExportsProperty */:
@@ -122396,12 +122654,12 @@ function shouldReallyMerge(a, b, parent2) {
return false;
}
switch (a.kind) {
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return isStatic(a) === isStatic(b);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return areSameModule(a, b) && getFullyQualifiedModuleName(a) === getFullyQualifiedModuleName(b);
default:
return true;
@@ -122418,7 +122676,7 @@ function areSameModule(a, b) {
if (!a.body || !b.body) {
return a.body === b.body;
}
- return a.body.kind === b.body.kind && (a.body.kind !== 270 /* ModuleDeclaration */ || areSameModule(a.body, b.body));
+ return a.body.kind === b.body.kind && (a.body.kind !== 273 /* ModuleDeclaration */ || areSameModule(a.body, b.body));
}
function merge(target, source) {
target.additionalNodes = target.additionalNodes || [];
@@ -122439,7 +122697,7 @@ function compareChildren(child1, child2) {
return compareStringsCaseSensitiveUI(tryGetName(child1.node), tryGetName(child2.node)) || compareValues(navigationBarNodeKind(child1), navigationBarNodeKind(child2));
}
function tryGetName(node) {
- if (node.kind === 270 /* ModuleDeclaration */) {
+ if (node.kind === 273 /* ModuleDeclaration */) {
return getModuleName(node);
}
const declName = getNameOfDeclaration(node);
@@ -122448,16 +122706,16 @@ function tryGetName(node) {
return propertyName && unescapeLeadingUnderscores(propertyName);
}
switch (node.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 232 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
return getFunctionOrClassName(node);
default:
return void 0;
}
}
function getItemName(node, name) {
- if (node.kind === 270 /* ModuleDeclaration */) {
+ if (node.kind === 273 /* ModuleDeclaration */) {
return cleanText(getModuleName(node));
}
if (name) {
@@ -122467,28 +122725,28 @@ function getItemName(node, name) {
}
}
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
const sourceFile = node;
return isExternalModule(sourceFile) ? `"${escapeString(getBaseFileName(removeFileExtension(normalizePath(sourceFile.fileName))))}"` : "";
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
if (getSyntacticModifierFlags(node) & 1024 /* Default */) {
return "default";
}
return getFunctionOrClassName(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return "constructor";
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return "new()";
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return "()";
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return "[]";
default:
return "";
@@ -122513,20 +122771,20 @@ function primaryNavBarMenuItems(root) {
return true;
}
switch (navigationBarNodeKind(item)) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 269 /* EnumDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 314 /* SourceFile */:
- case 268 /* TypeAliasDeclaration */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 317 /* SourceFile */:
+ case 271 /* TypeAliasDeclaration */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
return true;
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return isTopLevelFunctionDeclaration(item);
default:
return false;
@@ -122536,10 +122794,10 @@ function primaryNavBarMenuItems(root) {
return false;
}
switch (navigationBarNodeKind(item2.parent)) {
- case 271 /* ModuleBlock */:
- case 314 /* SourceFile */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
+ case 274 /* ModuleBlock */:
+ case 317 /* SourceFile */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
return true;
default:
return false;
@@ -122598,7 +122856,7 @@ function getModuleName(moduleDeclaration) {
}
function getFullyQualifiedModuleName(moduleDeclaration) {
const result = [getTextOfIdentifierOrLiteral(moduleDeclaration.name)];
- while (moduleDeclaration.body && moduleDeclaration.body.kind === 270 /* ModuleDeclaration */) {
+ while (moduleDeclaration.body && moduleDeclaration.body.kind === 273 /* ModuleDeclaration */) {
moduleDeclaration = moduleDeclaration.body;
result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name));
}
@@ -122608,13 +122866,13 @@ function getInteriorModule(decl) {
return decl.body && isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl;
}
function isComputedProperty(member) {
- return !member.name || member.name.kind === 166 /* ComputedPropertyName */;
+ return !member.name || member.name.kind === 167 /* ComputedPropertyName */;
}
function getNodeSpan(node) {
- return node.kind === 314 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile);
+ return node.kind === 317 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile);
}
function getModifiers2(node) {
- if (node.parent && node.parent.kind === 261 /* VariableDeclaration */) {
+ if (node.parent && node.parent.kind === 263 /* VariableDeclaration */) {
node = node.parent;
}
return getNodeModifiers(node);
@@ -122659,9 +122917,9 @@ function getCalledExpressionName(expr) {
}
function isFunctionOrClassExpression(node) {
switch (node.kind) {
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
return true;
default:
return false;
@@ -122747,8 +123005,8 @@ var NodeObject = class {
if (!children.length) {
return void 0;
}
- const child = find(children, (kid) => kid.kind < 318 /* FirstJSDocNode */ || kid.kind > 356 /* LastJSDocNode */);
- return child.kind < 165 /* FirstNode */ ? child : child.getFirstToken(sourceFile);
+ const child = find(children, (kid) => kid.kind < 321 /* FirstJSDocNode */ || kid.kind > 359 /* LastJSDocNode */);
+ return child.kind < 166 /* FirstNode */ ? child : child.getFirstToken(sourceFile);
}
getLastToken(sourceFile) {
this.assertHasRealPosition();
@@ -122757,7 +123015,7 @@ var NodeObject = class {
if (!child) {
return void 0;
}
- return child.kind < 165 /* FirstNode */ ? child : child.getLastToken(sourceFile);
+ return child.kind < 166 /* FirstNode */ ? child : child.getLastToken(sourceFile);
}
forEachChild(cbNode, cbNodeArray) {
return forEachChild(this, cbNode, cbNodeArray);
@@ -122820,7 +123078,7 @@ function addSyntheticNodes(nodes, pos, end, parent2) {
}
}
function createSyntaxList(nodes, parent2) {
- const list = createNode(357 /* SyntaxList */, nodes.pos, nodes.end, parent2);
+ const list = createNode(360 /* SyntaxList */, nodes.pos, nodes.end, parent2);
list._children = [];
let pos = nodes.pos;
for (const node of nodes) {
@@ -123134,7 +123392,7 @@ function getJsDocTagsOfDeclarations(declarations, checker) {
var _a2;
if (!seenSymbols.has(symbol)) {
seenSymbols.add(symbol);
- if (declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) {
+ if (declaration.kind === 179 /* GetAccessor */ || declaration.kind === 180 /* SetAccessor */) {
return symbol.getContextualJsDocTags(declaration, checker);
}
return ((_a2 = symbol.declarations) == null ? void 0 : _a2.length) === 1 ? symbol.getJsDocTags() : void 0;
@@ -123157,7 +123415,7 @@ function getDocumentationComment(declarations, checker) {
const inheritedDocs = findBaseOfDeclaration(checker, declaration, (symbol) => {
if (!seenSymbols.has(symbol)) {
seenSymbols.add(symbol);
- if (declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) {
+ if (declaration.kind === 179 /* GetAccessor */ || declaration.kind === 180 /* SetAccessor */) {
return symbol.getContextualDocumentationComment(declaration, checker);
}
return symbol.getDocumentationComment(checker);
@@ -123171,7 +123429,7 @@ function getDocumentationComment(declarations, checker) {
}
function findBaseOfDeclaration(checker, declaration, cb) {
var _a2;
- const classOrInterfaceDeclaration = ((_a2 = declaration.parent) == null ? void 0 : _a2.kind) === 176 /* Constructor */ ? declaration.parent.parent : declaration.parent;
+ const classOrInterfaceDeclaration = ((_a2 = declaration.parent) == null ? void 0 : _a2.kind) === 178 /* Constructor */ ? declaration.parent.parent : declaration.parent;
if (!classOrInterfaceDeclaration)
return;
const isStaticMember = hasStaticModifier(declaration);
@@ -123185,7 +123443,7 @@ function findBaseOfDeclaration(checker, declaration, cb) {
var SourceFileObject = class extends NodeObject {
constructor(kind, pos, end) {
super(kind, pos, end);
- this.kind = 314 /* SourceFile */;
+ this.kind = 317 /* SourceFile */;
}
update(newText, textChangeRange) {
return updateSourceFile(this, newText, textChangeRange);
@@ -123241,10 +123499,10 @@ var SourceFileObject = class extends NodeObject {
}
function visit(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
const functionDeclaration = node;
const declarationName = getDeclarationName(functionDeclaration);
if (declarationName) {
@@ -123260,30 +123518,30 @@ var SourceFileObject = class extends NodeObject {
}
forEachChild(node, visit);
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 284 /* ExportSpecifier */:
- case 279 /* ImportSpecifier */:
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 187 /* TypeLiteral */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 287 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 189 /* TypeLiteral */:
addDeclaration(node);
forEachChild(node, visit);
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (!hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) {
break;
}
- case 261 /* VariableDeclaration */:
- case 208 /* BindingElement */: {
+ case 263 /* VariableDeclaration */:
+ case 210 /* BindingElement */: {
const decl = node;
if (isBindingPattern(decl.name)) {
forEachChild(decl.name, visit);
@@ -123293,12 +123551,12 @@ var SourceFileObject = class extends NodeObject {
visit(decl.initializer);
}
}
- case 308 /* EnumMember */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 311 /* EnumMember */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
addDeclaration(node);
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportDeclaration = node;
if (exportDeclaration.exportClause) {
if (isNamedExports(exportDeclaration.exportClause)) {
@@ -123308,14 +123566,14 @@ var SourceFileObject = class extends NodeObject {
}
}
break;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
const importClause = node.importClause;
if (importClause) {
if (importClause.name) {
addDeclaration(importClause.name);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (importClause.namedBindings.kind === 280 /* NamespaceImport */) {
addDeclaration(importClause.namedBindings);
} else {
forEach(importClause.namedBindings.elements, visit);
@@ -123323,7 +123581,7 @@ var SourceFileObject = class extends NodeObject {
}
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (getAssignmentDeclarationKind(node) !== 0 /* None */) {
addDeclaration(node);
}
@@ -123965,15 +124223,15 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
switch (node.kind) {
case 79 /* Identifier */:
return !isLabelName(node) && !isTagName(node) && !isConstTypeReference(node.parent);
- case 211 /* PropertyAccessExpression */:
- case 165 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
return !isInComment(sourceFile, position);
case 109 /* ThisKeyword */:
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 107 /* SuperKeyword */:
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return true;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return isImportMeta(node);
default:
return false;
@@ -124083,15 +124341,15 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
return void 0;
}
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
- case 165 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
case 10 /* StringLiteral */:
case 96 /* FalseKeyword */:
case 111 /* TrueKeyword */:
case 105 /* NullKeyword */:
case 107 /* SuperKeyword */:
case 109 /* ThisKeyword */:
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 79 /* Identifier */:
break;
default:
@@ -124102,7 +124360,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) {
nodeForStartPos = nodeForStartPos.parent;
} else if (isNameOfModuleDeclaration(nodeForStartPos)) {
- if (nodeForStartPos.parent.parent.kind === 270 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) {
+ if (nodeForStartPos.parent.parent.kind === 273 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) {
nodeForStartPos = nodeForStartPos.parent.parent.name;
} else {
break;
@@ -124719,7 +124977,7 @@ function initializeNameTable(sourceFile) {
});
}
function literalIsName(node) {
- return isDeclarationName(node) || node.parent.kind === 286 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node);
+ return isDeclarationName(node) || node.parent.kind === 289 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node);
}
function getContainingObjectLiteralElement(node) {
const element = getContainingObjectLiteralElementWorker(node);
@@ -124730,11 +124988,11 @@ function getContainingObjectLiteralElementWorker(node) {
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
case 8 /* NumericLiteral */:
- if (node.parent.kind === 166 /* ComputedPropertyName */) {
+ if (node.parent.kind === 167 /* ComputedPropertyName */) {
return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : void 0;
}
case 79 /* Identifier */:
- return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.parent.kind === 295 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0;
+ return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 212 /* ObjectLiteralExpression */ || node.parent.parent.kind === 298 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0;
}
return void 0;
}
@@ -124769,7 +125027,7 @@ function getPropertySymbolsFromContextualType(node, checker, contextualType, uni
return discriminatedPropertySymbols;
}
function isArgumentOfElementAccessExpression(node) {
- return node && node.parent && node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.argumentExpression === node;
+ return node && node.parent && node.parent.kind === 214 /* ElementAccessExpression */ && node.parent.argumentExpression === node;
}
function getDefaultLibFilePath(options) {
if (sys) {
@@ -125691,89 +125949,89 @@ function spanInSourceFileAtLocation(sourceFile, position) {
if (node) {
const { parent: parent2 } = node;
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return spanInVariableDeclaration(node.declarationList.declarations[0]);
- case 261 /* VariableDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 263 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return spanInVariableDeclaration(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return spanInParameterDeclaration(node);
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return spanInFunctionDeclaration(node);
- case 242 /* Block */:
+ case 244 /* Block */:
if (isFunctionBlock(node)) {
return spanInFunctionBlock(node);
}
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return spanInBlock(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return spanInBlock(node.block);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return textSpan(node.expression);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return textSpan(node.getChildAt(0), node.expression);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return textSpanEndingAtNextToken(node, node.expression);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return spanInNode(node.statement);
- case 260 /* DebuggerStatement */:
+ case 262 /* DebuggerStatement */:
return textSpan(node.getChildAt(0));
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return textSpanEndingAtNextToken(node, node.expression);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return spanInNode(node.statement);
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
return textSpan(node.getChildAt(0), node.label);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return spanInForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return textSpanEndingAtNextToken(node, node.expression);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return spanInInitializerOfForLike(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return textSpanEndingAtNextToken(node, node.expression);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return spanInNode(node.statements[0]);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return spanInBlock(node.tryBlock);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return textSpan(node, node.expression);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return textSpan(node, node.expression);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return textSpan(node, node.moduleReference);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return textSpan(node, node.moduleSpecifier);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return textSpan(node, node.moduleSpecifier);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (getModuleInstanceState(node) !== 1 /* Instantiated */) {
return void 0;
}
- case 264 /* ClassDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 208 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 210 /* BindingElement */:
return textSpan(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return spanInNode(node.statement);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return spanInNodeArray(parent2.modifiers, node, isDecorator);
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return spanInBindingPattern(node);
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return void 0;
case 26 /* SemicolonToken */:
case 1 /* EndOfFileToken */:
@@ -125801,16 +126059,16 @@ function spanInSourceFileAtLocation(sourceFile, position) {
case 83 /* CatchKeyword */:
case 97 /* FinallyKeyword */:
return spanInNextNode(node);
- case 164 /* OfKeyword */:
+ case 165 /* OfKeyword */:
return spanInOfKeyword(node);
default:
if (isArrayLiteralOrObjectLiteralDestructuringPattern(node)) {
return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node);
}
- if ((node.kind === 79 /* Identifier */ || node.kind === 231 /* SpreadElement */ || node.kind === 305 /* PropertyAssignment */ || node.kind === 306 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) {
+ if ((node.kind === 79 /* Identifier */ || node.kind === 233 /* SpreadElement */ || node.kind === 308 /* PropertyAssignment */ || node.kind === 309 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) {
return textSpan(node);
}
- if (node.kind === 227 /* BinaryExpression */) {
+ if (node.kind === 229 /* BinaryExpression */) {
const { left, operatorToken } = node;
if (isArrayLiteralOrObjectLiteralDestructuringPattern(left)) {
return spanInArrayLiteralOrObjectLiteralDestructuringPattern(
@@ -125826,19 +126084,19 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
if (isExpressionNode(node)) {
switch (parent2.kind) {
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return spanInPreviousNode(node);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return spanInNode(node.parent);
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
return textSpan(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (node.parent.operatorToken.kind === 27 /* CommaToken */) {
return textSpan(node);
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (node.parent.body === node) {
return textSpan(node);
}
@@ -125846,25 +126104,25 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
}
switch (node.parent.kind) {
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (node.parent.name === node && !isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) {
return spanInNode(node.parent.initializer);
}
break;
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
if (node.parent.type === node) {
return spanInNextNode(node.parent.type);
}
break;
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */: {
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */: {
const { initializer, type } = node.parent;
if (initializer === node || type === node || isAssignmentOperator(node.kind)) {
return spanInPreviousNode(node);
}
break;
}
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const { left } = node.parent;
if (isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) {
return spanInPreviousNode(node);
@@ -125887,14 +126145,14 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
}
function spanInVariableDeclaration(variableDeclaration) {
- if (variableDeclaration.parent.parent.kind === 250 /* ForInStatement */) {
+ if (variableDeclaration.parent.parent.kind === 252 /* ForInStatement */) {
return spanInNode(variableDeclaration.parent.parent);
}
const parent2 = variableDeclaration.parent;
if (isBindingPattern(variableDeclaration.name)) {
return spanInBindingPattern(variableDeclaration.name);
}
- if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 1 /* Export */) || parent2.parent.kind === 251 /* ForOfStatement */) {
+ if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 1 /* Export */) || parent2.parent.kind === 253 /* ForOfStatement */) {
return textSpanFromVariableDeclaration(variableDeclaration);
}
if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) {
@@ -125921,7 +126179,7 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
}
function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) {
- return hasSyntacticModifier(functionDeclaration, 1 /* Export */) || functionDeclaration.parent.kind === 264 /* ClassDeclaration */ && functionDeclaration.kind !== 176 /* Constructor */;
+ return hasSyntacticModifier(functionDeclaration, 1 /* Export */) || functionDeclaration.parent.kind === 266 /* ClassDeclaration */ && functionDeclaration.kind !== 178 /* Constructor */;
}
function spanInFunctionDeclaration(functionDeclaration) {
if (!functionDeclaration.body) {
@@ -125941,22 +126199,22 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
function spanInBlock(block) {
switch (block.parent.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (getModuleInstanceState(block.parent) !== 1 /* Instantiated */) {
return void 0;
}
- case 248 /* WhileStatement */:
- case 246 /* IfStatement */:
- case 250 /* ForInStatement */:
+ case 250 /* WhileStatement */:
+ case 248 /* IfStatement */:
+ case 252 /* ForInStatement */:
return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]);
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
return spanInNodeIfStartsOnSameLine(findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]);
}
return spanInNode(block.statements[0]);
}
function spanInInitializerOfForLike(forLikeStatement) {
- if (forLikeStatement.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (forLikeStatement.initializer.kind === 264 /* VariableDeclarationList */) {
const variableDeclarationList = forLikeStatement.initializer;
if (variableDeclarationList.declarations.length > 0) {
return spanInNode(variableDeclarationList.declarations[0]);
@@ -125979,64 +126237,64 @@ function spanInSourceFileAtLocation(sourceFile, position) {
function spanInBindingPattern(bindingPattern) {
const firstBindingElement = forEach(
bindingPattern.elements,
- (element) => element.kind !== 233 /* OmittedExpression */ ? element : void 0
+ (element) => element.kind !== 235 /* OmittedExpression */ ? element : void 0
);
if (firstBindingElement) {
return spanInNode(firstBindingElement);
}
- if (bindingPattern.parent.kind === 208 /* BindingElement */) {
+ if (bindingPattern.parent.kind === 210 /* BindingElement */) {
return textSpan(bindingPattern.parent);
}
return textSpanFromVariableDeclaration(bindingPattern.parent);
}
function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node2) {
- Debug.assert(node2.kind !== 207 /* ArrayBindingPattern */ && node2.kind !== 206 /* ObjectBindingPattern */);
- const elements = node2.kind === 209 /* ArrayLiteralExpression */ ? node2.elements : node2.properties;
+ Debug.assert(node2.kind !== 209 /* ArrayBindingPattern */ && node2.kind !== 208 /* ObjectBindingPattern */);
+ const elements = node2.kind === 211 /* ArrayLiteralExpression */ ? node2.elements : node2.properties;
const firstBindingElement = forEach(
elements,
- (element) => element.kind !== 233 /* OmittedExpression */ ? element : void 0
+ (element) => element.kind !== 235 /* OmittedExpression */ ? element : void 0
);
if (firstBindingElement) {
return spanInNode(firstBindingElement);
}
- return textSpan(node2.parent.kind === 227 /* BinaryExpression */ ? node2.parent : node2);
+ return textSpan(node2.parent.kind === 229 /* BinaryExpression */ ? node2.parent : node2);
}
function spanInOpenBraceToken(node2) {
switch (node2.parent.kind) {
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
const enumDeclaration = node2.parent;
return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile));
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const classDeclaration = node2.parent;
return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile));
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return spanInNodeIfStartsOnSameLine(node2.parent.parent, node2.parent.clauses[0]);
}
return spanInNode(node2.parent);
}
function spanInCloseBraceToken(node2) {
switch (node2.parent.kind) {
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
if (getModuleInstanceState(node2.parent.parent) !== 1 /* Instantiated */) {
return void 0;
}
- case 269 /* EnumDeclaration */:
- case 264 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 266 /* ClassDeclaration */:
return textSpan(node2);
- case 242 /* Block */:
+ case 244 /* Block */:
if (isFunctionBlock(node2.parent)) {
return textSpan(node2);
}
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return spanInNode(lastOrUndefined(node2.parent.statements));
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
const caseBlock = node2.parent;
const lastClause = lastOrUndefined(caseBlock.clauses);
if (lastClause) {
return spanInNode(lastOrUndefined(lastClause.statements));
}
return void 0;
- case 206 /* ObjectBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
const bindingPattern = node2.parent;
return spanInNode(lastOrUndefined(bindingPattern.elements) || bindingPattern);
default:
@@ -126049,7 +126307,7 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
function spanInCloseBracketToken(node2) {
switch (node2.parent.kind) {
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
const bindingPattern = node2.parent;
return textSpan(lastOrUndefined(bindingPattern.elements) || bindingPattern);
default:
@@ -126061,56 +126319,56 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
}
function spanInOpenParenToken(node2) {
- if (node2.parent.kind === 247 /* DoStatement */ || node2.parent.kind === 213 /* CallExpression */ || node2.parent.kind === 214 /* NewExpression */) {
+ if (node2.parent.kind === 249 /* DoStatement */ || node2.parent.kind === 215 /* CallExpression */ || node2.parent.kind === 216 /* NewExpression */) {
return spanInPreviousNode(node2);
}
- if (node2.parent.kind === 217 /* ParenthesizedExpression */) {
+ if (node2.parent.kind === 219 /* ParenthesizedExpression */) {
return spanInNextNode(node2);
}
return spanInNode(node2.parent);
}
function spanInCloseParenToken(node2) {
switch (node2.parent.kind) {
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
- case 248 /* WhileStatement */:
- case 247 /* DoStatement */:
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 250 /* WhileStatement */:
+ case 249 /* DoStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 219 /* ParenthesizedExpression */:
return spanInPreviousNode(node2);
default:
return spanInNode(node2.parent);
}
}
function spanInColonToken(node2) {
- if (isFunctionLike(node2.parent) || node2.parent.kind === 305 /* PropertyAssignment */ || node2.parent.kind === 168 /* Parameter */) {
+ if (isFunctionLike(node2.parent) || node2.parent.kind === 308 /* PropertyAssignment */ || node2.parent.kind === 169 /* Parameter */) {
return spanInPreviousNode(node2);
}
return spanInNode(node2.parent);
}
function spanInGreaterThanOrLessThanToken(node2) {
- if (node2.parent.kind === 216 /* TypeAssertionExpression */) {
+ if (node2.parent.kind === 218 /* TypeAssertionExpression */) {
return spanInNextNode(node2);
}
return spanInNode(node2.parent);
}
function spanInWhileKeyword(node2) {
- if (node2.parent.kind === 247 /* DoStatement */) {
+ if (node2.parent.kind === 249 /* DoStatement */) {
return textSpanEndingAtNextToken(node2, node2.parent.expression);
}
return spanInNode(node2.parent);
}
function spanInOfKeyword(node2) {
- if (node2.parent.kind === 251 /* ForOfStatement */) {
+ if (node2.parent.kind === 253 /* ForOfStatement */) {
return spanInNextNode(node2);
}
return spanInNode(node2.parent);
@@ -126199,17 +126457,17 @@ function getCallHierarchItemContainerName(node) {
return;
}
switch (node.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- if (node.parent.kind === 210 /* ObjectLiteralExpression */) {
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ if (node.parent.kind === 212 /* ObjectLiteralExpression */) {
return (_a2 = getAssignedName(node.parent)) == null ? void 0 : _a2.getText();
}
return (_b = getNameOfDeclaration(node.parent)) == null ? void 0 : _b.getText();
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (isModuleBlock(node.parent) && isIdentifier(node.parent.parent.name)) {
return node.parent.parent.name.getText();
}
@@ -126387,55 +126645,55 @@ function createCallSiteCollector(program, callSites) {
}
switch (node.kind) {
case 79 /* Identifier */:
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return;
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
recordCallSite(node);
return;
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
collect(node.expression);
return;
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
collect(node.name);
collect(node.initializer);
return;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
recordCallSite(node);
collect(node.expression);
forEach(node.arguments, collect);
return;
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
recordCallSite(node);
collect(node.expression);
forEach(node.arguments, collect);
return;
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
recordCallSite(node);
collect(node.tag);
collect(node.template);
return;
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
recordCallSite(node);
collect(node.tagName);
collect(node.attributes);
return;
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
recordCallSite(node);
collect(node.expression);
return;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
recordCallSite(node);
forEachChild(node, collect);
break;
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
collect(node.expression);
return;
}
@@ -126488,26 +126746,26 @@ function collectCallSites(program, node) {
const callSites = [];
const collect = createCallSiteCollector(program, callSites);
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
collectCallSitesOfSourceFile(node, collect);
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
collectCallSitesOfModuleDeclaration(node, collect);
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect);
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
collectCallSitesOfClassLikeDeclaration(node, collect);
break;
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
collectCallSitesOfClassStaticBlockDeclaration(node, collect);
break;
default:
@@ -126608,13 +126866,13 @@ function collectTokens(program, sourceFile, span, collector, cancellationToken)
let inJSXElement = false;
function visit(node) {
switch (node.kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
if (!node || !textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) {
@@ -126754,25 +127012,25 @@ function isRightSideOfQualifiedNameOrPropertyAccess2(node) {
return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node;
}
var tokenFromDeclarationMapping = new Map2([
- [261 /* VariableDeclaration */, 7 /* variable */],
- [168 /* Parameter */, 6 /* parameter */],
- [171 /* PropertyDeclaration */, 9 /* property */],
- [270 /* ModuleDeclaration */, 3 /* namespace */],
- [269 /* EnumDeclaration */, 1 /* enum */],
- [308 /* EnumMember */, 8 /* enumMember */],
- [264 /* ClassDeclaration */, 0 /* class */],
- [174 /* MethodDeclaration */, 11 /* member */],
- [263 /* FunctionDeclaration */, 10 /* function */],
- [218 /* FunctionExpression */, 10 /* function */],
- [173 /* MethodSignature */, 11 /* member */],
- [177 /* GetAccessor */, 9 /* property */],
- [178 /* SetAccessor */, 9 /* property */],
- [170 /* PropertySignature */, 9 /* property */],
- [267 /* InterfaceDeclaration */, 2 /* interface */],
- [268 /* TypeAliasDeclaration */, 5 /* type */],
- [167 /* TypeParameter */, 4 /* typeParameter */],
- [305 /* PropertyAssignment */, 9 /* property */],
- [306 /* ShorthandPropertyAssignment */, 9 /* property */]
+ [263 /* VariableDeclaration */, 7 /* variable */],
+ [169 /* Parameter */, 6 /* parameter */],
+ [172 /* PropertyDeclaration */, 9 /* property */],
+ [273 /* ModuleDeclaration */, 3 /* namespace */],
+ [272 /* EnumDeclaration */, 1 /* enum */],
+ [311 /* EnumMember */, 8 /* enumMember */],
+ [266 /* ClassDeclaration */, 0 /* class */],
+ [176 /* MethodDeclaration */, 11 /* member */],
+ [265 /* FunctionDeclaration */, 10 /* function */],
+ [220 /* FunctionExpression */, 10 /* function */],
+ [175 /* MethodSignature */, 11 /* member */],
+ [179 /* GetAccessor */, 9 /* property */],
+ [180 /* SetAccessor */, 9 /* property */],
+ [171 /* PropertySignature */, 9 /* property */],
+ [270 /* InterfaceDeclaration */, 2 /* interface */],
+ [271 /* TypeAliasDeclaration */, 5 /* type */],
+ [168 /* TypeParameter */, 4 /* typeParameter */],
+ [308 /* PropertyAssignment */, 9 /* property */],
+ [309 /* ShorthandPropertyAssignment */, 9 /* property */]
]);
// src/services/_namespaces/ts.codefix.ts
@@ -127119,7 +127377,7 @@ function findAwaitableInitializers(expression, sourceFile, cancellationToken, pr
}
const declaration = tryCast(symbol.valueDeclaration, isVariableDeclaration);
const variableName = declaration && tryCast(declaration.name, isIdentifier);
- const variableStatement = getAncestor(declaration, 244 /* VariableStatement */);
+ const variableStatement = getAncestor(declaration, 246 /* VariableStatement */);
if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement, 1 /* Export */) || !variableName || !isInsideAwaitableBody(declaration.initializer)) {
isCompleteFix = false;
continue;
@@ -127171,7 +127429,7 @@ function symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, c
return diagnostic && contains(errorCodes3, diagnostic.code) || checker.getTypeAtLocation(errorNode).flags & 1 /* Any */;
}
function isInsideAwaitableBody(node) {
- return node.kind & 32768 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 263 /* FunctionDeclaration */ || ancestor.parent.kind === 218 /* FunctionExpression */ || ancestor.parent.kind === 219 /* ArrowFunction */ || ancestor.parent.kind === 174 /* MethodDeclaration */));
+ return node.kind & 32768 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 265 /* FunctionDeclaration */ || ancestor.parent.kind === 220 /* FunctionExpression */ || ancestor.parent.kind === 221 /* ArrowFunction */ || ancestor.parent.kind === 176 /* MethodDeclaration */));
}
function makeChange3(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) {
if (isForOfStatement(insertionSite.parent) && !insertionSite.parent.awaitModifier) {
@@ -127293,10 +127551,10 @@ function applyChange(changeTracker, initializer, sourceFile, fixedNodes) {
function isPossiblyPartOfDestructuring(node) {
switch (node.kind) {
case 79 /* Identifier */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return true;
default:
return false;
@@ -127309,7 +127567,7 @@ function arrayElementCouldBeVariableDeclaration(expression, checker) {
function isPossiblyPartOfCommaSeperatedInitializer(node) {
switch (node.kind) {
case 79 /* Identifier */:
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
case 27 /* CommaToken */:
return true;
default:
@@ -127351,7 +127609,7 @@ function makeChange5(changeTracker, sourceFile, pos, fixedNodes) {
return;
}
const declaration = token.parent;
- if (declaration.kind === 171 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) {
+ if (declaration.kind === 172 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) {
changeTracker.insertModifierBefore(sourceFile, 137 /* DeclareKeyword */, declaration);
}
}
@@ -127485,7 +127743,7 @@ function addUndefinedToOptionalProperty(changes, toAdd) {
const d = add.valueDeclaration;
if (d && (isPropertySignature(d) || isPropertyDeclaration(d)) && d.type) {
const t = factory.createUnionTypeNode([
- ...d.type.kind === 192 /* UnionType */ ? d.type.types : [d.type],
+ ...d.type.kind === 194 /* UnionType */ ? d.type.types : [d.type],
factory.createTypeReferenceNode("undefined")
]);
changes.replaceNode(d.getSourceFile(), d.type, t);
@@ -127553,24 +127811,24 @@ function doChange(changes, sourceFile, decl) {
}
}
function isDeclarationWithType(node) {
- return isFunctionLikeDeclaration(node) || node.kind === 261 /* VariableDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 171 /* PropertyDeclaration */;
+ return isFunctionLikeDeclaration(node) || node.kind === 263 /* VariableDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 172 /* PropertyDeclaration */;
}
function transformJSDocType(node) {
switch (node.kind) {
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
return factory.createTypeReferenceNode("any", emptyArray);
- case 325 /* JSDocOptionalType */:
+ case 328 /* JSDocOptionalType */:
return transformJSDocOptionalType(node);
- case 324 /* JSDocNonNullableType */:
+ case 327 /* JSDocNonNullableType */:
return transformJSDocType(node.type);
- case 323 /* JSDocNullableType */:
+ case 326 /* JSDocNullableType */:
return transformJSDocNullableType(node);
- case 327 /* JSDocVariadicType */:
+ case 330 /* JSDocVariadicType */:
return transformJSDocVariadicType(node);
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return transformJSDocFunctionType(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return transformJSDocTypeReference(node);
default:
const visited = visitEachChild(node, transformJSDocType, nullTransformationContext);
@@ -127593,7 +127851,7 @@ function transformJSDocFunctionType(node) {
}
function transformJSDocParameter(node) {
const index = node.parent.parameters.indexOf(node);
- const isRest = node.type.kind === 327 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1;
+ const isRest = node.type.kind === 330 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1;
const name = node.name || (isRest ? "rest" : "arg" + index);
const dotdotdot = isRest ? factory.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken;
return factory.createParameterDeclaration(node.modifiers, dotdotdot, name, node.questionToken, visitNode(node.type, transformJSDocType), node.initializer);
@@ -127741,7 +127999,7 @@ function doChange2(changes, sourceFile, position, checker, preferences, compiler
})) {
return;
}
- const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 245 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression;
+ const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 247 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression;
changes.delete(sourceFile, nodeToDelete);
if (!assignmentExpr) {
members.push(factory.createPropertyDeclaration(
@@ -127811,7 +128069,7 @@ function doChange2(changes, sourceFile, position, checker, preferences, compiler
function createArrowFunctionExpressionMember(members2, arrowFunction, name) {
const arrowFunctionBody = arrowFunction.body;
let bodyBlock;
- if (arrowFunctionBody.kind === 242 /* Block */) {
+ if (arrowFunctionBody.kind === 244 /* Block */) {
bodyBlock = arrowFunctionBody;
} else {
bodyBlock = factory.createBlock([factory.createReturnStatement(arrowFunctionBody)]);
@@ -128258,7 +128516,7 @@ function transformCallbackArgument(func, hasContinuation, continuationArgName, i
switch (func.kind) {
case 105 /* NullKeyword */:
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
case 79 /* Identifier */:
if (!inputArgName) {
break;
@@ -128278,8 +128536,8 @@ function transformCallbackArgument(func, hasContinuation, continuationArgName, i
continuationArgName.types.push(transformer.checker.getAwaitedType(returnType) || returnType);
}
return varDeclOrAssignment;
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */: {
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */: {
const funcBody = func.body;
const returnType2 = (_a2 = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) == null ? void 0 : _a2.getReturnType();
if (isBlock(funcBody)) {
@@ -128493,10 +128751,10 @@ function fixImportOfModuleExports(importingFile, exportingFile, changes, quotePr
}
const importNode = importFromModuleSpecifier(moduleSpecifier);
switch (importNode.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
changes.replaceNode(importingFile, importNode, makeImport(importNode.name, void 0, moduleSpecifier, quotePreference));
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isRequireCall(importNode, false)) {
changes.replaceNode(importingFile, importNode, factory.createPropertyAccessExpression(getSynthesizedDeepClone(importNode), "default"));
}
@@ -128555,19 +128813,19 @@ function forEachExportReference(sourceFile, cb) {
}
function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference) {
switch (statement.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference);
return false;
- case 245 /* ExpressionStatement */: {
+ case 247 /* ExpressionStatement */: {
const { expression } = statement;
switch (expression.kind) {
- case 213 /* CallExpression */: {
+ case 215 /* CallExpression */: {
if (isRequireCall(expression, true)) {
changes.replaceNode(sourceFile, statement, makeImport(void 0, void 0, expression.arguments[0], quotePreference));
}
return false;
}
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const { operatorToken } = expression;
return operatorToken.kind === 63 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports, useSitesToUnqualify);
}
@@ -128609,8 +128867,8 @@ function convertVariableStatement(sourceFile, statement, changes, checker, ident
}
function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) {
switch (name.kind) {
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */: {
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */: {
const tmp = makeUniqueName(propertyName, identifiers);
return convertedImports([
makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference),
@@ -128649,14 +128907,14 @@ function convertAssignment(sourceFile, checker, assignment, changes, exports, us
function tryChangeModuleExportsObject(object, useSitesToUnqualify) {
const statements = mapAllOrFail(object.properties, (prop) => {
switch (prop.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return void 0;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return !isIdentifier(prop.name) ? void 0 : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return !isIdentifier(prop.name) ? void 0 : functionExpressionToDeclaration(prop.name.text, [factory.createToken(94 /* ExportKeyword */)], prop, useSitesToUnqualify);
default:
Debug.assertNever(prop, `Convert to ES6 got invalid prop kind ${prop.kind}`);
@@ -128711,15 +128969,15 @@ function convertExportsPropertyAssignment({ left, right, parent: parent2 }, sour
function convertExportsDotXEquals_replaceNode(name, exported, useSitesToUnqualify) {
const modifiers = [factory.createToken(94 /* ExportKeyword */)];
switch (exported.kind) {
- case 218 /* FunctionExpression */: {
+ case 220 /* FunctionExpression */: {
const { name: expressionName } = exported;
if (expressionName && expressionName.text !== name) {
return exportConst();
}
}
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return functionExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return classExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify);
default:
return exportConst();
@@ -128734,7 +128992,7 @@ function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) {
}
return isArray(nodeOrNodes) ? getSynthesizedDeepClonesWithReplacements(nodeOrNodes, true, replaceNode) : getSynthesizedDeepCloneWithReplacements(nodeOrNodes, true, replaceNode);
function replaceNode(original) {
- if (original.kind === 211 /* PropertyAccessExpression */) {
+ if (original.kind === 213 /* PropertyAccessExpression */) {
const replacement = useSitesToUnqualify.get(original);
useSitesToUnqualify.delete(original);
return replacement;
@@ -128743,13 +129001,13 @@ function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) {
}
function convertSingleImport(name, moduleSpecifier, checker, identifiers, target, quotePreference) {
switch (name.kind) {
- case 206 /* ObjectBindingPattern */: {
+ case 208 /* ObjectBindingPattern */: {
const importSpecifiers = mapAllOrFail(name.elements, (e) => e.dotDotDotToken || e.initializer || e.propertyName && !isIdentifier(e.propertyName) || !isIdentifier(e.name) ? void 0 : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text));
if (importSpecifiers) {
return convertedImports([makeImport(void 0, importSpecifiers, moduleSpecifier, quotePreference)]);
}
}
- case 207 /* ArrayBindingPattern */: {
+ case 209 /* ArrayBindingPattern */: {
const tmp = makeUniqueName(moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers);
return convertedImports([
makeImport(factory.createIdentifier(tmp), void 0, moduleSpecifier, quotePreference),
@@ -128820,11 +129078,11 @@ function forEachFreeIdentifier(node, cb) {
function isFreeIdentifier(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return parent2.name !== node;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return parent2.propertyName !== node;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return parent2.propertyName !== node;
default:
return true;
@@ -129494,11 +129752,11 @@ function tryUseExistingNamespaceImport(existingImports, symbolName2, position, c
function getTargetModuleFromNamespaceLikeImport(declaration, checker) {
var _a2;
switch (declaration.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return checker.resolveExternalModuleName(declaration.initializer.arguments[0]);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return checker.getAliasedSymbol(declaration.symbol);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
const namespaceImport = tryCast((_a2 = declaration.importClause) == null ? void 0 : _a2.namedBindings, isNamespaceImport);
return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol);
default:
@@ -129508,11 +129766,11 @@ function getTargetModuleFromNamespaceLikeImport(declaration, checker) {
function getNamespaceLikeImportText(declaration) {
var _a2, _b, _c;
switch (declaration.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return (_a2 = tryCast(declaration.name, isIdentifier)) == null ? void 0 : _a2.text;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return declaration.name.text;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return (_c = tryCast((_b = declaration.importClause) == null ? void 0 : _b.namedBindings, isNamespaceImport)) == null ? void 0 : _c.name.text;
default:
return Debug.assertNever(declaration);
@@ -129532,11 +129790,11 @@ function getAddAsTypeOnly(isValidTypeOnlyUseSite, isForNewImportDeclaration, sym
}
function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, compilerOptions) {
return firstDefined(existingImports, ({ declaration, importKind, symbol, targetFlags }) => {
- if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 274 /* ImportEqualsDeclaration */) {
+ if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 277 /* ImportEqualsDeclaration */) {
return void 0;
}
- if (declaration.kind === 261 /* VariableDeclaration */) {
- return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 206 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0;
+ if (declaration.kind === 263 /* VariableDeclaration */) {
+ return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 208 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0;
}
const { importClause } = declaration;
if (!importClause || !isStringLiteralLike(declaration.moduleSpecifier))
@@ -129547,7 +129805,7 @@ function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker
const addAsTypeOnly = getAddAsTypeOnly(isValidTypeOnlyUseSite, false, symbol, targetFlags, checker, compilerOptions);
if (importKind === 1 /* Default */ && (name || addAsTypeOnly === 2 /* Required */ && namedBindings))
return void 0;
- if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 277 /* NamespaceImport */)
+ if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 280 /* NamespaceImport */)
return void 0;
return {
kind: 2 /* AddToExisting */,
@@ -129567,7 +129825,7 @@ function createExistingImportMap(checker, importingFile, compilerOptions) {
if (moduleSymbol) {
(importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i.parent);
}
- } else if (i.kind === 275 /* ImportDeclaration */ || i.kind === 274 /* ImportEqualsDeclaration */) {
+ } else if (i.kind === 278 /* ImportDeclaration */ || i.kind === 277 /* ImportEqualsDeclaration */) {
const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier);
if (moduleSymbol) {
(importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i);
@@ -129908,7 +130166,7 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy
case 4 /* PromoteTypeOnly */: {
const { typeOnlyAliasDeclaration } = fix;
const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, compilerOptions, sourceFile);
- return promotedDeclaration.kind === 279 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
+ return promotedDeclaration.kind === 282 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
}
default:
return Debug.assertNever(fix, `Unexpected fix kind ${fix.kind}`);
@@ -129916,12 +130174,12 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy
}
function getModuleSpecifierText(promotedDeclaration) {
var _a2, _b;
- return promotedDeclaration.kind === 274 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text;
+ return promotedDeclaration.kind === 277 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text;
}
function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile) {
const convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules;
switch (aliasDeclaration.kind) {
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
if (aliasDeclaration.isTypeOnly) {
if (aliasDeclaration.parent.elements.length > 1 && ts_OrganizeImports_exports.importSpecifiersAreSorted(aliasDeclaration.parent.elements)) {
changes.delete(sourceFile, aliasDeclaration);
@@ -129937,13 +130195,13 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF
promoteImportClause(aliasDeclaration.parent.parent);
return aliasDeclaration.parent.parent;
}
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
promoteImportClause(aliasDeclaration);
return aliasDeclaration;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
promoteImportClause(aliasDeclaration.parent);
return aliasDeclaration.parent;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
changes.deleteRange(sourceFile, aliasDeclaration.getChildAt(1));
return aliasDeclaration;
default:
@@ -129954,7 +130212,7 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF
if (convertExistingToTypeOnly) {
const namedImports = tryCast(importClause.namedBindings, isNamedImports);
if (namedImports && namedImports.elements.length > 1) {
- if (ts_OrganizeImports_exports.importSpecifiersAreSorted(namedImports.elements) && aliasDeclaration.kind === 279 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) {
+ if (ts_OrganizeImports_exports.importSpecifiersAreSorted(namedImports.elements) && aliasDeclaration.kind === 282 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) {
changes.delete(sourceFile, aliasDeclaration);
changes.insertImportSpecifierAtIndex(sourceFile, aliasDeclaration, namedImports, 0);
}
@@ -129969,7 +130227,7 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF
}
function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, compilerOptions) {
var _a2;
- if (clause.kind === 206 /* ObjectBindingPattern */) {
+ if (clause.kind === 208 /* ObjectBindingPattern */) {
if (defaultImport) {
addElementToBindingPattern(clause, defaultImport.name, "default");
}
@@ -130367,13 +130625,13 @@ function doRemoveOverrideModifierChange(changeTracker, sourceFile, pos) {
}
function isClassElementLikeHasJSDoc(node) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return isParameterPropertyDeclaration(node, node.parent);
default:
return false;
@@ -130631,7 +130889,7 @@ registerCodeFix({
});
function getNamedTupleMember(sourceFile, pos) {
const token = getTokenAtPosition(sourceFile, pos);
- return findAncestor(token, (t) => t.kind === 202 /* NamedTupleMember */);
+ return findAncestor(token, (t) => t.kind === 204 /* NamedTupleMember */);
}
function doChange8(changes, sourceFile, namedTupleMember) {
if (!namedTupleMember) {
@@ -130640,10 +130898,10 @@ function doChange8(changes, sourceFile, namedTupleMember) {
let unwrappedType = namedTupleMember.type;
let sawOptional = false;
let sawRest = false;
- while (unwrappedType.kind === 190 /* OptionalType */ || unwrappedType.kind === 191 /* RestType */ || unwrappedType.kind === 196 /* ParenthesizedType */) {
- if (unwrappedType.kind === 190 /* OptionalType */) {
+ while (unwrappedType.kind === 192 /* OptionalType */ || unwrappedType.kind === 193 /* RestType */ || unwrappedType.kind === 198 /* ParenthesizedType */) {
+ if (unwrappedType.kind === 192 /* OptionalType */) {
sawOptional = true;
- } else if (unwrappedType.kind === 191 /* RestType */) {
+ } else if (unwrappedType.kind === 193 /* RestType */) {
sawRest = true;
}
unwrappedType = unwrappedType.type;
@@ -130945,19 +131203,19 @@ function getInfo6(checker, sourceFile, position, errorCode) {
}
function getVariableLikeInitializer(declaration) {
switch (declaration.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 171 /* PropertyDeclaration */:
- case 305 /* PropertyAssignment */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 172 /* PropertyDeclaration */:
+ case 308 /* PropertyAssignment */:
return declaration.initializer;
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return declaration.initializer && (isJsxExpression(declaration.initializer) ? declaration.initializer.expression : void 0);
- case 306 /* ShorthandPropertyAssignment */:
- case 170 /* PropertySignature */:
- case 308 /* EnumMember */:
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 171 /* PropertySignature */:
+ case 311 /* EnumMember */:
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
return void 0;
}
}
@@ -131190,7 +131448,7 @@ function createActionForAddMissingMemberInJavascriptFile(context, { parentDeclar
function addMissingMemberInJs(changeTracker, sourceFile, classDeclaration, token, makeStatic) {
const tokenName = token.text;
if (makeStatic) {
- if (classDeclaration.kind === 232 /* ClassExpression */) {
+ if (classDeclaration.kind === 234 /* ClassExpression */) {
return;
}
const className = classDeclaration.name.getText();
@@ -131239,7 +131497,7 @@ function createActionsForAddMissingMemberInTypeScriptFile(context, { parentDecla
}
function getTypeNode2(checker, node, token) {
let typeNode;
- if (token.parent.parent.kind === 227 /* BinaryExpression */) {
+ if (token.parent.parent.kind === 229 /* BinaryExpression */) {
const binaryExpression = token.parent.parent;
const otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left;
const widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression)));
@@ -131305,7 +131563,7 @@ function getActionsForMissingMethodDeclaration(context, info) {
}
function addMethodDeclaration(context, changes, callExpression, name, modifierFlags, parentDeclaration, sourceFile) {
const importAdder = createImportAdder(sourceFile, context.program, context.preferences, context.host);
- const kind = isClassLike(parentDeclaration) ? 174 /* MethodDeclaration */ : 173 /* MethodSignature */;
+ const kind = isClassLike(parentDeclaration) ? 176 /* MethodDeclaration */ : 175 /* MethodSignature */;
const signatureDeclaration = createSignatureDeclarationFromCallExpression(kind, context, importAdder, callExpression, name, modifierFlags, parentDeclaration);
const containingMethodDeclaration = tryGetContainingMethodDeclaration(parentDeclaration, callExpression);
if (containingMethodDeclaration) {
@@ -131334,7 +131592,7 @@ function addEnumMemberDeclaration(changes, checker, { token, parentDeclaration }
function addFunctionDeclaration(changes, context, info) {
const quotePreference = getQuotePreference(context.sourceFile, context.preferences);
const importAdder = createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
- const functionDeclaration = info.kind === 2 /* Function */ ? createSignatureDeclarationFromCallExpression(263 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature(263 /* FunctionDeclaration */, context, quotePreference, info.signature, createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference), info.token, void 0, void 0, void 0, importAdder);
+ const functionDeclaration = info.kind === 2 /* Function */ ? createSignatureDeclarationFromCallExpression(265 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature(265 /* FunctionDeclaration */, context, quotePreference, info.signature, createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference), info.token, void 0, void 0, void 0, importAdder);
if (functionDeclaration === void 0) {
Debug.fail("fixMissingFunctionDeclaration codefix got unexpected error.");
}
@@ -131434,7 +131692,7 @@ function tryGetValueFromType(context, checker, importAdder, quotePreference, typ
if (signature === void 0)
return createUndefined();
const func = createSignatureDeclarationFromSignature(
- 218 /* FunctionExpression */,
+ 220 /* FunctionExpression */,
context,
quotePreference,
signature[0],
@@ -132095,7 +132353,7 @@ registerCodeFix({
const importDeclaration = getImportDeclaration(context.sourceFile, context.program, context.span.start);
if (!importDeclaration)
return;
- const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => importDeclaration.kind === 279 /* ImportSpecifier */ && doNamespaceImportChange(t, context.sourceFile, importDeclaration, context.program));
+ const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => importDeclaration.kind === 282 /* ImportSpecifier */ && doNamespaceImportChange(t, context.sourceFile, importDeclaration, context.program));
const typeOnlyChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => doTypeOnlyImportChange(t, context.sourceFile, importDeclaration, context.program));
let actions2;
if (namespaceChanges.length) {
@@ -132110,18 +132368,18 @@ registerCodeFix({
});
function getImportDeclaration(sourceFile, program, start) {
const identifier = tryCast(getTokenAtPosition(sourceFile, start), isIdentifier);
- if (!identifier || identifier.parent.kind !== 183 /* TypeReference */)
+ if (!identifier || identifier.parent.kind !== 185 /* TypeReference */)
return;
const checker = program.getTypeChecker();
const symbol = checker.getSymbolAtLocation(identifier);
return find((symbol == null ? void 0 : symbol.declarations) || emptyArray, or(isImportClause, isImportSpecifier, isImportEqualsDeclaration));
}
function doTypeOnlyImportChange(changes, sourceFile, importDeclaration, program) {
- if (importDeclaration.kind === 274 /* ImportEqualsDeclaration */) {
+ if (importDeclaration.kind === 277 /* ImportEqualsDeclaration */) {
changes.insertModifierBefore(sourceFile, 155 /* TypeKeyword */, importDeclaration.name);
return;
}
- const importClause = importDeclaration.kind === 276 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent;
+ const importClause = importDeclaration.kind === 279 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent;
if (importClause.name && importClause.namedBindings) {
return;
}
@@ -132279,7 +132537,7 @@ function deleteTypeParameters(changes, sourceFile, token) {
changes.delete(sourceFile, Debug.checkDefined(cast(token.parent, isDeclarationWithTypeParameterChildren).typeParameters, "The type parameter to delete should exist"));
}
function isImport(token) {
- return token.kind === 101 /* ImportKeyword */ || token.kind === 79 /* Identifier */ && (token.parent.kind === 279 /* ImportSpecifier */ || token.parent.kind === 276 /* ImportClause */);
+ return token.kind === 101 /* ImportKeyword */ || token.kind === 79 /* Identifier */ && (token.parent.kind === 282 /* ImportSpecifier */ || token.parent.kind === 279 /* ImportClause */);
}
function tryGetFullImport(token) {
return token.kind === 101 /* ImportKeyword */ ? tryCast(token.parent, isImportDeclaration) : void 0;
@@ -132288,7 +132546,7 @@ function canDeleteEntireVariableStatement(sourceFile, token) {
return isVariableDeclarationList(token.parent) && first(token.parent.getChildren(sourceFile)) === token;
}
function deleteEntireVariableStatement(changes, sourceFile, node) {
- changes.delete(sourceFile, node.parent.kind === 244 /* VariableStatement */ ? node.parent : node);
+ changes.delete(sourceFile, node.parent.kind === 246 /* VariableStatement */ ? node.parent : node);
}
function deleteDestructuringElements(changes, sourceFile, node) {
forEach(node.elements, (n) => changes.delete(sourceFile, n));
@@ -132312,14 +132570,14 @@ function tryPrefixDeclaration(changes, errorCode, sourceFile, token) {
}
function canPrefix(token) {
switch (token.parent.kind) {
- case 168 /* Parameter */:
- case 167 /* TypeParameter */:
+ case 169 /* Parameter */:
+ case 168 /* TypeParameter */:
return true;
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
const varDecl = token.parent;
switch (varDecl.parent.parent.kind) {
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
return true;
}
}
@@ -132368,8 +132626,8 @@ function isNotProvidedArguments(parameter, checker, sourceFiles) {
function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll) {
const { parent: parent2 } = parameter;
switch (parent2.kind) {
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
const index = parent2.parameters.indexOf(parameter);
const referent = isMethodDeclaration(parent2) ? parent2.name : parent2;
const entries = ts_FindAllReferences_exports.Core.getReferencedSymbolsForNode(parent2.pos, referent, program, sourceFiles, cancellationToken);
@@ -132387,18 +132645,18 @@ function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program
}
}
return true;
- case 263 /* FunctionDeclaration */: {
+ case 265 /* FunctionDeclaration */: {
if (parent2.name && isCallbackLike(checker, sourceFile, parent2.name)) {
return isLastParameter(parent2, parameter, isFixAll);
}
return true;
}
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return isLastParameter(parent2, parameter, isFixAll);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return false;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return true;
default:
return Debug.failBadSyntaxKind(parent2);
@@ -132448,7 +132706,7 @@ function doChange18(changes, sourceFile, start, length2, errorCode) {
const container = (isBlock(statement.parent) ? statement.parent : statement).parent;
if (!isBlock(statement.parent) || statement === first(statement.parent.statements)) {
switch (container.kind) {
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
if (container.elseStatement) {
if (isBlock(statement.parent)) {
break;
@@ -132457,8 +132715,8 @@ function doChange18(changes, sourceFile, start, length2, errorCode) {
}
return;
}
- case 248 /* WhileStatement */:
- case 249 /* ForStatement */:
+ case 250 /* WhileStatement */:
+ case 251 /* ForStatement */:
changes.delete(sourceFile, container);
return;
}
@@ -132517,7 +132775,7 @@ registerCodeFix({
const { typeNode, type } = info;
const original = typeNode.getText(sourceFile);
const actions2 = [fix(type, fixIdPlain, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)];
- if (typeNode.kind === 323 /* JSDocNullableType */) {
+ if (typeNode.kind === 326 /* JSDocNullableType */) {
actions2.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types));
}
return actions2;
@@ -132535,7 +132793,7 @@ registerCodeFix({
if (!info)
return;
const { typeNode, type } = info;
- const fixedType = typeNode.kind === 323 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
+ const fixedType = typeNode.kind === 326 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
doChange20(changes, sourceFile, typeNode, fixedType, checker);
});
}
@@ -132550,22 +132808,22 @@ function getInfo11(sourceFile, pos, checker) {
}
function isTypeContainer(node) {
switch (node.kind) {
- case 235 /* AsExpression */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 263 /* FunctionDeclaration */:
- case 177 /* GetAccessor */:
- case 181 /* IndexSignature */:
- case 200 /* MappedType */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 178 /* SetAccessor */:
- case 268 /* TypeAliasDeclaration */:
- case 216 /* TypeAssertionExpression */:
- case 261 /* VariableDeclaration */:
+ case 237 /* AsExpression */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 179 /* GetAccessor */:
+ case 183 /* IndexSignature */:
+ case 202 /* MappedType */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 180 /* SetAccessor */:
+ case 271 /* TypeAliasDeclaration */:
+ case 218 /* TypeAssertionExpression */:
+ case 263 /* VariableDeclaration */:
return true;
default:
return false;
@@ -132656,14 +132914,14 @@ function getNodes3(sourceFile, start) {
}
let insertBefore;
switch (containingFunction.kind) {
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
insertBefore = containingFunction.name;
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
insertBefore = findChildOfKind(containingFunction, 99 /* FunctionKeyword */, sourceFile);
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
const kind = containingFunction.typeParameters ? 29 /* LessThanToken */ : 20 /* OpenParenToken */;
insertBefore = findChildOfKind(containingFunction, kind, sourceFile) || first(containingFunction.parameters);
break;
@@ -132958,7 +133216,7 @@ function annotateSetAccessor(changes, importAdder, sourceFile, setAccessorDeclar
function annotate(changes, importAdder, sourceFile, declaration, type, program, host) {
const typeNode = getTypeNodeIfAccessible(type, declaration, program, host);
if (typeNode) {
- if (isInJSFile(sourceFile) && declaration.kind !== 170 /* PropertySignature */) {
+ if (isInJSFile(sourceFile) && declaration.kind !== 171 /* PropertySignature */) {
const parent2 = isVariableDeclaration(declaration) ? tryCast(declaration.parent.parent, isVariableStatement) : declaration;
if (!parent2) {
return;
@@ -133034,17 +133292,17 @@ function inferTypeForParametersFromUsage(func, sourceFile, program, cancellation
function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) {
let searchToken;
switch (containingFunction.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
searchToken = findChildOfKind(containingFunction, 136 /* ConstructorKeyword */, sourceFile);
break;
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
const parent2 = containingFunction.parent;
searchToken = (isVariableDeclaration(parent2) || isPropertyDeclaration(parent2)) && isIdentifier(parent2.name) ? parent2.name : containingFunction.name;
break;
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
searchToken = containingFunction.name;
break;
}
@@ -133179,44 +133437,44 @@ function inferTypeFromReferences(program, references, cancellationToken) {
node = node.parent;
}
switch (node.parent.kind) {
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
inferTypeFromExpressionStatement(node, usage);
break;
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
usage.isNumber = true;
break;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
inferTypeFromPrefixUnaryExpression(node.parent, usage);
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
inferTypeFromBinaryExpression(node, node.parent, usage);
break;
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
inferTypeFromSwitchStatementLabel(node.parent, usage);
break;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
if (node.parent.expression === node) {
inferTypeFromCallExpression(node.parent, usage);
} else {
inferTypeFromContextualType(node, usage);
}
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
inferTypeFromPropertyAccessExpression(node.parent, usage);
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
inferTypeFromPropertyElementExpression(node.parent, node, usage);
break;
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
inferTypeFromPropertyAssignment(node.parent, usage);
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
inferTypeFromPropertyDeclaration(node.parent, usage);
break;
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
const { name, initializer } = node.parent;
if (node === name) {
if (initializer) {
@@ -133313,7 +133571,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
break;
case 56 /* BarBarToken */:
case 60 /* QuestionQuestionToken */:
- if (node === parent2.left && (node.parent.parent.kind === 261 /* VariableDeclaration */ || isAssignmentExpression(node.parent.parent, true))) {
+ if (node === parent2.left && (node.parent.parent.kind === 263 /* VariableDeclaration */ || isAssignmentExpression(node.parent.parent, true))) {
addCandidateType(usage, checker.getTypeAtLocation(parent2.right));
}
break;
@@ -133337,7 +133595,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
}
}
calculateUsageOfNode(parent2, call.return_);
- if (parent2.kind === 213 /* CallExpression */) {
+ if (parent2.kind === 215 /* CallExpression */) {
(usage.calls || (usage.calls = [])).push(call);
} else {
(usage.constructs || (usage.constructs = [])).push(call);
@@ -133756,7 +134014,7 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
const declaration = declarations == null ? void 0 : declarations[0];
const checker = context.program.getTypeChecker();
const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions());
- const kind = (_a2 = declaration == null ? void 0 : declaration.kind) != null ? _a2 : 170 /* PropertySignature */;
+ const kind = (_a2 = declaration == null ? void 0 : declaration.kind) != null ? _a2 : 171 /* PropertySignature */;
const declarationName = getSynthesizedDeepClone(getNameOfDeclaration(declaration), false);
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
let modifierFlags = effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
@@ -133769,8 +134027,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
const ambient = !!(enclosingDeclaration.flags & 16777216 /* Ambient */) || isAmbient;
const quotePreference = getQuotePreference(sourceFile, preferences);
switch (kind) {
- case 170 /* PropertySignature */:
- case 171 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
const flags = quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : void 0;
let typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context));
if (importAdder) {
@@ -133788,8 +134046,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
void 0
));
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */: {
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */: {
Debug.assertIsDefined(declarations);
let typeNode2 = checker.typeToTypeNode(type, enclosingDeclaration, void 0, getNoopSymbolTrackerWithResolver(context));
const allAccessors = getAllAccessorDeclarations(declarations, declaration);
@@ -133824,8 +134082,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
}
break;
}
- case 173 /* MethodSignature */:
- case 174 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
Debug.assertIsDefined(declarations);
const signatures = type.isUnion() ? flatMap(type.types, (t) => t.getCallSignatures()) : type.getCallSignatures();
if (!some(signatures)) {
@@ -133852,7 +134110,7 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
break;
}
function outputMethod(quotePreference2, signature, modifiers2, name, body2) {
- const method = createSignatureDeclarationFromSignature(174 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder);
+ const method = createSignatureDeclarationFromSignature(176 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder);
if (method)
addClassElement(method);
}
@@ -133978,7 +134236,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder
const parameters = createDummyParameters(args.length, names, argumentTypeNodes, void 0, isJs);
const type = isJs || contextualType === void 0 ? void 0 : checker.typeToTypeNode(contextualType, contextNode, void 0, tracker);
switch (kind) {
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return factory.createMethodDeclaration(
modifiers,
asteriskToken,
@@ -133989,7 +134247,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder
type,
createStubbedMethodBody(quotePreference)
);
- case 173 /* MethodSignature */:
+ case 175 /* MethodSignature */:
return factory.createMethodSignature(
modifiers,
name,
@@ -133998,7 +134256,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder
parameters,
type === void 0 ? factory.createKeywordTypeNode(159 /* UnknownKeyword */) : type
);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return factory.createFunctionDeclaration(
modifiers,
asteriskToken,
@@ -134352,7 +134610,7 @@ function getAccessorConvertiblePropertyAtPosition(file, program, start, end, con
isStatic: hasStaticModifier(declaration),
isReadonly: hasEffectiveReadonlyModifier(declaration),
type: getDeclarationType(declaration, program),
- container: declaration.kind === 168 /* Parameter */ ? declaration.parent.parent : declaration.parent,
+ container: declaration.kind === 169 /* Parameter */ ? declaration.parent.parent : declaration.parent,
originalName: declaration.name.text,
declaration,
fieldName,
@@ -134500,7 +134758,7 @@ registerCodeFix({
});
function getActionsForUsageOfInvalidImport(context) {
const sourceFile = context.sourceFile;
- const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 213 /* CallExpression */ : 214 /* NewExpression */;
+ const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 215 /* CallExpression */ : 216 /* NewExpression */;
const node = findAncestor(getTokenAtPosition(sourceFile, context.span.start), (a) => a.kind === targetKind);
if (!node) {
return [];
@@ -134823,7 +135081,7 @@ registerCodeFix({
function getImportTypeNode(sourceFile, pos) {
const token = getTokenAtPosition(sourceFile, pos);
Debug.assert(token.kind === 101 /* ImportKeyword */, "This token should be an ImportKeyword");
- Debug.assert(token.parent.kind === 205 /* ImportType */, "Token parent should be an ImportType");
+ Debug.assert(token.parent.kind === 207 /* ImportType */, "Token parent should be an ImportType");
return token.parent;
}
function doChange28(changes, sourceFile, importType) {
@@ -135600,12 +135858,12 @@ function isMemberCompletionKind(kind) {
function getJsxClosingTagCompletion(location, sourceFile) {
const jsxClosingElement = findAncestor(location, (node) => {
switch (node.kind) {
- case 290 /* JsxClosingElement */:
+ case 293 /* JsxClosingElement */:
return true;
case 43 /* SlashToken */:
case 31 /* GreaterThanToken */:
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return false;
default:
return "quit";
@@ -135924,10 +136182,10 @@ function createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, pro
const quotePreference = getQuotePreference(sourceFile, preferences);
const builderFlags = 33554432 /* OmitThisParameter */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0 /* None */);
switch (declaration.kind) {
- case 170 /* PropertySignature */:
- case 171 /* PropertyDeclaration */:
- case 173 /* MethodSignature */:
- case 174 /* MethodDeclaration */: {
+ case 171 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 175 /* MethodSignature */:
+ case 176 /* MethodDeclaration */: {
let effectiveType = type.flags & 1048576 /* Union */ && type.types.length < 10 ? checker.getUnionType(type.types, 2 /* Subtype */) : type;
if (effectiveType.flags & 1048576 /* Union */) {
const functionTypes = filter(effectiveType.types, (type2) => checker.getSignaturesOfType(type2, 0 /* Call */).length > 0);
@@ -136447,11 +136705,11 @@ function getContextualType(previousToken, position, sourceFile, checker) {
return getContextualTypeFromParent(previousToken, checker);
case 63 /* EqualsToken */:
switch (parent2.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return checker.getContextualType(parent2.initializer);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return checker.getTypeAtLocation(parent2.left);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return checker.getContextualTypeForJsxAttribute(parent2);
default:
return void 0;
@@ -136476,7 +136734,7 @@ function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) {
}
function isModuleSymbol(symbol) {
var _a2;
- return !!((_a2 = symbol.declarations) == null ? void 0 : _a2.some((d) => d.kind === 314 /* SourceFile */));
+ return !!((_a2 = symbol.declarations) == null ? void 0 : _a2.some((d) => d.kind === 317 /* SourceFile */));
}
function getCompletionData(program, log, sourceFile, compilerOptions, position, preferences, detailsEntryId, host, formatContext, cancellationToken) {
var _a2;
@@ -136510,7 +136768,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const typeExpression = tryGetTypeExpressionFromTag(tag);
if (typeExpression) {
currentToken = getTokenAtPosition(sourceFile, position);
- if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 356 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) {
+ if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 359 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) {
insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression);
}
}
@@ -136568,7 +136826,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
isRightOfDot = contextToken.kind === 24 /* DotToken */;
isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
propertyAccessToConvert = parent2;
node = propertyAccessToConvert.expression;
const leftmostAccessExpression = getLeftmostAccessExpression(propertyAccessToConvert);
@@ -136579,16 +136837,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return void 0;
}
break;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
node = parent2.left;
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
node = parent2.name;
break;
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
node = parent2;
break;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
node = parent2.getFirstToken(sourceFile);
Debug.assert(node.kind === 101 /* ImportKeyword */ || node.kind === 104 /* NewKeyword */);
break;
@@ -136596,51 +136854,51 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return void 0;
}
} else if (!importStatementCompletion) {
- if (parent2 && parent2.kind === 211 /* PropertyAccessExpression */) {
+ if (parent2 && parent2.kind === 213 /* PropertyAccessExpression */) {
contextToken = parent2;
parent2 = parent2.parent;
}
if (currentToken.parent === location) {
switch (currentToken.kind) {
case 31 /* GreaterThanToken */:
- if (currentToken.parent.kind === 287 /* JsxElement */ || currentToken.parent.kind === 289 /* JsxOpeningElement */) {
+ if (currentToken.parent.kind === 290 /* JsxElement */ || currentToken.parent.kind === 292 /* JsxOpeningElement */) {
location = currentToken;
}
break;
case 43 /* SlashToken */:
- if (currentToken.parent.kind === 288 /* JsxSelfClosingElement */) {
+ if (currentToken.parent.kind === 291 /* JsxSelfClosingElement */) {
location = currentToken;
}
break;
}
}
switch (parent2.kind) {
- case 290 /* JsxClosingElement */:
+ case 293 /* JsxClosingElement */:
if (contextToken.kind === 43 /* SlashToken */) {
isStartingCloseTag = true;
location = contextToken;
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (!binaryExpressionMayBeOpenTag(parent2)) {
break;
}
- case 288 /* JsxSelfClosingElement */:
- case 287 /* JsxElement */:
- case 289 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 290 /* JsxElement */:
+ case 292 /* JsxOpeningElement */:
isJsxIdentifierExpected = true;
if (contextToken.kind === 29 /* LessThanToken */) {
isRightOfOpenTag = true;
location = contextToken;
}
break;
- case 297 /* JsxExpression */:
- case 296 /* JsxSpreadAttribute */:
+ case 300 /* JsxExpression */:
+ case 299 /* JsxSpreadAttribute */:
if (previousToken.kind === 19 /* CloseBraceToken */ && currentToken.kind === 31 /* GreaterThanToken */) {
isJsxIdentifierExpected = true;
}
break;
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
if (parent2.initializer === previousToken && previousToken.end < position) {
isJsxIdentifierExpected = true;
break;
@@ -136744,13 +137002,13 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
};
function isTagWithTypeExpression(tag) {
switch (tag.kind) {
- case 349 /* JSDocParameterTag */:
- case 356 /* JSDocPropertyTag */:
- case 350 /* JSDocReturnTag */:
- case 352 /* JSDocTypeTag */:
- case 354 /* JSDocTypedefTag */:
+ case 352 /* JSDocParameterTag */:
+ case 359 /* JSDocPropertyTag */:
+ case 353 /* JSDocReturnTag */:
+ case 355 /* JSDocTypeTag */:
+ case 357 /* JSDocTypedefTag */:
return true;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return !!tag.constraint;
default:
return false;
@@ -136759,7 +137017,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
function tryGetTypeExpressionFromTag(tag) {
if (isTagWithTypeExpression(tag)) {
const typeExpression = isJSDocTemplateTag(tag) ? tag.constraint : tag.typeExpression;
- return typeExpression && typeExpression.kind === 318 /* JSDocTypeExpression */ ? typeExpression : void 0;
+ return typeExpression && typeExpression.kind === 321 /* JSDocTypeExpression */ ? typeExpression : void 0;
}
return void 0;
}
@@ -136789,7 +137047,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
symbols.push(exportedSymbol);
}
}
- if (!isTypeLocation && symbol.declarations && symbol.declarations.some((d) => d.kind !== 314 /* SourceFile */ && d.kind !== 270 /* ModuleDeclaration */ && d.kind !== 269 /* EnumDeclaration */)) {
+ if (!isTypeLocation && symbol.declarations && symbol.declarations.some((d) => d.kind !== 317 /* SourceFile */ && d.kind !== 273 /* ModuleDeclaration */ && d.kind !== 272 /* EnumDeclaration */)) {
let type = typeChecker3.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType();
let insertQuestionDot = false;
if (type.isNullableType()) {
@@ -136828,7 +137086,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
if (isRightOfQuestionDot && some(type.getCallSignatures())) {
isNewIdentifierLocation = true;
}
- const propertyAccess = node.kind === 205 /* ImportType */ ? node : node.parent;
+ const propertyAccess = node.kind === 207 /* ImportType */ ? node : node.parent;
if (inCheckedFile) {
const typeSymbols = type.getApparentProperties();
for (const symbol of typeSymbols) {
@@ -137064,7 +137322,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
}
}
}
- if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 314 /* SourceFile */) {
+ if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 317 /* SourceFile */) {
const thisType = typeChecker3.tryGetThisTypeAt(scopeNode, false, isClassLike(scopeNode.parent) ? scopeNode : void 0);
if (thisType && !isProbablyGlobalType(thisType, sourceFile, typeChecker3)) {
for (const symbol of getPropertiesForCompletion(thisType, typeChecker3)) {
@@ -137094,10 +137352,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
}
function isSnippetScope(scopeNode) {
switch (scopeNode.kind) {
- case 314 /* SourceFile */:
- case 229 /* TemplateExpression */:
- case 297 /* JsxExpression */:
- case 242 /* Block */:
+ case 317 /* SourceFile */:
+ case 231 /* TemplateExpression */:
+ case 300 /* JsxExpression */:
+ case 244 /* Block */:
return true;
default:
return isStatement(scopeNode);
@@ -137107,24 +137365,24 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return insideJsDocTagTypeExpression || !!importStatementCompletion && isTypeOnlyImportOrExportDeclaration(location.parent) || !isContextTokenValueLocation(contextToken) && (isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker3) || isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
}
function isContextTokenValueLocation(contextToken2) {
- return contextToken2 && (contextToken2.kind === 113 /* TypeOfKeyword */ && (contextToken2.parent.kind === 186 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 130 /* AssertsKeyword */ && contextToken2.parent.kind === 182 /* TypePredicate */);
+ return contextToken2 && (contextToken2.kind === 113 /* TypeOfKeyword */ && (contextToken2.parent.kind === 188 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 130 /* AssertsKeyword */ && contextToken2.parent.kind === 184 /* TypePredicate */);
}
function isContextTokenTypeLocation(contextToken2) {
if (contextToken2) {
const parentKind = contextToken2.parent.kind;
switch (contextToken2.kind) {
case 58 /* ColonToken */:
- return parentKind === 171 /* PropertyDeclaration */ || parentKind === 170 /* PropertySignature */ || parentKind === 168 /* Parameter */ || parentKind === 261 /* VariableDeclaration */ || isFunctionLikeKind(parentKind);
+ return parentKind === 172 /* PropertyDeclaration */ || parentKind === 171 /* PropertySignature */ || parentKind === 169 /* Parameter */ || parentKind === 263 /* VariableDeclaration */ || isFunctionLikeKind(parentKind);
case 63 /* EqualsToken */:
- return parentKind === 268 /* TypeAliasDeclaration */;
+ return parentKind === 271 /* TypeAliasDeclaration */;
case 129 /* AsKeyword */:
- return parentKind === 235 /* AsExpression */;
+ return parentKind === 237 /* AsExpression */;
case 29 /* LessThanToken */:
- return parentKind === 183 /* TypeReference */ || parentKind === 216 /* TypeAssertionExpression */;
+ return parentKind === 185 /* TypeReference */ || parentKind === 218 /* TypeAssertionExpression */;
case 95 /* ExtendsKeyword */:
- return parentKind === 167 /* TypeParameter */;
+ return parentKind === 168 /* TypeParameter */;
case 151 /* SatisfiesKeyword */:
- return parentKind === 239 /* SatisfiesExpression */;
+ return parentKind === 241 /* SatisfiesExpression */;
}
}
return false;
@@ -137299,14 +137557,14 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return true;
}
if (contextToken2.kind === 31 /* GreaterThanToken */ && contextToken2.parent) {
- if (location === contextToken2.parent && (location.kind === 289 /* JsxOpeningElement */ || location.kind === 288 /* JsxSelfClosingElement */)) {
+ if (location === contextToken2.parent && (location.kind === 292 /* JsxOpeningElement */ || location.kind === 291 /* JsxSelfClosingElement */)) {
return false;
}
- if (contextToken2.parent.kind === 289 /* JsxOpeningElement */) {
- return location.parent.kind !== 289 /* JsxOpeningElement */;
+ if (contextToken2.parent.kind === 292 /* JsxOpeningElement */) {
+ return location.parent.kind !== 292 /* JsxOpeningElement */;
}
- if (contextToken2.parent.kind === 290 /* JsxClosingElement */ || contextToken2.parent.kind === 288 /* JsxSelfClosingElement */) {
- return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 287 /* JsxElement */;
+ if (contextToken2.parent.kind === 293 /* JsxClosingElement */ || contextToken2.parent.kind === 291 /* JsxSelfClosingElement */) {
+ return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 290 /* JsxElement */;
}
}
return false;
@@ -137317,29 +137575,29 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const tokenKind = keywordForNode(contextToken);
switch (tokenKind) {
case 27 /* CommaToken */:
- return containingNodeKind === 213 /* CallExpression */ || containingNodeKind === 176 /* Constructor */ || containingNodeKind === 214 /* NewExpression */ || containingNodeKind === 209 /* ArrayLiteralExpression */ || containingNodeKind === 227 /* BinaryExpression */ || containingNodeKind === 184 /* FunctionType */ || containingNodeKind === 210 /* ObjectLiteralExpression */;
+ return containingNodeKind === 215 /* CallExpression */ || containingNodeKind === 178 /* Constructor */ || containingNodeKind === 216 /* NewExpression */ || containingNodeKind === 211 /* ArrayLiteralExpression */ || containingNodeKind === 229 /* BinaryExpression */ || containingNodeKind === 186 /* FunctionType */ || containingNodeKind === 212 /* ObjectLiteralExpression */;
case 20 /* OpenParenToken */:
- return containingNodeKind === 213 /* CallExpression */ || containingNodeKind === 176 /* Constructor */ || containingNodeKind === 214 /* NewExpression */ || containingNodeKind === 217 /* ParenthesizedExpression */ || containingNodeKind === 196 /* ParenthesizedType */;
+ return containingNodeKind === 215 /* CallExpression */ || containingNodeKind === 178 /* Constructor */ || containingNodeKind === 216 /* NewExpression */ || containingNodeKind === 219 /* ParenthesizedExpression */ || containingNodeKind === 198 /* ParenthesizedType */;
case 22 /* OpenBracketToken */:
- return containingNodeKind === 209 /* ArrayLiteralExpression */ || containingNodeKind === 181 /* IndexSignature */ || containingNodeKind === 166 /* ComputedPropertyName */;
+ return containingNodeKind === 211 /* ArrayLiteralExpression */ || containingNodeKind === 183 /* IndexSignature */ || containingNodeKind === 167 /* ComputedPropertyName */;
case 143 /* ModuleKeyword */:
case 144 /* NamespaceKeyword */:
case 101 /* ImportKeyword */:
return true;
case 24 /* DotToken */:
- return containingNodeKind === 270 /* ModuleDeclaration */;
+ return containingNodeKind === 273 /* ModuleDeclaration */;
case 18 /* OpenBraceToken */:
- return containingNodeKind === 264 /* ClassDeclaration */ || containingNodeKind === 265 /* StructDeclaration */ || containingNodeKind === 210 /* ObjectLiteralExpression */;
+ return containingNodeKind === 266 /* ClassDeclaration */ || containingNodeKind === 267 /* StructDeclaration */ || containingNodeKind === 212 /* ObjectLiteralExpression */;
case 63 /* EqualsToken */:
- return containingNodeKind === 261 /* VariableDeclaration */ || containingNodeKind === 227 /* BinaryExpression */;
+ return containingNodeKind === 263 /* VariableDeclaration */ || containingNodeKind === 229 /* BinaryExpression */;
case 15 /* TemplateHead */:
- return containingNodeKind === 229 /* TemplateExpression */;
+ return containingNodeKind === 231 /* TemplateExpression */;
case 16 /* TemplateMiddle */:
- return containingNodeKind === 240 /* TemplateSpan */;
+ return containingNodeKind === 242 /* TemplateSpan */;
case 133 /* AsyncKeyword */:
- return containingNodeKind === 174 /* MethodDeclaration */ || containingNodeKind === 306 /* ShorthandPropertyAssignment */;
+ return containingNodeKind === 176 /* MethodDeclaration */ || containingNodeKind === 309 /* ShorthandPropertyAssignment */;
case 41 /* AsteriskToken */:
- return containingNodeKind === 174 /* MethodDeclaration */;
+ return containingNodeKind === 176 /* MethodDeclaration */;
}
if (isClassMemberCompletionKeyword(tokenKind)) {
return true;
@@ -137377,7 +137635,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
completionKind = 0 /* ObjectPropertyDeclaration */;
let typeMembers;
let existingMembers;
- if (objectLikeContainer.kind === 210 /* ObjectLiteralExpression */) {
+ if (objectLikeContainer.kind === 212 /* ObjectLiteralExpression */) {
const instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker3);
if (instantiatedType === void 0) {
if (objectLikeContainer.flags & 33554432 /* InWithStatement */) {
@@ -137399,16 +137657,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
}
}
} else {
- Debug.assert(objectLikeContainer.kind === 206 /* ObjectBindingPattern */);
+ Debug.assert(objectLikeContainer.kind === 208 /* ObjectBindingPattern */);
isNewIdentifierLocation = false;
const rootDeclaration = getRootDeclaration(objectLikeContainer.parent);
if (!isVariableLike(rootDeclaration))
return Debug.fail("Root declaration is not variable-like.");
- let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 251 /* ForOfStatement */;
- if (!canGetType && rootDeclaration.kind === 168 /* Parameter */) {
+ let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 253 /* ForOfStatement */;
+ if (!canGetType && rootDeclaration.kind === 169 /* Parameter */) {
if (isExpression(rootDeclaration.parent)) {
canGetType = !!typeChecker3.getContextualType(rootDeclaration.parent);
- } else if (rootDeclaration.parent.kind === 174 /* MethodDeclaration */ || rootDeclaration.parent.kind === 178 /* SetAccessor */) {
+ } else if (rootDeclaration.parent.kind === 176 /* MethodDeclaration */ || rootDeclaration.parent.kind === 180 /* SetAccessor */) {
canGetType = isExpression(rootDeclaration.parent.parent) && !!typeChecker3.getContextualType(rootDeclaration.parent.parent);
}
}
@@ -137426,7 +137684,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const filteredMembers = filterObjectMembersList(typeMembers, Debug.checkDefined(existingMembers));
symbols = concatenate(symbols, filteredMembers);
setSortTextToOptionalMember();
- if (objectLikeContainer.kind === 210 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) {
+ if (objectLikeContainer.kind === 212 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) {
transformObjectLiteralMembersSortText(symbolsStartIndex);
collectObjectLiteralMethodSymbols(filteredMembers, objectLikeContainer);
}
@@ -137442,10 +137700,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
if (!isTypeKeywordTokenOrIdentifier(contextToken)) {
keywordFilters = 8 /* TypeKeyword */;
}
- const { moduleSpecifier } = namedImportsOrExports.kind === 278 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent;
+ const { moduleSpecifier } = namedImportsOrExports.kind === 281 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent;
if (!moduleSpecifier) {
isNewIdentifierLocation = true;
- return namedImportsOrExports.kind === 278 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */;
+ return namedImportsOrExports.kind === 281 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */;
}
const moduleSpecifierSymbol = typeChecker3.getSymbolAtLocation(moduleSpecifier);
if (!moduleSpecifierSymbol) {
@@ -137560,31 +137818,31 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
case 30 /* LessThanSlashToken */:
case 43 /* SlashToken */:
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */:
- case 295 /* JsxAttributes */:
- case 294 /* JsxAttribute */:
- case 296 /* JsxSpreadAttribute */:
- if (parent2 && (parent2.kind === 288 /* JsxSelfClosingElement */ || parent2.kind === 289 /* JsxOpeningElement */)) {
+ case 213 /* PropertyAccessExpression */:
+ case 298 /* JsxAttributes */:
+ case 297 /* JsxAttribute */:
+ case 299 /* JsxSpreadAttribute */:
+ if (parent2 && (parent2.kind === 291 /* JsxSelfClosingElement */ || parent2.kind === 292 /* JsxOpeningElement */)) {
if (contextToken2.kind === 31 /* GreaterThanToken */) {
const precedingToken = findPrecedingToken(contextToken2.pos, sourceFile, void 0);
if (!parent2.typeArguments || precedingToken && precedingToken.kind === 43 /* SlashToken */)
break;
}
return parent2;
- } else if (parent2.kind === 294 /* JsxAttribute */) {
+ } else if (parent2.kind === 297 /* JsxAttribute */) {
return parent2.parent.parent;
}
break;
case 10 /* StringLiteral */:
- if (parent2 && (parent2.kind === 294 /* JsxAttribute */ || parent2.kind === 296 /* JsxSpreadAttribute */)) {
+ if (parent2 && (parent2.kind === 297 /* JsxAttribute */ || parent2.kind === 299 /* JsxSpreadAttribute */)) {
return parent2.parent.parent;
}
break;
case 19 /* CloseBraceToken */:
- if (parent2 && parent2.kind === 297 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 294 /* JsxAttribute */) {
+ if (parent2 && parent2.kind === 300 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 297 /* JsxAttribute */) {
return parent2.parent.parent.parent;
}
- if (parent2 && parent2.kind === 296 /* JsxSpreadAttribute */) {
+ if (parent2 && parent2.kind === 299 /* JsxSpreadAttribute */) {
return parent2.parent.parent;
}
break;
@@ -137597,34 +137855,34 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const containingNodeKind = parent2.kind;
switch (contextToken2.kind) {
case 27 /* CommaToken */:
- return containingNodeKind === 261 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 244 /* VariableStatement */ || containingNodeKind === 269 /* EnumDeclaration */ || isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 267 /* InterfaceDeclaration */ || containingNodeKind === 207 /* ArrayBindingPattern */ || containingNodeKind === 268 /* TypeAliasDeclaration */ || isClassLike(parent2) && !!parent2.typeParameters && parent2.typeParameters.end >= contextToken2.pos;
+ return containingNodeKind === 263 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 246 /* VariableStatement */ || containingNodeKind === 272 /* EnumDeclaration */ || isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 270 /* InterfaceDeclaration */ || containingNodeKind === 209 /* ArrayBindingPattern */ || containingNodeKind === 271 /* TypeAliasDeclaration */ || isClassLike(parent2) && !!parent2.typeParameters && parent2.typeParameters.end >= contextToken2.pos;
case 24 /* DotToken */:
- return containingNodeKind === 207 /* ArrayBindingPattern */;
+ return containingNodeKind === 209 /* ArrayBindingPattern */;
case 58 /* ColonToken */:
- return containingNodeKind === 208 /* BindingElement */;
+ return containingNodeKind === 210 /* BindingElement */;
case 22 /* OpenBracketToken */:
- return containingNodeKind === 207 /* ArrayBindingPattern */;
+ return containingNodeKind === 209 /* ArrayBindingPattern */;
case 20 /* OpenParenToken */:
- return containingNodeKind === 301 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind);
+ return containingNodeKind === 304 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind);
case 18 /* OpenBraceToken */:
- return containingNodeKind === 269 /* EnumDeclaration */;
+ return containingNodeKind === 272 /* EnumDeclaration */;
case 29 /* LessThanToken */:
- return containingNodeKind === 264 /* ClassDeclaration */ || containingNodeKind === 232 /* ClassExpression */ || containingNodeKind === 267 /* InterfaceDeclaration */ || containingNodeKind === 268 /* TypeAliasDeclaration */ || isFunctionLikeKind(containingNodeKind);
+ return containingNodeKind === 266 /* ClassDeclaration */ || containingNodeKind === 234 /* ClassExpression */ || containingNodeKind === 270 /* InterfaceDeclaration */ || containingNodeKind === 271 /* TypeAliasDeclaration */ || isFunctionLikeKind(containingNodeKind);
case 125 /* StaticKeyword */:
- return containingNodeKind === 171 /* PropertyDeclaration */ && !isClassLike(parent2.parent);
+ return containingNodeKind === 172 /* PropertyDeclaration */ && !isClassLike(parent2.parent);
case 25 /* DotDotDotToken */:
- return containingNodeKind === 168 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 207 /* ArrayBindingPattern */;
+ return containingNodeKind === 169 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 209 /* ArrayBindingPattern */;
case 124 /* PublicKeyword */:
case 122 /* PrivateKeyword */:
case 123 /* ProtectedKeyword */:
- return containingNodeKind === 168 /* Parameter */ && !isConstructorDeclaration(parent2.parent);
+ return containingNodeKind === 169 /* Parameter */ && !isConstructorDeclaration(parent2.parent);
case 129 /* AsKeyword */:
- return containingNodeKind === 279 /* ImportSpecifier */ || containingNodeKind === 284 /* ExportSpecifier */ || containingNodeKind === 277 /* NamespaceImport */;
+ return containingNodeKind === 282 /* ImportSpecifier */ || containingNodeKind === 287 /* ExportSpecifier */ || containingNodeKind === 280 /* NamespaceImport */;
case 138 /* GetKeyword */:
case 152 /* SetKeyword */:
return !isFromObjectTypeDeclaration(contextToken2);
case 79 /* Identifier */:
- if (containingNodeKind === 279 /* ImportSpecifier */ && contextToken2 === parent2.name && contextToken2.text === "type") {
+ if (containingNodeKind === 282 /* ImportSpecifier */ && contextToken2 === parent2.name && contextToken2.text === "type") {
return false;
}
break;
@@ -137640,7 +137898,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
case 139 /* InferKeyword */:
return true;
case 155 /* TypeKeyword */:
- return containingNodeKind !== 279 /* ImportSpecifier */;
+ return containingNodeKind !== 282 /* ImportSpecifier */;
case 41 /* AsteriskToken */:
return isFunctionLike(contextToken2.parent) && !isMethodDeclaration(contextToken2.parent);
}
@@ -137675,7 +137933,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
if (ancestorClassLike && contextToken2 === previousToken && isPreviousPropertyDeclarationTerminated(contextToken2, position)) {
return false;
}
- const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 171 /* PropertyDeclaration */);
+ const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 172 /* PropertyDeclaration */);
if (ancestorPropertyDeclaraion && contextToken2 !== previousToken && isClassLike(previousToken.parent.parent) && position <= previousToken.end) {
if (isPreviousPropertyDeclarationTerminated(contextToken2, previousToken.end)) {
return false;
@@ -137689,7 +137947,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return contextToken2.kind !== 63 /* EqualsToken */ && (contextToken2.kind === 26 /* SemicolonToken */ || !positionsAreOnSameLine(contextToken2.end, position2, sourceFile));
}
function isFunctionLikeButNotConstructor(kind) {
- return isFunctionLikeKind(kind) && kind !== 176 /* Constructor */;
+ return isFunctionLikeKind(kind) && kind !== 178 /* Constructor */;
}
function isDotOfNumericLiteral(contextToken2) {
if (contextToken2.kind === 8 /* NumericLiteral */) {
@@ -137699,7 +137957,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return false;
}
function isVariableDeclarationListButNotTypeArgument(node2) {
- return node2.parent.kind === 262 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker3);
+ return node2.parent.kind === 264 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker3);
}
function filterObjectMembersList(contextualMemberSymbols, existingMembers) {
if (existingMembers.length === 0) {
@@ -137708,7 +137966,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const membersDeclaredBySpreadAssignment = new Set2();
const existingMemberNames = new Set2();
for (const m of existingMembers) {
- if (m.kind !== 305 /* PropertyAssignment */ && m.kind !== 306 /* ShorthandPropertyAssignment */ && m.kind !== 208 /* BindingElement */ && m.kind !== 174 /* MethodDeclaration */ && m.kind !== 177 /* GetAccessor */ && m.kind !== 178 /* SetAccessor */ && m.kind !== 307 /* SpreadAssignment */) {
+ if (m.kind !== 308 /* PropertyAssignment */ && m.kind !== 309 /* ShorthandPropertyAssignment */ && m.kind !== 210 /* BindingElement */ && m.kind !== 176 /* MethodDeclaration */ && m.kind !== 179 /* GetAccessor */ && m.kind !== 180 /* SetAccessor */ && m.kind !== 310 /* SpreadAssignment */) {
continue;
}
if (isCurrentlyEditingNode(m)) {
@@ -137787,7 +138045,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
function filterClassMembersList(baseSymbols, existingMembers, currentClassElementModifierFlags) {
const existingMemberNames = new Set2();
for (const m of existingMembers) {
- if (m.kind !== 171 /* PropertyDeclaration */ && m.kind !== 174 /* MethodDeclaration */ && m.kind !== 177 /* GetAccessor */ && m.kind !== 178 /* SetAccessor */) {
+ if (m.kind !== 172 /* PropertyDeclaration */ && m.kind !== 176 /* MethodDeclaration */ && m.kind !== 179 /* GetAccessor */ && m.kind !== 180 /* SetAccessor */) {
continue;
}
if (isCurrentlyEditingNode(m)) {
@@ -137813,7 +138071,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
if (isCurrentlyEditingNode(attr)) {
continue;
}
- if (attr.kind === 294 /* JsxAttribute */) {
+ if (attr.kind === 297 /* JsxAttribute */) {
seenNames.add(attr.name.escapedText);
} else if (isJsxSpreadAttribute(attr)) {
setMembersDeclaredBySpreadAssignment(attr, membersDeclaredBySpreadAssignment);
@@ -137893,7 +138151,7 @@ function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, js
var _keywordCompletions = [];
var allKeywordsCompletions = memoize(() => {
const res = [];
- for (let i = 81 /* FirstKeyword */; i <= 164 /* LastKeyword */; i++) {
+ for (let i = 81 /* FirstKeyword */; i <= 165 /* LastKeyword */; i++) {
res.push({
name: tokenToString(i),
kind: "keyword" /* keyword */,
@@ -138039,7 +138297,7 @@ function getPropertiesForCompletion(type, checker) {
}
function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) {
switch (location.kind) {
- case 357 /* SyntaxList */:
+ case 360 /* SyntaxList */:
return tryCast(location.parent, isObjectTypeDeclaration);
case 1 /* EndOfFileToken */:
const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration);
@@ -138098,7 +138356,7 @@ function tryGetTypeLiteralNode(node) {
case 26 /* SemicolonToken */:
case 27 /* CommaToken */:
case 79 /* Identifier */:
- if (parent2.kind === 170 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) {
+ if (parent2.kind === 171 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) {
return parent2.parent;
}
break;
@@ -138115,11 +138373,11 @@ function getConstraintOfTypeArgumentProperty(node, checker) {
if (!t)
return void 0;
switch (node.kind) {
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
return checker.getTypeOfPropertyOfContextualType(t, node.symbol.escapedName);
- case 193 /* IntersectionType */:
- case 187 /* TypeLiteral */:
- case 192 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 189 /* TypeLiteral */:
+ case 194 /* UnionType */:
return t;
}
}
@@ -138142,7 +138400,7 @@ function isValidTrigger(sourceFile, triggerCharacter, contextToken, position) {
case "/":
return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 43 /* SlashToken */ && isJsxClosingElement(contextToken.parent));
case " ":
- return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 314 /* SourceFile */;
+ return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 317 /* SourceFile */;
default:
return Debug.assertNever(triggerCharacter);
}
@@ -138238,8 +138496,8 @@ function getSingleLineReplacementSpanForImportCompletionNode(node) {
if (rangeIsOnSingleLine(top, sourceFile)) {
return createTextSpanFromNode(top, sourceFile);
}
- Debug.assert(top.kind !== 101 /* ImportKeyword */ && top.kind !== 279 /* ImportSpecifier */);
- const potentialSplitPoint = top.kind === 275 /* ImportDeclaration */ ? (_c = getPotentiallyInvalidImportSpecifier((_b = top.importClause) == null ? void 0 : _b.namedBindings)) != null ? _c : top.moduleSpecifier : top.moduleReference;
+ Debug.assert(top.kind !== 101 /* ImportKeyword */ && top.kind !== 282 /* ImportSpecifier */);
+ const potentialSplitPoint = top.kind === 278 /* ImportDeclaration */ ? (_c = getPotentiallyInvalidImportSpecifier((_b = top.importClause) == null ? void 0 : _b.namedBindings)) != null ? _c : top.moduleSpecifier : top.moduleReference;
const withoutModuleSpecifier = {
pos: top.getFirstToken().getStart(),
end: potentialSplitPoint.pos
@@ -138482,26 +138740,26 @@ var StringLiteralCompletionKind = /* @__PURE__ */ ((StringLiteralCompletionKind2
function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker3, compilerOptions, host, preferences) {
const parent2 = walkUpParentheses(node.parent);
switch (parent2.kind) {
- case 201 /* LiteralType */: {
+ case 203 /* LiteralType */: {
const grandParent = walkUpParentheses(parent2.parent);
switch (grandParent.kind) {
- case 234 /* ExpressionWithTypeArguments */:
- case 183 /* TypeReference */: {
+ case 236 /* ExpressionWithTypeArguments */:
+ case 185 /* TypeReference */: {
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
if (typeArgument) {
return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker3.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };
}
return void 0;
}
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
const { indexType, objectType } = grandParent;
if (!rangeContainsPosition(indexType, position)) {
return void 0;
}
return stringLiteralCompletionsFromProperties(typeChecker3.getTypeFromTypeNode(objectType));
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker3, preferences) };
- case 192 /* UnionType */: {
+ case 194 /* UnionType */: {
if (!isTypeReferenceNode(grandParent.parent)) {
return void 0;
}
@@ -138513,28 +138771,28 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
return void 0;
}
}
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) {
return stringLiteralCompletionsForObjectLiteral(typeChecker3, parent2.parent);
}
return fromContextualType();
- case 212 /* ElementAccessExpression */: {
+ case 214 /* ElementAccessExpression */: {
const { expression, argumentExpression } = parent2;
if (node === skipParentheses(argumentExpression)) {
return stringLiteralCompletionsFromProperties(typeChecker3.getTypeAtLocation(expression));
}
return void 0;
}
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 294 /* JsxAttribute */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 297 /* JsxAttribute */:
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
- const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 294 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
+ const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 297 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker3) || fromContextualType();
}
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 286 /* ExternalModuleReference */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 289 /* ExternalModuleReference */:
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker3, preferences) };
default:
return fromContextualType();
@@ -138545,9 +138803,9 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
}
function walkUpParentheses(node) {
switch (node.kind) {
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return walkUpParenthesizedTypes(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return walkUpParenthesizedExpressions(node);
default:
return node;
@@ -139125,14 +139383,14 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
if (cancellationToken)
cancellationToken.throwIfCancellationRequested();
switch (direct.kind) {
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isImportCall(direct)) {
handleImportCall(direct);
break;
}
if (!isAvailableThroughGlobal) {
const parent2 = direct.parent;
- if (exportKind === 2 /* ExportEquals */ && parent2.kind === 261 /* VariableDeclaration */) {
+ if (exportKind === 2 /* ExportEquals */ && parent2.kind === 263 /* VariableDeclaration */) {
const { name } = parent2;
if (name.kind === 79 /* Identifier */) {
directImports.push(name);
@@ -139143,28 +139401,28 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
break;
case 79 /* Identifier */:
break;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
handleNamespaceImport(direct, direct.name, hasSyntacticModifier(direct, 1 /* Export */), false);
break;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
directImports.push(direct);
const namedBindings = direct.importClause && direct.importClause.namedBindings;
- if (namedBindings && namedBindings.kind === 277 /* NamespaceImport */) {
+ if (namedBindings && namedBindings.kind === 280 /* NamespaceImport */) {
handleNamespaceImport(direct, namedBindings.name, false, true);
} else if (!isAvailableThroughGlobal && isDefaultImport(direct)) {
addIndirectUser(getSourceFileLikeForImportDeclaration(direct));
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
if (!direct.exportClause) {
handleDirectImports(getContainingModuleSymbol(direct, checker));
- } else if (direct.exportClause.kind === 283 /* NamespaceExport */) {
+ } else if (direct.exportClause.kind === 286 /* NamespaceExport */) {
addIndirectUser(getSourceFileLikeForImportDeclaration(direct), true);
} else {
directImports.push(direct);
}
break;
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported2(direct)) {
addIndirectUser(direct.getSourceFile(), true);
}
@@ -139193,7 +139451,7 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
directImports.push(importDeclaration);
} else if (!isAvailableThroughGlobal) {
const sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration);
- Debug.assert(sourceFileLike.kind === 314 /* SourceFile */ || sourceFileLike.kind === 270 /* ModuleDeclaration */);
+ Debug.assert(sourceFileLike.kind === 317 /* SourceFile */ || sourceFileLike.kind === 273 /* ModuleDeclaration */);
if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) {
addIndirectUser(sourceFileLike, true);
} else {
@@ -139239,7 +139497,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
}
return { importSearches, singleReferences };
function handleImport(decl) {
- if (decl.kind === 274 /* ImportEqualsDeclaration */) {
+ if (decl.kind === 277 /* ImportEqualsDeclaration */) {
if (isExternalModuleImportEquals(decl)) {
handleNamespaceImportLike(decl.name);
}
@@ -139249,7 +139507,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
handleNamespaceImportLike(decl);
return;
}
- if (decl.kind === 205 /* ImportType */) {
+ if (decl.kind === 207 /* ImportType */) {
if (decl.qualifier) {
const firstIdentifier = getFirstIdentifier(decl.qualifier);
if (firstIdentifier.escapedText === symbolName(exportSymbol)) {
@@ -139263,7 +139521,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) {
return;
}
- if (decl.kind === 281 /* ExportDeclaration */) {
+ if (decl.kind === 284 /* ExportDeclaration */) {
if (decl.exportClause && isNamedExports(decl.exportClause)) {
searchForNamedImport(decl.exportClause);
}
@@ -139272,10 +139530,10 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
const { name, namedBindings } = decl.importClause || { name: void 0, namedBindings: void 0 };
if (namedBindings) {
switch (namedBindings.kind) {
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
handleNamespaceImportLike(namedBindings.name);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) {
searchForNamedImport(namedBindings);
}
@@ -139309,7 +139567,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
addSearch(name, checker.getSymbolAtLocation(name));
}
} else {
- const localSymbol = element.kind === 284 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name);
+ const localSymbol = element.kind === 287 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name);
addSearch(name, localSymbol);
}
}
@@ -139332,7 +139590,7 @@ function findModuleReferences(program, sourceFiles, searchModuleSymbol) {
const checker = program.getTypeChecker();
for (const referencingFile of sourceFiles) {
const searchSourceFile = searchModuleSymbol.valueDeclaration;
- if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 314 /* SourceFile */) {
+ if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 317 /* SourceFile */) {
for (const ref of referencingFile.referencedFiles) {
if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) {
refs.push({ kind: "reference", referencingFile, ref });
@@ -139374,7 +139632,7 @@ function getDirectImportsMap(sourceFiles, checker, cancellationToken) {
return map2;
}
function forEachPossibleImportOrExportStatement(sourceFileLike, action) {
- return forEach(sourceFileLike.kind === 314 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action));
+ return forEach(sourceFileLike.kind === 317 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action));
}
function forEachImport(sourceFile, action) {
if (sourceFile.externalModuleIndicator || sourceFile.imports !== void 0) {
@@ -139384,15 +139642,15 @@ function forEachImport(sourceFile, action) {
} else {
forEachPossibleImportOrExportStatement(sourceFile, (statement) => {
switch (statement.kind) {
- case 281 /* ExportDeclaration */:
- case 275 /* ImportDeclaration */: {
+ case 284 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */: {
const decl = statement;
if (decl.moduleSpecifier && isStringLiteral(decl.moduleSpecifier)) {
action(decl, decl.moduleSpecifier);
}
break;
}
- case 274 /* ImportEqualsDeclaration */: {
+ case 277 /* ImportEqualsDeclaration */: {
const decl = statement;
if (isExternalModuleImportEquals(decl)) {
action(decl, decl.moduleReference.expression);
@@ -139410,7 +139668,7 @@ function getImportOrExportSymbol(node, symbol, checker, comingFromExport) {
const { parent: parent2 } = node;
const grandparent = parent2.parent;
if (symbol.exportSymbol) {
- if (parent2.kind === 211 /* PropertyAccessExpression */) {
+ if (parent2.kind === 213 /* PropertyAccessExpression */) {
return ((_a2 = symbol.declarations) == null ? void 0 : _a2.some((d) => d === parent2)) && isBinaryExpression(grandparent) ? getSpecialPropertyExport(grandparent, false) : void 0;
} else {
return exportInfo(symbol.exportSymbol, getExportKindForDeclaration(parent2));
@@ -139514,15 +139772,15 @@ function getExportNode(parent2, node) {
function isNodeImport(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return parent2.name === node && isExternalModuleImportEquals(parent2);
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return !parent2.propertyName;
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
Debug.assert(parent2.name === node);
return true;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(parent2.parent.parent);
default:
return false;
@@ -139553,21 +139811,21 @@ function getContainingModuleSymbol(importer, checker) {
return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol);
}
function getSourceFileLikeForImportDeclaration(node) {
- if (node.kind === 213 /* CallExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
return node.getSourceFile();
}
const { parent: parent2 } = node;
- if (parent2.kind === 314 /* SourceFile */) {
+ if (parent2.kind === 317 /* SourceFile */) {
return parent2;
}
- Debug.assert(parent2.kind === 271 /* ModuleBlock */);
+ Debug.assert(parent2.kind === 274 /* ModuleBlock */);
return cast(parent2.parent, isAmbientModuleDeclaration);
}
function isAmbientModuleDeclaration(node) {
- return node.kind === 270 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */;
+ return node.kind === 273 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */;
}
function isExternalModuleImportEquals(eq) {
- return eq.moduleReference.kind === 286 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */;
+ return eq.moduleReference.kind === 289 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */;
}
// src/services/findAllReferences.ts
@@ -139637,28 +139895,28 @@ function getContextNode(node) {
if (!node)
return void 0;
switch (node.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return !isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : isVariableStatement(node.parent.parent) ? node.parent.parent : isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getContextNode(node.parent.parent);
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return node.parent.parent.parent;
- case 284 /* ExportSpecifier */:
- case 277 /* NamespaceImport */:
+ case 287 /* ExportSpecifier */:
+ case 280 /* NamespaceImport */:
return node.parent.parent;
- case 276 /* ImportClause */:
- case 283 /* NamespaceExport */:
+ case 279 /* ImportClause */:
+ case 286 /* NamespaceExport */:
return node.parent;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isExpressionStatement(node.parent) ? node.parent : node;
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
return {
start: node.initializer,
end: node.expression
};
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(
findAncestor(
node.parent,
@@ -139700,7 +139958,7 @@ function getImplementationsAtPosition(program, cancellationToken, sourceFiles, s
const node = getTouchingPropertyName(sourceFile, position);
let referenceEntries;
const entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position);
- if (node.parent.kind === 211 /* PropertyAccessExpression */ || node.parent.kind === 208 /* BindingElement */ || node.parent.kind === 212 /* ElementAccessExpression */ || node.kind === 107 /* SuperKeyword */) {
+ if (node.parent.kind === 213 /* PropertyAccessExpression */ || node.parent.kind === 210 /* BindingElement */ || node.parent.kind === 214 /* ElementAccessExpression */ || node.kind === 107 /* SuperKeyword */) {
referenceEntries = entries && [...entries];
} else if (entries) {
const queue = createQueue(entries);
@@ -139721,11 +139979,11 @@ function getImplementationsAtPosition(program, cancellationToken, sourceFiles, s
return map(referenceEntries, (entry) => toImplementationLocation(entry, checker));
}
function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return void 0;
}
const checker = program.getTypeChecker();
- if (node.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.parent.kind === 309 /* ShorthandPropertyAssignment */) {
const result = [];
Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, (node2) => result.push(nodeEntry(node2)));
return result;
@@ -139916,12 +140174,12 @@ function implementationKindDisplayParts(node, checker) {
const symbol = checker.getSymbolAtLocation(isDeclaration(node) && node.name ? node.name : node);
if (symbol) {
return getDefinitionKindAndDisplayParts(symbol, checker, node);
- } else if (node.kind === 210 /* ObjectLiteralExpression */) {
+ } else if (node.kind === 212 /* ObjectLiteralExpression */) {
return {
kind: "interface" /* interfaceElement */,
displayParts: [punctuationPart(20 /* OpenParenToken */), textPart("object literal"), punctuationPart(21 /* CloseParenToken */)]
};
- } else if (node.kind === 232 /* ClassExpression */) {
+ } else if (node.kind === 234 /* ClassExpression */) {
return {
kind: "local class" /* localClassElement */,
displayParts: [punctuationPart(20 /* OpenParenToken */), textPart("anonymous local class"), punctuationPart(21 /* CloseParenToken */)]
@@ -139979,47 +140237,47 @@ function declarationIsWriteAccess(decl) {
if (!!(decl.flags & 16777216 /* Ambient */))
return true;
switch (decl.kind) {
- case 227 /* BinaryExpression */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 229 /* BinaryExpression */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
case 89 /* DefaultKeyword */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 284 /* ExportSpecifier */:
- case 276 /* ImportClause */:
- case 274 /* ImportEqualsDeclaration */:
- case 279 /* ImportSpecifier */:
- case 267 /* InterfaceDeclaration */:
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
- case 294 /* JsxAttribute */:
- case 270 /* ModuleDeclaration */:
- case 273 /* NamespaceExportDeclaration */:
- case 277 /* NamespaceImport */:
- case 283 /* NamespaceExport */:
- case 168 /* Parameter */:
- case 306 /* ShorthandPropertyAssignment */:
- case 268 /* TypeAliasDeclaration */:
- case 167 /* TypeParameter */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 287 /* ExportSpecifier */:
+ case 279 /* ImportClause */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 282 /* ImportSpecifier */:
+ case 270 /* InterfaceDeclaration */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 297 /* JsxAttribute */:
+ case 273 /* ModuleDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
+ case 280 /* NamespaceImport */:
+ case 286 /* NamespaceExport */:
+ case 169 /* Parameter */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 271 /* TypeAliasDeclaration */:
+ case 168 /* TypeParameter */:
return true;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return !isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return !!decl.body;
- case 261 /* VariableDeclaration */:
- case 171 /* PropertyDeclaration */:
+ case 263 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
return !!decl.initializer || isCatchClause(decl.parent);
- case 173 /* MethodSignature */:
- case 170 /* PropertySignature */:
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */:
+ case 175 /* MethodSignature */:
+ case 171 /* PropertySignature */:
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
return false;
default:
return Debug.failBadSyntaxKind(decl);
@@ -140208,9 +140466,9 @@ var Core;
if (symbol.declarations) {
for (const decl of symbol.declarations) {
switch (decl.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (sourceFilesSet.has(decl.getSourceFile().fileName)) {
references.push(nodeEntry(decl.name));
}
@@ -140300,7 +140558,7 @@ var Core;
}
function getSpecialSearchKind(node) {
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
case 136 /* ConstructorKeyword */:
return SpecialSearchKind.Constructor;
case 79 /* Identifier */:
@@ -140476,7 +140734,7 @@ var Core;
}
function getSymbolScope(symbol) {
const { declarations, flags, parent: parent2, valueDeclaration } = symbol;
- if (valueDeclaration && (valueDeclaration.kind === 218 /* FunctionExpression */ || valueDeclaration.kind === 232 /* ClassExpression */)) {
+ if (valueDeclaration && (valueDeclaration.kind === 220 /* FunctionExpression */ || valueDeclaration.kind === 234 /* ClassExpression */)) {
return valueDeclaration;
}
if (!declarations) {
@@ -140485,7 +140743,7 @@ var Core;
if (flags & (4 /* Property */ | 8192 /* Method */)) {
const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d, 8 /* Private */) || isPrivateIdentifierClassElementDeclaration(d));
if (privateDeclaration) {
- return getAncestor(privateDeclaration, 264 /* ClassDeclaration */);
+ return getAncestor(privateDeclaration, 266 /* ClassDeclaration */);
}
return void 0;
}
@@ -140502,7 +140760,7 @@ var Core;
if (scope && scope !== container) {
return void 0;
}
- if (!container || container.kind === 314 /* SourceFile */ && !isExternalOrCommonJsModule(container)) {
+ if (!container || container.kind === 317 /* SourceFile */ && !isExternalOrCommonJsModule(container)) {
return void 0;
}
scope = container;
@@ -140709,7 +140967,7 @@ var Core;
default:
Debug.assertNever(state.specialSearchKind);
}
- if (isInJSFile(referenceLocation) && referenceLocation.parent.kind === 208 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(referenceLocation.parent.parent.parent)) {
+ if (isInJSFile(referenceLocation) && referenceLocation.parent.kind === 210 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(referenceLocation.parent.parent.parent)) {
referenceSymbol = referenceLocation.parent.symbol;
if (!referenceSymbol)
return;
@@ -140846,14 +141104,14 @@ var Core;
if (constructorSymbol && constructorSymbol.declarations) {
for (const decl of constructorSymbol.declarations) {
const ctrKeyword = findChildOfKind(decl, 136 /* ConstructorKeyword */, sourceFile);
- Debug.assert(decl.kind === 176 /* Constructor */ && !!ctrKeyword);
+ Debug.assert(decl.kind === 178 /* Constructor */ && !!ctrKeyword);
addNode(ctrKeyword);
}
}
if (classSymbol.exports) {
classSymbol.exports.forEach((member) => {
const decl = member.valueDeclaration;
- if (decl && decl.kind === 174 /* MethodDeclaration */) {
+ if (decl && decl.kind === 176 /* MethodDeclaration */) {
const body = decl.body;
if (body) {
forEachDescendantOfKind(body, 109 /* ThisKeyword */, (thisKeyword) => {
@@ -140875,7 +141133,7 @@ var Core;
return;
}
for (const decl of constructor.declarations) {
- Debug.assert(decl.kind === 176 /* Constructor */);
+ Debug.assert(decl.kind === 178 /* Constructor */);
const body = decl.body;
if (body) {
forEachDescendantOfKind(body, 107 /* SuperKeyword */, (node) => {
@@ -140904,7 +141162,7 @@ var Core;
if (refNode.kind !== 79 /* Identifier */) {
return;
}
- if (refNode.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (refNode.parent.kind === 309 /* ShorthandPropertyAssignment */) {
getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2);
}
const containingClass = getContainingClassIfInHeritageClause(refNode);
@@ -140919,7 +141177,7 @@ var Core;
addIfImplementation(typeHavingNode.initializer);
} else if (isFunctionLike(typeHavingNode) && typeHavingNode.body) {
const body = typeHavingNode.body;
- if (body.kind === 242 /* Block */) {
+ if (body.kind === 244 /* Block */) {
forEachReturnStatement(body, (returnStatement) => {
if (returnStatement.expression)
addIfImplementation(returnStatement.expression);
@@ -140941,13 +141199,13 @@ var Core;
}
function isImplementationExpression(node) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isImplementationExpression(node.expression);
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 232 /* ClassExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 234 /* ClassExpression */:
+ case 211 /* ArrayLiteralExpression */:
return true;
default:
return false;
@@ -140977,13 +141235,13 @@ var Core;
}
let staticFlag = 32 /* Static */;
switch (searchSpaceNode.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
staticFlag &= getSyntacticModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
@@ -141001,38 +141259,38 @@ var Core;
return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references }];
}
function isParameterName(node) {
- return node.kind === 79 /* Identifier */ && node.parent.kind === 168 /* Parameter */ && node.parent.name === node;
+ return node.kind === 79 /* Identifier */ && node.parent.kind === 169 /* Parameter */ && node.parent.name === node;
}
function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) {
let searchSpaceNode = getThisContainer(thisOrSuperKeyword, false);
let staticFlag = 32 /* Static */;
switch (searchSpaceNode.kind) {
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isObjectLiteralMethod(searchSpaceNode)) {
staticFlag &= getSyntacticModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
}
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
staticFlag &= getSyntacticModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) {
return void 0;
}
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
break;
default:
return void 0;
}
- const references = flatMap(searchSpaceNode.kind === 314 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => {
+ const references = flatMap(searchSpaceNode.kind === 317 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => {
cancellationToken.throwIfCancellationRequested();
return getPossibleSymbolReferenceNodes(sourceFile, "this", isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter((node) => {
if (!isThis(node)) {
@@ -141040,19 +141298,19 @@ var Core;
}
const container = getThisContainer(node, false);
switch (searchSpaceNode.kind) {
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
return searchSpaceNode.symbol === container.symbol;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol;
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 210 /* ObjectLiteralExpression */:
- case 265 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 212 /* ObjectLiteralExpression */:
+ case 267 /* StructDeclaration */:
return container.parent && searchSpaceNode.symbol === container.parent.symbol && isStatic(container) === !!staticFlag;
- case 314 /* SourceFile */:
- return container.kind === 314 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node);
+ case 317 /* SourceFile */:
+ return container.kind === 317 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node);
}
});
}).map((n) => nodeEntry(n));
@@ -141140,7 +141398,7 @@ var Core;
Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */));
return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]);
}
- const exportSpecifier = getDeclarationOfKind(symbol, 284 /* ExportSpecifier */);
+ const exportSpecifier = getDeclarationOfKind(symbol, 287 /* ExportSpecifier */);
if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) {
const localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier);
if (localSymbol) {
@@ -141168,7 +141426,7 @@ var Core;
return firstDefined(checker.getRootSymbols(sym), (rootSymbol) => cbSymbol(sym, rootSymbol, void 0, kind) || (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */) && allowBaseTypes(rootSymbol) ? getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, (base) => cbSymbol(sym, rootSymbol, base, kind)) : void 0));
}
function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol2, checker2) {
- const bindingElement = getDeclarationOfKind(symbol2, 208 /* BindingElement */);
+ const bindingElement = getDeclarationOfKind(symbol2, 210 /* BindingElement */);
if (bindingElement && isObjectBindingElementWithoutPropertyName(bindingElement)) {
return getPropertySymbolFromBindingElement(checker2, bindingElement);
}
@@ -141346,9 +141604,9 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
}
if (searchOtherFilesOnly && every(symbol.declarations, (d) => d.getSourceFile().fileName === sourceFile.fileName))
return void 0;
- if (parent2.kind === 213 /* CallExpression */ || parent2.kind === 220 /* EtsComponentExpression */ && isCalledStructDeclaration(symbol.getDeclarations())) {
+ if (parent2.kind === 215 /* CallExpression */ || parent2.kind === 222 /* EtsComponentExpression */ && isCalledStructDeclaration(symbol.getDeclarations())) {
const declarations = symbol.getDeclarations();
- if ((declarations == null ? void 0 : declarations.length) && declarations[0].kind === 265 /* StructDeclaration */) {
+ if ((declarations == null ? void 0 : declarations.length) && declarations[0].kind === 267 /* StructDeclaration */) {
return getDefinitionFromSymbol(typeChecker3, symbol, node);
}
}
@@ -141368,7 +141626,7 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
return node.kind === 107 /* SuperKeyword */ ? [sigInfo, ...defs] : [...defs, sigInfo];
}
}
- if (node.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.parent.kind === 309 /* ShorthandPropertyAssignment */) {
const shorthandSymbol = typeChecker3.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
const definitions = (shorthandSymbol == null ? void 0 : shorthandSymbol.declarations) ? shorthandSymbol.declarations.map((decl) => createDefinitionInfo(decl, typeChecker3, shorthandSymbol, node, false, failedAliasResolution)) : emptyArray;
return concatenate(definitions, getDefinitionFromObjectLiteralElement(typeChecker3, node) || emptyArray);
@@ -141516,7 +141774,7 @@ function shouldSkipAlias(node, declaration) {
if (node.parent === declaration) {
return true;
}
- if (declaration.kind === 277 /* NamespaceImport */) {
+ if (declaration.kind === 280 /* NamespaceImport */) {
return false;
}
return true;
@@ -141594,19 +141852,19 @@ function isDefinitionVisible(checker, declaration) {
if (hasInitializer(declaration.parent) && declaration.parent.initializer === declaration)
return isDefinitionVisible(checker, declaration.parent);
switch (declaration.kind) {
- case 171 /* PropertyDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
if (hasEffectiveModifier(declaration, 8 /* Private */))
return false;
- case 176 /* Constructor */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 210 /* ObjectLiteralExpression */:
- case 232 /* ClassExpression */:
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 212 /* ObjectLiteralExpression */:
+ case 234 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
return isDefinitionVisible(checker, declaration.parent);
default:
return false;
@@ -141641,9 +141899,9 @@ function tryGetSignatureDeclaration(typeChecker3, node) {
}
function isConstructorLike(node) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 178 /* Constructor */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
return true;
default:
return false;
@@ -141680,14 +141938,14 @@ function provideInlayHints(context) {
return;
}
switch (node.kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 219 /* ArrowFunction */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
if (!textSpanIntersectsWith(span, node.pos, node.getFullWidth())) {
@@ -141827,7 +142085,7 @@ function provideInlayHints(context) {
}
function isHintableLiteral(node) {
switch (node.kind) {
- case 225 /* PrefixUnaryExpression */: {
+ case 227 /* PrefixUnaryExpression */: {
const operand = node.operand;
return isLiteralExpression(operand) || isIdentifier(operand) && isInfinityOrNaNString(operand.escapedText);
}
@@ -141835,7 +142093,7 @@ function provideInlayHints(context) {
case 96 /* FalseKeyword */:
case 105 /* NullKeyword */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return true;
case 79 /* Identifier */: {
const name = node.escapedText;
@@ -142035,8 +142293,8 @@ function getJsDocCommentsFromDeclarations(declarations, checker) {
const parts = [];
forEachUnique(declarations, (declaration) => {
for (const jsdoc of getCommentHavingNodes(declaration)) {
- const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 336 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc"));
- if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 354 /* JSDocTypedefTag */ && declaration.kind !== 347 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 354 /* JSDocTypedefTag */ || t.kind === 347 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 349 /* JSDocParameterTag */ || t.kind === 350 /* JSDocReturnTag */)) {
+ const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 339 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc"));
+ if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 357 /* JSDocTypedefTag */ && declaration.kind !== 350 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 357 /* JSDocTypedefTag */ || t.kind === 350 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 352 /* JSDocParameterTag */ || t.kind === 353 /* JSDocReturnTag */)) {
continue;
}
let newparts = jsdoc.comment ? getDisplayPartsFromComment(jsdoc.comment, checker) : [];
@@ -142055,11 +142313,11 @@ function isIdenticalListOfDisplayParts(parts1, parts2) {
}
function getCommentHavingNodes(declaration) {
switch (declaration.kind) {
- case 349 /* JSDocParameterTag */:
- case 356 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
+ case 359 /* JSDocPropertyTag */:
return [declaration];
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
return [declaration, declaration.parent];
default:
return getJSDocCommentsAndTags(declaration);
@@ -142069,7 +142327,7 @@ function getJsDocTagsFromDeclarations(declarations, checker) {
const infos = [];
forEachUnique(declarations, (declaration) => {
const tags = getJSDocTags(declaration);
- if (tags.some((t) => t.kind === 354 /* JSDocTypedefTag */ || t.kind === 347 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 349 /* JSDocParameterTag */ || t.kind === 350 /* JSDocReturnTag */)) {
+ if (tags.some((t) => t.kind === 357 /* JSDocTypedefTag */ || t.kind === 350 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 352 /* JSDocParameterTag */ || t.kind === 353 /* JSDocReturnTag */)) {
return;
}
for (const tag of tags) {
@@ -142084,18 +142342,18 @@ function getDisplayPartsFromComment(comment, checker) {
}
return flatMap(
comment,
- (node) => node.kind === 330 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker)
+ (node) => node.kind === 333 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker)
);
}
function getCommentDisplayParts(tag, checker) {
const { comment, kind } = tag;
const namePart = getTagNameDisplayPart(kind);
switch (kind) {
- case 338 /* JSDocImplementsTag */:
+ case 341 /* JSDocImplementsTag */:
return withNode(tag.class);
- case 337 /* JSDocAugmentsTag */:
+ case 340 /* JSDocAugmentsTag */:
return withNode(tag.class);
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
const templateTag = tag;
const displayParts = [];
if (templateTag.constraint) {
@@ -142117,13 +142375,13 @@ function getCommentDisplayParts(tag, checker) {
displayParts.push(...[spacePart(), ...getDisplayPartsFromComment(comment, checker)]);
}
return displayParts;
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return withNode(tag.typeExpression);
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */:
- case 355 /* JSDocSeeTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
+ case 358 /* JSDocSeeTag */:
const { name } = tag;
return name ? withNode(name) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker);
default:
@@ -142146,14 +142404,14 @@ function getCommentDisplayParts(tag, checker) {
}
function getTagNameDisplayPart(kind) {
switch (kind) {
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
return parameterNamePart;
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
return propertyNamePart;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return typeParameterNamePart;
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
return typeAliasNamePart;
default:
return textPart;
@@ -142278,47 +142536,47 @@ function getCommentOwnerInfo(tokenAtPos, options) {
}
function getCommentOwnerInfoWorker(commentOwner, options) {
switch (commentOwner.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 173 /* MethodSignature */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 175 /* MethodSignature */:
+ case 221 /* ArrowFunction */:
const host = commentOwner;
return { commentOwner, parameters: host.parameters, hasReturn: hasReturn(host, options) };
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getCommentOwnerInfoWorker(commentOwner.initializer, options);
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 268 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 271 /* TypeAliasDeclaration */:
return { commentOwner };
- case 170 /* PropertySignature */: {
+ case 171 /* PropertySignature */: {
const host2 = commentOwner;
return host2.type && isFunctionTypeNode(host2.type) ? { commentOwner, parameters: host2.type.parameters, hasReturn: hasReturn(host2.type, options) } : { commentOwner };
}
- case 244 /* VariableStatement */: {
+ case 246 /* VariableStatement */: {
const varStatement = commentOwner;
const varDeclarations = varStatement.declarationList.declarations;
const host2 = varDeclarations.length === 1 && varDeclarations[0].initializer ? getRightHandSideOfAssignment(varDeclarations[0].initializer) : void 0;
return host2 ? { commentOwner, parameters: host2.parameters, hasReturn: hasReturn(host2, options) } : { commentOwner };
}
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return "quit";
- case 270 /* ModuleDeclaration */:
- return commentOwner.parent.kind === 270 /* ModuleDeclaration */ ? void 0 : { commentOwner };
- case 245 /* ExpressionStatement */:
+ case 273 /* ModuleDeclaration */:
+ return commentOwner.parent.kind === 273 /* ModuleDeclaration */ ? void 0 : { commentOwner };
+ case 247 /* ExpressionStatement */:
return getCommentOwnerInfoWorker(commentOwner.expression, options);
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const be = commentOwner;
if (getAssignmentDeclarationKind(be) === 0 /* None */) {
return "quit";
}
return isFunctionLike(be.right) ? { commentOwner, parameters: be.right.parameters, hasReturn: hasReturn(be.right, options) } : { commentOwner };
}
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
const init = commentOwner.initializer;
if (init && (isFunctionExpression(init) || isArrowFunction(init))) {
return { commentOwner, parameters: init.parameters, hasReturn: hasReturn(init, options) };
@@ -142329,14 +142587,14 @@ function hasReturn(node, options) {
return !!(options == null ? void 0 : options.generateReturnInDocTemplate) && (isFunctionTypeNode(node) || isArrowFunction(node) && isExpression(node.body) || isFunctionLikeDeclaration(node) && node.body && isBlock(node.body) && !!forEachReturnStatement(node.body, (n) => n));
}
function getRightHandSideOfAssignment(rightHandSide) {
- while (rightHandSide.kind === 217 /* ParenthesizedExpression */) {
+ while (rightHandSide.kind === 219 /* ParenthesizedExpression */) {
rightHandSide = rightHandSide.expression;
}
switch (rightHandSide.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return rightHandSide;
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return find(rightHandSide.members, isConstructorDeclaration);
}
}
@@ -142660,11 +142918,11 @@ function compareIdentifiers(s1, s2) {
function getModuleSpecifierExpression(declaration) {
var _a2;
switch (declaration.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return (_a2 = tryCast(declaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return declaration.moduleSpecifier;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return declaration.declarationList.declarations[0].initializer.arguments[0];
}
}
@@ -142691,19 +142949,19 @@ function compareImportKind(s1, s2) {
function getImportKindOrder(s1) {
var _a2;
switch (s1.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
if (!s1.importClause)
return 0;
if (s1.importClause.isTypeOnly)
return 1;
- if (((_a2 = s1.importClause.namedBindings) == null ? void 0 : _a2.kind) === 277 /* NamespaceImport */)
+ if (((_a2 = s1.importClause.namedBindings) == null ? void 0 : _a2.kind) === 280 /* NamespaceImport */)
return 2;
if (s1.importClause.name)
return 3;
return 4;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return 5;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return 6;
}
}
@@ -142877,21 +143135,21 @@ function createOutliningSpanFromBounds(pos, end, kind) {
}
function getOutliningSpanForNode(n, sourceFile) {
switch (n.kind) {
- case 242 /* Block */:
+ case 244 /* Block */:
if (isFunctionLike(n.parent)) {
return functionSpan(n.parent, n, sourceFile);
}
switch (n.parent.kind) {
- case 247 /* DoStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 249 /* ForStatement */:
- case 246 /* IfStatement */:
- case 248 /* WhileStatement */:
- case 255 /* WithStatement */:
- case 301 /* CatchClause */:
+ case 249 /* DoStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 248 /* IfStatement */:
+ case 250 /* WhileStatement */:
+ case 257 /* WithStatement */:
+ case 304 /* CatchClause */:
return spanForNode(n.parent);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
const tryStatement = n.parent;
if (tryStatement.tryBlock === n) {
return spanForNode(n.parent);
@@ -142903,43 +143161,43 @@ function getOutliningSpanForNode(n, sourceFile) {
default:
return createOutliningSpan(createTextSpanFromNode(n, sourceFile), "code" /* Code */);
}
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return spanForNode(n.parent);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 272 /* CaseBlock */:
- case 187 /* TypeLiteral */:
- case 206 /* ObjectBindingPattern */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 275 /* CaseBlock */:
+ case 189 /* TypeLiteral */:
+ case 208 /* ObjectBindingPattern */:
return spanForNode(n);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
return spanForNode(n, false, !isTupleTypeNode(n.parent), 22 /* OpenBracketToken */);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return spanForNodeArray(n.statements);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return spanForObjectOrArrayLiteral(n);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */);
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return spanForJSXElement(n);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return spanForJSXFragment(n);
- case 288 /* JsxSelfClosingElement */:
- case 289 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
return spanForJSXAttributes(n.attributes);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
case 14 /* NoSubstitutionTemplateLiteral */:
return spanForTemplateLiteral(n);
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return spanForNode(n, false, !isBindingElement(n.parent), 22 /* OpenBracketToken */);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return spanForArrowFunction(n);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return spanForCallExpression(n);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return spanForParenthesizedExpression(n);
}
function spanForCallExpression(node) {
@@ -143004,7 +143262,7 @@ function getOutliningSpanForNode(n, sourceFile) {
function functionSpan(node, body, sourceFile) {
const openToken = tryGetFunctionOpenToken(node, body, sourceFile);
const closeToken = findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile);
- return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, node.kind !== 219 /* ArrowFunction */);
+ return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, node.kind !== 221 /* ArrowFunction */);
}
function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse = false, useFullStart = true) {
const textSpan = createTextSpanFromBounds(useFullStart ? openToken.getFullStart() : openToken.getStart(sourceFile), closeToken.getEnd());
@@ -143118,18 +143376,18 @@ function getInfo19(context, considerPartialSpans = true) {
}
const noSymbolError = (id) => isIdentifier(id) && checker.getSymbolAtLocation(id) ? void 0 : { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_named_export) };
switch (exportNode.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 270 /* ModuleDeclaration */: {
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 273 /* ModuleDeclaration */: {
const node = exportNode;
if (!node.name)
return void 0;
return noSymbolError(node.name) || { exportNode: node, exportName: node.name, wasDefault, exportingModuleSymbol };
}
- case 244 /* VariableStatement */: {
+ case 246 /* VariableStatement */: {
const vs = exportNode;
if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) {
return void 0;
@@ -143140,7 +143398,7 @@ function getInfo19(context, considerPartialSpans = true) {
Debug.assert(!wasDefault, "Can't have a default flag here");
return noSymbolError(decl.name) || { exportNode: vs, exportName: decl.name, wasDefault, exportingModuleSymbol };
}
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
const node = exportNode;
if (node.isExportEquals)
return void 0;
@@ -143166,20 +143424,20 @@ function changeExport(exportingSourceFile, { wasDefault, exportNode, exportName
} else {
const exportKeyword = Debug.checkDefined(findModifier(exportNode, 94 /* ExportKeyword */), "Should find an export keyword in modifier list");
switch (exportNode.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
changes.insertNodeAfter(exportingSourceFile, exportKeyword, factory.createToken(89 /* DefaultKeyword */));
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
const decl = first(exportNode.declarationList.declarations);
if (!ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) {
changes.replaceNode(exportingSourceFile, exportNode, factory.createExportDefault(Debug.checkDefined(decl.initializer, "Initializer was previously known to be present")));
break;
}
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 273 /* ModuleDeclaration */:
changes.deleteModifier(exportingSourceFile, exportKeyword);
changes.insertNodeAfter(exportingSourceFile, exportNode, factory.createExportDefault(factory.createIdentifier(exportName.text)));
break;
@@ -143205,23 +143463,23 @@ function changeImports(program, { wasDefault, exportName, exportingModuleSymbol
function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) {
const { parent: parent2 } = ref;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
changes.replaceNode(importingSourceFile, ref, factory.createIdentifier(exportName));
break;
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */: {
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */: {
const spec = parent2;
changes.replaceNode(importingSourceFile, spec, makeImportSpecifier2(exportName, spec.name.text));
break;
}
- case 276 /* ImportClause */: {
+ case 279 /* ImportClause */: {
const clause = parent2;
Debug.assert(clause.name === ref, "Import clause name should match provided ref");
const spec = makeImportSpecifier2(exportName, ref.text);
const { namedBindings } = clause;
if (!namedBindings) {
changes.replaceNode(importingSourceFile, ref, factory.createNamedImports([spec]));
- } else if (namedBindings.kind === 277 /* NamespaceImport */) {
+ } else if (namedBindings.kind === 280 /* NamespaceImport */) {
changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) });
const quotePreference = isStringLiteral(clause.parent.moduleSpecifier) ? quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */;
const newImport = makeImport(void 0, [makeImportSpecifier2(exportName, ref.text)], clause.parent.moduleSpecifier, quotePreference);
@@ -143232,7 +143490,7 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam
}
break;
}
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
const importTypeNode = parent2;
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.assertions, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf));
break;
@@ -143243,10 +143501,10 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam
function changeNamedToDefaultImport(importingSourceFile, ref, changes) {
const parent2 = ref.parent;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
changes.replaceNode(importingSourceFile, ref, factory.createIdentifier("default"));
break;
- case 279 /* ImportSpecifier */: {
+ case 282 /* ImportSpecifier */: {
const defaultImport = factory.createIdentifier(parent2.name.text);
if (parent2.parent.elements.length === 1) {
changes.replaceNode(importingSourceFile, parent2.parent, defaultImport);
@@ -143256,7 +143514,7 @@ function changeNamedToDefaultImport(importingSourceFile, ref, changes) {
}
break;
}
- case 284 /* ExportSpecifier */: {
+ case 287 /* ExportSpecifier */: {
changes.replaceNode(importingSourceFile, parent2, makeExportSpecifier("default", parent2.name.text));
break;
}
@@ -143346,7 +143604,7 @@ function getImportConversionInfo(context, considerPartialSpans = true) {
if (!importClause.namedBindings) {
return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_namespace_import_or_named_imports) };
}
- if (importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (importClause.namedBindings.kind === 280 /* NamespaceImport */) {
return { convertTo: 0 /* Named */, import: importClause.namedBindings };
}
const shouldUseDefault = getShouldUseDefault(context.program, importClause);
@@ -143767,11 +144025,11 @@ function isAllowedStatementToMove(statement) {
}
function isPureImport(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return true;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return !hasSyntacticModifier(node, 1 /* Export */);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return node.declarationList.declarations.every((d) => !!d.initializer && isRequireCall(d.initializer, true));
default:
return false;
@@ -143860,11 +144118,11 @@ function updateImportsInOtherFiles(changes, program, oldFile, movedSymbols, newM
}
function getNamespaceLikeImport(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 277 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0;
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 280 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0;
+ case 277 /* ImportEqualsDeclaration */:
return node.name;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return tryCast(node.name, isIdentifier);
default:
return Debug.assertNever(node, `Unexpected node kind ${node.kind}`);
@@ -143894,23 +144152,23 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie
const newNamespaceId = factory.createIdentifier(newNamespaceName);
const newModuleString = factory.createStringLiteral(newModuleSpecifier);
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return factory.createImportDeclaration(
void 0,
factory.createImportClause(false, void 0, factory.createNamespaceImport(newNamespaceId)),
newModuleString,
void 0
);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return factory.createImportEqualsDeclaration(void 0, false, newNamespaceId, factory.createExternalModuleReference(newModuleString));
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return factory.createVariableDeclaration(newNamespaceId, void 0, void 0, createRequireCall(newModuleString));
default:
return Debug.assertNever(node, `Unexpected node kind ${node.kind}`);
}
}
function moduleSpecifierFromImport(i) {
- return i.kind === 275 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 274 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0];
+ return i.kind === 278 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 277 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0];
}
function forEachImportInStatement(statement, cb) {
if (isImportDeclaration(statement)) {
@@ -143969,15 +144227,15 @@ function addExports(sourceFile, toMove, needExport, useEs6Exports) {
}
function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) {
switch (importDecl.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused);
break;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
if (isUnused(importDecl.name)) {
changes.delete(sourceFile, importDecl);
}
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused);
break;
default:
@@ -143989,7 +144247,7 @@ function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnu
return;
const { name, namedBindings } = importDecl.importClause;
const defaultUnused = !name || isUnused(name);
- const namedBindingsUnused = !namedBindings || (namedBindings.kind === 277 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name)));
+ const namedBindingsUnused = !namedBindings || (namedBindings.kind === 280 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name)));
if (defaultUnused && namedBindingsUnused) {
changes.delete(sourceFile, importDecl);
} else {
@@ -144003,7 +144261,7 @@ function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnu
importDecl.importClause,
factory.updateImportClause(importDecl.importClause, importDecl.importClause.isTypeOnly, name, void 0)
);
- } else if (namedBindings.kind === 278 /* NamedImports */) {
+ } else if (namedBindings.kind === 281 /* NamedImports */) {
for (const element of namedBindings.elements) {
if (isUnused(element.name))
changes.delete(sourceFile, element);
@@ -144027,9 +144285,9 @@ function deleteUnusedImportsInVariableDeclaration(sourceFile, varDecl, changes,
}
}
break;
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
break;
- case 206 /* ObjectBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
if (name.elements.every((e) => isIdentifier(e.name) && isUnused(e.name))) {
changes.delete(
sourceFile,
@@ -144144,14 +144402,14 @@ function getUsageInfo(oldFile, toMove, checker) {
}
function isInImport(decl) {
switch (decl.kind) {
- case 274 /* ImportEqualsDeclaration */:
- case 279 /* ImportSpecifier */:
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 282 /* ImportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
return true;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return isVariableDeclarationInImport(decl);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent);
default:
return false;
@@ -144162,7 +144420,7 @@ function isVariableDeclarationInImport(decl) {
}
function filterImport(i, moduleSpecifier, keep) {
switch (i.kind) {
- case 275 /* ImportDeclaration */: {
+ case 278 /* ImportDeclaration */: {
const clause = i.importClause;
if (!clause)
return void 0;
@@ -144170,9 +144428,9 @@ function filterImport(i, moduleSpecifier, keep) {
const namedBindings = clause.namedBindings && filterNamedBindings(clause.namedBindings, keep);
return defaultImport || namedBindings ? factory.createImportDeclaration(void 0, factory.createImportClause(false, defaultImport, namedBindings), moduleSpecifier, void 0) : void 0;
}
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return keep(i.name) ? i : void 0;
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
const name = filterBindingName(i.name, keep);
return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : void 0;
}
@@ -144181,7 +144439,7 @@ function filterImport(i, moduleSpecifier, keep) {
}
}
function filterNamedBindings(namedBindings, keep) {
- if (namedBindings.kind === 277 /* NamespaceImport */) {
+ if (namedBindings.kind === 280 /* NamespaceImport */) {
return keep(namedBindings.name) ? namedBindings : void 0;
} else {
const newElements = namedBindings.elements.filter((e) => keep(e.name));
@@ -144192,9 +144450,9 @@ function filterBindingName(name, keep) {
switch (name.kind) {
case 79 /* Identifier */:
return keep(name) ? name : void 0;
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return name;
- case 206 /* ObjectBindingPattern */: {
+ case 208 /* ObjectBindingPattern */: {
const newElements = name.elements.filter((prop) => prop.propertyName || !isIdentifier(prop.name) || keep(prop.name));
return newElements.length ? factory.createObjectBindingPattern(newElements) : void 0;
}
@@ -144251,13 +144509,13 @@ function isTopLevelDeclarationStatement(node) {
}
function isNonVariableTopLevelDeclaration(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return true;
default:
return false;
@@ -144265,17 +144523,17 @@ function isNonVariableTopLevelDeclaration(node) {
}
function forEachTopLevelDeclaration(statement, cb) {
switch (statement.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return cb(statement);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return firstDefined(statement.declarationList.declarations, (decl) => forEachTopLevelDeclarationInBindingName(decl.name, cb));
- case 245 /* ExpressionStatement */: {
+ case 247 /* ExpressionStatement */: {
const { expression } = statement;
return isBinaryExpression(expression) && getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) : void 0;
}
@@ -144285,8 +144543,8 @@ function forEachTopLevelDeclarationInBindingName(name, cb) {
switch (name.kind) {
case 79 /* Identifier */:
return cb(cast(name.parent, (x) => isVariableDeclaration(x) || isBindingElement(x)));
- case 207 /* ArrayBindingPattern */:
- case 206 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
return firstDefined(name.elements, (em) => isOmittedExpression(em) ? void 0 : forEachTopLevelDeclarationInBindingName(em.name, cb));
default:
return Debug.assertNever(name, `Unexpected name kind ${name.kind}`);
@@ -144297,9 +144555,9 @@ function nameOfTopLevelDeclaration(d) {
}
function getTopLevelDeclarationStatement(d) {
switch (d.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return d.parent.parent;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getTopLevelDeclarationStatement(
cast(d.parent.parent, (p) => isVariableDeclaration(p) || isBindingElement(p))
);
@@ -144332,24 +144590,24 @@ function addExport(decl, useEs6Exports) {
function addEs6Export(d) {
const modifiers = canHaveModifiers(d) ? concatenate([factory.createModifier(94 /* ExportKeyword */)], getModifiers(d)) : void 0;
switch (d.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return factory.updateFunctionDeclaration(d, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const decorators = canHaveDecorators(d) ? getDecorators(d) : void 0;
return factory.updateClassDeclaration(d, concatenate(decorators, modifiers), d.name, d.typeParameters, d.heritageClauses, d.members);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return factory.updateVariableStatement(d, modifiers, d.declarationList);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return factory.updateModuleDeclaration(d, modifiers, d.name, d.body);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return factory.updateEnumDeclaration(d, modifiers, d.name, d.members);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return factory.updateTypeAliasDeclaration(d, modifiers, d.name, d.typeParameters, d.type);
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return factory.updateInterfaceDeclaration(d, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return factory.updateImportEqualsDeclaration(d, modifiers, d.isTypeOnly, d.name, d.moduleReference);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return Debug.fail();
default:
return Debug.assertNever(d, `Unexpected declaration kind ${d.kind}`);
@@ -144360,18 +144618,18 @@ function addCommonjsExport(decl) {
}
function getNamesToExportInCommonJS(decl) {
switch (decl.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
return [decl.name.text];
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return mapDefined(decl.declarationList.declarations, (d) => isIdentifier(d.name) ? d.name.text : void 0);
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return emptyArray;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return Debug.fail("Can't export an ExpressionStatement");
default:
return Debug.assertNever(decl, `Unexpected decl kind ${decl.kind}`);
@@ -144423,7 +144681,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
const lastDeclaration = signatureDecls[signatureDecls.length - 1];
let updated = lastDeclaration;
switch (lastDeclaration.kind) {
- case 173 /* MethodSignature */: {
+ case 175 /* MethodSignature */: {
updated = factory.updateMethodSignature(
lastDeclaration,
lastDeclaration.modifiers,
@@ -144435,7 +144693,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 174 /* MethodDeclaration */: {
+ case 176 /* MethodDeclaration */: {
updated = factory.updateMethodDeclaration(
lastDeclaration,
lastDeclaration.modifiers,
@@ -144449,7 +144707,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 179 /* CallSignature */: {
+ case 181 /* CallSignature */: {
updated = factory.updateCallSignature(
lastDeclaration,
lastDeclaration.typeParameters,
@@ -144458,7 +144716,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 176 /* Constructor */: {
+ case 178 /* Constructor */: {
updated = factory.updateConstructorDeclaration(
lastDeclaration,
lastDeclaration.modifiers,
@@ -144467,7 +144725,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 180 /* ConstructSignature */: {
+ case 182 /* ConstructSignature */: {
updated = factory.updateConstructSignature(
lastDeclaration,
lastDeclaration.typeParameters,
@@ -144476,7 +144734,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 263 /* FunctionDeclaration */: {
+ case 265 /* FunctionDeclaration */: {
updated = factory.updateFunctionDeclaration(
lastDeclaration,
lastDeclaration.modifiers,
@@ -144547,12 +144805,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
}
function isConvertableSignatureDeclaration(d) {
switch (d.kind) {
- case 173 /* MethodSignature */:
- case 174 /* MethodDeclaration */:
- case 179 /* CallSignature */:
- case 176 /* Constructor */:
- case 180 /* ConstructSignature */:
- case 263 /* FunctionDeclaration */:
+ case 175 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 181 /* CallSignature */:
+ case 178 /* Constructor */:
+ case 182 /* ConstructSignature */:
+ case 265 /* FunctionDeclaration */:
return true;
}
return false;
@@ -145099,14 +145357,14 @@ function entryToFunctionCall(entry) {
const functionReference = entry.node;
const parent2 = functionReference.parent;
switch (parent2.kind) {
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
const callOrNewExpression = tryCast(parent2, isCallOrNewExpression);
if (callOrNewExpression && callOrNewExpression.expression === functionReference) {
return callOrNewExpression;
}
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression);
if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) {
const callOrNewExpression2 = tryCast(propertyAccessExpression.parent, isCallOrNewExpression);
@@ -145115,7 +145373,7 @@ function entryToFunctionCall(entry) {
}
}
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const elementAccessExpression = tryCast(parent2, isElementAccessExpression);
if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) {
const callOrNewExpression2 = tryCast(elementAccessExpression.parent, isCallOrNewExpression);
@@ -145133,13 +145391,13 @@ function entryToAccessExpression(entry) {
const reference = entry.node;
const parent2 = reference.parent;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression);
if (propertyAccessExpression && propertyAccessExpression.expression === reference) {
return propertyAccessExpression;
}
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const elementAccessExpression = tryCast(parent2, isElementAccessExpression);
if (elementAccessExpression && elementAccessExpression.expression === reference) {
return elementAccessExpression;
@@ -145181,22 +145439,22 @@ function isValidFunctionDeclaration(functionDeclaration, checker) {
if (!isValidParameterNodeArray(functionDeclaration.parameters, checker))
return false;
switch (functionDeclaration.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
if (isObjectLiteralExpression(functionDeclaration.parent)) {
const contextualSymbol = getSymbolForContextualType(functionDeclaration.name, checker);
return ((_a2 = contextualSymbol == null ? void 0 : contextualSymbol.declarations) == null ? void 0 : _a2.length) === 1 && isSingleImplementation(functionDeclaration, checker);
}
return isSingleImplementation(functionDeclaration, checker);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
if (isClassDeclaration(functionDeclaration.parent)) {
return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker);
} else {
return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker);
}
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return isValidVariableDeclaration(functionDeclaration.parent);
}
return false;
@@ -145356,7 +145614,7 @@ function getParameterName(paramDeclaration) {
}
function getClassNames(constructorDeclaration) {
switch (constructorDeclaration.parent.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const classDeclaration = constructorDeclaration.parent;
if (classDeclaration.name)
return [classDeclaration.name];
@@ -145365,7 +145623,7 @@ function getClassNames(constructorDeclaration) {
"Nameless class declaration should be a default export"
);
return [defaultModifier];
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
const classExpression = constructorDeclaration.parent;
const variableDeclaration = constructorDeclaration.parent.parent;
const className = classExpression.name;
@@ -145376,7 +145634,7 @@ function getClassNames(constructorDeclaration) {
}
function getFunctionNames(functionDeclaration) {
switch (functionDeclaration.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (functionDeclaration.name)
return [functionDeclaration.name];
const defaultModifier = Debug.checkDefined(
@@ -145384,21 +145642,21 @@ function getFunctionNames(functionDeclaration) {
"Nameless function declaration should be a default export"
);
return [defaultModifier];
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return [functionDeclaration.name];
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
const ctrKeyword = Debug.checkDefined(
findChildOfKind(functionDeclaration, 136 /* ConstructorKeyword */, functionDeclaration.getSourceFile()),
"Constructor declaration should have constructor keyword"
);
- if (functionDeclaration.parent.kind === 232 /* ClassExpression */) {
+ if (functionDeclaration.parent.kind === 234 /* ClassExpression */) {
const variableDeclaration = functionDeclaration.parent.parent;
return [variableDeclaration.name, ctrKeyword];
}
return [ctrKeyword];
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return [functionDeclaration.parent.name];
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
if (functionDeclaration.name)
return [functionDeclaration.name, functionDeclaration.parent.name];
return [functionDeclaration.parent.name];
@@ -145481,11 +145739,11 @@ function isNotEqualsOperator(node) {
function getParentBinaryExpression(expr) {
const container = findAncestor(expr.parent, (n) => {
switch (n.kind) {
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return false;
- case 229 /* TemplateExpression */:
- case 227 /* BinaryExpression */:
+ case 231 /* TemplateExpression */:
+ case 229 /* BinaryExpression */:
return !(isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent));
default:
return "quit";
@@ -146105,18 +146363,18 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
function checkForStaticContext(nodeToCheck, containingClass) {
let current = nodeToCheck;
while (current !== containingClass) {
- if (current.kind === 171 /* PropertyDeclaration */) {
+ if (current.kind === 172 /* PropertyDeclaration */) {
if (isStatic(current)) {
rangeFacts |= 32 /* InStaticRegion */;
}
break;
- } else if (current.kind === 168 /* Parameter */) {
+ } else if (current.kind === 169 /* Parameter */) {
const ctorOrMethod = getContainingFunction(current);
- if (ctorOrMethod.kind === 176 /* Constructor */) {
+ if (ctorOrMethod.kind === 178 /* Constructor */) {
rangeFacts |= 32 /* InStaticRegion */;
}
break;
- } else if (current.kind === 174 /* MethodDeclaration */) {
+ } else if (current.kind === 176 /* MethodDeclaration */) {
if (isStatic(current)) {
rangeFacts |= 32 /* InStaticRegion */;
}
@@ -146150,7 +146408,7 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
visit(nodeToCheck);
if (rangeFacts & 8 /* UsesThis */) {
const container = getThisContainer(nodeToCheck, false);
- if (container.kind === 263 /* FunctionDeclaration */ || container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ || container.kind === 218 /* FunctionExpression */) {
+ if (container.kind === 265 /* FunctionDeclaration */ || container.kind === 176 /* MethodDeclaration */ && container.parent.kind === 212 /* ObjectLiteralExpression */ || container.kind === 220 /* FunctionExpression */) {
rangeFacts |= 16 /* UsesThisInFunction */;
}
}
@@ -146160,21 +146418,21 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
return true;
}
if (isDeclaration(node2)) {
- const declaringNode = node2.kind === 261 /* VariableDeclaration */ ? node2.parent.parent : node2;
+ const declaringNode = node2.kind === 263 /* VariableDeclaration */ ? node2.parent.parent : node2;
if (hasSyntacticModifier(declaringNode, 1 /* Export */)) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity));
return true;
}
}
switch (node2.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractImport));
return true;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity));
return true;
case 107 /* SuperKeyword */:
- if (node2.parent.kind === 213 /* CallExpression */) {
+ if (node2.parent.kind === 215 /* CallExpression */) {
const containingClass2 = getContainingClass(node2);
if (containingClass2 === void 0 || containingClass2.pos < span.start || containingClass2.end >= span.start + span.length) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractSuper));
@@ -146185,7 +146443,7 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
thisNode = node2;
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
forEachChild(node2, function check(n) {
if (isThis(n)) {
rangeFacts |= 8 /* UsesThis */;
@@ -146196,34 +146454,34 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
forEachChild(n, check);
}
});
- case 264 /* ClassDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (isSourceFile(node2.parent) && node2.parent.externalModuleIndicator === void 0) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.functionWillNotBeVisibleInTheNewScope));
}
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return false;
}
const savedPermittedJumps = permittedJumps;
switch (node2.kind) {
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
permittedJumps &= ~4 /* Return */;
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
permittedJumps = 0 /* None */;
break;
- case 242 /* Block */:
- if (node2.parent && node2.parent.kind === 259 /* TryStatement */ && node2.parent.finallyBlock === node2) {
+ case 244 /* Block */:
+ if (node2.parent && node2.parent.kind === 261 /* TryStatement */ && node2.parent.finallyBlock === node2) {
permittedJumps = 4 /* Return */;
}
break;
- case 299 /* DefaultClause */:
- case 298 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 301 /* CaseClause */:
permittedJumps |= 1 /* Break */;
break;
default:
@@ -146233,39 +146491,39 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
break;
}
switch (node2.kind) {
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 109 /* ThisKeyword */:
rangeFacts |= 8 /* UsesThis */;
thisNode = node2;
break;
- case 257 /* LabeledStatement */: {
+ case 259 /* LabeledStatement */: {
const label = node2.label;
(seenLabels || (seenLabels = [])).push(label.escapedText);
forEachChild(node2, visit);
seenLabels.pop();
break;
}
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */: {
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */: {
const label = node2.label;
if (label) {
if (!contains(seenLabels, label.escapedText)) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange));
}
} else {
- if (!(permittedJumps & (node2.kind === 253 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) {
+ if (!(permittedJumps & (node2.kind === 255 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements));
}
}
break;
}
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
rangeFacts |= 4 /* IsAsyncFunction */;
break;
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
rangeFacts |= 2 /* IsGenerator */;
break;
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
if (permittedJumps & 4 /* Return */) {
rangeFacts |= 1 /* HasReturn */;
} else {
@@ -146315,12 +146573,12 @@ function collectEnclosingScopes(range) {
const scopes = [];
while (true) {
current = current.parent;
- if (current.kind === 168 /* Parameter */) {
+ if (current.kind === 169 /* Parameter */) {
current = findAncestor(current, (parent2) => isFunctionLikeDeclaration(parent2)).parent;
}
if (isScope(current)) {
scopes.push(current);
- if (current.kind === 314 /* SourceFile */) {
+ if (current.kind === 317 /* SourceFile */) {
return scopes;
}
}
@@ -146396,28 +146654,28 @@ function getDescriptionForConstantInScope(scope) {
}
function getDescriptionForFunctionLikeDeclaration(scope) {
switch (scope.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return "constructor";
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
return scope.name ? `function '${scope.name.text}'` : ANONYMOUS;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return "arrow function";
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return `method '${scope.name.getText()}'`;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return `'get ${scope.name.getText()}'`;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return `'set ${scope.name.getText()}'`;
default:
throw Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`);
}
}
function getDescriptionForClassLikeDeclaration(scope) {
- return scope.kind === 264 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression";
+ return scope.kind === 266 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression";
}
function getDescriptionForModuleLikeDeclaration(scope) {
- return scope.kind === 271 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? SpecialScope.Module : SpecialScope.Global;
+ return scope.kind === 274 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? SpecialScope.Module : SpecialScope.Global;
}
var SpecialScope = /* @__PURE__ */ ((SpecialScope2) => {
SpecialScope2[SpecialScope2["Module"] = 0] = "Module";
@@ -146713,7 +146971,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont
changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration);
const localReference = factory.createIdentifier(localNameText);
changeTracker.replaceNode(context.file, node, localReference);
- } else if (node.parent.kind === 245 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) {
+ } else if (node.parent.kind === 247 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) {
const newVariableStatement = factory.createVariableStatement(
void 0,
factory.createVariableDeclarationList([newVariableDeclaration], 2 /* Const */)
@@ -146730,7 +146988,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont
} else {
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, false);
}
- if (node.parent.kind === 245 /* ExpressionStatement */) {
+ if (node.parent.kind === 247 /* ExpressionStatement */) {
changeTracker.delete(context.file, node.parent);
} else {
let localReference = factory.createIdentifier(localNameText);
@@ -147251,27 +147509,27 @@ function getExtractableParent(node) {
function isExtractableExpression(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return false;
}
switch (node.kind) {
case 10 /* StringLiteral */:
- return parent2.kind !== 275 /* ImportDeclaration */ && parent2.kind !== 279 /* ImportSpecifier */;
- case 231 /* SpreadElement */:
- case 206 /* ObjectBindingPattern */:
- case 208 /* BindingElement */:
+ return parent2.kind !== 278 /* ImportDeclaration */ && parent2.kind !== 282 /* ImportSpecifier */;
+ case 233 /* SpreadElement */:
+ case 208 /* ObjectBindingPattern */:
+ case 210 /* BindingElement */:
return false;
case 79 /* Identifier */:
- return parent2.kind !== 208 /* BindingElement */ && parent2.kind !== 279 /* ImportSpecifier */ && parent2.kind !== 284 /* ExportSpecifier */;
+ return parent2.kind !== 210 /* BindingElement */ && parent2.kind !== 282 /* ImportSpecifier */ && parent2.kind !== 287 /* ExportSpecifier */;
}
return true;
}
function isBlockLike(node) {
switch (node.kind) {
- case 242 /* Block */:
- case 314 /* SourceFile */:
- case 271 /* ModuleBlock */:
- case 298 /* CaseClause */:
+ case 244 /* Block */:
+ case 317 /* SourceFile */:
+ case 274 /* ModuleBlock */:
+ case 301 /* CaseClause */:
return true;
default:
return false;
@@ -147411,10 +147669,10 @@ function getInfo21(context) {
}
function isConvertibleDeclaration(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
return true;
default:
return false;
@@ -147482,7 +147740,7 @@ function getRenameInfoForNode(node, typeChecker3, sourceFile, program, preferenc
return getRenameInfoError(wouldRenameNodeModules);
}
const kind = ts_SymbolDisplay_exports.getSymbolKind(typeChecker3, symbol, node);
- const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 166 /* ComputedPropertyName */ ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0;
+ const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0;
const displayName = specifierName || typeChecker3.symbolToString(symbol);
const fullDisplayName = specifierName || typeChecker3.getFullyQualifiedName(symbol);
return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker3, symbol), node, sourceFile);
@@ -147745,10 +148003,10 @@ function getImmediatelyContainingArgumentInfo(node, position, sourceFile) {
return getArgumentListInfoForTemplate(parent2, 0, sourceFile);
}
return void 0;
- } else if (isTemplateHead(node) && parent2.parent.kind === 215 /* TaggedTemplateExpression */) {
+ } else if (isTemplateHead(node) && parent2.parent.kind === 217 /* TaggedTemplateExpression */) {
const templateExpression = parent2;
const tagExpression = templateExpression.parent;
- Debug.assert(templateExpression.kind === 229 /* TemplateExpression */);
+ Debug.assert(templateExpression.kind === 231 /* TemplateExpression */);
const argumentIndex = isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1;
return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile);
} else if (isTemplateSpan(parent2) && isTaggedTemplateExpression(parent2.parent.parent)) {
@@ -147810,17 +148068,17 @@ function getContextualSignatureLocationInfo(startingToken, sourceFile, position,
return void 0;
const { parent: parent2 } = startingToken;
switch (parent2.kind) {
- case 217 /* ParenthesizedExpression */:
- case 174 /* MethodDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 219 /* ParenthesizedExpression */:
+ case 176 /* MethodDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
const info = getArgumentOrParameterListInfo(startingToken, position, sourceFile);
if (!info)
return void 0;
const { argumentIndex, argumentCount, argumentsSpan } = info;
const contextualType = isMethodDeclaration(parent2) ? checker.getContextualTypeForObjectLiteralElement(parent2) : checker.getContextualType(parent2);
return contextualType && { contextualType, argumentIndex, argumentCount, argumentsSpan };
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const highestBinary = getHighestBinary(parent2);
const contextualType2 = checker.getContextualType(highestBinary);
const argumentIndex2 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1;
@@ -147886,7 +148144,7 @@ function getApplicableSpanForTaggedTemplate(taggedTemplate, sourceFile) {
const template = taggedTemplate.template;
const applicableSpanStart = template.getStart();
let applicableSpanEnd = template.getEnd();
- if (template.kind === 229 /* TemplateExpression */) {
+ if (template.kind === 231 /* TemplateExpression */) {
const lastSpan = last(template.templateSpans);
if (lastSpan.literal.getFullWidth() === 0) {
applicableSpanEnd = skipTrivia(sourceFile.text, applicableSpanEnd, false);
@@ -148153,7 +148411,7 @@ function getSelectionChildren(node) {
const groupedWithPlusMinusTokens = groupChildren(children, (child) => child === node.readonlyToken || child.kind === 147 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */);
const groupedWithBrackets = groupChildren(
groupedWithPlusMinusTokens,
- ({ kind }) => kind === 22 /* OpenBracketToken */ || kind === 167 /* TypeParameter */ || kind === 23 /* CloseBracketToken */
+ ({ kind }) => kind === 22 /* OpenBracketToken */ || kind === 168 /* TypeParameter */ || kind === 23 /* CloseBracketToken */
);
return [
openBraceToken,
@@ -148163,7 +148421,7 @@ function getSelectionChildren(node) {
}
if (isPropertySignature(node)) {
const children = groupChildren(node.getChildren(), (child) => child === node.name || contains(node.modifiers, child));
- const firstJSDocChild = ((_a2 = children[0]) == null ? void 0 : _a2.kind) === 329 /* JSDoc */ ? children[0] : void 0;
+ const firstJSDocChild = ((_a2 = children[0]) == null ? void 0 : _a2.kind) === 332 /* JSDoc */ ? children[0] : void 0;
const withJSDocSeparated = firstJSDocChild ? children.slice(1) : children;
const splittedChildren = splitChildren(withJSDocSeparated, ({ kind }) => kind === 58 /* ColonToken */);
return firstJSDocChild ? [firstJSDocChild, createSyntaxList2(splittedChildren)] : splittedChildren;
@@ -148224,19 +148482,19 @@ function createSyntaxList2(children) {
}
function isListOpener(token) {
const kind = token && token.kind;
- return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ || kind === 289 /* JsxOpeningElement */;
+ return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ || kind === 292 /* JsxOpeningElement */;
}
function isListCloser(token) {
const kind = token && token.kind;
- return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ || kind === 290 /* JsxClosingElement */;
+ return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ || kind === 293 /* JsxClosingElement */;
}
function getEndPos(sourceFile, node) {
switch (node.kind) {
- case 349 /* JSDocParameterTag */:
- case 347 /* JSDocCallbackTag */:
- case 356 /* JSDocPropertyTag */:
- case 354 /* JSDocTypedefTag */:
- case 351 /* JSDocThisTag */:
+ case 352 /* JSDocParameterTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 359 /* JSDocPropertyTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 354 /* JSDocThisTag */:
return sourceFile.getLineEndOfPosition(node.getStart());
default:
return node.getEnd();
@@ -148260,7 +148518,7 @@ function getSymbolKind(typeChecker3, symbol, location) {
}
const flags = getCombinedLocalAndExportSymbolFlags(symbol);
if (flags & 32 /* Class */) {
- return getDeclarationOfKind(symbol, 232 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */;
+ return getDeclarationOfKind(symbol, 234 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */;
}
if (flags & 384 /* Enum */)
return "enum" /* enumElement */;
@@ -148386,13 +148644,13 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
const declaration = find(symbol.declarations, (declaration2) => declaration2.name === location);
if (declaration) {
switch (declaration.kind) {
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
symbolKind = "getter" /* memberGetAccessorElement */;
break;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
symbolKind = "setter" /* memberSetAccessorElement */;
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
symbolKind = "accessor" /* memberAccessorVariableElement */;
break;
default:
@@ -148404,7 +148662,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
let signature;
type = isThisExpression ? typeChecker3.getTypeAtLocation(location) : typeChecker3.getTypeOfSymbolAtLocation(symbol, location);
- if (location.parent && location.parent.kind === 211 /* PropertyAccessExpression */) {
+ if (location.parent && location.parent.kind === 213 /* PropertyAccessExpression */) {
const right = location.parent.name;
if (right === location || right && right.getFullWidth() === 0) {
location = location.parent;
@@ -148420,7 +148678,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
if (callExpressionLike) {
signature = typeChecker3.getResolvedSignature(callExpressionLike);
- const useConstructSignatures = callExpressionLike.kind === 214 /* NewExpression */ || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 107 /* SuperKeyword */;
+ const useConstructSignatures = callExpressionLike.kind === 216 /* NewExpression */ || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 107 /* SuperKeyword */;
const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
if (signature && !contains(allSignatures, signature.target) && !contains(allSignatures, signature)) {
signature = allSignatures.length ? allSignatures[0] : void 0;
@@ -148475,21 +148733,21 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
hasAddedSymbolInfo = true;
hasMultipleSignatures = allSignatures.length > 1;
}
- } else if (isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */) || location.kind === 136 /* ConstructorKeyword */ && location.parent.kind === 176 /* Constructor */) {
+ } else if (isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */) || location.kind === 136 /* ConstructorKeyword */ && location.parent.kind === 178 /* Constructor */) {
const functionDeclaration = location.parent;
const locationIsSymbolDeclaration = symbol.declarations && find(symbol.declarations, (declaration) => declaration === (location.kind === 136 /* ConstructorKeyword */ ? functionDeclaration.parent : functionDeclaration));
if (locationIsSymbolDeclaration) {
- const allSignatures = functionDeclaration.kind === 176 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
+ const allSignatures = functionDeclaration.kind === 178 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
if (!typeChecker3.isImplementationOfOverload(functionDeclaration)) {
signature = typeChecker3.getSignatureFromDeclaration(functionDeclaration);
} else {
signature = allSignatures[0];
}
- if (functionDeclaration.kind === 176 /* Constructor */) {
+ if (functionDeclaration.kind === 178 /* Constructor */) {
symbolKind = "constructor" /* constructorImplementationElement */;
addPrefixForAnyFunctionOrVar(type.symbol, symbolKind);
} else {
- addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 179 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind);
+ addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 181 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind);
}
if (signature) {
addSignatureDisplayParts(signature, allSignatures);
@@ -148501,9 +148759,9 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) {
addAliasPrefixIfNecessary();
- if (getDeclarationOfKind(symbol, 232 /* ClassExpression */)) {
+ if (getDeclarationOfKind(symbol, 234 /* ClassExpression */)) {
pushSymbolKind("local class" /* localClassElement */);
- } else if (getDeclarationOfKind(symbol, 265 /* StructDeclaration */)) {
+ } else if (getDeclarationOfKind(symbol, 267 /* StructDeclaration */)) {
displayParts.push(keywordPart(85 /* StructKeyword */));
} else {
displayParts.push(keywordPart(84 /* ClassKeyword */));
@@ -148542,7 +148800,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
if (symbolFlags & 1536 /* Module */ && !isThisExpression) {
prefixNextMeaning();
- const declaration = getDeclarationOfKind(symbol, 270 /* ModuleDeclaration */);
+ const declaration = getDeclarationOfKind(symbol, 273 /* ModuleDeclaration */);
const isNamespace = declaration && declaration.name && declaration.name.kind === 79 /* Identifier */;
displayParts.push(keywordPart(isNamespace ? 144 /* NamespaceKeyword */ : 143 /* ModuleKeyword */));
displayParts.push(spacePart());
@@ -148560,7 +148818,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
addFullSymbolName(symbol.parent, enclosingDeclaration);
writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration);
} else {
- const decl = getDeclarationOfKind(symbol, 167 /* TypeParameter */);
+ const decl = getDeclarationOfKind(symbol, 168 /* TypeParameter */);
if (decl === void 0)
return Debug.fail();
const declaration = decl.parent;
@@ -148568,14 +148826,14 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
if (isFunctionLikeKind(declaration.kind)) {
addInPrefix();
const signature = typeChecker3.getSignatureFromDeclaration(declaration);
- if (declaration.kind === 180 /* ConstructSignature */) {
+ if (declaration.kind === 182 /* ConstructSignature */) {
displayParts.push(keywordPart(104 /* NewKeyword */));
displayParts.push(spacePart());
- } else if (declaration.kind !== 179 /* CallSignature */ && declaration.name) {
+ } else if (declaration.kind !== 181 /* CallSignature */ && declaration.name) {
addFullSymbolName(declaration.symbol);
}
addRange(displayParts, signatureToDisplayParts(typeChecker3, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */));
- } else if (declaration.kind === 268 /* TypeAliasDeclaration */) {
+ } else if (declaration.kind === 271 /* TypeAliasDeclaration */) {
addInPrefix();
displayParts.push(keywordPart(155 /* TypeKeyword */));
displayParts.push(spacePart());
@@ -148589,7 +148847,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
symbolKind = "enum member" /* enumMemberElement */;
addPrefixForAnyFunctionOrVar(symbol, "enum member");
const declaration = (_a2 = symbol.declarations) == null ? void 0 : _a2[0];
- if ((declaration == null ? void 0 : declaration.kind) === 308 /* EnumMember */) {
+ if ((declaration == null ? void 0 : declaration.kind) === 311 /* EnumMember */) {
const constantValue = typeChecker3.getConstantValue(declaration);
if (constantValue !== void 0) {
displayParts.push(spacePart());
@@ -148633,17 +148891,17 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
if (symbol.declarations) {
switch (symbol.declarations[0].kind) {
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
displayParts.push(keywordPart(94 /* ExportKeyword */));
displayParts.push(spacePart());
displayParts.push(keywordPart(144 /* NamespaceKeyword */));
break;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
displayParts.push(keywordPart(94 /* ExportKeyword */));
displayParts.push(spacePart());
displayParts.push(keywordPart(symbol.declarations[0].isExportEquals ? 63 /* EqualsToken */ : 89 /* DefaultKeyword */));
break;
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
displayParts.push(keywordPart(94 /* ExportKeyword */));
break;
default:
@@ -148653,7 +148911,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
displayParts.push(spacePart());
addFullSymbolName(symbol);
forEach(symbol.declarations, (declaration) => {
- if (declaration.kind === 274 /* ImportEqualsDeclaration */) {
+ if (declaration.kind === 277 /* ImportEqualsDeclaration */) {
const importEqualsDeclaration = declaration;
if (isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) {
displayParts.push(spacePart());
@@ -148721,9 +148979,9 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
documentation = symbol.getContextualDocumentationComment(enclosingDeclaration, typeChecker3);
}
if (documentation.length === 0 && symbolFlags & 4 /* Property */) {
- if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 314 /* SourceFile */)) {
+ if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 317 /* SourceFile */)) {
for (const declaration of symbol.declarations) {
- if (!declaration.parent || declaration.parent.kind !== 227 /* BinaryExpression */) {
+ if (!declaration.parent || declaration.parent.kind !== 229 /* BinaryExpression */) {
continue;
}
const rhsSymbol = typeChecker3.getSymbolAtLocation(declaration.parent.right);
@@ -148874,14 +149132,14 @@ function isLocalVariableOrFunction(symbol) {
return false;
}
return forEach(symbol.declarations, (declaration) => {
- if (declaration.kind === 218 /* FunctionExpression */) {
+ if (declaration.kind === 220 /* FunctionExpression */) {
return true;
}
- if (declaration.kind !== 261 /* VariableDeclaration */ && declaration.kind !== 263 /* FunctionDeclaration */) {
+ if (declaration.kind !== 263 /* VariableDeclaration */ && declaration.kind !== 265 /* FunctionDeclaration */) {
return false;
}
for (let parent2 = declaration.parent; !isFunctionBlock(parent2); parent2 = parent2.parent) {
- if (parent2.kind === 314 /* SourceFile */ || parent2.kind === 271 /* ModuleBlock */) {
+ if (parent2.kind === 317 /* SourceFile */ || parent2.kind === 274 /* ModuleBlock */) {
return false;
}
}
@@ -149039,7 +149297,7 @@ function getAdjustedEndPosition(sourceFile, node, options) {
return newEnd !== end && (trailingTriviaOption === 2 /* Include */ || isLineBreak(sourceFile.text.charCodeAt(newEnd - 1))) ? newEnd : end;
}
function isSeparator(node, candidate) {
- return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 210 /* ObjectLiteralExpression */);
+ return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 212 /* ObjectLiteralExpression */);
}
function isThisTypeAnnotatable(containingFunction) {
return isFunctionExpression(containingFunction) || isFunctionDeclaration(containingFunction);
@@ -149236,7 +149494,7 @@ var ChangeTracker = class {
endNode2 = first(node.parameters);
}
} else {
- endNode2 = (_a2 = node.kind === 261 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) != null ? _a2 : node.name;
+ endNode2 = (_a2 = node.kind === 263 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) != null ? _a2 : node.name;
}
this.insertNodeAt(sourceFile, endNode2.end, type, { prefix: ": " });
return true;
@@ -149378,19 +149636,19 @@ ${options.prefix}` : "\n" : options.prefix
}
getInsertNodeAfterOptionsWorker(node) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 273 /* ModuleDeclaration */:
return { prefix: this.newLineCharacter, suffix: this.newLineCharacter };
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
case 10 /* StringLiteral */:
case 79 /* Identifier */:
return { prefix: ", " };
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return { suffix: "," + this.newLineCharacter };
case 94 /* ExportKeyword */:
return { prefix: " " };
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return {};
default:
Debug.assert(isStatement(node) || isClassOrTypeElement(node));
@@ -149399,7 +149657,7 @@ ${options.prefix}` : "\n" : options.prefix
}
insertName(sourceFile, node, name) {
Debug.assert(!node.name);
- if (node.kind === 219 /* ArrowFunction */) {
+ if (node.kind === 221 /* ArrowFunction */) {
const arrow = findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile);
const lparen = findChildOfKind(node, 20 /* OpenParenToken */, sourceFile);
if (lparen) {
@@ -149409,12 +149667,12 @@ ${options.prefix}` : "\n" : options.prefix
this.insertText(sourceFile, first(node.parameters).getStart(sourceFile), `function ${name}(`);
this.replaceRange(sourceFile, arrow, factory.createToken(21 /* CloseParenToken */));
}
- if (node.body.kind !== 242 /* Block */) {
+ if (node.body.kind !== 244 /* Block */) {
this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [factory.createToken(18 /* OpenBraceToken */), factory.createToken(106 /* ReturnKeyword */)], { joiner: " ", suffix: " " });
this.insertNodesAt(sourceFile, node.body.end, [factory.createToken(26 /* SemicolonToken */), factory.createToken(19 /* CloseBraceToken */)], { joiner: " " });
}
} else {
- const pos = findChildOfKind(node, node.kind === 218 /* FunctionExpression */ ? 99 /* FunctionKeyword */ : 84 /* ClassKeyword */, sourceFile).end;
+ const pos = findChildOfKind(node, node.kind === 220 /* FunctionExpression */ ? 99 /* FunctionKeyword */ : 84 /* ClassKeyword */, sourceFile).end;
this.insertNodeAt(sourceFile, pos, factory.createIdentifier(name), { prefix: " " });
}
}
@@ -149535,10 +149793,10 @@ ${options.prefix}` : "\n" : options.prefix
}
};
function updateJSDocHost(parent2) {
- if (parent2.kind !== 219 /* ArrowFunction */) {
+ if (parent2.kind !== 221 /* ArrowFunction */) {
return parent2;
}
- const jsDocNode = parent2.parent.kind === 171 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent;
+ const jsDocNode = parent2.parent.kind === 172 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent;
jsDocNode.jsDoc = parent2.jsDoc;
jsDocNode.jsDocCache = parent2.jsDocCache;
return jsDocNode;
@@ -149548,14 +149806,14 @@ function tryMergeJsdocTags(oldTag, newTag) {
return void 0;
}
switch (oldTag.kind) {
- case 349 /* JSDocParameterTag */: {
+ case 352 /* JSDocParameterTag */: {
const oldParam = oldTag;
const newParam = newTag;
return isIdentifier(oldParam.name) && isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? factory.createJSDocParameterTag(void 0, newParam.name, false, newParam.typeExpression, newParam.isNameFirst, oldParam.comment) : void 0;
}
- case 350 /* JSDocReturnTag */:
+ case 353 /* JSDocReturnTag */:
return factory.createJSDocReturnTag(void 0, newTag.typeExpression, oldTag.comment);
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return factory.createJSDocTypeTag(void 0, newTag.typeExpression, oldTag.comment);
}
}
@@ -149936,13 +150194,13 @@ function isValidLocationToAddComment(sourceFile, position) {
return !isInComment(sourceFile, position) && !isInString(sourceFile, position) && !isInTemplateString(sourceFile, position) && !isInJSXText(sourceFile, position);
}
function needSemicolonBetween(a, b) {
- return (isPropertySignature(a) || isPropertyDeclaration(a)) && isClassOrTypeElement(b) && b.name.kind === 166 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b);
+ return (isPropertySignature(a) || isPropertyDeclaration(a)) && isClassOrTypeElement(b) && b.name.kind === 167 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b);
}
var deleteDeclaration;
((_deleteDeclaration) => {
function deleteDeclaration2(changes, deletedNodesInLists, sourceFile, node) {
switch (node.kind) {
- case 168 /* Parameter */: {
+ case 169 /* Parameter */: {
const oldFunction = node.parent;
if (isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && !findChildOfKind(oldFunction, 20 /* OpenParenToken */, sourceFile)) {
changes.replaceNodeWithText(sourceFile, node, "()");
@@ -149951,29 +150209,29 @@ var deleteDeclaration;
}
break;
}
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
const isFirstImport = sourceFile.imports.length && node === first(sourceFile.imports).parent || node === find(sourceFile.statements, isAnyImportSyntax);
deleteNode(changes, sourceFile, node, {
leadingTriviaOption: isFirstImport ? 0 /* Exclude */ : hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */
});
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
const pattern = node.parent;
- const preserveComma = pattern.kind === 207 /* ArrayBindingPattern */ && node !== last(pattern.elements);
+ const preserveComma = pattern.kind === 209 /* ArrayBindingPattern */ && node !== last(pattern.elements);
if (preserveComma) {
deleteNode(changes, sourceFile, node);
} else {
deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);
}
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node);
break;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);
break;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
const namedImports = node.parent;
if (namedImports.elements.length === 1) {
deleteImportBinding(changes, sourceFile, namedImports);
@@ -149981,7 +150239,7 @@ var deleteDeclaration;
deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);
}
break;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
deleteImportBinding(changes, sourceFile, node);
break;
case 26 /* SemicolonToken */:
@@ -149990,9 +150248,9 @@ var deleteDeclaration;
case 99 /* FunctionKeyword */:
deleteNode(changes, sourceFile, node, { leadingTriviaOption: 0 /* Exclude */ });
break;
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 265 /* FunctionDeclaration */:
deleteNode(changes, sourceFile, node, { leadingTriviaOption: hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */ });
break;
default:
@@ -150027,13 +150285,13 @@ var deleteDeclaration;
const previousToken = Debug.checkDefined(getTokenAtPosition(sourceFile, node.pos - 1));
changes.deleteRange(sourceFile, { pos: previousToken.getStart(sourceFile), end: node.end });
} else {
- const importDecl = getAncestor(node, 275 /* ImportDeclaration */);
+ const importDecl = getAncestor(node, 278 /* ImportDeclaration */);
deleteNode(changes, sourceFile, importDecl);
}
}
function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) {
const { parent: parent2 } = node;
- if (parent2.kind === 301 /* CatchClause */) {
+ if (parent2.kind === 304 /* CatchClause */) {
changes.deleteNodeRange(sourceFile, findChildOfKind(parent2, 20 /* OpenParenToken */, sourceFile), findChildOfKind(parent2, 21 /* CloseParenToken */, sourceFile));
return;
}
@@ -150043,14 +150301,14 @@ var deleteDeclaration;
}
const gp = parent2.parent;
switch (gp.kind) {
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
changes.replaceNode(sourceFile, node, factory.createObjectLiteralExpression());
break;
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
deleteNode(changes, sourceFile, parent2);
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
deleteNode(changes, sourceFile, gp, { leadingTriviaOption: hasJSDocNodes(gp) ? 2 /* JSDoc */ : 3 /* StartLine */ });
break;
default:
@@ -150252,10 +150510,10 @@ function getFormattingScanner(text, languageVariant, startPos, endPos, cb) {
function shouldRescanJsxIdentifier(node) {
if (node.parent) {
switch (node.parent.kind) {
- case 294 /* JsxAttribute */:
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 297 /* JsxAttribute */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return isKeyword(node.kind) || node.kind === 79 /* Identifier */;
}
}
@@ -150422,7 +150680,7 @@ var RuleFlags = /* @__PURE__ */ ((RuleFlags2) => {
// src/services/formatting/rules.ts
function getAllRules() {
const allTokens = [];
- for (let token = 0 /* FirstToken */; token <= 164 /* LastToken */; token++) {
+ for (let token = 0 /* FirstToken */; token <= 165 /* LastToken */; token++) {
if (token !== 1 /* EndOfFileToken */) {
allTokens.push(token);
}
@@ -150433,9 +150691,9 @@ function getAllRules() {
const anyToken = { tokens: allTokens, isSpecific: false };
const anyTokenIncludingMultilineComments = tokenRangeFrom([...allTokens, 3 /* MultiLineCommentTrivia */]);
const anyTokenIncludingEOF = tokenRangeFrom([...allTokens, 1 /* EndOfFileToken */]);
- const keywords = tokenRangeFromRange(81 /* FirstKeyword */, 164 /* LastKeyword */);
+ const keywords = tokenRangeFromRange(81 /* FirstKeyword */, 165 /* LastKeyword */);
const binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 78 /* LastBinaryOperator */);
- const binaryKeywordOperators = [102 /* InKeyword */, 103 /* InstanceOfKeyword */, 164 /* OfKeyword */, 129 /* AsKeyword */, 141 /* IsKeyword */];
+ const binaryKeywordOperators = [102 /* InKeyword */, 103 /* InstanceOfKeyword */, 165 /* OfKeyword */, 129 /* AsKeyword */, 141 /* IsKeyword */];
const unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */];
const unaryPrefixExpressions = [
8 /* NumericLiteral */,
@@ -150708,40 +150966,40 @@ function isOptionEnabledOrUndefined(optionName) {
return (context) => !context.options || !hasProperty(context.options, optionName) || !!context.options[optionName];
}
function isForContext(context) {
- return context.contextNode.kind === 249 /* ForStatement */;
+ return context.contextNode.kind === 251 /* ForStatement */;
}
function isNotForContext(context) {
return !isForContext(context);
}
function isBinaryOpContext(context) {
switch (context.contextNode.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return context.contextNode.operatorToken.kind !== 27 /* CommaToken */;
- case 228 /* ConditionalExpression */:
- case 194 /* ConditionalType */:
- case 235 /* AsExpression */:
- case 284 /* ExportSpecifier */:
- case 279 /* ImportSpecifier */:
- case 182 /* TypePredicate */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 239 /* SatisfiesExpression */:
+ case 230 /* ConditionalExpression */:
+ case 196 /* ConditionalType */:
+ case 237 /* AsExpression */:
+ case 287 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 184 /* TypePredicate */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 241 /* SatisfiesExpression */:
return true;
- case 208 /* BindingElement */:
- case 268 /* TypeAliasDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 280 /* ExportAssignment */:
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 308 /* EnumMember */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 210 /* BindingElement */:
+ case 271 /* TypeAliasDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 311 /* EnumMember */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return context.currentTokenSpan.kind === 63 /* EqualsToken */ || context.nextTokenSpan.kind === 63 /* EqualsToken */;
- case 250 /* ForInStatement */:
- case 167 /* TypeParameter */:
+ case 252 /* ForInStatement */:
+ case 168 /* TypeParameter */:
return context.currentTokenSpan.kind === 102 /* InKeyword */ || context.nextTokenSpan.kind === 102 /* InKeyword */ || context.currentTokenSpan.kind === 63 /* EqualsToken */ || context.nextTokenSpan.kind === 63 /* EqualsToken */;
- case 251 /* ForOfStatement */:
- return context.currentTokenSpan.kind === 164 /* OfKeyword */ || context.nextTokenSpan.kind === 164 /* OfKeyword */;
+ case 253 /* ForOfStatement */:
+ return context.currentTokenSpan.kind === 165 /* OfKeyword */ || context.nextTokenSpan.kind === 165 /* OfKeyword */;
}
return false;
}
@@ -150753,16 +151011,16 @@ function isNotTypeAnnotationContext(context) {
}
function isTypeAnnotationContext(context) {
const contextKind = context.contextNode.kind;
- return contextKind === 171 /* PropertyDeclaration */ || contextKind === 170 /* PropertySignature */ || contextKind === 168 /* Parameter */ || contextKind === 261 /* VariableDeclaration */ || isFunctionLikeKind(contextKind);
+ return contextKind === 172 /* PropertyDeclaration */ || contextKind === 171 /* PropertySignature */ || contextKind === 169 /* Parameter */ || contextKind === 263 /* VariableDeclaration */ || isFunctionLikeKind(contextKind);
}
function isConditionalOperatorContext(context) {
- return context.contextNode.kind === 228 /* ConditionalExpression */ || context.contextNode.kind === 194 /* ConditionalType */;
+ return context.contextNode.kind === 230 /* ConditionalExpression */ || context.contextNode.kind === 196 /* ConditionalType */;
}
function isSameLineTokenOrBeforeBlockContext(context) {
return context.TokensAreOnSameLine() || isBeforeBlockContext(context);
}
function isBraceWrappedContext(context) {
- return context.contextNode.kind === 206 /* ObjectBindingPattern */ || context.contextNode.kind === 200 /* MappedType */ || isSingleLineBlockContext(context);
+ return context.contextNode.kind === 208 /* ObjectBindingPattern */ || context.contextNode.kind === 202 /* MappedType */ || isSingleLineBlockContext(context);
}
function isBeforeMultilineBlockContext(context) {
return isBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine());
@@ -150784,26 +151042,26 @@ function nodeIsBlockContext(node) {
return true;
}
switch (node.kind) {
- case 242 /* Block */:
- case 272 /* CaseBlock */:
- case 210 /* ObjectLiteralExpression */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 275 /* CaseBlock */:
+ case 212 /* ObjectLiteralExpression */:
+ case 274 /* ModuleBlock */:
return true;
}
return false;
}
function isFunctionDeclContext(context) {
switch (context.contextNode.kind) {
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 179 /* CallSignature */:
- case 218 /* FunctionExpression */:
- case 176 /* Constructor */:
- case 219 /* ArrowFunction */:
- case 267 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 181 /* CallSignature */:
+ case 220 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 221 /* ArrowFunction */:
+ case 270 /* InterfaceDeclaration */:
return true;
}
return false;
@@ -150812,41 +151070,41 @@ function isNotFunctionDeclContext(context) {
return !isFunctionDeclContext(context);
}
function isFunctionDeclarationOrFunctionExpressionContext(context) {
- return context.contextNode.kind === 263 /* FunctionDeclaration */ || context.contextNode.kind === 218 /* FunctionExpression */;
+ return context.contextNode.kind === 265 /* FunctionDeclaration */ || context.contextNode.kind === 220 /* FunctionExpression */;
}
function isTypeScriptDeclWithBlockContext(context) {
return nodeIsTypeScriptDeclWithBlockContext(context.contextNode);
}
function nodeIsTypeScriptDeclWithBlockContext(node) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 187 /* TypeLiteral */:
- case 270 /* ModuleDeclaration */:
- case 281 /* ExportDeclaration */:
- case 282 /* NamedExports */:
- case 275 /* ImportDeclaration */:
- case 278 /* NamedImports */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 189 /* TypeLiteral */:
+ case 273 /* ModuleDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 285 /* NamedExports */:
+ case 278 /* ImportDeclaration */:
+ case 281 /* NamedImports */:
return true;
}
return false;
}
function isAfterCodeBlockContext(context) {
switch (context.currentTokenParent.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 301 /* CatchClause */:
- case 271 /* ModuleBlock */:
- case 256 /* SwitchStatement */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 304 /* CatchClause */:
+ case 274 /* ModuleBlock */:
+ case 258 /* SwitchStatement */:
return true;
- case 242 /* Block */: {
+ case 244 /* Block */: {
const blockParent = context.currentTokenParent.parent;
- if (!blockParent || blockParent.kind !== 219 /* ArrowFunction */ && blockParent.kind !== 218 /* FunctionExpression */) {
+ if (!blockParent || blockParent.kind !== 221 /* ArrowFunction */ && blockParent.kind !== 220 /* FunctionExpression */) {
return true;
}
}
@@ -150855,29 +151113,29 @@ function isAfterCodeBlockContext(context) {
}
function isControlDeclContext(context) {
switch (context.contextNode.kind) {
- case 246 /* IfStatement */:
- case 256 /* SwitchStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 248 /* WhileStatement */:
- case 259 /* TryStatement */:
- case 247 /* DoStatement */:
- case 255 /* WithStatement */:
- case 301 /* CatchClause */:
+ case 248 /* IfStatement */:
+ case 258 /* SwitchStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 250 /* WhileStatement */:
+ case 261 /* TryStatement */:
+ case 249 /* DoStatement */:
+ case 257 /* WithStatement */:
+ case 304 /* CatchClause */:
return true;
default:
return false;
}
}
function isObjectContext(context) {
- return context.contextNode.kind === 210 /* ObjectLiteralExpression */;
+ return context.contextNode.kind === 212 /* ObjectLiteralExpression */;
}
function isFunctionCallContext(context) {
- return context.contextNode.kind === 213 /* CallExpression */;
+ return context.contextNode.kind === 215 /* CallExpression */;
}
function isNewContext(context) {
- return context.contextNode.kind === 214 /* NewExpression */;
+ return context.contextNode.kind === 216 /* NewExpression */;
}
function isFunctionCallOrNewContext(context) {
return isFunctionCallContext(context) || isNewContext(context);
@@ -150892,10 +151150,10 @@ function isNextTokenNotCloseParen(context) {
return context.nextTokenSpan.kind !== 21 /* CloseParenToken */;
}
function isArrowFunctionContext(context) {
- return context.contextNode.kind === 219 /* ArrowFunction */;
+ return context.contextNode.kind === 221 /* ArrowFunction */;
}
function isImportTypeContext(context) {
- return context.contextNode.kind === 205 /* ImportType */;
+ return context.contextNode.kind === 207 /* ImportType */;
}
function isNonJsxSameLineTokenContext(context) {
return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */;
@@ -150904,19 +151162,19 @@ function isNonJsxTextContext(context) {
return context.contextNode.kind !== 11 /* JsxText */;
}
function isNonJsxElementOrFragmentContext(context) {
- return context.contextNode.kind !== 287 /* JsxElement */ && context.contextNode.kind !== 291 /* JsxFragment */;
+ return context.contextNode.kind !== 290 /* JsxElement */ && context.contextNode.kind !== 294 /* JsxFragment */;
}
function isJsxExpressionContext(context) {
- return context.contextNode.kind === 297 /* JsxExpression */ || context.contextNode.kind === 296 /* JsxSpreadAttribute */;
+ return context.contextNode.kind === 300 /* JsxExpression */ || context.contextNode.kind === 299 /* JsxSpreadAttribute */;
}
function isNextTokenParentJsxAttribute(context) {
- return context.nextTokenParent.kind === 294 /* JsxAttribute */;
+ return context.nextTokenParent.kind === 297 /* JsxAttribute */;
}
function isJsxAttributeContext(context) {
- return context.contextNode.kind === 294 /* JsxAttribute */;
+ return context.contextNode.kind === 297 /* JsxAttribute */;
}
function isJsxSelfClosingElementContext(context) {
- return context.contextNode.kind === 288 /* JsxSelfClosingElement */;
+ return context.contextNode.kind === 291 /* JsxSelfClosingElement */;
}
function isNotBeforeBlockInFunctionDeclarationContext(context) {
return !isFunctionDeclContext(context) && !isBeforeBlockContext(context);
@@ -150928,45 +151186,45 @@ function nodeIsInDecoratorContext(node) {
while (node && isExpression(node)) {
node = node.parent;
}
- return node && node.kind === 169 /* Decorator */;
+ return node && node.kind === 170 /* Decorator */;
}
function isStartOfVariableDeclarationList(context) {
- return context.currentTokenParent.kind === 262 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos;
+ return context.currentTokenParent.kind === 264 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos;
}
function isNotFormatOnEnter(context) {
return context.formattingRequestKind !== 2 /* FormatOnEnter */;
}
function isModuleDeclContext(context) {
- return context.contextNode.kind === 270 /* ModuleDeclaration */;
+ return context.contextNode.kind === 273 /* ModuleDeclaration */;
}
function isObjectTypeContext(context) {
- return context.contextNode.kind === 187 /* TypeLiteral */;
+ return context.contextNode.kind === 189 /* TypeLiteral */;
}
function isConstructorSignatureContext(context) {
- return context.contextNode.kind === 180 /* ConstructSignature */;
+ return context.contextNode.kind === 182 /* ConstructSignature */;
}
function isTypeArgumentOrParameterOrAssertion(token, parent2) {
if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) {
return false;
}
switch (parent2.kind) {
- case 183 /* TypeReference */:
- case 216 /* TypeAssertionExpression */:
- case 268 /* TypeAliasDeclaration */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 234 /* ExpressionWithTypeArguments */:
+ case 185 /* TypeReference */:
+ case 218 /* TypeAssertionExpression */:
+ case 271 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
return true;
default:
return false;
@@ -150976,28 +151234,28 @@ function isTypeArgumentOrParameterOrAssertionContext(context) {
return isTypeArgumentOrParameterOrAssertion(context.currentTokenSpan, context.currentTokenParent) || isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent);
}
function isTypeAssertionContext(context) {
- return context.contextNode.kind === 216 /* TypeAssertionExpression */;
+ return context.contextNode.kind === 218 /* TypeAssertionExpression */;
}
function isVoidOpContext(context) {
- return context.currentTokenSpan.kind === 115 /* VoidKeyword */ && context.currentTokenParent.kind === 223 /* VoidExpression */;
+ return context.currentTokenSpan.kind === 115 /* VoidKeyword */ && context.currentTokenParent.kind === 225 /* VoidExpression */;
}
function isYieldOrYieldStarWithOperand(context) {
- return context.contextNode.kind === 230 /* YieldExpression */ && context.contextNode.expression !== void 0;
+ return context.contextNode.kind === 232 /* YieldExpression */ && context.contextNode.expression !== void 0;
}
function isNonNullAssertionContext(context) {
- return context.contextNode.kind === 236 /* NonNullExpression */;
+ return context.contextNode.kind === 238 /* NonNullExpression */;
}
function isNotStatementConditionContext(context) {
return !isStatementConditionContext(context);
}
function isStatementConditionContext(context) {
switch (context.contextNode.kind) {
- case 246 /* IfStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 248 /* IfStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return true;
default:
return false;
@@ -151023,16 +151281,16 @@ function isSemicolonDeletionContext(context) {
if (startLine === endLine) {
return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */;
}
- if (nextTokenKind === 241 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) {
+ if (nextTokenKind === 243 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) {
return false;
}
- if (context.contextNode.kind === 267 /* InterfaceDeclaration */ || context.contextNode.kind === 268 /* TypeAliasDeclaration */) {
+ if (context.contextNode.kind === 270 /* InterfaceDeclaration */ || context.contextNode.kind === 271 /* TypeAliasDeclaration */) {
return !isPropertySignature(context.currentTokenParent) || !!context.currentTokenParent.type || nextTokenKind !== 20 /* OpenParenToken */;
}
if (isPropertyDeclaration(context.currentTokenParent)) {
return !context.currentTokenParent.initializer;
}
- return context.currentTokenParent.kind !== 249 /* ForStatement */ && context.currentTokenParent.kind !== 243 /* EmptyStatement */ && context.currentTokenParent.kind !== 241 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ && nextTokenKind !== 40 /* MinusToken */ && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ && nextTokenKind !== 229 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */;
+ return context.currentTokenParent.kind !== 251 /* ForStatement */ && context.currentTokenParent.kind !== 245 /* EmptyStatement */ && context.currentTokenParent.kind !== 243 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ && nextTokenKind !== 40 /* MinusToken */ && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ && nextTokenKind !== 231 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */;
}
function isSemicolonInsertionContext(context) {
return positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile);
@@ -151107,12 +151365,12 @@ function buildMap(rules) {
return map2;
}
function getRuleBucketIndex(row, column) {
- Debug.assert(row <= 164 /* LastKeyword */ && column <= 164 /* LastKeyword */, "Must compute formatting context from tokens");
+ Debug.assert(row <= 165 /* LastKeyword */ && column <= 165 /* LastKeyword */, "Must compute formatting context from tokens");
return row * mapRowLength + column;
}
var maskBitSize = 5;
var mask = 31;
-var mapRowLength = 164 /* LastToken */ + 1;
+var mapRowLength = 165 /* LastToken */ + 1;
var RulesPosition = ((RulesPosition2) => {
RulesPosition2[RulesPosition2["StopRulesSpecific"] = 0] = "StopRulesSpecific";
RulesPosition2[RulesPosition2["StopRulesAny"] = maskBitSize * 1] = "StopRulesAny";
@@ -151218,18 +151476,18 @@ function findOutermostNodeWithinListLevel(node) {
}
function isListElement(parent2, node) {
switch (parent2.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return rangeContainsRange(parent2.members, node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const body = parent2.body;
- return !!body && body.kind === 271 /* ModuleBlock */ && rangeContainsRange(body.statements, node);
- case 314 /* SourceFile */:
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
+ return !!body && body.kind === 274 /* ModuleBlock */ && rangeContainsRange(body.statements, node);
+ case 317 /* SourceFile */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
return rangeContainsRange(parent2.statements, node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return rangeContainsRange(parent2.block.statements, node);
}
return false;
@@ -151443,26 +151701,26 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
return modifier.kind;
}
switch (node.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return 84 /* ClassKeyword */;
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return 85 /* StructKeyword */;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return 119 /* InterfaceKeyword */;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return 99 /* FunctionKeyword */;
- case 269 /* EnumDeclaration */:
- return 269 /* EnumDeclaration */;
- case 177 /* GetAccessor */:
+ case 272 /* EnumDeclaration */:
+ return 272 /* EnumDeclaration */;
+ case 179 /* GetAccessor */:
return 138 /* GetKeyword */;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return 152 /* SetKeyword */;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
if (node.asteriskToken) {
return 41 /* AsteriskToken */;
}
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
const name = getNameOfDeclaration(node);
if (name) {
return name.kind;
@@ -151502,15 +151760,15 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
case 43 /* SlashToken */:
case 31 /* GreaterThanToken */:
switch (container.kind) {
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return false;
}
break;
case 22 /* OpenBracketToken */:
case 23 /* CloseBracketToken */:
- if (container.kind !== 200 /* MappedType */) {
+ if (container.kind !== 202 /* MappedType */) {
return false;
}
break;
@@ -151594,11 +151852,11 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
return inheritedIndentation;
}
}
- const effectiveParentStartLine = child.kind === 169 /* Decorator */ ? childStartLine : undecoratedParentStartLine;
+ const effectiveParentStartLine = child.kind === 170 /* Decorator */ ? childStartLine : undecoratedParentStartLine;
const childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine);
processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta);
childContextNode = node;
- if (isFirstListItem && parent2.kind === 209 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) {
+ if (isFirstListItem && parent2.kind === 211 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) {
inheritedIndentation = childIndentation.indentation;
}
return inheritedIndentation;
@@ -151971,50 +152229,50 @@ function getRangeOfEnclosingComment(sourceFile, position, precedingToken, tokenA
}
function getOpenTokenForList(node, list) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 219 /* ArrowFunction */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 221 /* ArrowFunction */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
if (node.typeParameters === list) {
return 29 /* LessThanToken */;
} else if (node.parameters === list) {
return 20 /* OpenParenToken */;
}
break;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
if (node.typeArguments === list) {
return 29 /* LessThanToken */;
} else if (node.arguments === list) {
return 20 /* OpenParenToken */;
}
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
if (node.typeParameters === list) {
return 29 /* LessThanToken */;
}
break;
- case 183 /* TypeReference */:
- case 215 /* TaggedTemplateExpression */:
- case 186 /* TypeQuery */:
- case 234 /* ExpressionWithTypeArguments */:
- case 205 /* ImportType */:
+ case 185 /* TypeReference */:
+ case 217 /* TaggedTemplateExpression */:
+ case 188 /* TypeQuery */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 207 /* ImportType */:
if (node.typeArguments === list) {
return 29 /* LessThanToken */;
}
break;
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return 18 /* OpenBraceToken */;
}
return 0 /* Unknown */;
@@ -152097,11 +152355,11 @@ var SmartIndenter;
}
const lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line;
const currentToken = getTokenAtPosition(sourceFile, position);
- const isObjectLiteral = currentToken.kind === 18 /* OpenBraceToken */ && currentToken.parent.kind === 210 /* ObjectLiteralExpression */;
+ const isObjectLiteral = currentToken.kind === 18 /* OpenBraceToken */ && currentToken.parent.kind === 212 /* ObjectLiteralExpression */;
if (options.indentStyle === 1 /* Block */ || isObjectLiteral) {
return getBlockIndent(sourceFile, position, options);
}
- if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 227 /* BinaryExpression */) {
+ if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 229 /* BinaryExpression */) {
const actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options);
if (actualIndentation !== -1 /* Unknown */) {
return actualIndentation;
@@ -152109,7 +152367,7 @@ var SmartIndenter;
}
const containerList = getListByPosition(position, precedingToken.parent, sourceFile);
if (containerList && !rangeContainsRange(containerList, precedingToken)) {
- const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].indexOf(currentToken.parent.kind) !== -1;
+ const useTheSameBaseIndentation = [220 /* FunctionExpression */, 221 /* ArrowFunction */].indexOf(currentToken.parent.kind) !== -1;
const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize;
return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize;
}
@@ -152218,7 +152476,7 @@ var SmartIndenter;
}
}
function getActualIndentationForNode(current, parent2, currentLineAndChar, parentAndChildShareLine, sourceFile, options) {
- const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 314 /* SourceFile */ || !parentAndChildShareLine);
+ const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 317 /* SourceFile */ || !parentAndChildShareLine);
if (!useActualIndentation) {
return -1 /* Unknown */;
}
@@ -152256,7 +152514,7 @@ var SmartIndenter;
}
SmartIndenter2.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled;
function childStartsOnTheSameLineWithElseInIfStatement(parent2, child, childStartLine, sourceFile) {
- if (parent2.kind === 246 /* IfStatement */ && parent2.elseStatement === child) {
+ if (parent2.kind === 248 /* IfStatement */ && parent2.elseStatement === child) {
const elseKeyword = findChildOfKind(parent2, 92 /* ElseKeyword */, sourceFile);
Debug.assert(elseKeyword !== void 0);
const elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line;
@@ -152307,43 +152565,43 @@ var SmartIndenter;
}
function getListByRange(start, end, node, sourceFile) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return getList(node.typeArguments);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return getList(node.properties);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return getList(node.elements);
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return getList(node.members);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 176 /* Constructor */:
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 178 /* Constructor */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
return getList(node.typeParameters) || getList(node.parameters);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return getList(node.parameters);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 353 /* JSDocTemplateTag */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 356 /* JSDocTemplateTag */:
return getList(node.typeParameters);
- case 214 /* NewExpression */:
- case 213 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 215 /* CallExpression */:
return getList(node.typeArguments) || getList(node.arguments);
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return getList(node.declarations);
- case 278 /* NamedImports */:
- case 282 /* NamedExports */:
+ case 281 /* NamedImports */:
+ case 285 /* NamedExports */:
return getList(node.elements);
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return getList(node.elements);
}
function getList(list) {
@@ -152366,7 +152624,7 @@ var SmartIndenter;
return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options);
}
function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) {
- if (node.parent && node.parent.kind === 262 /* VariableDeclarationList */) {
+ if (node.parent && node.parent.kind === 264 /* VariableDeclarationList */) {
return -1 /* Unknown */;
}
const containingList = getContainingList(node, sourceFile);
@@ -152427,96 +152685,96 @@ var SmartIndenter;
function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) {
const childKind = child ? child.kind : 0 /* Unknown */;
switch (parent2.kind) {
- case 245 /* ExpressionStatement */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 209 /* ArrayLiteralExpression */:
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
- case 210 /* ObjectLiteralExpression */:
- case 187 /* TypeLiteral */:
- case 200 /* MappedType */:
- case 189 /* TupleType */:
- case 272 /* CaseBlock */:
- case 299 /* DefaultClause */:
- case 298 /* CaseClause */:
- case 217 /* ParenthesizedExpression */:
- case 211 /* PropertyAccessExpression */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 244 /* VariableStatement */:
- case 280 /* ExportAssignment */:
- case 254 /* ReturnStatement */:
- case 228 /* ConditionalExpression */:
- case 207 /* ArrayBindingPattern */:
- case 206 /* ObjectBindingPattern */:
- case 289 /* JsxOpeningElement */:
- case 292 /* JsxOpeningFragment */:
- case 288 /* JsxSelfClosingElement */:
- case 297 /* JsxExpression */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 168 /* Parameter */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 196 /* ParenthesizedType */:
- case 215 /* TaggedTemplateExpression */:
- case 224 /* AwaitExpression */:
- case 282 /* NamedExports */:
- case 278 /* NamedImports */:
- case 284 /* ExportSpecifier */:
- case 279 /* ImportSpecifier */:
- case 171 /* PropertyDeclaration */:
+ case 247 /* ExpressionStatement */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 211 /* ArrayLiteralExpression */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
+ case 212 /* ObjectLiteralExpression */:
+ case 189 /* TypeLiteral */:
+ case 202 /* MappedType */:
+ case 191 /* TupleType */:
+ case 275 /* CaseBlock */:
+ case 302 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 219 /* ParenthesizedExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 246 /* VariableStatement */:
+ case 283 /* ExportAssignment */:
+ case 256 /* ReturnStatement */:
+ case 230 /* ConditionalExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 292 /* JsxOpeningElement */:
+ case 295 /* JsxOpeningFragment */:
+ case 291 /* JsxSelfClosingElement */:
+ case 300 /* JsxExpression */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 169 /* Parameter */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 198 /* ParenthesizedType */:
+ case 217 /* TaggedTemplateExpression */:
+ case 226 /* AwaitExpression */:
+ case 285 /* NamedExports */:
+ case 281 /* NamedImports */:
+ case 287 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 172 /* PropertyDeclaration */:
return true;
- case 261 /* VariableDeclaration */:
- case 305 /* PropertyAssignment */:
- case 227 /* BinaryExpression */:
- if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 210 /* ObjectLiteralExpression */) {
+ case 263 /* VariableDeclaration */:
+ case 308 /* PropertyAssignment */:
+ case 229 /* BinaryExpression */:
+ if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 212 /* ObjectLiteralExpression */) {
return rangeIsOnOneLine(sourceFile, child);
}
- if (parent2.kind === 227 /* BinaryExpression */ && sourceFile && child && childKind === 287 /* JsxElement */) {
+ if (parent2.kind === 229 /* BinaryExpression */ && sourceFile && child && childKind === 290 /* JsxElement */) {
const parentStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, parent2.pos)).line;
const childStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, child.pos)).line;
return parentStartLine !== childStartLine;
}
- if (parent2.kind !== 227 /* BinaryExpression */) {
+ if (parent2.kind !== 229 /* BinaryExpression */) {
return true;
}
break;
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 249 /* ForStatement */:
- case 246 /* IfStatement */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- return childKind !== 242 /* Block */;
- case 219 /* ArrowFunction */:
- if (sourceFile && childKind === 217 /* ParenthesizedExpression */) {
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 248 /* IfStatement */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ return childKind !== 244 /* Block */;
+ case 221 /* ArrowFunction */:
+ if (sourceFile && childKind === 219 /* ParenthesizedExpression */) {
return rangeIsOnOneLine(sourceFile, child);
}
- return childKind !== 242 /* Block */;
- case 281 /* ExportDeclaration */:
- return childKind !== 282 /* NamedExports */;
- case 275 /* ImportDeclaration */:
- return childKind !== 276 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 278 /* NamedImports */;
- case 287 /* JsxElement */:
- return childKind !== 290 /* JsxClosingElement */;
- case 291 /* JsxFragment */:
- return childKind !== 293 /* JsxClosingFragment */;
- case 193 /* IntersectionType */:
- case 192 /* UnionType */:
- if (childKind === 187 /* TypeLiteral */ || childKind === 189 /* TupleType */) {
+ return childKind !== 244 /* Block */;
+ case 284 /* ExportDeclaration */:
+ return childKind !== 285 /* NamedExports */;
+ case 278 /* ImportDeclaration */:
+ return childKind !== 279 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 281 /* NamedImports */;
+ case 290 /* JsxElement */:
+ return childKind !== 293 /* JsxClosingElement */;
+ case 294 /* JsxFragment */:
+ return childKind !== 296 /* JsxClosingFragment */;
+ case 195 /* IntersectionType */:
+ case 194 /* UnionType */:
+ if (childKind === 189 /* TypeLiteral */ || childKind === 191 /* TupleType */) {
return false;
}
break;
@@ -152526,11 +152784,11 @@ var SmartIndenter;
SmartIndenter2.nodeWillIndentChild = nodeWillIndentChild;
function isControlFlowEndingStatement(kind, parent2) {
switch (kind) {
- case 254 /* ReturnStatement */:
- case 258 /* ThrowStatement */:
- case 252 /* ContinueStatement */:
- case 253 /* BreakStatement */:
- return parent2.kind !== 242 /* Block */;
+ case 256 /* ReturnStatement */:
+ case 260 /* ThrowStatement */:
+ case 254 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ return parent2.kind !== 244 /* Block */;
default:
return false;
}
@@ -154332,6 +154590,9 @@ __export(ts_exports3, {
isOptionalTypeNode: () => isOptionalTypeNode,
isOuterExpression: () => isOuterExpression,
isOutermostOptionalChain: () => isOutermostOptionalChain,
+ isOverloadDeclaration: () => isOverloadDeclaration,
+ isOverloadElement: () => isOverloadElement,
+ isOverloadPropertyDeclaration: () => isOverloadPropertyDeclaration,
isOverrideModifier: () => isOverrideModifier,
isPackedArrayLiteral: () => isPackedArrayLiteral,
isParameter: () => isParameter,
@@ -155666,7 +155927,7 @@ var createLogicalNot = Debug.deprecate(function createLogicalNot2(operand) {
}, factoryDeprecation);
var createNode2 = Debug.deprecate(function createNode3(kind, pos = 0, end = 0) {
return setTextRangePosEnd(
- kind === 314 /* SourceFile */ ? parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 79 /* Identifier */ ? parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 80 /* PrivateIdentifier */ ? parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !isNodeKind(kind) ? parseBaseNodeFactory.createBaseTokenNode(kind) : parseBaseNodeFactory.createBaseNode(kind),
+ kind === 317 /* SourceFile */ ? parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 79 /* Identifier */ ? parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 80 /* PrivateIdentifier */ ? parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !isNodeKind(kind) ? parseBaseNodeFactory.createBaseTokenNode(kind) : parseBaseNodeFactory.createBaseNode(kind),
pos,
end
);
@@ -155680,7 +155941,7 @@ var getMutableClone = Debug.deprecate(function getMutableClone2(node) {
// src/deprecatedCompat/4.0/renamedNodeTests.ts
var isTypeAssertion = Debug.deprecate(function isTypeAssertion2(node) {
- return node.kind === 216 /* TypeAssertionExpression */;
+ return node.kind === 218 /* TypeAssertionExpression */;
}, {
since: "4.0",
warnAfter: "4.1",
@@ -163860,7 +164121,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
}
const initialNode = getTouchingPropertyName(program.getSourceFile(file), position);
const symbol = program.getTypeChecker().getSymbolAtLocation(initialNode);
- const importSpecifier = symbol && getDeclarationOfKind(symbol, 279 /* ImportSpecifier */);
+ const importSpecifier = symbol && getDeclarationOfKind(symbol, 282 /* ImportSpecifier */);
if (!importSpecifier)
return void 0;
const nameToSearch = ((_a3 = importSpecifier.propertyName) == null ? void 0 : _a3.text) || importSpecifier.name.text;
@@ -166466,7 +166727,7 @@ function unwrapParenthesizedType(tsType) {
function findParentIf(asExpr) {
let node = asExpr.parent;
while (node) {
- if (node.kind === 246 /* IfStatement */) {
+ if (node.kind === 248 /* IfStatement */) {
return node;
}
node = node.parent;
@@ -166542,14 +166803,14 @@ function clearTrueSymbolAtLocationCache() {
trueSymbolAtLocationCache.clear();
}
function isTypeDeclSyntaxKind(kind) {
- return isStructDeclarationKind(kind) || kind === 269 /* EnumDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */;
+ return isStructDeclarationKind(kind) || kind === 272 /* EnumDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */;
}
function symbolHasDuplicateName(symbol, tsDeclKind) {
const symbolDecls = symbol == null ? void 0 : symbol.getDeclarations();
if (symbolDecls) {
for (const symDecl of symbolDecls) {
const declKind = symDecl.kind;
- const isNamespaceTypeCollision = isTypeDeclSyntaxKind(declKind) && tsDeclKind === 270 /* ModuleDeclaration */ || isTypeDeclSyntaxKind(tsDeclKind) && declKind === 270 /* ModuleDeclaration */;
+ const isNamespaceTypeCollision = isTypeDeclSyntaxKind(declKind) && tsDeclKind === 273 /* ModuleDeclaration */ || isTypeDeclSyntaxKind(tsDeclKind) && declKind === 273 /* ModuleDeclaration */;
if (declKind !== 79 /* Identifier */ && declKind !== tsDeclKind && !isNamespaceTypeCollision)
return true;
}
@@ -166661,12 +166922,12 @@ function isCompileTimeExpression(tsExpr) {
return isCompileTimeExpression(tsExpr.expression);
}
switch (tsExpr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return isPrefixUnaryExprValidEnumMemberInit(tsExpr);
- case 217 /* ParenthesizedExpression */:
- case 227 /* BinaryExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 229 /* BinaryExpression */:
return isBinaryExprValidEnumMemberInit(tsExpr);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isConditionalExprValidEnumMemberInit(tsExpr);
case 79 /* Identifier */:
return isIdentifierValidEnumMemberInit(tsExpr);
@@ -166674,7 +166935,7 @@ function isCompileTimeExpression(tsExpr) {
return true;
case 10 /* StringLiteral */:
return true;
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const propertyAccess = tsExpr;
if (isNumberConstantValue(propertyAccess)) {
return true;
@@ -166705,7 +166966,7 @@ function isConditionalExprValidEnumMemberInit(tsExpr) {
function isIdentifierValidEnumMemberInit(tsExpr) {
const tsSymbol = typeChecker.getSymbolAtLocation(tsExpr);
const tsDecl = getDeclaration2(tsSymbol);
- return !!tsDecl && (isVarDeclaration(tsDecl) && isConst(tsDecl.parent) || tsDecl.kind === 308 /* EnumMember */);
+ return !!tsDecl && (isVarDeclaration(tsDecl) && isConst(tsDecl.parent) || tsDecl.kind === 311 /* EnumMember */);
}
function isUnaryOpAllowedForEnumMemberInit(tsPrefixUnaryOp) {
return tsPrefixUnaryOp === 39 /* PlusToken */ || tsPrefixUnaryOp === 40 /* MinusToken */ || tsPrefixUnaryOp === 54 /* TildeToken */;
@@ -166882,7 +167143,7 @@ function validateObjectLiteralType(type) {
return type !== void 0 && type.isClassOrInterface() && hasDefaultCtor(type) && !hasReadonlyFields(type) && !isAbstractClass(type);
}
function isStructDeclarationKind(kind) {
- return kind === 265 /* StructDeclaration */;
+ return kind === 267 /* StructDeclaration */;
}
function isStructDeclaration2(node) {
return isStructDeclarationKind(node.kind);
@@ -167051,7 +167312,7 @@ function validateFields(type, objectLiteral) {
return true;
}
function isSupportedTypeNodeKind(kind) {
- return kind !== 132 /* AnyKeyword */ && kind !== 159 /* UnknownKeyword */ && kind !== 154 /* SymbolKeyword */ && kind !== 199 /* IndexedAccessType */ && kind !== 194 /* ConditionalType */ && kind !== 200 /* MappedType */ && kind !== 195 /* InferType */;
+ return kind !== 132 /* AnyKeyword */ && kind !== 159 /* UnknownKeyword */ && kind !== 154 /* SymbolKeyword */ && kind !== 201 /* IndexedAccessType */ && kind !== 196 /* ConditionalType */ && kind !== 202 /* MappedType */ && kind !== 197 /* InferType */;
}
function isSupportedType(typeNode) {
if (isParenthesizedTypeNode(typeNode))
@@ -168052,28 +168313,28 @@ LinterConfig.terminalTokens = new Set2([
LinterConfig.incrementOnlyTokens = new Map2([
[132 /* AnyKeyword */, 0 /* AnyType */],
[154 /* SymbolKeyword */, 1 /* SymbolType */],
- [197 /* ThisType */, 56 /* ThisType */],
- [186 /* TypeQuery */, 6 /* TypeQuery */],
- [221 /* DeleteExpression */, 33 /* DeleteOperator */],
+ [199 /* ThisType */, 56 /* ThisType */],
+ [188 /* TypeQuery */, 6 /* TypeQuery */],
+ [223 /* DeleteExpression */, 33 /* DeleteOperator */],
[13 /* RegularExpressionLiteral */, 7 /* RegexLiteral */],
- [182 /* TypePredicate */, 8 /* IsOperator */],
- [230 /* YieldExpression */, 10 /* YieldExpression */],
- [181 /* IndexSignature */, 14 /* IndexMember */],
- [255 /* WithStatement */, 15 /* WithStatement */],
- [199 /* IndexedAccessType */, 17 /* IndexedAccessType */],
+ [184 /* TypePredicate */, 8 /* IsOperator */],
+ [232 /* YieldExpression */, 10 /* YieldExpression */],
+ [183 /* IndexSignature */, 14 /* IndexMember */],
+ [257 /* WithStatement */, 15 /* WithStatement */],
+ [201 /* IndexedAccessType */, 17 /* IndexedAccessType */],
[159 /* UnknownKeyword */, 18 /* UnknownType */],
[102 /* InKeyword */, 20 /* InOperator */],
- [179 /* CallSignature */, 39 /* CallSignature */],
- [193 /* IntersectionType */, 23 /* IntersectionType */],
- [187 /* TypeLiteral */, 24 /* ObjectTypeLiteral */],
- [185 /* ConstructorType */, 38 /* ConstructorFuncs */],
+ [181 /* CallSignature */, 39 /* CallSignature */],
+ [195 /* IntersectionType */, 23 /* IntersectionType */],
+ [189 /* TypeLiteral */, 24 /* ObjectTypeLiteral */],
+ [187 /* ConstructorType */, 38 /* ConstructorFuncs */],
[80 /* PrivateIdentifier */, 41 /* PrivateIdentifier */],
- [194 /* ConditionalType */, 43 /* ConditionalType */],
- [200 /* MappedType */, 44 /* MappedType */],
- [287 /* JsxElement */, 51 /* JsxElement */],
- [288 /* JsxSelfClosingElement */, 51 /* JsxElement */],
- [274 /* ImportEqualsDeclaration */, 61 /* ImportAssignment */],
- [273 /* NamespaceExportDeclaration */, 67 /* UMDModuleDefinition */]
+ [196 /* ConditionalType */, 43 /* ConditionalType */],
+ [202 /* MappedType */, 44 /* MappedType */],
+ [290 /* JsxElement */, 51 /* JsxElement */],
+ [291 /* JsxSelfClosingElement */, 51 /* JsxElement */],
+ [277 /* ImportEqualsDeclaration */, 61 /* ImportAssignment */],
+ [276 /* NamespaceExportDeclaration */, 67 /* UMDModuleDefinition */]
]);
// src/linter/ArkTSLinter_1_0/TypeScriptLinter.ts
@@ -168082,53 +168343,53 @@ var _TypeScriptLinter = class {
this.sourceFile = sourceFile;
this.tscStrictDiagnostics = tscStrictDiagnostics;
this.handlersMap = new Map2([
- [210 /* ObjectLiteralExpression */, this.handleObjectLiteralExpression],
- [209 /* ArrayLiteralExpression */, this.handleArrayLiteralExpression],
- [168 /* Parameter */, this.handleParameter],
- [269 /* EnumDeclaration */, this.handleEnumDeclaration],
- [267 /* InterfaceDeclaration */, this.handleInterfaceDeclaration],
- [258 /* ThrowStatement */, this.handleThrowStatement],
- [276 /* ImportClause */, this.handleImportClause],
- [249 /* ForStatement */, this.handleForStatement],
- [250 /* ForInStatement */, this.handleForInStatement],
- [251 /* ForOfStatement */, this.handleForOfStatement],
- [275 /* ImportDeclaration */, this.handleImportDeclaration],
- [211 /* PropertyAccessExpression */, this.handlePropertyAccessExpression],
- [171 /* PropertyDeclaration */, this.handlePropertyAssignmentOrDeclaration],
- [305 /* PropertyAssignment */, this.handlePropertyAssignmentOrDeclaration],
- [218 /* FunctionExpression */, this.handleFunctionExpression],
- [219 /* ArrowFunction */, this.handleArrowFunction],
- [232 /* ClassExpression */, this.handleClassExpression],
- [301 /* CatchClause */, this.handleCatchClause],
- [263 /* FunctionDeclaration */, this.handleFunctionDeclaration],
- [225 /* PrefixUnaryExpression */, this.handlePrefixUnaryExpression],
- [227 /* BinaryExpression */, this.handleBinaryExpression],
- [262 /* VariableDeclarationList */, this.handleVariableDeclarationList],
- [261 /* VariableDeclaration */, this.handleVariableDeclaration],
- [264 /* ClassDeclaration */, this.handleClassDeclaration],
- [270 /* ModuleDeclaration */, this.handleModuleDeclaration],
- [268 /* TypeAliasDeclaration */, this.handleTypeAliasDeclaration],
- [279 /* ImportSpecifier */, this.handleImportSpecifier],
- [277 /* NamespaceImport */, this.handleNamespaceImport],
- [216 /* TypeAssertionExpression */, this.handleTypeAssertionExpression],
- [174 /* MethodDeclaration */, this.handleMethodDeclaration],
+ [212 /* ObjectLiteralExpression */, this.handleObjectLiteralExpression],
+ [211 /* ArrayLiteralExpression */, this.handleArrayLiteralExpression],
+ [169 /* Parameter */, this.handleParameter],
+ [272 /* EnumDeclaration */, this.handleEnumDeclaration],
+ [270 /* InterfaceDeclaration */, this.handleInterfaceDeclaration],
+ [260 /* ThrowStatement */, this.handleThrowStatement],
+ [279 /* ImportClause */, this.handleImportClause],
+ [251 /* ForStatement */, this.handleForStatement],
+ [252 /* ForInStatement */, this.handleForInStatement],
+ [253 /* ForOfStatement */, this.handleForOfStatement],
+ [278 /* ImportDeclaration */, this.handleImportDeclaration],
+ [213 /* PropertyAccessExpression */, this.handlePropertyAccessExpression],
+ [172 /* PropertyDeclaration */, this.handlePropertyAssignmentOrDeclaration],
+ [308 /* PropertyAssignment */, this.handlePropertyAssignmentOrDeclaration],
+ [220 /* FunctionExpression */, this.handleFunctionExpression],
+ [221 /* ArrowFunction */, this.handleArrowFunction],
+ [234 /* ClassExpression */, this.handleClassExpression],
+ [304 /* CatchClause */, this.handleCatchClause],
+ [265 /* FunctionDeclaration */, this.handleFunctionDeclaration],
+ [227 /* PrefixUnaryExpression */, this.handlePrefixUnaryExpression],
+ [229 /* BinaryExpression */, this.handleBinaryExpression],
+ [264 /* VariableDeclarationList */, this.handleVariableDeclarationList],
+ [263 /* VariableDeclaration */, this.handleVariableDeclaration],
+ [266 /* ClassDeclaration */, this.handleClassDeclaration],
+ [273 /* ModuleDeclaration */, this.handleModuleDeclaration],
+ [271 /* TypeAliasDeclaration */, this.handleTypeAliasDeclaration],
+ [282 /* ImportSpecifier */, this.handleImportSpecifier],
+ [280 /* NamespaceImport */, this.handleNamespaceImport],
+ [218 /* TypeAssertionExpression */, this.handleTypeAssertionExpression],
+ [176 /* MethodDeclaration */, this.handleMethodDeclaration],
[79 /* Identifier */, this.handleIdentifier],
- [212 /* ElementAccessExpression */, this.handleElementAccessExpression],
- [308 /* EnumMember */, this.handleEnumMember],
- [183 /* TypeReference */, this.handleTypeReference],
- [280 /* ExportAssignment */, this.handleExportAssignment],
- [213 /* CallExpression */, this.handleCallExpression],
- [237 /* MetaProperty */, this.handleMetaProperty],
- [214 /* NewExpression */, this.handleNewExpression],
- [235 /* AsExpression */, this.handleAsExpression],
- [231 /* SpreadElement */, this.handleSpreadOp],
- [307 /* SpreadAssignment */, this.handleSpreadOp],
- [177 /* GetAccessor */, this.handleGetAccessor],
- [178 /* SetAccessor */, this.handleSetAccessor],
- [180 /* ConstructSignature */, this.handleConstructSignature],
- [234 /* ExpressionWithTypeArguments */, this.handleExpressionWithTypeArguments],
- [166 /* ComputedPropertyName */, this.handleComputedPropertyName],
- [175 /* ClassStaticBlockDeclaration */, this.handleClassStaticBlockDeclaration]
+ [214 /* ElementAccessExpression */, this.handleElementAccessExpression],
+ [311 /* EnumMember */, this.handleEnumMember],
+ [185 /* TypeReference */, this.handleTypeReference],
+ [283 /* ExportAssignment */, this.handleExportAssignment],
+ [215 /* CallExpression */, this.handleCallExpression],
+ [239 /* MetaProperty */, this.handleMetaProperty],
+ [216 /* NewExpression */, this.handleNewExpression],
+ [237 /* AsExpression */, this.handleAsExpression],
+ [233 /* SpreadElement */, this.handleSpreadOp],
+ [310 /* SpreadAssignment */, this.handleSpreadOp],
+ [179 /* GetAccessor */, this.handleGetAccessor],
+ [180 /* SetAccessor */, this.handleSetAccessor],
+ [182 /* ConstructSignature */, this.handleConstructSignature],
+ [236 /* ExpressionWithTypeArguments */, this.handleExpressionWithTypeArguments],
+ [167 /* ComputedPropertyName */, this.handleComputedPropertyName],
+ [177 /* ClassStaticBlockDeclaration */, this.handleClassStaticBlockDeclaration]
]);
this.validatedTypesSet = new Set2();
_TypeScriptLinter.tsTypeChecker = tsProgram.getLinterTypeChecker();
@@ -168357,28 +168618,28 @@ var _TypeScriptLinter = class {
if (!p.declarations)
continue;
const decl = p.declarations[0];
- if (decl.kind === 173 /* MethodSignature */) {
+ if (decl.kind === 175 /* MethodSignature */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 174 /* MethodDeclaration */) {
+ } else if (decl.kind === 176 /* MethodDeclaration */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 171 /* PropertyDeclaration */) {
+ } else if (decl.kind === 172 /* PropertyDeclaration */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 170 /* PropertySignature */) {
+ } else if (decl.kind === 171 /* PropertySignature */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
@@ -168406,7 +168667,7 @@ var _TypeScriptLinter = class {
let noContextTypeForArrayLiteral = false;
const arrayLitElements = arrayLitNode.elements;
for (const element of arrayLitElements) {
- if (element.kind === 210 /* ObjectLiteralExpression */) {
+ if (element.kind === 212 /* ObjectLiteralExpression */) {
const objectLiteralType = _TypeScriptLinter.tsTypeChecker.getContextualType(element);
if (!isDynamicLiteralInitializer(arrayLitNode) && !isExpressionAssignableToType(objectLiteralType, element)) {
noContextTypeForArrayLiteral = true;
@@ -168441,7 +168702,7 @@ var _TypeScriptLinter = class {
return;
let enumDeclCount = 0;
for (const decl of enumDecls) {
- if (decl.kind === 269 /* EnumDeclaration */)
+ if (decl.kind === 272 /* EnumDeclaration */)
enumDeclCount++;
}
if (enumDeclCount > 1)
@@ -168454,7 +168715,7 @@ var _TypeScriptLinter = class {
if (iDecls) {
let iDeclCount = 0;
for (const decl of iDecls) {
- if (decl.kind === 267 /* InterfaceDeclaration */)
+ if (decl.kind === 270 /* InterfaceDeclaration */)
iDeclCount++;
}
if (iDeclCount > 1)
@@ -168800,11 +169061,11 @@ var _TypeScriptLinter = class {
} else if (tsBinaryExpr.operatorToken.kind === 27 /* CommaToken */) {
let tsExprNode = tsBinaryExpr;
let tsParentNode = tsExprNode.parent;
- while (tsParentNode && tsParentNode.kind === 227 /* BinaryExpression */) {
+ while (tsParentNode && tsParentNode.kind === 229 /* BinaryExpression */) {
tsExprNode = tsParentNode;
tsParentNode = tsExprNode.parent;
}
- if (tsParentNode && tsParentNode.kind === 249 /* ForStatement */) {
+ if (tsParentNode && tsParentNode.kind === 251 /* ForStatement */) {
const tsForNode = tsParentNode;
if (tsExprNode === tsForNode.initializer || tsExprNode === tsForNode.incrementor)
return;
@@ -168943,15 +169204,15 @@ var _TypeScriptLinter = class {
if (isModuleBlock(tsModuleBody)) {
for (const tsModuleStmt of tsModuleBody.statements) {
switch (tsModuleStmt.kind) {
- case 244 /* VariableStatement */:
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 246 /* VariableStatement */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 284 /* ExportDeclaration */:
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
break;
default:
this.incrementCounters(tsModuleStmt, 47 /* NonDeclarationInNamespace */);
@@ -169073,7 +169334,7 @@ var _TypeScriptLinter = class {
handleRestrictedValues(tsIdentifier, tsIdentSym) {
const illegalValues = 128 /* ConstEnum */ | 256 /* RegularEnum */ | 512 /* ValueModule */ | 32 /* Class */;
if ((tsIdentSym.flags & 512 /* ValueModule */) !== 0) {
- if (!!tsIdentSym && symbolHasDuplicateName(tsIdentSym, 270 /* ModuleDeclaration */)) {
+ if (!!tsIdentSym && symbolHasDuplicateName(tsIdentSym, 273 /* ModuleDeclaration */)) {
return;
}
}
@@ -169199,7 +169460,7 @@ var _TypeScriptLinter = class {
}
handleGenericCallWithNoTypeArgs(callLikeExpr, callSignature) {
var _a2, _b;
- const tsSyntaxKind = isNewExpression(callLikeExpr) ? 176 /* Constructor */ : 263 /* FunctionDeclaration */;
+ const tsSyntaxKind = isNewExpression(callLikeExpr) ? 178 /* Constructor */ : 265 /* FunctionDeclaration */;
const signDecl = _TypeScriptLinter.tsTypeChecker.signatureToSignatureDeclaration(
callSignature,
tsSyntaxKind,
@@ -169392,10 +169653,10 @@ var _TypeScriptLinter = class {
}
handleConstructSignature(node) {
switch (node.parent.kind) {
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
this.incrementCounters(node, 36 /* ConstructorType */);
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
this.incrementCounters(node, 37 /* ConstructorIface */);
break;
default:
@@ -170720,13 +170981,13 @@ var SENDABLE_DECORATOR = "Sendable";
var SENDABLE_INTERFACE = "ISendable";
var PROMISE = "Promise";
var SENDABLE_DECORATOR_NODES = [
- 264 /* ClassDeclaration */,
- 263 /* FunctionDeclaration */,
- 268 /* TypeAliasDeclaration */
+ 266 /* ClassDeclaration */,
+ 265 /* FunctionDeclaration */,
+ 271 /* TypeAliasDeclaration */
];
var SENDABLE_CLOSURE_DECLS = [
- 264 /* ClassDeclaration */,
- 263 /* FunctionDeclaration */
+ 266 /* ClassDeclaration */,
+ 265 /* FunctionDeclaration */
];
var ARKTS_COLLECTIONS_D_ETS = "@arkts.collections.d.ets";
var COLLECTIONS_NAMESPACE = "collections";
@@ -170812,7 +171073,7 @@ function getInstanceofUnsupportedHighlightRange(nodeOrComment) {
return getKeywordHighlightRange(nodeOrComment.operatorToken, "instanceof");
}
function getConstAssertionHighlightRange(nodeOrComment) {
- if (nodeOrComment.kind === 235 /* AsExpression */) {
+ if (nodeOrComment.kind === 237 /* AsExpression */) {
return [
nodeOrComment.expression.getEnd() + 1,
nodeOrComment.type.getStart() - 1
@@ -170825,11 +171086,11 @@ function getConstAssertionHighlightRange(nodeOrComment) {
}
function getLimitedReturnTypeInferenceHighlightRange(nodeOrComment) {
let node;
- if (nodeOrComment.kind === 218 /* FunctionExpression */) {
+ if (nodeOrComment.kind === 220 /* FunctionExpression */) {
node = nodeOrComment.type;
- } else if (nodeOrComment.kind === 263 /* FunctionDeclaration */) {
+ } else if (nodeOrComment.kind === 265 /* FunctionDeclaration */) {
node = nodeOrComment.name;
- } else if (nodeOrComment.kind === 174 /* MethodDeclaration */) {
+ } else if (nodeOrComment.kind === 176 /* MethodDeclaration */) {
node = nodeOrComment.name;
}
if (node !== void 0) {
@@ -170928,7 +171189,7 @@ function unwrapParenthesizedType2(tsType) {
function findParentIf2(asExpr) {
let node = asExpr.parent;
while (node) {
- if (node.kind === 246 /* IfStatement */) {
+ if (node.kind === 248 /* IfStatement */) {
return node;
}
node = node.parent;
@@ -171006,14 +171267,14 @@ function clearTrueSymbolAtLocationCache2() {
trueSymbolAtLocationCache2.clear();
}
function isTypeDeclSyntaxKind2(kind) {
- return isStructDeclarationKind2(kind) || kind === 269 /* EnumDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */;
+ return isStructDeclarationKind2(kind) || kind === 272 /* EnumDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */;
}
function symbolHasDuplicateName2(symbol, tsDeclKind) {
const symbolDecls = symbol == null ? void 0 : symbol.getDeclarations();
if (symbolDecls) {
for (const symDecl of symbolDecls) {
const declKind = symDecl.kind;
- const isNamespaceTypeCollision = isTypeDeclSyntaxKind2(declKind) && tsDeclKind === 270 /* ModuleDeclaration */ || isTypeDeclSyntaxKind2(tsDeclKind) && declKind === 270 /* ModuleDeclaration */;
+ const isNamespaceTypeCollision = isTypeDeclSyntaxKind2(declKind) && tsDeclKind === 273 /* ModuleDeclaration */ || isTypeDeclSyntaxKind2(tsDeclKind) && declKind === 273 /* ModuleDeclaration */;
if (declKind !== 79 /* Identifier */ && declKind !== tsDeclKind && !isNamespaceTypeCollision)
return true;
}
@@ -171176,12 +171437,12 @@ function isCompileTimeExpression2(tsExpr) {
return isCompileTimeExpression2(tsExpr.expression);
}
switch (tsExpr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return isPrefixUnaryExprValidEnumMemberInit2(tsExpr);
- case 217 /* ParenthesizedExpression */:
- case 227 /* BinaryExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 229 /* BinaryExpression */:
return isBinaryExprValidEnumMemberInit2(tsExpr);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isConditionalExprValidEnumMemberInit2(tsExpr);
case 79 /* Identifier */:
return isIdentifierValidEnumMemberInit2(tsExpr);
@@ -171189,7 +171450,7 @@ function isCompileTimeExpression2(tsExpr) {
return true;
case 10 /* StringLiteral */:
return true;
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const propertyAccess = tsExpr;
if (isNumberConstantValue2(propertyAccess)) {
return true;
@@ -171220,7 +171481,7 @@ function isConditionalExprValidEnumMemberInit2(tsExpr) {
function isIdentifierValidEnumMemberInit2(tsExpr) {
const tsSymbol = typeChecker2.getSymbolAtLocation(tsExpr);
const tsDecl = getDeclaration3(tsSymbol);
- return !!tsDecl && (isVarDeclaration2(tsDecl) && isConst2(tsDecl.parent) || tsDecl.kind === 308 /* EnumMember */);
+ return !!tsDecl && (isVarDeclaration2(tsDecl) && isConst2(tsDecl.parent) || tsDecl.kind === 311 /* EnumMember */);
}
function isUnaryOpAllowedForEnumMemberInit2(tsPrefixUnaryOp) {
return tsPrefixUnaryOp === 39 /* PlusToken */ || tsPrefixUnaryOp === 40 /* MinusToken */ || tsPrefixUnaryOp === 54 /* TildeToken */;
@@ -171463,7 +171724,7 @@ function validateObjectLiteralType2(type) {
return type !== void 0 && type.isClassOrInterface() && hasDefaultCtor2(type) && !hasReadonlyFields2(type) && !isAbstractClass2(type);
}
function isStructDeclarationKind2(kind) {
- return kind === 265 /* StructDeclaration */;
+ return kind === 267 /* StructDeclaration */;
}
function isStructDeclaration3(node) {
return isStructDeclarationKind2(node.kind);
@@ -171600,7 +171861,7 @@ function validateField(type, prop) {
return true;
}
function isSupportedTypeNodeKind2(kind) {
- return kind !== 132 /* AnyKeyword */ && kind !== 159 /* UnknownKeyword */ && kind !== 154 /* SymbolKeyword */ && kind !== 199 /* IndexedAccessType */ && kind !== 194 /* ConditionalType */ && kind !== 200 /* MappedType */ && kind !== 195 /* InferType */;
+ return kind !== 132 /* AnyKeyword */ && kind !== 159 /* UnknownKeyword */ && kind !== 154 /* SymbolKeyword */ && kind !== 201 /* IndexedAccessType */ && kind !== 196 /* ConditionalType */ && kind !== 202 /* MappedType */ && kind !== 197 /* InferType */;
}
function isSupportedType2(typeNode) {
if (isParenthesizedTypeNode(typeNode))
@@ -172368,7 +172629,7 @@ function getDecoratorsIfInSendableClass(declaration) {
return getDecorators(declaration);
}
function getClassNodeFromDeclaration(declaration) {
- if (declaration.kind === 168 /* Parameter */) {
+ if (declaration.kind === 169 /* Parameter */) {
return isClassDeclaration(declaration.parent.parent) ? declaration.parent.parent : void 0;
}
return isClassDeclaration(declaration.parent) ? declaration.parent : void 0;
@@ -172944,26 +173205,26 @@ LinterConfig2.terminalTokens = new Set2([
LinterConfig2.incrementOnlyTokens = new Map2([
[132 /* AnyKeyword */, 0 /* AnyType */],
[154 /* SymbolKeyword */, 1 /* SymbolType */],
- [197 /* ThisType */, 53 /* ThisType */],
- [186 /* TypeQuery */, 6 /* TypeQuery */],
- [221 /* DeleteExpression */, 30 /* DeleteOperator */],
- [182 /* TypePredicate */, 7 /* IsOperator */],
- [230 /* YieldExpression */, 9 /* YieldExpression */],
- [255 /* WithStatement */, 14 /* WithStatement */],
- [199 /* IndexedAccessType */, 16 /* IndexedAccessType */],
+ [199 /* ThisType */, 53 /* ThisType */],
+ [188 /* TypeQuery */, 6 /* TypeQuery */],
+ [223 /* DeleteExpression */, 30 /* DeleteOperator */],
+ [184 /* TypePredicate */, 7 /* IsOperator */],
+ [232 /* YieldExpression */, 9 /* YieldExpression */],
+ [257 /* WithStatement */, 14 /* WithStatement */],
+ [201 /* IndexedAccessType */, 16 /* IndexedAccessType */],
[159 /* UnknownKeyword */, 17 /* UnknownType */],
- [179 /* CallSignature */, 36 /* CallSignature */],
- [193 /* IntersectionType */, 21 /* IntersectionType */],
- [187 /* TypeLiteral */, 22 /* ObjectTypeLiteral */],
- [185 /* ConstructorType */, 35 /* ConstructorFuncs */],
+ [181 /* CallSignature */, 36 /* CallSignature */],
+ [195 /* IntersectionType */, 21 /* IntersectionType */],
+ [189 /* TypeLiteral */, 22 /* ObjectTypeLiteral */],
+ [187 /* ConstructorType */, 35 /* ConstructorFuncs */],
[80 /* PrivateIdentifier */, 38 /* PrivateIdentifier */],
- [194 /* ConditionalType */, 40 /* ConditionalType */],
- [200 /* MappedType */, 41 /* MappedType */],
- [287 /* JsxElement */, 48 /* JsxElement */],
- [288 /* JsxSelfClosingElement */, 48 /* JsxElement */],
- [274 /* ImportEqualsDeclaration */, 57 /* ImportAssignment */],
- [273 /* NamespaceExportDeclaration */, 63 /* UMDModuleDefinition */],
- [232 /* ClassExpression */, 25 /* ClassExpression */]
+ [196 /* ConditionalType */, 40 /* ConditionalType */],
+ [202 /* MappedType */, 41 /* MappedType */],
+ [290 /* JsxElement */, 48 /* JsxElement */],
+ [291 /* JsxSelfClosingElement */, 48 /* JsxElement */],
+ [277 /* ImportEqualsDeclaration */, 57 /* ImportAssignment */],
+ [276 /* NamespaceExportDeclaration */, 63 /* UMDModuleDefinition */],
+ [234 /* ClassExpression */, 25 /* ClassExpression */]
]);
// src/linter/ArkTSLinter_1_1/TypeScriptLinter.ts
@@ -172975,60 +173236,60 @@ var _TypeScriptLinter2 = class {
this.compatibleSdkVersion = 12;
this.mixCompile = false;
this.handlersMap = new Map2([
- [210 /* ObjectLiteralExpression */, { handler: this.handleObjectLiteralExpression, name: "handleObjectLiteralExpression" }],
- [209 /* ArrayLiteralExpression */, { handler: this.handleArrayLiteralExpression, name: "handleArrayLiteralExpression" }],
- [168 /* Parameter */, { handler: this.handleParameter, name: "handleParameter" }],
- [269 /* EnumDeclaration */, { handler: this.handleEnumDeclaration, name: "handleEnumDeclaration" }],
- [267 /* InterfaceDeclaration */, { handler: this.handleInterfaceDeclaration, name: "handleInterfaceDeclaration" }],
- [258 /* ThrowStatement */, { handler: this.handleThrowStatement, name: "handleThrowStatement" }],
- [276 /* ImportClause */, { handler: this.handleImportClause, name: "handleImportClause" }],
- [249 /* ForStatement */, { handler: this.handleForStatement, name: "handleForStatement" }],
- [250 /* ForInStatement */, { handler: this.handleForInStatement, name: "handleForInStatement" }],
- [251 /* ForOfStatement */, { handler: this.handleForOfStatement, name: "handleForOfStatement" }],
- [275 /* ImportDeclaration */, { handler: this.handleImportDeclaration, name: "handleImportDeclaration" }],
- [211 /* PropertyAccessExpression */, { handler: this.handlePropertyAccessExpression, name: "handlePropertyAccessExpression" }],
- [171 /* PropertyDeclaration */, { handler: this.handlePropertyDeclaration, name: "handlePropertyDeclaration" }],
- [305 /* PropertyAssignment */, { handler: this.handlePropertyAssignment, name: "handlePropertyAssignment" }],
- [170 /* PropertySignature */, { handler: this.handlePropertySignature, name: "handlePropertySignature" }],
- [218 /* FunctionExpression */, { handler: this.handleFunctionExpression, name: "handleFunctionExpression" }],
- [219 /* ArrowFunction */, { handler: this.handleArrowFunction, name: "handleArrowFunction" }],
- [301 /* CatchClause */, { handler: this.handleCatchClause, name: "handleCatchClause" }],
- [263 /* FunctionDeclaration */, { handler: this.handleFunctionDeclaration, name: "handleFunctionDeclaration" }],
- [225 /* PrefixUnaryExpression */, { handler: this.handlePrefixUnaryExpression, name: "handlePrefixUnaryExpression" }],
- [227 /* BinaryExpression */, { handler: this.handleBinaryExpression, name: "handleBinaryExpression" }],
- [262 /* VariableDeclarationList */, { handler: this.handleVariableDeclarationList, name: "handleVariableDeclarationList" }],
- [261 /* VariableDeclaration */, { handler: this.handleVariableDeclaration, name: "handleVariableDeclaration" }],
- [264 /* ClassDeclaration */, { handler: this.handleClassDeclaration, name: "handleClassDeclaration" }],
- [270 /* ModuleDeclaration */, { handler: this.handleModuleDeclaration, name: "handleModuleDeclaration" }],
- [268 /* TypeAliasDeclaration */, { handler: this.handleTypeAliasDeclaration, name: "handleTypeAliasDeclaration" }],
- [279 /* ImportSpecifier */, { handler: this.handleImportSpecifier, name: "handleImportSpecifier" }],
- [277 /* NamespaceImport */, { handler: this.handleNamespaceImport, name: "handleNamespaceImport" }],
- [216 /* TypeAssertionExpression */, { handler: this.handleTypeAssertionExpression, name: "handleTypeAssertionExpression" }],
- [174 /* MethodDeclaration */, { handler: this.handleMethodDeclaration, name: "handleMethodDeclaration" }],
- [173 /* MethodSignature */, { handler: this.handleMethodSignature, name: "handleMethodSignature" }],
+ [212 /* ObjectLiteralExpression */, { handler: this.handleObjectLiteralExpression, name: "handleObjectLiteralExpression" }],
+ [211 /* ArrayLiteralExpression */, { handler: this.handleArrayLiteralExpression, name: "handleArrayLiteralExpression" }],
+ [169 /* Parameter */, { handler: this.handleParameter, name: "handleParameter" }],
+ [272 /* EnumDeclaration */, { handler: this.handleEnumDeclaration, name: "handleEnumDeclaration" }],
+ [270 /* InterfaceDeclaration */, { handler: this.handleInterfaceDeclaration, name: "handleInterfaceDeclaration" }],
+ [260 /* ThrowStatement */, { handler: this.handleThrowStatement, name: "handleThrowStatement" }],
+ [279 /* ImportClause */, { handler: this.handleImportClause, name: "handleImportClause" }],
+ [251 /* ForStatement */, { handler: this.handleForStatement, name: "handleForStatement" }],
+ [252 /* ForInStatement */, { handler: this.handleForInStatement, name: "handleForInStatement" }],
+ [253 /* ForOfStatement */, { handler: this.handleForOfStatement, name: "handleForOfStatement" }],
+ [278 /* ImportDeclaration */, { handler: this.handleImportDeclaration, name: "handleImportDeclaration" }],
+ [213 /* PropertyAccessExpression */, { handler: this.handlePropertyAccessExpression, name: "handlePropertyAccessExpression" }],
+ [172 /* PropertyDeclaration */, { handler: this.handlePropertyDeclaration, name: "handlePropertyDeclaration" }],
+ [308 /* PropertyAssignment */, { handler: this.handlePropertyAssignment, name: "handlePropertyAssignment" }],
+ [171 /* PropertySignature */, { handler: this.handlePropertySignature, name: "handlePropertySignature" }],
+ [220 /* FunctionExpression */, { handler: this.handleFunctionExpression, name: "handleFunctionExpression" }],
+ [221 /* ArrowFunction */, { handler: this.handleArrowFunction, name: "handleArrowFunction" }],
+ [304 /* CatchClause */, { handler: this.handleCatchClause, name: "handleCatchClause" }],
+ [265 /* FunctionDeclaration */, { handler: this.handleFunctionDeclaration, name: "handleFunctionDeclaration" }],
+ [227 /* PrefixUnaryExpression */, { handler: this.handlePrefixUnaryExpression, name: "handlePrefixUnaryExpression" }],
+ [229 /* BinaryExpression */, { handler: this.handleBinaryExpression, name: "handleBinaryExpression" }],
+ [264 /* VariableDeclarationList */, { handler: this.handleVariableDeclarationList, name: "handleVariableDeclarationList" }],
+ [263 /* VariableDeclaration */, { handler: this.handleVariableDeclaration, name: "handleVariableDeclaration" }],
+ [266 /* ClassDeclaration */, { handler: this.handleClassDeclaration, name: "handleClassDeclaration" }],
+ [273 /* ModuleDeclaration */, { handler: this.handleModuleDeclaration, name: "handleModuleDeclaration" }],
+ [271 /* TypeAliasDeclaration */, { handler: this.handleTypeAliasDeclaration, name: "handleTypeAliasDeclaration" }],
+ [282 /* ImportSpecifier */, { handler: this.handleImportSpecifier, name: "handleImportSpecifier" }],
+ [280 /* NamespaceImport */, { handler: this.handleNamespaceImport, name: "handleNamespaceImport" }],
+ [218 /* TypeAssertionExpression */, { handler: this.handleTypeAssertionExpression, name: "handleTypeAssertionExpression" }],
+ [176 /* MethodDeclaration */, { handler: this.handleMethodDeclaration, name: "handleMethodDeclaration" }],
+ [175 /* MethodSignature */, { handler: this.handleMethodSignature, name: "handleMethodSignature" }],
[79 /* Identifier */, { handler: this.handleIdentifier, name: "handleIdentifier" }],
- [212 /* ElementAccessExpression */, { handler: this.handleElementAccessExpression, name: "handleElementAccessExpression" }],
- [308 /* EnumMember */, { handler: this.handleEnumMember, name: "handleEnumMember" }],
- [183 /* TypeReference */, { handler: this.handleTypeReference, name: "handleTypeReference" }],
- [280 /* ExportAssignment */, { handler: this.handleExportAssignment, name: "handleExportAssignment" }],
- [213 /* CallExpression */, { handler: this.handleCallExpression, name: "handleCallExpression" }],
- [237 /* MetaProperty */, { handler: this.handleMetaProperty, name: "handleMetaProperty" }],
- [214 /* NewExpression */, { handler: this.handleNewExpression, name: "handleNewExpression" }],
- [235 /* AsExpression */, { handler: this.handleAsExpression, name: "handleAsExpression" }],
- [231 /* SpreadElement */, { handler: this.handleSpreadOp, name: "handleSpreadOp" }],
- [307 /* SpreadAssignment */, { handler: this.handleSpreadOp, name: "handleSpreadOp" }],
- [177 /* GetAccessor */, { handler: this.handleGetAccessor, name: "handleGetAccessor" }],
- [178 /* SetAccessor */, { handler: this.handleSetAccessor, name: "handleSetAccessor" }],
- [180 /* ConstructSignature */, { handler: this.handleConstructSignature, name: "handleConstructSignature" }],
- [234 /* ExpressionWithTypeArguments */, { handler: this.handleExpressionWithTypeArguments, name: "handleExpressionWithTypeArguments" }],
- [166 /* ComputedPropertyName */, { handler: this.handleComputedPropertyName, name: "handleComputedPropertyName" }],
- [220 /* EtsComponentExpression */, { handler: this.handleEtsComponentExpression, name: "handleEtsComponentExpression" }],
- [175 /* ClassStaticBlockDeclaration */, { handler: this.handleClassStaticBlockDeclaration, name: "handleClassStaticBlockDeclaration" }],
- [181 /* IndexSignature */, { handler: this.handleIndexSignature, name: "handleIndexSignature" }],
+ [214 /* ElementAccessExpression */, { handler: this.handleElementAccessExpression, name: "handleElementAccessExpression" }],
+ [311 /* EnumMember */, { handler: this.handleEnumMember, name: "handleEnumMember" }],
+ [185 /* TypeReference */, { handler: this.handleTypeReference, name: "handleTypeReference" }],
+ [283 /* ExportAssignment */, { handler: this.handleExportAssignment, name: "handleExportAssignment" }],
+ [215 /* CallExpression */, { handler: this.handleCallExpression, name: "handleCallExpression" }],
+ [239 /* MetaProperty */, { handler: this.handleMetaProperty, name: "handleMetaProperty" }],
+ [216 /* NewExpression */, { handler: this.handleNewExpression, name: "handleNewExpression" }],
+ [237 /* AsExpression */, { handler: this.handleAsExpression, name: "handleAsExpression" }],
+ [233 /* SpreadElement */, { handler: this.handleSpreadOp, name: "handleSpreadOp" }],
+ [310 /* SpreadAssignment */, { handler: this.handleSpreadOp, name: "handleSpreadOp" }],
+ [179 /* GetAccessor */, { handler: this.handleGetAccessor, name: "handleGetAccessor" }],
+ [180 /* SetAccessor */, { handler: this.handleSetAccessor, name: "handleSetAccessor" }],
+ [182 /* ConstructSignature */, { handler: this.handleConstructSignature, name: "handleConstructSignature" }],
+ [236 /* ExpressionWithTypeArguments */, { handler: this.handleExpressionWithTypeArguments, name: "handleExpressionWithTypeArguments" }],
+ [167 /* ComputedPropertyName */, { handler: this.handleComputedPropertyName, name: "handleComputedPropertyName" }],
+ [222 /* EtsComponentExpression */, { handler: this.handleEtsComponentExpression, name: "handleEtsComponentExpression" }],
+ [177 /* ClassStaticBlockDeclaration */, { handler: this.handleClassStaticBlockDeclaration, name: "handleClassStaticBlockDeclaration" }],
+ [183 /* IndexSignature */, { handler: this.handleIndexSignature, name: "handleIndexSignature" }],
[94 /* ExportKeyword */, { handler: this.handleExportKeyword, name: "handleExportKeyword" }],
- [281 /* ExportDeclaration */, { handler: this.handleExportDeclaration, name: "handleExportDeclaration" }],
- [254 /* ReturnStatement */, { handler: this.handleReturnStatement, name: "handleReturnStatement" }],
- [169 /* Decorator */, { handler: this.handleDecorator, name: "handleDecorator" }]
+ [284 /* ExportDeclaration */, { handler: this.handleExportDeclaration, name: "handleExportDeclaration" }],
+ [256 /* ReturnStatement */, { handler: this.handleReturnStatement, name: "handleReturnStatement" }],
+ [170 /* Decorator */, { handler: this.handleDecorator, name: "handleDecorator" }]
]);
this.validatedTypesSet = new Set2();
_TypeScriptLinter2.tsTypeChecker = tsProgram.getLinterTypeChecker();
@@ -173286,28 +173547,28 @@ var _TypeScriptLinter2 = class {
if (!p.declarations)
continue;
const decl = p.declarations[0];
- if (decl.kind === 173 /* MethodSignature */) {
+ if (decl.kind === 175 /* MethodSignature */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 174 /* MethodDeclaration */) {
+ } else if (decl.kind === 176 /* MethodDeclaration */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 171 /* PropertyDeclaration */) {
+ } else if (decl.kind === 172 /* PropertyDeclaration */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 170 /* PropertySignature */) {
+ } else if (decl.kind === 171 /* PropertySignature */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
@@ -173398,7 +173659,7 @@ var _TypeScriptLinter2 = class {
const arrayLitElements = arrayLitNode.elements;
for (const element of arrayLitElements) {
const elementContextType = _TypeScriptLinter2.tsTypeChecker.getContextualType(element);
- if (element.kind === 210 /* ObjectLiteralExpression */) {
+ if (element.kind === 212 /* ObjectLiteralExpression */) {
if (!isDynamicLiteralInitializer2(arrayLitNode) && !isObjectLiteralAssignable2(elementContextType, element)) {
noContextTypeForArrayLiteral = true;
break;
@@ -173438,7 +173699,7 @@ var _TypeScriptLinter2 = class {
return;
let enumDeclCount = 0;
for (const decl of enumDecls) {
- if (decl.kind === 269 /* EnumDeclaration */)
+ if (decl.kind === 272 /* EnumDeclaration */)
enumDeclCount++;
}
if (enumDeclCount > 1)
@@ -173451,7 +173712,7 @@ var _TypeScriptLinter2 = class {
if (iDecls) {
let iDeclCount = 0;
for (const decl of iDecls) {
- if (decl.kind === 267 /* InterfaceDeclaration */)
+ if (decl.kind === 270 /* InterfaceDeclaration */)
iDeclCount++;
}
if (iDeclCount > 1)
@@ -173903,11 +174164,11 @@ var _TypeScriptLinter2 = class {
} else if (tsBinaryExpr.operatorToken.kind === 27 /* CommaToken */) {
let tsExprNode = tsBinaryExpr;
let tsParentNode = tsExprNode.parent;
- while (tsParentNode && tsParentNode.kind === 227 /* BinaryExpression */) {
+ while (tsParentNode && tsParentNode.kind === 229 /* BinaryExpression */) {
tsExprNode = tsParentNode;
tsParentNode = tsExprNode.parent;
}
- if (tsParentNode && tsParentNode.kind === 249 /* ForStatement */) {
+ if (tsParentNode && tsParentNode.kind === 251 /* ForStatement */) {
const tsForNode = tsParentNode;
if (tsExprNode === tsForNode.initializer || tsExprNode === tsForNode.incrementor)
return;
@@ -174172,15 +174433,15 @@ var _TypeScriptLinter2 = class {
if (isModuleBlock(tsModuleBody)) {
for (const tsModuleStmt of tsModuleBody.statements) {
switch (tsModuleStmt.kind) {
- case 244 /* VariableStatement */:
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 246 /* VariableStatement */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 284 /* ExportDeclaration */:
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
break;
default:
this.incrementCounters(tsModuleStmt, 44 /* NonDeclarationInNamespace */);
@@ -174307,7 +174568,7 @@ var _TypeScriptLinter2 = class {
handleRestrictedValues(tsIdentifier, tsIdentSym) {
const illegalValues = 128 /* ConstEnum */ | 256 /* RegularEnum */ | 512 /* ValueModule */ | 32 /* Class */;
if ((tsIdentSym.flags & 512 /* ValueModule */) !== 0) {
- if (!!tsIdentSym && symbolHasDuplicateName2(tsIdentSym, 270 /* ModuleDeclaration */)) {
+ if (!!tsIdentSym && symbolHasDuplicateName2(tsIdentSym, 273 /* ModuleDeclaration */)) {
return;
}
}
@@ -174603,25 +174864,25 @@ var _TypeScriptLinter2 = class {
}
isEsObjectPossiblyAllowed(typeRef) {
switch (typeRef.parent.kind) {
- case 261 /* VariableDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
- case 184 /* FunctionType */:
- case 170 /* PropertySignature */:
- case 188 /* ArrayType */:
- case 214 /* NewExpression */:
+ case 263 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
+ case 186 /* FunctionType */:
+ case 171 /* PropertySignature */:
+ case 190 /* ArrayType */:
+ case 216 /* NewExpression */:
return true;
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
return this.isObjectLiteralFromFunc(typeRef.parent);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
const promiseType = typeRef.parent;
if (promiseType.typeName.getText() === PROMISE) {
return this.isObjectLiteralFromFunc(typeRef.parent.parent, true);
}
return true;
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return !isObjectLiteralExpression(typeRef.parent.expression);
default:
return false;
@@ -174700,10 +174961,10 @@ var _TypeScriptLinter2 = class {
}
handleConstructSignature(node) {
switch (node.parent.kind) {
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
this.incrementCounters(node, 33 /* ConstructorType */);
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
this.incrementCounters(node, 34 /* ConstructorIface */);
break;
default:
@@ -174780,9 +175041,9 @@ var _TypeScriptLinter2 = class {
if (decl.exclamationToken === void 0) {
return;
}
- if (decl.kind === 171 /* PropertyDeclaration */) {
+ if (decl.kind === 172 /* PropertyDeclaration */) {
const parentDecl = decl.parent;
- if (parentDecl.kind === 264 /* ClassDeclaration */ && hasSendableDecorator(parentDecl)) {
+ if (parentDecl.kind === 266 /* ClassDeclaration */ && hasSendableDecorator(parentDecl)) {
this.incrementCounters(decl, 82 /* SendableDefiniteAssignment */);
return;
}
@@ -174913,28 +175174,28 @@ var _TypeScriptLinter2 = class {
return;
}
switch (parentNode.kind) {
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (isConstEnum(parentNode.symbol)) {
break;
} else {
this.incrementCounters((_a2 = parentNode.name) != null ? _a2 : parentNode, 90 /* SharedModuleExports */);
}
return;
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
if (!isShareableType(_TypeScriptLinter2.tsTypeChecker.getTypeAtLocation(parentNode))) {
this.incrementCounters((_b = parentNode.name) != null ? _b : parentNode, 90 /* SharedModuleExports */);
}
return;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
for (const variableDeclaration of parentNode.declarationList.declarations) {
if (!isShareableEntity(variableDeclaration.name)) {
this.incrementCounters(variableDeclaration.name, 90 /* SharedModuleExports */);
}
}
return;
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
if (!isShareableEntity(parentNode)) {
this.incrementCounters(parentNode, 108 /* SharedModuleExportsWarning */);
}
@@ -175043,15 +175304,15 @@ var _InteropTypescriptLinter = class {
this.D_ETS = ".d.ets";
this.ETS = ".ets";
this.handlersMap = new Map2([
- [275 /* ImportDeclaration */, this.handleImportDeclaration],
- [267 /* InterfaceDeclaration */, this.handleInterfaceDeclaration],
- [264 /* ClassDeclaration */, this.handleClassDeclaration],
- [214 /* NewExpression */, this.handleNewExpression],
- [210 /* ObjectLiteralExpression */, this.handleObjectLiteralExpression],
- [209 /* ArrayLiteralExpression */, this.handleArrayLiteralExpression],
- [235 /* AsExpression */, this.handleAsExpression],
- [281 /* ExportDeclaration */, this.handleExportDeclaration],
- [280 /* ExportAssignment */, this.handleExportAssignment]
+ [278 /* ImportDeclaration */, this.handleImportDeclaration],
+ [270 /* InterfaceDeclaration */, this.handleInterfaceDeclaration],
+ [266 /* ClassDeclaration */, this.handleClassDeclaration],
+ [216 /* NewExpression */, this.handleNewExpression],
+ [212 /* ObjectLiteralExpression */, this.handleObjectLiteralExpression],
+ [211 /* ArrayLiteralExpression */, this.handleArrayLiteralExpression],
+ [237 /* AsExpression */, this.handleAsExpression],
+ [284 /* ExportDeclaration */, this.handleExportDeclaration],
+ [283 /* ExportAssignment */, this.handleExportAssignment]
]);
_InteropTypescriptLinter.tsTypeChecker = tsProgram.getLinterTypeChecker();
_InteropTypescriptLinter.etsLoaderPath = tsProgram.getCompilerOptions().etsLoaderPath;
@@ -177596,6 +177857,9 @@ __export(ts_server_exports3, {
isOptionalTypeNode,
isOuterExpression,
isOutermostOptionalChain,
+ isOverloadDeclaration,
+ isOverloadElement,
+ isOverloadPropertyDeclaration,
isOverrideModifier,
isPackedArrayLiteral,
isParameter,
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
index c912487c4a..5022a4ba2c 100644
--- a/lib/typescript.d.ts
+++ b/lib/typescript.d.ts
@@ -310,209 +310,212 @@ declare namespace ts {
GlobalKeyword = 161,
BigIntKeyword = 162,
OverrideKeyword = 163,
- OfKeyword = 164,
- QualifiedName = 165,
- ComputedPropertyName = 166,
- TypeParameter = 167,
- Parameter = 168,
- Decorator = 169,
- PropertySignature = 170,
- PropertyDeclaration = 171,
- AnnotationPropertyDeclaration = 172,
- MethodSignature = 173,
- MethodDeclaration = 174,
- ClassStaticBlockDeclaration = 175,
- Constructor = 176,
- GetAccessor = 177,
- SetAccessor = 178,
- CallSignature = 179,
- ConstructSignature = 180,
- IndexSignature = 181,
- TypePredicate = 182,
- TypeReference = 183,
- FunctionType = 184,
- ConstructorType = 185,
- TypeQuery = 186,
- TypeLiteral = 187,
- ArrayType = 188,
- TupleType = 189,
- OptionalType = 190,
- RestType = 191,
- UnionType = 192,
- IntersectionType = 193,
- ConditionalType = 194,
- InferType = 195,
- ParenthesizedType = 196,
- ThisType = 197,
- TypeOperator = 198,
- IndexedAccessType = 199,
- MappedType = 200,
- LiteralType = 201,
- NamedTupleMember = 202,
- TemplateLiteralType = 203,
- TemplateLiteralTypeSpan = 204,
- ImportType = 205,
- ObjectBindingPattern = 206,
- ArrayBindingPattern = 207,
- BindingElement = 208,
- ArrayLiteralExpression = 209,
- ObjectLiteralExpression = 210,
- PropertyAccessExpression = 211,
- ElementAccessExpression = 212,
- CallExpression = 213,
- NewExpression = 214,
- TaggedTemplateExpression = 215,
- TypeAssertionExpression = 216,
- ParenthesizedExpression = 217,
- FunctionExpression = 218,
- ArrowFunction = 219,
- EtsComponentExpression = 220,
- DeleteExpression = 221,
- TypeOfExpression = 222,
- VoidExpression = 223,
- AwaitExpression = 224,
- PrefixUnaryExpression = 225,
- PostfixUnaryExpression = 226,
- BinaryExpression = 227,
- ConditionalExpression = 228,
- TemplateExpression = 229,
- YieldExpression = 230,
- SpreadElement = 231,
- ClassExpression = 232,
- OmittedExpression = 233,
- ExpressionWithTypeArguments = 234,
- AsExpression = 235,
- NonNullExpression = 236,
- MetaProperty = 237,
- SyntheticExpression = 238,
- SatisfiesExpression = 239,
- TemplateSpan = 240,
- SemicolonClassElement = 241,
- Block = 242,
- EmptyStatement = 243,
- VariableStatement = 244,
- ExpressionStatement = 245,
- IfStatement = 246,
- DoStatement = 247,
- WhileStatement = 248,
- ForStatement = 249,
- ForInStatement = 250,
- ForOfStatement = 251,
- ContinueStatement = 252,
- BreakStatement = 253,
- ReturnStatement = 254,
- WithStatement = 255,
- SwitchStatement = 256,
- LabeledStatement = 257,
- ThrowStatement = 258,
- TryStatement = 259,
- DebuggerStatement = 260,
- VariableDeclaration = 261,
- VariableDeclarationList = 262,
- FunctionDeclaration = 263,
- ClassDeclaration = 264,
- StructDeclaration = 265,
- AnnotationDeclaration = 266,
- InterfaceDeclaration = 267,
- TypeAliasDeclaration = 268,
- EnumDeclaration = 269,
- ModuleDeclaration = 270,
- ModuleBlock = 271,
- CaseBlock = 272,
- NamespaceExportDeclaration = 273,
- ImportEqualsDeclaration = 274,
- ImportDeclaration = 275,
- ImportClause = 276,
- NamespaceImport = 277,
- NamedImports = 278,
- ImportSpecifier = 279,
- ExportAssignment = 280,
- ExportDeclaration = 281,
- NamedExports = 282,
- NamespaceExport = 283,
- ExportSpecifier = 284,
- MissingDeclaration = 285,
- ExternalModuleReference = 286,
- JsxElement = 287,
- JsxSelfClosingElement = 288,
- JsxOpeningElement = 289,
- JsxClosingElement = 290,
- JsxFragment = 291,
- JsxOpeningFragment = 292,
- JsxClosingFragment = 293,
- JsxAttribute = 294,
- JsxAttributes = 295,
- JsxSpreadAttribute = 296,
- JsxExpression = 297,
- CaseClause = 298,
- DefaultClause = 299,
- HeritageClause = 300,
- CatchClause = 301,
- AssertClause = 302,
- AssertEntry = 303,
- ImportTypeAssertionContainer = 304,
- PropertyAssignment = 305,
- ShorthandPropertyAssignment = 306,
- SpreadAssignment = 307,
- EnumMember = 308,
- UnparsedPrologue = 309,
- UnparsedPrepend = 310,
- UnparsedText = 311,
- UnparsedInternalText = 312,
- UnparsedSyntheticReference = 313,
- SourceFile = 314,
- Bundle = 315,
- UnparsedSource = 316,
- InputFiles = 317,
- JSDocTypeExpression = 318,
- JSDocNameReference = 319,
- JSDocMemberName = 320,
- JSDocAllType = 321,
- JSDocUnknownType = 322,
- JSDocNullableType = 323,
- JSDocNonNullableType = 324,
- JSDocOptionalType = 325,
- JSDocFunctionType = 326,
- JSDocVariadicType = 327,
- JSDocNamepathType = 328,
- JSDoc = 329,
+ OverloadKeyword = 164,
+ OfKeyword = 165,
+ QualifiedName = 166,
+ ComputedPropertyName = 167,
+ TypeParameter = 168,
+ Parameter = 169,
+ Decorator = 170,
+ PropertySignature = 171,
+ PropertyDeclaration = 172,
+ AnnotationPropertyDeclaration = 173,
+ OverloadPropertyDeclaration = 174,
+ MethodSignature = 175,
+ MethodDeclaration = 176,
+ ClassStaticBlockDeclaration = 177,
+ Constructor = 178,
+ GetAccessor = 179,
+ SetAccessor = 180,
+ CallSignature = 181,
+ ConstructSignature = 182,
+ IndexSignature = 183,
+ TypePredicate = 184,
+ TypeReference = 185,
+ FunctionType = 186,
+ ConstructorType = 187,
+ TypeQuery = 188,
+ TypeLiteral = 189,
+ ArrayType = 190,
+ TupleType = 191,
+ OptionalType = 192,
+ RestType = 193,
+ UnionType = 194,
+ IntersectionType = 195,
+ ConditionalType = 196,
+ InferType = 197,
+ ParenthesizedType = 198,
+ ThisType = 199,
+ TypeOperator = 200,
+ IndexedAccessType = 201,
+ MappedType = 202,
+ LiteralType = 203,
+ NamedTupleMember = 204,
+ TemplateLiteralType = 205,
+ TemplateLiteralTypeSpan = 206,
+ ImportType = 207,
+ ObjectBindingPattern = 208,
+ ArrayBindingPattern = 209,
+ BindingElement = 210,
+ ArrayLiteralExpression = 211,
+ ObjectLiteralExpression = 212,
+ PropertyAccessExpression = 213,
+ ElementAccessExpression = 214,
+ CallExpression = 215,
+ NewExpression = 216,
+ TaggedTemplateExpression = 217,
+ TypeAssertionExpression = 218,
+ ParenthesizedExpression = 219,
+ FunctionExpression = 220,
+ ArrowFunction = 221,
+ EtsComponentExpression = 222,
+ DeleteExpression = 223,
+ TypeOfExpression = 224,
+ VoidExpression = 225,
+ AwaitExpression = 226,
+ PrefixUnaryExpression = 227,
+ PostfixUnaryExpression = 228,
+ BinaryExpression = 229,
+ ConditionalExpression = 230,
+ TemplateExpression = 231,
+ YieldExpression = 232,
+ SpreadElement = 233,
+ ClassExpression = 234,
+ OmittedExpression = 235,
+ ExpressionWithTypeArguments = 236,
+ AsExpression = 237,
+ NonNullExpression = 238,
+ MetaProperty = 239,
+ SyntheticExpression = 240,
+ SatisfiesExpression = 241,
+ TemplateSpan = 242,
+ SemicolonClassElement = 243,
+ Block = 244,
+ EmptyStatement = 245,
+ VariableStatement = 246,
+ ExpressionStatement = 247,
+ IfStatement = 248,
+ DoStatement = 249,
+ WhileStatement = 250,
+ ForStatement = 251,
+ ForInStatement = 252,
+ ForOfStatement = 253,
+ ContinueStatement = 254,
+ BreakStatement = 255,
+ ReturnStatement = 256,
+ WithStatement = 257,
+ SwitchStatement = 258,
+ LabeledStatement = 259,
+ ThrowStatement = 260,
+ TryStatement = 261,
+ DebuggerStatement = 262,
+ VariableDeclaration = 263,
+ VariableDeclarationList = 264,
+ FunctionDeclaration = 265,
+ ClassDeclaration = 266,
+ StructDeclaration = 267,
+ AnnotationDeclaration = 268,
+ OverloadDeclaration = 269,
+ InterfaceDeclaration = 270,
+ TypeAliasDeclaration = 271,
+ EnumDeclaration = 272,
+ ModuleDeclaration = 273,
+ ModuleBlock = 274,
+ CaseBlock = 275,
+ NamespaceExportDeclaration = 276,
+ ImportEqualsDeclaration = 277,
+ ImportDeclaration = 278,
+ ImportClause = 279,
+ NamespaceImport = 280,
+ NamedImports = 281,
+ ImportSpecifier = 282,
+ ExportAssignment = 283,
+ ExportDeclaration = 284,
+ NamedExports = 285,
+ NamespaceExport = 286,
+ ExportSpecifier = 287,
+ MissingDeclaration = 288,
+ ExternalModuleReference = 289,
+ JsxElement = 290,
+ JsxSelfClosingElement = 291,
+ JsxOpeningElement = 292,
+ JsxClosingElement = 293,
+ JsxFragment = 294,
+ JsxOpeningFragment = 295,
+ JsxClosingFragment = 296,
+ JsxAttribute = 297,
+ JsxAttributes = 298,
+ JsxSpreadAttribute = 299,
+ JsxExpression = 300,
+ CaseClause = 301,
+ DefaultClause = 302,
+ HeritageClause = 303,
+ CatchClause = 304,
+ AssertClause = 305,
+ AssertEntry = 306,
+ ImportTypeAssertionContainer = 307,
+ PropertyAssignment = 308,
+ ShorthandPropertyAssignment = 309,
+ SpreadAssignment = 310,
+ EnumMember = 311,
+ UnparsedPrologue = 312,
+ UnparsedPrepend = 313,
+ UnparsedText = 314,
+ UnparsedInternalText = 315,
+ UnparsedSyntheticReference = 316,
+ SourceFile = 317,
+ Bundle = 318,
+ UnparsedSource = 319,
+ InputFiles = 320,
+ JSDocTypeExpression = 321,
+ JSDocNameReference = 322,
+ JSDocMemberName = 323,
+ JSDocAllType = 324,
+ JSDocUnknownType = 325,
+ JSDocNullableType = 326,
+ JSDocNonNullableType = 327,
+ JSDocOptionalType = 328,
+ JSDocFunctionType = 329,
+ JSDocVariadicType = 330,
+ JSDocNamepathType = 331,
+ JSDoc = 332,
/** @deprecated Use SyntaxKind.JSDoc */
- JSDocComment = 329,
- JSDocText = 330,
- JSDocTypeLiteral = 331,
- JSDocSignature = 332,
- JSDocLink = 333,
- JSDocLinkCode = 334,
- JSDocLinkPlain = 335,
- JSDocTag = 336,
- JSDocAugmentsTag = 337,
- JSDocImplementsTag = 338,
- JSDocAuthorTag = 339,
- JSDocDeprecatedTag = 340,
- JSDocClassTag = 341,
- JSDocPublicTag = 342,
- JSDocPrivateTag = 343,
- JSDocProtectedTag = 344,
- JSDocReadonlyTag = 345,
- JSDocOverrideTag = 346,
- JSDocCallbackTag = 347,
- JSDocEnumTag = 348,
- JSDocParameterTag = 349,
- JSDocReturnTag = 350,
- JSDocThisTag = 351,
- JSDocTypeTag = 352,
- JSDocTemplateTag = 353,
- JSDocTypedefTag = 354,
- JSDocSeeTag = 355,
- JSDocPropertyTag = 356,
- SyntaxList = 357,
- NotEmittedStatement = 358,
- PartiallyEmittedExpression = 359,
- CommaListExpression = 360,
- MergeDeclarationMarker = 361,
- EndOfDeclarationMarker = 362,
- SyntheticReferenceExpression = 363,
- Count = 364,
+ JSDocComment = 332,
+ JSDocText = 333,
+ JSDocTypeLiteral = 334,
+ JSDocSignature = 335,
+ JSDocLink = 336,
+ JSDocLinkCode = 337,
+ JSDocLinkPlain = 338,
+ JSDocTag = 339,
+ JSDocAugmentsTag = 340,
+ JSDocImplementsTag = 341,
+ JSDocAuthorTag = 342,
+ JSDocDeprecatedTag = 343,
+ JSDocClassTag = 344,
+ JSDocPublicTag = 345,
+ JSDocPrivateTag = 346,
+ JSDocProtectedTag = 347,
+ JSDocReadonlyTag = 348,
+ JSDocOverrideTag = 349,
+ JSDocCallbackTag = 350,
+ JSDocEnumTag = 351,
+ JSDocParameterTag = 352,
+ JSDocReturnTag = 353,
+ JSDocThisTag = 354,
+ JSDocTypeTag = 355,
+ JSDocTemplateTag = 356,
+ JSDocTypedefTag = 357,
+ JSDocSeeTag = 358,
+ JSDocPropertyTag = 359,
+ SyntaxList = 360,
+ NotEmittedStatement = 361,
+ PartiallyEmittedExpression = 362,
+ CommaListExpression = 363,
+ MergeDeclarationMarker = 364,
+ EndOfDeclarationMarker = 365,
+ SyntheticReferenceExpression = 366,
+ Count = 367,
FirstAssignment = 63,
LastAssignment = 78,
FirstCompoundAssignment = 64,
@@ -520,15 +523,15 @@ declare namespace ts {
FirstReservedWord = 81,
LastReservedWord = 117,
FirstKeyword = 81,
- LastKeyword = 164,
+ LastKeyword = 165,
FirstFutureReservedWord = 118,
LastFutureReservedWord = 126,
- FirstTypeNode = 182,
- LastTypeNode = 205,
+ FirstTypeNode = 184,
+ LastTypeNode = 207,
FirstPunctuation = 18,
LastPunctuation = 78,
FirstToken = 0,
- LastToken = 164,
+ LastToken = 165,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 8,
@@ -537,19 +540,19 @@ declare namespace ts {
LastTemplateToken = 17,
FirstBinaryOperator = 29,
LastBinaryOperator = 78,
- FirstStatement = 244,
- LastStatement = 260,
- FirstNode = 165,
- FirstJSDocNode = 318,
- LastJSDocNode = 356,
- FirstJSDocTagNode = 336,
- LastJSDocTagNode = 356
+ FirstStatement = 246,
+ LastStatement = 262,
+ FirstNode = 166,
+ FirstJSDocNode = 321,
+ LastJSDocNode = 359,
+ FirstJSDocTagNode = 339,
+ LastJSDocTagNode = 359
}
type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia;
type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;
type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail;
type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken;
- type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.StructKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.LazyKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
+ type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.StructKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.OverloadKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.LazyKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword;
type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword;
type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
@@ -690,14 +693,14 @@ declare namespace ts {
}
interface JSDocContainer {
}
- type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AnnotationPropertyDeclaration | AnnotationDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | CaseClause | EndOfFileToken;
- type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | AnnotationPropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
+ type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AnnotationPropertyDeclaration | OverloadPropertyDeclaration | AnnotationDeclaration | OverloadDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | CaseClause | EndOfFileToken;
+ type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | AnnotationPropertyDeclaration | OverloadPropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | EnumMember;
type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration;
type HasIllegalDecorators = PropertyAssignment | ShorthandPropertyAssignment | FunctionDeclaration | ConstructorDeclaration | IndexSignatureDeclaration | ClassStaticBlockDeclaration | MissingDeclaration | VariableStatement | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportDeclaration | ExportAssignment;
- type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration;
+ type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
interface NodeArray extends ReadonlyArray, ReadonlyTextRange {
readonly hasTrailingComma: boolean;
}
@@ -938,7 +941,7 @@ declare namespace ts {
readonly parent: ObjectLiteralExpression;
readonly expression: Expression;
}
- type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
+ type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | OverloadPropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
interface PropertyLikeDeclaration extends NamedDeclaration {
readonly name: PropertyName;
}
@@ -1730,7 +1733,7 @@ declare namespace ts {
type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer {
- readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression | SyntaxKind.StructDeclaration | SyntaxKind.AnnotationDeclaration;
+ readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression | SyntaxKind.StructDeclaration | SyntaxKind.AnnotationDeclaration | SyntaxKind.OverloadDeclaration;
readonly name?: Identifier;
readonly typeParameters?: NodeArray;
readonly heritageClauses?: NodeArray;
@@ -1754,6 +1757,12 @@ declare namespace ts {
readonly name: Identifier;
readonly members: NodeArray;
}
+ interface OverloadDeclaration extends DeclarationStatement {
+ readonly kind: SyntaxKind.OverloadDeclaration;
+ readonly modifiers?: NodeArray;
+ readonly name: Identifier;
+ readonly members: NodeArray;
+ }
interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression {
readonly kind: SyntaxKind.ClassExpression;
readonly modifiers?: NodeArray;
@@ -1767,6 +1776,16 @@ declare namespace ts {
_annnotationElementBrand: any;
readonly name: PropertyName;
}
+ interface OverloadElement extends NamedDeclaration {
+ readonly name: PropertyName;
+ }
+ interface OverloadPropertyDeclaration extends OverloadElement, JSDocContainer {
+ readonly kind: SyntaxKind.OverloadPropertyDeclaration;
+ readonly modifiers?: NodeArray;
+ readonly name: PropertyName;
+ readonly questionToken?: QuestionToken;
+ readonly type?: TypeNode;
+ }
interface TypeElement extends NamedDeclaration {
_typeElementBrand: any;
readonly name?: PropertyName;
@@ -3892,6 +3911,8 @@ declare namespace ts {
updatePropertyDeclaration(node: PropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
createAnnotationPropertyDeclaration(name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
updateAnnotationPropertyDeclaration(node: AnnotationPropertyDeclaration, name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
+ createOverloadPropertyDeclaration(modifiers: readonly ModifierLike[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
+ updateOverloadPropertyDeclaration(node: OverloadPropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature;
createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
@@ -4091,6 +4112,8 @@ declare namespace ts {
updateStructDeclaration(node: StructDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): StructDeclaration;
createAnnotationDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, members: readonly AnnotationElement[]): AnnotationDeclaration;
updateAnnotationDeclaration(node: AnnotationDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly AnnotationElement[]): AnnotationDeclaration;
+ createOverloadDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
+ updateOverloadDeclaration(node: OverloadDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
@@ -5271,6 +5294,7 @@ declare namespace ts {
function isBindingName(node: Node): node is BindingName;
function isFunctionLike(node: Node | undefined): node is SignatureDeclaration;
function isAnnotationElement(node: Node): node is AnnotationElement;
+ function isOverloadElement(node: Node): node is OverloadElement;
function isClassElement(node: Node): node is ClassElement;
function isClassLike(node: Node): node is ClassLikeDeclaration;
function isStruct(node: Node): node is StructDeclaration;
@@ -5441,6 +5465,7 @@ declare namespace ts {
function isDecorator(node: Node): node is Decorator;
function isAnnotation(node: Node): node is Annotation;
function isPropertySignature(node: Node): node is PropertySignature;
+ function isOverloadPropertyDeclaration(node: Node): node is OverloadPropertyDeclaration;
function isPropertyDeclaration(node: Node): node is PropertyDeclaration;
function isAnnotationPropertyDeclaration(node: Node): node is AnnotationPropertyDeclaration;
function isMethodSignature(node: Node): node is MethodSignature;
@@ -5539,6 +5564,7 @@ declare namespace ts {
function isClassDeclaration(node: Node): node is ClassDeclaration;
function isStructDeclaration(node: Node): node is StructDeclaration;
function isAnnotationDeclaration(node: Node): node is AnnotationDeclaration;
+ function isOverloadDeclaration(node: Node): node is OverloadDeclaration;
function isInterfaceDeclaration(node: Node): node is InterfaceDeclaration;
function isTypeAliasDeclaration(node: Node): node is TypeAliasDeclaration;
function isEnumDeclaration(node: Node): node is EnumDeclaration;
diff --git a/lib/typescript.js b/lib/typescript.js
index 1d0abba447..a2b6e59397 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -1828,6 +1828,9 @@ __export(typescript_exports, {
isOptionalTypeNode: () => isOptionalTypeNode,
isOuterExpression: () => isOuterExpression,
isOutermostOptionalChain: () => isOutermostOptionalChain,
+ isOverloadDeclaration: () => isOverloadDeclaration,
+ isOverloadElement: () => isOverloadElement,
+ isOverloadPropertyDeclaration: () => isOverloadPropertyDeclaration,
isOverrideModifier: () => isOverrideModifier,
isPackedArrayLiteral: () => isPackedArrayLiteral,
isParameter: () => isParameter,
@@ -6464,208 +6467,211 @@ var SyntaxKind2 = /* @__PURE__ */ ((SyntaxKind5) => {
SyntaxKind5[SyntaxKind5["GlobalKeyword"] = 161] = "GlobalKeyword";
SyntaxKind5[SyntaxKind5["BigIntKeyword"] = 162] = "BigIntKeyword";
SyntaxKind5[SyntaxKind5["OverrideKeyword"] = 163] = "OverrideKeyword";
- SyntaxKind5[SyntaxKind5["OfKeyword"] = 164] = "OfKeyword";
- SyntaxKind5[SyntaxKind5["QualifiedName"] = 165] = "QualifiedName";
- SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 166] = "ComputedPropertyName";
- SyntaxKind5[SyntaxKind5["TypeParameter"] = 167] = "TypeParameter";
- SyntaxKind5[SyntaxKind5["Parameter"] = 168] = "Parameter";
- SyntaxKind5[SyntaxKind5["Decorator"] = 169] = "Decorator";
- SyntaxKind5[SyntaxKind5["PropertySignature"] = 170] = "PropertySignature";
- SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 171] = "PropertyDeclaration";
- SyntaxKind5[SyntaxKind5["AnnotationPropertyDeclaration"] = 172] = "AnnotationPropertyDeclaration";
- SyntaxKind5[SyntaxKind5["MethodSignature"] = 173] = "MethodSignature";
- SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 174] = "MethodDeclaration";
- SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 175] = "ClassStaticBlockDeclaration";
- SyntaxKind5[SyntaxKind5["Constructor"] = 176] = "Constructor";
- SyntaxKind5[SyntaxKind5["GetAccessor"] = 177] = "GetAccessor";
- SyntaxKind5[SyntaxKind5["SetAccessor"] = 178] = "SetAccessor";
- SyntaxKind5[SyntaxKind5["CallSignature"] = 179] = "CallSignature";
- SyntaxKind5[SyntaxKind5["ConstructSignature"] = 180] = "ConstructSignature";
- SyntaxKind5[SyntaxKind5["IndexSignature"] = 181] = "IndexSignature";
- SyntaxKind5[SyntaxKind5["TypePredicate"] = 182] = "TypePredicate";
- SyntaxKind5[SyntaxKind5["TypeReference"] = 183] = "TypeReference";
- SyntaxKind5[SyntaxKind5["FunctionType"] = 184] = "FunctionType";
- SyntaxKind5[SyntaxKind5["ConstructorType"] = 185] = "ConstructorType";
- SyntaxKind5[SyntaxKind5["TypeQuery"] = 186] = "TypeQuery";
- SyntaxKind5[SyntaxKind5["TypeLiteral"] = 187] = "TypeLiteral";
- SyntaxKind5[SyntaxKind5["ArrayType"] = 188] = "ArrayType";
- SyntaxKind5[SyntaxKind5["TupleType"] = 189] = "TupleType";
- SyntaxKind5[SyntaxKind5["OptionalType"] = 190] = "OptionalType";
- SyntaxKind5[SyntaxKind5["RestType"] = 191] = "RestType";
- SyntaxKind5[SyntaxKind5["UnionType"] = 192] = "UnionType";
- SyntaxKind5[SyntaxKind5["IntersectionType"] = 193] = "IntersectionType";
- SyntaxKind5[SyntaxKind5["ConditionalType"] = 194] = "ConditionalType";
- SyntaxKind5[SyntaxKind5["InferType"] = 195] = "InferType";
- SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 196] = "ParenthesizedType";
- SyntaxKind5[SyntaxKind5["ThisType"] = 197] = "ThisType";
- SyntaxKind5[SyntaxKind5["TypeOperator"] = 198] = "TypeOperator";
- SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 199] = "IndexedAccessType";
- SyntaxKind5[SyntaxKind5["MappedType"] = 200] = "MappedType";
- SyntaxKind5[SyntaxKind5["LiteralType"] = 201] = "LiteralType";
- SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 202] = "NamedTupleMember";
- SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 203] = "TemplateLiteralType";
- SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 204] = "TemplateLiteralTypeSpan";
- SyntaxKind5[SyntaxKind5["ImportType"] = 205] = "ImportType";
- SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 206] = "ObjectBindingPattern";
- SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 207] = "ArrayBindingPattern";
- SyntaxKind5[SyntaxKind5["BindingElement"] = 208] = "BindingElement";
- SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 209] = "ArrayLiteralExpression";
- SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 210] = "ObjectLiteralExpression";
- SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 211] = "PropertyAccessExpression";
- SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 212] = "ElementAccessExpression";
- SyntaxKind5[SyntaxKind5["CallExpression"] = 213] = "CallExpression";
- SyntaxKind5[SyntaxKind5["NewExpression"] = 214] = "NewExpression";
- SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 215] = "TaggedTemplateExpression";
- SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 216] = "TypeAssertionExpression";
- SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 217] = "ParenthesizedExpression";
- SyntaxKind5[SyntaxKind5["FunctionExpression"] = 218] = "FunctionExpression";
- SyntaxKind5[SyntaxKind5["ArrowFunction"] = 219] = "ArrowFunction";
- SyntaxKind5[SyntaxKind5["EtsComponentExpression"] = 220] = "EtsComponentExpression";
- SyntaxKind5[SyntaxKind5["DeleteExpression"] = 221] = "DeleteExpression";
- SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 222] = "TypeOfExpression";
- SyntaxKind5[SyntaxKind5["VoidExpression"] = 223] = "VoidExpression";
- SyntaxKind5[SyntaxKind5["AwaitExpression"] = 224] = "AwaitExpression";
- SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 225] = "PrefixUnaryExpression";
- SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 226] = "PostfixUnaryExpression";
- SyntaxKind5[SyntaxKind5["BinaryExpression"] = 227] = "BinaryExpression";
- SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 228] = "ConditionalExpression";
- SyntaxKind5[SyntaxKind5["TemplateExpression"] = 229] = "TemplateExpression";
- SyntaxKind5[SyntaxKind5["YieldExpression"] = 230] = "YieldExpression";
- SyntaxKind5[SyntaxKind5["SpreadElement"] = 231] = "SpreadElement";
- SyntaxKind5[SyntaxKind5["ClassExpression"] = 232] = "ClassExpression";
- SyntaxKind5[SyntaxKind5["OmittedExpression"] = 233] = "OmittedExpression";
- SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 234] = "ExpressionWithTypeArguments";
- SyntaxKind5[SyntaxKind5["AsExpression"] = 235] = "AsExpression";
- SyntaxKind5[SyntaxKind5["NonNullExpression"] = 236] = "NonNullExpression";
- SyntaxKind5[SyntaxKind5["MetaProperty"] = 237] = "MetaProperty";
- SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 238] = "SyntheticExpression";
- SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 239] = "SatisfiesExpression";
- SyntaxKind5[SyntaxKind5["TemplateSpan"] = 240] = "TemplateSpan";
- SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 241] = "SemicolonClassElement";
- SyntaxKind5[SyntaxKind5["Block"] = 242] = "Block";
- SyntaxKind5[SyntaxKind5["EmptyStatement"] = 243] = "EmptyStatement";
- SyntaxKind5[SyntaxKind5["VariableStatement"] = 244] = "VariableStatement";
- SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 245] = "ExpressionStatement";
- SyntaxKind5[SyntaxKind5["IfStatement"] = 246] = "IfStatement";
- SyntaxKind5[SyntaxKind5["DoStatement"] = 247] = "DoStatement";
- SyntaxKind5[SyntaxKind5["WhileStatement"] = 248] = "WhileStatement";
- SyntaxKind5[SyntaxKind5["ForStatement"] = 249] = "ForStatement";
- SyntaxKind5[SyntaxKind5["ForInStatement"] = 250] = "ForInStatement";
- SyntaxKind5[SyntaxKind5["ForOfStatement"] = 251] = "ForOfStatement";
- SyntaxKind5[SyntaxKind5["ContinueStatement"] = 252] = "ContinueStatement";
- SyntaxKind5[SyntaxKind5["BreakStatement"] = 253] = "BreakStatement";
- SyntaxKind5[SyntaxKind5["ReturnStatement"] = 254] = "ReturnStatement";
- SyntaxKind5[SyntaxKind5["WithStatement"] = 255] = "WithStatement";
- SyntaxKind5[SyntaxKind5["SwitchStatement"] = 256] = "SwitchStatement";
- SyntaxKind5[SyntaxKind5["LabeledStatement"] = 257] = "LabeledStatement";
- SyntaxKind5[SyntaxKind5["ThrowStatement"] = 258] = "ThrowStatement";
- SyntaxKind5[SyntaxKind5["TryStatement"] = 259] = "TryStatement";
- SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 260] = "DebuggerStatement";
- SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 261] = "VariableDeclaration";
- SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 262] = "VariableDeclarationList";
- SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 263] = "FunctionDeclaration";
- SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 264] = "ClassDeclaration";
- SyntaxKind5[SyntaxKind5["StructDeclaration"] = 265] = "StructDeclaration";
- SyntaxKind5[SyntaxKind5["AnnotationDeclaration"] = 266] = "AnnotationDeclaration";
- SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 267] = "InterfaceDeclaration";
- SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 268] = "TypeAliasDeclaration";
- SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 269] = "EnumDeclaration";
- SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 270] = "ModuleDeclaration";
- SyntaxKind5[SyntaxKind5["ModuleBlock"] = 271] = "ModuleBlock";
- SyntaxKind5[SyntaxKind5["CaseBlock"] = 272] = "CaseBlock";
- SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 273] = "NamespaceExportDeclaration";
- SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 274] = "ImportEqualsDeclaration";
- SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 275] = "ImportDeclaration";
- SyntaxKind5[SyntaxKind5["ImportClause"] = 276] = "ImportClause";
- SyntaxKind5[SyntaxKind5["NamespaceImport"] = 277] = "NamespaceImport";
- SyntaxKind5[SyntaxKind5["NamedImports"] = 278] = "NamedImports";
- SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 279] = "ImportSpecifier";
- SyntaxKind5[SyntaxKind5["ExportAssignment"] = 280] = "ExportAssignment";
- SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 281] = "ExportDeclaration";
- SyntaxKind5[SyntaxKind5["NamedExports"] = 282] = "NamedExports";
- SyntaxKind5[SyntaxKind5["NamespaceExport"] = 283] = "NamespaceExport";
- SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 284] = "ExportSpecifier";
- SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 285] = "MissingDeclaration";
- SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 286] = "ExternalModuleReference";
- SyntaxKind5[SyntaxKind5["JsxElement"] = 287] = "JsxElement";
- SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 288] = "JsxSelfClosingElement";
- SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 289] = "JsxOpeningElement";
- SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 290] = "JsxClosingElement";
- SyntaxKind5[SyntaxKind5["JsxFragment"] = 291] = "JsxFragment";
- SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 292] = "JsxOpeningFragment";
- SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 293] = "JsxClosingFragment";
- SyntaxKind5[SyntaxKind5["JsxAttribute"] = 294] = "JsxAttribute";
- SyntaxKind5[SyntaxKind5["JsxAttributes"] = 295] = "JsxAttributes";
- SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 296] = "JsxSpreadAttribute";
- SyntaxKind5[SyntaxKind5["JsxExpression"] = 297] = "JsxExpression";
- SyntaxKind5[SyntaxKind5["CaseClause"] = 298] = "CaseClause";
- SyntaxKind5[SyntaxKind5["DefaultClause"] = 299] = "DefaultClause";
- SyntaxKind5[SyntaxKind5["HeritageClause"] = 300] = "HeritageClause";
- SyntaxKind5[SyntaxKind5["CatchClause"] = 301] = "CatchClause";
- SyntaxKind5[SyntaxKind5["AssertClause"] = 302] = "AssertClause";
- SyntaxKind5[SyntaxKind5["AssertEntry"] = 303] = "AssertEntry";
- SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 304] = "ImportTypeAssertionContainer";
- SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 305] = "PropertyAssignment";
- SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 306] = "ShorthandPropertyAssignment";
- SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 307] = "SpreadAssignment";
- SyntaxKind5[SyntaxKind5["EnumMember"] = 308] = "EnumMember";
- SyntaxKind5[SyntaxKind5["UnparsedPrologue"] = 309] = "UnparsedPrologue";
- SyntaxKind5[SyntaxKind5["UnparsedPrepend"] = 310] = "UnparsedPrepend";
- SyntaxKind5[SyntaxKind5["UnparsedText"] = 311] = "UnparsedText";
- SyntaxKind5[SyntaxKind5["UnparsedInternalText"] = 312] = "UnparsedInternalText";
- SyntaxKind5[SyntaxKind5["UnparsedSyntheticReference"] = 313] = "UnparsedSyntheticReference";
- SyntaxKind5[SyntaxKind5["SourceFile"] = 314] = "SourceFile";
- SyntaxKind5[SyntaxKind5["Bundle"] = 315] = "Bundle";
- SyntaxKind5[SyntaxKind5["UnparsedSource"] = 316] = "UnparsedSource";
- SyntaxKind5[SyntaxKind5["InputFiles"] = 317] = "InputFiles";
- SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 318] = "JSDocTypeExpression";
- SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 319] = "JSDocNameReference";
- SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 320] = "JSDocMemberName";
- SyntaxKind5[SyntaxKind5["JSDocAllType"] = 321] = "JSDocAllType";
- SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 322] = "JSDocUnknownType";
- SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 323] = "JSDocNullableType";
- SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 324] = "JSDocNonNullableType";
- SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 325] = "JSDocOptionalType";
- SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 326] = "JSDocFunctionType";
- SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 327] = "JSDocVariadicType";
- SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 328] = "JSDocNamepathType";
- SyntaxKind5[SyntaxKind5["JSDoc"] = 329] = "JSDoc";
- SyntaxKind5[SyntaxKind5["JSDocComment"] = 329 /* JSDoc */] = "JSDocComment";
- SyntaxKind5[SyntaxKind5["JSDocText"] = 330] = "JSDocText";
- SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 331] = "JSDocTypeLiteral";
- SyntaxKind5[SyntaxKind5["JSDocSignature"] = 332] = "JSDocSignature";
- SyntaxKind5[SyntaxKind5["JSDocLink"] = 333] = "JSDocLink";
- SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 334] = "JSDocLinkCode";
- SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 335] = "JSDocLinkPlain";
- SyntaxKind5[SyntaxKind5["JSDocTag"] = 336] = "JSDocTag";
- SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 337] = "JSDocAugmentsTag";
- SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 338] = "JSDocImplementsTag";
- SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 339] = "JSDocAuthorTag";
- SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 340] = "JSDocDeprecatedTag";
- SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 341] = "JSDocClassTag";
- SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 342] = "JSDocPublicTag";
- SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 343] = "JSDocPrivateTag";
- SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 344] = "JSDocProtectedTag";
- SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 345] = "JSDocReadonlyTag";
- SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 346] = "JSDocOverrideTag";
- SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 347] = "JSDocCallbackTag";
- SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 348] = "JSDocEnumTag";
- SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 349] = "JSDocParameterTag";
- SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 350] = "JSDocReturnTag";
- SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 351] = "JSDocThisTag";
- SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 352] = "JSDocTypeTag";
- SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 353] = "JSDocTemplateTag";
- SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 354] = "JSDocTypedefTag";
- SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 355] = "JSDocSeeTag";
- SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 356] = "JSDocPropertyTag";
- SyntaxKind5[SyntaxKind5["SyntaxList"] = 357] = "SyntaxList";
- SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 358] = "NotEmittedStatement";
- SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 359] = "PartiallyEmittedExpression";
- SyntaxKind5[SyntaxKind5["CommaListExpression"] = 360] = "CommaListExpression";
- SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 361] = "MergeDeclarationMarker";
- SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 362] = "EndOfDeclarationMarker";
- SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 363] = "SyntheticReferenceExpression";
- SyntaxKind5[SyntaxKind5["Count"] = 364] = "Count";
+ SyntaxKind5[SyntaxKind5["OverloadKeyword"] = 164] = "OverloadKeyword";
+ SyntaxKind5[SyntaxKind5["OfKeyword"] = 165] = "OfKeyword";
+ SyntaxKind5[SyntaxKind5["QualifiedName"] = 166] = "QualifiedName";
+ SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 167] = "ComputedPropertyName";
+ SyntaxKind5[SyntaxKind5["TypeParameter"] = 168] = "TypeParameter";
+ SyntaxKind5[SyntaxKind5["Parameter"] = 169] = "Parameter";
+ SyntaxKind5[SyntaxKind5["Decorator"] = 170] = "Decorator";
+ SyntaxKind5[SyntaxKind5["PropertySignature"] = 171] = "PropertySignature";
+ SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 172] = "PropertyDeclaration";
+ SyntaxKind5[SyntaxKind5["AnnotationPropertyDeclaration"] = 173] = "AnnotationPropertyDeclaration";
+ SyntaxKind5[SyntaxKind5["OverloadPropertyDeclaration"] = 174] = "OverloadPropertyDeclaration";
+ SyntaxKind5[SyntaxKind5["MethodSignature"] = 175] = "MethodSignature";
+ SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 176] = "MethodDeclaration";
+ SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 177] = "ClassStaticBlockDeclaration";
+ SyntaxKind5[SyntaxKind5["Constructor"] = 178] = "Constructor";
+ SyntaxKind5[SyntaxKind5["GetAccessor"] = 179] = "GetAccessor";
+ SyntaxKind5[SyntaxKind5["SetAccessor"] = 180] = "SetAccessor";
+ SyntaxKind5[SyntaxKind5["CallSignature"] = 181] = "CallSignature";
+ SyntaxKind5[SyntaxKind5["ConstructSignature"] = 182] = "ConstructSignature";
+ SyntaxKind5[SyntaxKind5["IndexSignature"] = 183] = "IndexSignature";
+ SyntaxKind5[SyntaxKind5["TypePredicate"] = 184] = "TypePredicate";
+ SyntaxKind5[SyntaxKind5["TypeReference"] = 185] = "TypeReference";
+ SyntaxKind5[SyntaxKind5["FunctionType"] = 186] = "FunctionType";
+ SyntaxKind5[SyntaxKind5["ConstructorType"] = 187] = "ConstructorType";
+ SyntaxKind5[SyntaxKind5["TypeQuery"] = 188] = "TypeQuery";
+ SyntaxKind5[SyntaxKind5["TypeLiteral"] = 189] = "TypeLiteral";
+ SyntaxKind5[SyntaxKind5["ArrayType"] = 190] = "ArrayType";
+ SyntaxKind5[SyntaxKind5["TupleType"] = 191] = "TupleType";
+ SyntaxKind5[SyntaxKind5["OptionalType"] = 192] = "OptionalType";
+ SyntaxKind5[SyntaxKind5["RestType"] = 193] = "RestType";
+ SyntaxKind5[SyntaxKind5["UnionType"] = 194] = "UnionType";
+ SyntaxKind5[SyntaxKind5["IntersectionType"] = 195] = "IntersectionType";
+ SyntaxKind5[SyntaxKind5["ConditionalType"] = 196] = "ConditionalType";
+ SyntaxKind5[SyntaxKind5["InferType"] = 197] = "InferType";
+ SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 198] = "ParenthesizedType";
+ SyntaxKind5[SyntaxKind5["ThisType"] = 199] = "ThisType";
+ SyntaxKind5[SyntaxKind5["TypeOperator"] = 200] = "TypeOperator";
+ SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 201] = "IndexedAccessType";
+ SyntaxKind5[SyntaxKind5["MappedType"] = 202] = "MappedType";
+ SyntaxKind5[SyntaxKind5["LiteralType"] = 203] = "LiteralType";
+ SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 204] = "NamedTupleMember";
+ SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 205] = "TemplateLiteralType";
+ SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 206] = "TemplateLiteralTypeSpan";
+ SyntaxKind5[SyntaxKind5["ImportType"] = 207] = "ImportType";
+ SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 208] = "ObjectBindingPattern";
+ SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 209] = "ArrayBindingPattern";
+ SyntaxKind5[SyntaxKind5["BindingElement"] = 210] = "BindingElement";
+ SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 211] = "ArrayLiteralExpression";
+ SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 212] = "ObjectLiteralExpression";
+ SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 213] = "PropertyAccessExpression";
+ SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 214] = "ElementAccessExpression";
+ SyntaxKind5[SyntaxKind5["CallExpression"] = 215] = "CallExpression";
+ SyntaxKind5[SyntaxKind5["NewExpression"] = 216] = "NewExpression";
+ SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 217] = "TaggedTemplateExpression";
+ SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 218] = "TypeAssertionExpression";
+ SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 219] = "ParenthesizedExpression";
+ SyntaxKind5[SyntaxKind5["FunctionExpression"] = 220] = "FunctionExpression";
+ SyntaxKind5[SyntaxKind5["ArrowFunction"] = 221] = "ArrowFunction";
+ SyntaxKind5[SyntaxKind5["EtsComponentExpression"] = 222] = "EtsComponentExpression";
+ SyntaxKind5[SyntaxKind5["DeleteExpression"] = 223] = "DeleteExpression";
+ SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 224] = "TypeOfExpression";
+ SyntaxKind5[SyntaxKind5["VoidExpression"] = 225] = "VoidExpression";
+ SyntaxKind5[SyntaxKind5["AwaitExpression"] = 226] = "AwaitExpression";
+ SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 227] = "PrefixUnaryExpression";
+ SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 228] = "PostfixUnaryExpression";
+ SyntaxKind5[SyntaxKind5["BinaryExpression"] = 229] = "BinaryExpression";
+ SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 230] = "ConditionalExpression";
+ SyntaxKind5[SyntaxKind5["TemplateExpression"] = 231] = "TemplateExpression";
+ SyntaxKind5[SyntaxKind5["YieldExpression"] = 232] = "YieldExpression";
+ SyntaxKind5[SyntaxKind5["SpreadElement"] = 233] = "SpreadElement";
+ SyntaxKind5[SyntaxKind5["ClassExpression"] = 234] = "ClassExpression";
+ SyntaxKind5[SyntaxKind5["OmittedExpression"] = 235] = "OmittedExpression";
+ SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 236] = "ExpressionWithTypeArguments";
+ SyntaxKind5[SyntaxKind5["AsExpression"] = 237] = "AsExpression";
+ SyntaxKind5[SyntaxKind5["NonNullExpression"] = 238] = "NonNullExpression";
+ SyntaxKind5[SyntaxKind5["MetaProperty"] = 239] = "MetaProperty";
+ SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 240] = "SyntheticExpression";
+ SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 241] = "SatisfiesExpression";
+ SyntaxKind5[SyntaxKind5["TemplateSpan"] = 242] = "TemplateSpan";
+ SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 243] = "SemicolonClassElement";
+ SyntaxKind5[SyntaxKind5["Block"] = 244] = "Block";
+ SyntaxKind5[SyntaxKind5["EmptyStatement"] = 245] = "EmptyStatement";
+ SyntaxKind5[SyntaxKind5["VariableStatement"] = 246] = "VariableStatement";
+ SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 247] = "ExpressionStatement";
+ SyntaxKind5[SyntaxKind5["IfStatement"] = 248] = "IfStatement";
+ SyntaxKind5[SyntaxKind5["DoStatement"] = 249] = "DoStatement";
+ SyntaxKind5[SyntaxKind5["WhileStatement"] = 250] = "WhileStatement";
+ SyntaxKind5[SyntaxKind5["ForStatement"] = 251] = "ForStatement";
+ SyntaxKind5[SyntaxKind5["ForInStatement"] = 252] = "ForInStatement";
+ SyntaxKind5[SyntaxKind5["ForOfStatement"] = 253] = "ForOfStatement";
+ SyntaxKind5[SyntaxKind5["ContinueStatement"] = 254] = "ContinueStatement";
+ SyntaxKind5[SyntaxKind5["BreakStatement"] = 255] = "BreakStatement";
+ SyntaxKind5[SyntaxKind5["ReturnStatement"] = 256] = "ReturnStatement";
+ SyntaxKind5[SyntaxKind5["WithStatement"] = 257] = "WithStatement";
+ SyntaxKind5[SyntaxKind5["SwitchStatement"] = 258] = "SwitchStatement";
+ SyntaxKind5[SyntaxKind5["LabeledStatement"] = 259] = "LabeledStatement";
+ SyntaxKind5[SyntaxKind5["ThrowStatement"] = 260] = "ThrowStatement";
+ SyntaxKind5[SyntaxKind5["TryStatement"] = 261] = "TryStatement";
+ SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 262] = "DebuggerStatement";
+ SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 263] = "VariableDeclaration";
+ SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 264] = "VariableDeclarationList";
+ SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 265] = "FunctionDeclaration";
+ SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 266] = "ClassDeclaration";
+ SyntaxKind5[SyntaxKind5["StructDeclaration"] = 267] = "StructDeclaration";
+ SyntaxKind5[SyntaxKind5["AnnotationDeclaration"] = 268] = "AnnotationDeclaration";
+ SyntaxKind5[SyntaxKind5["OverloadDeclaration"] = 269] = "OverloadDeclaration";
+ SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 270] = "InterfaceDeclaration";
+ SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 271] = "TypeAliasDeclaration";
+ SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 272] = "EnumDeclaration";
+ SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 273] = "ModuleDeclaration";
+ SyntaxKind5[SyntaxKind5["ModuleBlock"] = 274] = "ModuleBlock";
+ SyntaxKind5[SyntaxKind5["CaseBlock"] = 275] = "CaseBlock";
+ SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 276] = "NamespaceExportDeclaration";
+ SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 277] = "ImportEqualsDeclaration";
+ SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 278] = "ImportDeclaration";
+ SyntaxKind5[SyntaxKind5["ImportClause"] = 279] = "ImportClause";
+ SyntaxKind5[SyntaxKind5["NamespaceImport"] = 280] = "NamespaceImport";
+ SyntaxKind5[SyntaxKind5["NamedImports"] = 281] = "NamedImports";
+ SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 282] = "ImportSpecifier";
+ SyntaxKind5[SyntaxKind5["ExportAssignment"] = 283] = "ExportAssignment";
+ SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 284] = "ExportDeclaration";
+ SyntaxKind5[SyntaxKind5["NamedExports"] = 285] = "NamedExports";
+ SyntaxKind5[SyntaxKind5["NamespaceExport"] = 286] = "NamespaceExport";
+ SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 287] = "ExportSpecifier";
+ SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 288] = "MissingDeclaration";
+ SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 289] = "ExternalModuleReference";
+ SyntaxKind5[SyntaxKind5["JsxElement"] = 290] = "JsxElement";
+ SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 291] = "JsxSelfClosingElement";
+ SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 292] = "JsxOpeningElement";
+ SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 293] = "JsxClosingElement";
+ SyntaxKind5[SyntaxKind5["JsxFragment"] = 294] = "JsxFragment";
+ SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 295] = "JsxOpeningFragment";
+ SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 296] = "JsxClosingFragment";
+ SyntaxKind5[SyntaxKind5["JsxAttribute"] = 297] = "JsxAttribute";
+ SyntaxKind5[SyntaxKind5["JsxAttributes"] = 298] = "JsxAttributes";
+ SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 299] = "JsxSpreadAttribute";
+ SyntaxKind5[SyntaxKind5["JsxExpression"] = 300] = "JsxExpression";
+ SyntaxKind5[SyntaxKind5["CaseClause"] = 301] = "CaseClause";
+ SyntaxKind5[SyntaxKind5["DefaultClause"] = 302] = "DefaultClause";
+ SyntaxKind5[SyntaxKind5["HeritageClause"] = 303] = "HeritageClause";
+ SyntaxKind5[SyntaxKind5["CatchClause"] = 304] = "CatchClause";
+ SyntaxKind5[SyntaxKind5["AssertClause"] = 305] = "AssertClause";
+ SyntaxKind5[SyntaxKind5["AssertEntry"] = 306] = "AssertEntry";
+ SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 307] = "ImportTypeAssertionContainer";
+ SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 308] = "PropertyAssignment";
+ SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 309] = "ShorthandPropertyAssignment";
+ SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 310] = "SpreadAssignment";
+ SyntaxKind5[SyntaxKind5["EnumMember"] = 311] = "EnumMember";
+ SyntaxKind5[SyntaxKind5["UnparsedPrologue"] = 312] = "UnparsedPrologue";
+ SyntaxKind5[SyntaxKind5["UnparsedPrepend"] = 313] = "UnparsedPrepend";
+ SyntaxKind5[SyntaxKind5["UnparsedText"] = 314] = "UnparsedText";
+ SyntaxKind5[SyntaxKind5["UnparsedInternalText"] = 315] = "UnparsedInternalText";
+ SyntaxKind5[SyntaxKind5["UnparsedSyntheticReference"] = 316] = "UnparsedSyntheticReference";
+ SyntaxKind5[SyntaxKind5["SourceFile"] = 317] = "SourceFile";
+ SyntaxKind5[SyntaxKind5["Bundle"] = 318] = "Bundle";
+ SyntaxKind5[SyntaxKind5["UnparsedSource"] = 319] = "UnparsedSource";
+ SyntaxKind5[SyntaxKind5["InputFiles"] = 320] = "InputFiles";
+ SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 321] = "JSDocTypeExpression";
+ SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 322] = "JSDocNameReference";
+ SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 323] = "JSDocMemberName";
+ SyntaxKind5[SyntaxKind5["JSDocAllType"] = 324] = "JSDocAllType";
+ SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 325] = "JSDocUnknownType";
+ SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 326] = "JSDocNullableType";
+ SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 327] = "JSDocNonNullableType";
+ SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 328] = "JSDocOptionalType";
+ SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 329] = "JSDocFunctionType";
+ SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 330] = "JSDocVariadicType";
+ SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 331] = "JSDocNamepathType";
+ SyntaxKind5[SyntaxKind5["JSDoc"] = 332] = "JSDoc";
+ SyntaxKind5[SyntaxKind5["JSDocComment"] = 332 /* JSDoc */] = "JSDocComment";
+ SyntaxKind5[SyntaxKind5["JSDocText"] = 333] = "JSDocText";
+ SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 334] = "JSDocTypeLiteral";
+ SyntaxKind5[SyntaxKind5["JSDocSignature"] = 335] = "JSDocSignature";
+ SyntaxKind5[SyntaxKind5["JSDocLink"] = 336] = "JSDocLink";
+ SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 337] = "JSDocLinkCode";
+ SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 338] = "JSDocLinkPlain";
+ SyntaxKind5[SyntaxKind5["JSDocTag"] = 339] = "JSDocTag";
+ SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 340] = "JSDocAugmentsTag";
+ SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 341] = "JSDocImplementsTag";
+ SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 342] = "JSDocAuthorTag";
+ SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 343] = "JSDocDeprecatedTag";
+ SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 344] = "JSDocClassTag";
+ SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 345] = "JSDocPublicTag";
+ SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 346] = "JSDocPrivateTag";
+ SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 347] = "JSDocProtectedTag";
+ SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 348] = "JSDocReadonlyTag";
+ SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 349] = "JSDocOverrideTag";
+ SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 350] = "JSDocCallbackTag";
+ SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 351] = "JSDocEnumTag";
+ SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 352] = "JSDocParameterTag";
+ SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 353] = "JSDocReturnTag";
+ SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 354] = "JSDocThisTag";
+ SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 355] = "JSDocTypeTag";
+ SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 356] = "JSDocTemplateTag";
+ SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 357] = "JSDocTypedefTag";
+ SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 358] = "JSDocSeeTag";
+ SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 359] = "JSDocPropertyTag";
+ SyntaxKind5[SyntaxKind5["SyntaxList"] = 360] = "SyntaxList";
+ SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 361] = "NotEmittedStatement";
+ SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 362] = "PartiallyEmittedExpression";
+ SyntaxKind5[SyntaxKind5["CommaListExpression"] = 363] = "CommaListExpression";
+ SyntaxKind5[SyntaxKind5["MergeDeclarationMarker"] = 364] = "MergeDeclarationMarker";
+ SyntaxKind5[SyntaxKind5["EndOfDeclarationMarker"] = 365] = "EndOfDeclarationMarker";
+ SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 366] = "SyntheticReferenceExpression";
+ SyntaxKind5[SyntaxKind5["Count"] = 367] = "Count";
SyntaxKind5[SyntaxKind5["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
SyntaxKind5[SyntaxKind5["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -6673,15 +6679,15 @@ var SyntaxKind2 = /* @__PURE__ */ ((SyntaxKind5) => {
SyntaxKind5[SyntaxKind5["FirstReservedWord"] = 81 /* BreakKeyword */] = "FirstReservedWord";
SyntaxKind5[SyntaxKind5["LastReservedWord"] = 117 /* WithKeyword */] = "LastReservedWord";
SyntaxKind5[SyntaxKind5["FirstKeyword"] = 81 /* BreakKeyword */] = "FirstKeyword";
- SyntaxKind5[SyntaxKind5["LastKeyword"] = 164 /* OfKeyword */] = "LastKeyword";
+ SyntaxKind5[SyntaxKind5["LastKeyword"] = 165 /* OfKeyword */] = "LastKeyword";
SyntaxKind5[SyntaxKind5["FirstFutureReservedWord"] = 118 /* ImplementsKeyword */] = "FirstFutureReservedWord";
SyntaxKind5[SyntaxKind5["LastFutureReservedWord"] = 126 /* YieldKeyword */] = "LastFutureReservedWord";
- SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 182 /* TypePredicate */] = "FirstTypeNode";
- SyntaxKind5[SyntaxKind5["LastTypeNode"] = 205 /* ImportType */] = "LastTypeNode";
+ SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 184 /* TypePredicate */] = "FirstTypeNode";
+ SyntaxKind5[SyntaxKind5["LastTypeNode"] = 207 /* ImportType */] = "LastTypeNode";
SyntaxKind5[SyntaxKind5["FirstPunctuation"] = 18 /* OpenBraceToken */] = "FirstPunctuation";
SyntaxKind5[SyntaxKind5["LastPunctuation"] = 78 /* CaretEqualsToken */] = "LastPunctuation";
SyntaxKind5[SyntaxKind5["FirstToken"] = 0 /* Unknown */] = "FirstToken";
- SyntaxKind5[SyntaxKind5["LastToken"] = 164 /* LastKeyword */] = "LastToken";
+ SyntaxKind5[SyntaxKind5["LastToken"] = 165 /* LastKeyword */] = "LastToken";
SyntaxKind5[SyntaxKind5["FirstTriviaToken"] = 2 /* SingleLineCommentTrivia */] = "FirstTriviaToken";
SyntaxKind5[SyntaxKind5["LastTriviaToken"] = 7 /* ConflictMarkerTrivia */] = "LastTriviaToken";
SyntaxKind5[SyntaxKind5["FirstLiteralToken"] = 8 /* NumericLiteral */] = "FirstLiteralToken";
@@ -6690,15 +6696,15 @@ var SyntaxKind2 = /* @__PURE__ */ ((SyntaxKind5) => {
SyntaxKind5[SyntaxKind5["LastTemplateToken"] = 17 /* TemplateTail */] = "LastTemplateToken";
SyntaxKind5[SyntaxKind5["FirstBinaryOperator"] = 29 /* LessThanToken */] = "FirstBinaryOperator";
SyntaxKind5[SyntaxKind5["LastBinaryOperator"] = 78 /* CaretEqualsToken */] = "LastBinaryOperator";
- SyntaxKind5[SyntaxKind5["FirstStatement"] = 244 /* VariableStatement */] = "FirstStatement";
- SyntaxKind5[SyntaxKind5["LastStatement"] = 260 /* DebuggerStatement */] = "LastStatement";
- SyntaxKind5[SyntaxKind5["FirstNode"] = 165 /* QualifiedName */] = "FirstNode";
- SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 318 /* JSDocTypeExpression */] = "FirstJSDocNode";
- SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 356 /* JSDocPropertyTag */] = "LastJSDocNode";
- SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 336 /* JSDocTag */] = "FirstJSDocTagNode";
- SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 356 /* JSDocPropertyTag */] = "LastJSDocTagNode";
+ SyntaxKind5[SyntaxKind5["FirstStatement"] = 246 /* VariableStatement */] = "FirstStatement";
+ SyntaxKind5[SyntaxKind5["LastStatement"] = 262 /* DebuggerStatement */] = "LastStatement";
+ SyntaxKind5[SyntaxKind5["FirstNode"] = 166 /* QualifiedName */] = "FirstNode";
+ SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 321 /* JSDocTypeExpression */] = "FirstJSDocNode";
+ SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 359 /* JSDocPropertyTag */] = "LastJSDocNode";
+ SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 339 /* JSDocTag */] = "FirstJSDocTagNode";
+ SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 359 /* JSDocPropertyTag */] = "LastJSDocTagNode";
SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 127 /* AbstractKeyword */] = "FirstContextualKeyword";
- SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 164 /* OfKeyword */] = "LastContextualKeyword";
+ SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword";
return SyntaxKind5;
})(SyntaxKind2 || {});
var NodeFlags2 = /* @__PURE__ */ ((NodeFlags4) => {
@@ -11715,6 +11721,7 @@ var textToKeywordObj = {
protected: 123 /* ProtectedKeyword */,
public: 124 /* PublicKeyword */,
override: 163 /* OverrideKeyword */,
+ overload: 164 /* OverloadKeyword */,
out: 146 /* OutKeyword */,
readonly: 147 /* ReadonlyKeyword */,
require: 148 /* RequireKeyword */,
@@ -11745,7 +11752,7 @@ var textToKeywordObj = {
yield: 126 /* YieldKeyword */,
async: 133 /* AsyncKeyword */,
await: 134 /* AwaitKeyword */,
- of: 164 /* OfKeyword */
+ of: 165 /* OfKeyword */
};
var textToKeyword = new Map2(getEntries(textToKeywordObj));
var textToToken = new Map2(getEntries({
@@ -13820,16 +13827,16 @@ function collapseTextChangeRangesAcrossMultipleVersions(changes) {
return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
}
function getTypeParameterOwner(d) {
- if (d && d.kind === 167 /* TypeParameter */) {
+ if (d && d.kind === 168 /* TypeParameter */) {
for (let current = d; current; current = current.parent) {
- if (isFunctionLike(current) || isClassLike(current) || current.kind === 267 /* InterfaceDeclaration */) {
+ if (isFunctionLike(current) || isClassLike(current) || current.kind === 270 /* InterfaceDeclaration */) {
return current;
}
}
}
}
function isParameterPropertyDeclaration(node, parent2) {
- return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 176 /* Constructor */;
+ return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 178 /* Constructor */;
}
function isEmptyBindingPattern(node) {
if (isBindingPattern(node)) {
@@ -13855,14 +13862,14 @@ function getCombinedFlags(node, getFlags) {
node = walkUpBindingElementsAndPatterns(node);
}
let flags = getFlags(node);
- if (node.kind === 261 /* VariableDeclaration */) {
+ if (node.kind === 263 /* VariableDeclaration */) {
node = node.parent;
}
- if (node && node.kind === 262 /* VariableDeclarationList */) {
+ if (node && node.kind === 264 /* VariableDeclarationList */) {
flags |= getFlags(node);
node = node.parent;
}
- if (node && node.kind === 244 /* VariableStatement */) {
+ if (node && node.kind === 246 /* VariableStatement */) {
flags |= getFlags(node);
}
return flags;
@@ -13983,30 +13990,30 @@ function nameForNamelessJSDocTypedef(declaration) {
return getDeclarationIdentifier(hostNode);
}
switch (hostNode.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (hostNode.declarationList && hostNode.declarationList.declarations[0]) {
return getDeclarationIdentifier(hostNode.declarationList.declarations[0]);
}
break;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
let expr = hostNode.expression;
- if (expr.kind === 227 /* BinaryExpression */ && expr.operatorToken.kind === 63 /* EqualsToken */) {
+ if (expr.kind === 229 /* BinaryExpression */ && expr.operatorToken.kind === 63 /* EqualsToken */) {
expr = expr.left;
}
switch (expr.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return expr.name;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const arg = expr.argumentExpression;
if (isIdentifier(arg)) {
return arg;
}
}
break;
- case 217 /* ParenthesizedExpression */: {
+ case 219 /* ParenthesizedExpression */: {
return getDeclarationIdentifier(hostNode.expression);
}
- case 257 /* LabeledStatement */: {
+ case 259 /* LabeledStatement */: {
if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) {
return getDeclarationIdentifier(hostNode.statement);
}
@@ -14037,16 +14044,16 @@ function getNonAssignedNameOfDeclaration(declaration) {
switch (declaration.kind) {
case 79 /* Identifier */:
return declaration;
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */: {
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */: {
const { name } = declaration;
- if (name.kind === 165 /* QualifiedName */) {
+ if (name.kind === 166 /* QualifiedName */) {
return name.right;
}
break;
}
- case 213 /* CallExpression */:
- case 227 /* BinaryExpression */: {
+ case 215 /* CallExpression */:
+ case 229 /* BinaryExpression */: {
const expr2 = declaration;
switch (getAssignmentDeclarationKind(expr2)) {
case 1 /* ExportsProperty */:
@@ -14062,15 +14069,15 @@ function getNonAssignedNameOfDeclaration(declaration) {
return void 0;
}
}
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return getNameOfJSDocTypedef(declaration);
- case 348 /* JSDocEnumTag */:
+ case 351 /* JSDocEnumTag */:
return nameForNamelessJSDocTypedef(declaration);
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
const { expression } = declaration;
return isIdentifier(expression) ? expression : void 0;
}
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = declaration;
if (isBindableStaticElementAccessExpression(expr)) {
return expr.argumentExpression;
@@ -14284,10 +14291,10 @@ function getAllJSDocTagsOfKind(node, kind) {
return getJSDocTags(node).filter((doc) => doc.kind === kind);
}
function getTextOfJSDocComment(comment) {
- return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 330 /* JSDocText */ ? c.text : formatJSDocLink(c)).join("");
+ return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 333 /* JSDocText */ ? c.text : formatJSDocLink(c)).join("");
}
function formatJSDocLink(link) {
- const kind = link.kind === 333 /* JSDocLink */ ? "link" : link.kind === 334 /* JSDocLinkCode */ ? "linkcode" : "linkplain";
+ const kind = link.kind === 336 /* JSDocLink */ ? "link" : link.kind === 337 /* JSDocLinkCode */ ? "linkcode" : "linkplain";
const name = link.name ? entityNameToString(link.name) : "";
const space = link.name && link.text.startsWith("://") ? "" : " ";
return `{@${kind} ${name}${space}${link.text}}`;
@@ -14297,7 +14304,7 @@ function getEffectiveTypeParameterDeclarations(node) {
return emptyArray;
}
if (isJSDocTypeAlias(node)) {
- Debug.assert(node.parent.kind === 329 /* JSDoc */);
+ Debug.assert(node.parent.kind === 332 /* JSDoc */);
return flatMap(node.parent.tags, (tag) => isJSDocTemplateTag(tag) ? tag.typeParameters : void 0);
}
if (node.typeParameters) {
@@ -14325,7 +14332,7 @@ function isMemberName(node) {
return node.kind === 79 /* Identifier */ || node.kind === 80 /* PrivateIdentifier */;
}
function isGetOrSetAccessorDeclaration(node) {
- return node.kind === 178 /* SetAccessor */ || node.kind === 177 /* GetAccessor */;
+ return node.kind === 180 /* SetAccessor */ || node.kind === 179 /* GetAccessor */;
}
function isPropertyAccessChain(node) {
return isPropertyAccessExpression(node) && !!(node.flags & 32 /* OptionalChain */);
@@ -14338,7 +14345,7 @@ function isCallChain(node) {
}
function isOptionalChain(node) {
const kind = node.kind;
- return !!(node.flags & 32 /* OptionalChain */) && (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */ || kind === 213 /* CallExpression */ || kind === 236 /* NonNullExpression */);
+ return !!(node.flags & 32 /* OptionalChain */) && (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */ || kind === 215 /* CallExpression */ || kind === 238 /* NonNullExpression */);
}
function isOptionalChainRoot(node) {
return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken;
@@ -14350,7 +14357,7 @@ function isOutermostOptionalChain(node) {
return !isOptionalChain(node.parent) || isOptionalChainRoot(node.parent) || node !== node.parent.expression;
}
function isNullishCoalesce(node) {
- return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
+ return node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
}
function isConstTypeReference(node) {
return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "const" && !node.typeArguments;
@@ -14362,34 +14369,34 @@ function isNonNullChain(node) {
return isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */);
}
function isBreakOrContinueStatement(node) {
- return node.kind === 253 /* BreakStatement */ || node.kind === 252 /* ContinueStatement */;
+ return node.kind === 255 /* BreakStatement */ || node.kind === 254 /* ContinueStatement */;
}
function isNamedExportBindings(node) {
- return node.kind === 283 /* NamespaceExport */ || node.kind === 282 /* NamedExports */;
+ return node.kind === 286 /* NamespaceExport */ || node.kind === 285 /* NamedExports */;
}
function isUnparsedTextLike(node) {
switch (node.kind) {
- case 311 /* UnparsedText */:
- case 312 /* UnparsedInternalText */:
+ case 314 /* UnparsedText */:
+ case 315 /* UnparsedInternalText */:
return true;
default:
return false;
}
}
function isUnparsedNode(node) {
- return isUnparsedTextLike(node) || node.kind === 309 /* UnparsedPrologue */ || node.kind === 313 /* UnparsedSyntheticReference */;
+ return isUnparsedTextLike(node) || node.kind === 312 /* UnparsedPrologue */ || node.kind === 316 /* UnparsedSyntheticReference */;
}
function isJSDocPropertyLikeTag(node) {
- return node.kind === 356 /* JSDocPropertyTag */ || node.kind === 349 /* JSDocParameterTag */;
+ return node.kind === 359 /* JSDocPropertyTag */ || node.kind === 352 /* JSDocParameterTag */;
}
function isNode(node) {
return isNodeKind(node.kind);
}
function isNodeKind(kind) {
- return kind >= 165 /* FirstNode */;
+ return kind >= 166 /* FirstNode */;
}
function isTokenKind(kind) {
- return kind >= 0 /* FirstToken */ && kind <= 164 /* LastToken */;
+ return kind >= 0 /* FirstToken */ && kind <= 165 /* LastToken */;
}
function isToken(n) {
return isTokenKind(n.kind);
@@ -14405,11 +14412,11 @@ function isLiteralExpression(node) {
}
function isLiteralExpressionOfObject(node) {
switch (node.kind) {
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
case 13 /* RegularExpressionLiteral */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
return true;
}
return false;
@@ -14429,13 +14436,13 @@ function isImportOrExportSpecifier(node) {
}
function isTypeOnlyImportOrExportDeclaration(node) {
switch (node.kind) {
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return node.isTypeOnly || node.parent.parent.isTypeOnly;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return node.parent.isTypeOnly;
- case 276 /* ImportClause */:
- case 274 /* ImportEqualsDeclaration */:
+ case 279 /* ImportClause */:
+ case 277 /* ImportEqualsDeclaration */:
return node.isTypeOnly;
default:
return false;
@@ -14491,15 +14498,15 @@ function isModifier(node) {
}
function isEntityName(node) {
const kind = node.kind;
- return kind === 165 /* QualifiedName */ || kind === 79 /* Identifier */;
+ return kind === 166 /* QualifiedName */ || kind === 79 /* Identifier */;
}
function isPropertyName(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 80 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ || kind === 166 /* ComputedPropertyName */;
+ return kind === 79 /* Identifier */ || kind === 80 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ || kind === 167 /* ComputedPropertyName */;
}
function isBindingName(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 206 /* ObjectBindingPattern */ || kind === 207 /* ArrayBindingPattern */;
+ return kind === 79 /* Identifier */ || kind === 208 /* ObjectBindingPattern */ || kind === 209 /* ArrayBindingPattern */;
}
function isFunctionLike(node) {
return !!node && isFunctionLikeKind(node.kind);
@@ -14515,13 +14522,13 @@ function isBooleanLiteral(node) {
}
function isFunctionLikeDeclarationKind(kind) {
switch (kind) {
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
default:
return false;
@@ -14529,14 +14536,14 @@ function isFunctionLikeDeclarationKind(kind) {
}
function isFunctionLikeKind(kind) {
switch (kind) {
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 184 /* FunctionType */:
- case 326 /* JSDocFunctionType */:
- case 185 /* ConstructorType */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 186 /* FunctionType */:
+ case 329 /* JSDocFunctionType */:
+ case 187 /* ConstructorType */:
return true;
default:
return isFunctionLikeDeclarationKind(kind);
@@ -14547,29 +14554,33 @@ function isFunctionOrModuleBlock(node) {
}
function isAnnotationElement(node) {
const kind = node.kind;
- return kind === 172 /* AnnotationPropertyDeclaration */;
+ return kind === 173 /* AnnotationPropertyDeclaration */;
+}
+function isOverloadElement(node) {
+ const kind = node.kind;
+ return kind === 174 /* OverloadPropertyDeclaration */;
}
function isClassElement(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 171 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 241 /* SemicolonClassElement */;
+ return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */;
}
function isClassLike(node) {
- return node && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || node.kind === 265 /* StructDeclaration */);
+ return node && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 267 /* StructDeclaration */);
}
function isStruct(node) {
- return node && node.kind === 265 /* StructDeclaration */;
+ return node && node.kind === 267 /* StructDeclaration */;
}
function isAccessor(node) {
- return node && (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */);
+ return node && (node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */);
}
function isAutoAccessorPropertyDeclaration(node) {
return isPropertyDeclaration(node) && hasAccessorModifier(node);
}
function isMethodOrAccessor(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -14577,10 +14588,10 @@ function isMethodOrAccessor(node) {
}
function isNamedClassElement(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
return true;
default:
return false;
@@ -14591,22 +14602,22 @@ function isModifierLike(node) {
}
function isTypeElement(node) {
const kind = node.kind;
- return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 170 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function isClassOrTypeElement(node) {
return isTypeElement(node) || isClassElement(node);
}
function isObjectLiteralElementLike(node) {
const kind = node.kind;
- return kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 307 /* SpreadAssignment */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 310 /* SpreadAssignment */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function isTypeNode(node) {
return isTypeNodeKind(node.kind);
}
function isFunctionOrConstructorTypeNode(node) {
switch (node.kind) {
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return true;
}
return false;
@@ -14614,23 +14625,23 @@ function isFunctionOrConstructorTypeNode(node) {
function isBindingPattern(node) {
if (node) {
const kind = node.kind;
- return kind === 207 /* ArrayBindingPattern */ || kind === 206 /* ObjectBindingPattern */;
+ return kind === 209 /* ArrayBindingPattern */ || kind === 208 /* ObjectBindingPattern */;
}
return false;
}
function isAssignmentPattern(node) {
const kind = node.kind;
- return kind === 209 /* ArrayLiteralExpression */ || kind === 210 /* ObjectLiteralExpression */;
+ return kind === 211 /* ArrayLiteralExpression */ || kind === 212 /* ObjectLiteralExpression */;
}
function isArrayBindingElement(node) {
const kind = node.kind;
- return kind === 208 /* BindingElement */ || kind === 233 /* OmittedExpression */;
+ return kind === 210 /* BindingElement */ || kind === 235 /* OmittedExpression */;
}
function isDeclarationBindingElement(bindingElement) {
switch (bindingElement.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
return true;
}
return false;
@@ -14640,78 +14651,78 @@ function isBindingOrAssignmentPattern(node) {
}
function isObjectBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 206 /* ObjectBindingPattern */:
- case 210 /* ObjectLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 212 /* ObjectLiteralExpression */:
return true;
}
return false;
}
function isObjectBindingOrAssignmentElement(node) {
switch (node.kind) {
- case 208 /* BindingElement */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 210 /* BindingElement */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return true;
}
return false;
}
function isArrayBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return true;
}
return false;
}
function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
const kind = node.kind;
- return kind === 211 /* PropertyAccessExpression */ || kind === 165 /* QualifiedName */ || kind === 205 /* ImportType */;
+ return kind === 213 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */ || kind === 207 /* ImportType */;
}
function isPropertyAccessOrQualifiedName(node) {
const kind = node.kind;
- return kind === 211 /* PropertyAccessExpression */ || kind === 165 /* QualifiedName */;
+ return kind === 213 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
}
function isCallLikeExpression(node) {
switch (node.kind) {
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 215 /* TaggedTemplateExpression */:
- case 169 /* Decorator */:
- case 220 /* EtsComponentExpression */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 170 /* Decorator */:
+ case 222 /* EtsComponentExpression */:
return true;
default:
return false;
}
}
function isCallOrNewExpression(node) {
- return node.kind === 213 /* CallExpression */ || node.kind === 214 /* NewExpression */;
+ return node.kind === 215 /* CallExpression */ || node.kind === 216 /* NewExpression */;
}
function isTemplateLiteral(node) {
const kind = node.kind;
- return kind === 229 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */;
+ return kind === 231 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */;
}
function isLeftHandSideExpression(node) {
return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind);
}
function isLeftHandSideExpressionKind(kind) {
switch (kind) {
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
- case 214 /* NewExpression */:
- case 213 /* CallExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
- case 215 /* TaggedTemplateExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 217 /* ParenthesizedExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 220 /* EtsComponentExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 216 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
+ case 217 /* TaggedTemplateExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 222 /* EtsComponentExpression */:
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
case 13 /* RegularExpressionLiteral */:
@@ -14719,15 +14730,15 @@ function isLeftHandSideExpressionKind(kind) {
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
case 96 /* FalseKeyword */:
case 105 /* NullKeyword */:
case 109 /* ThisKeyword */:
case 111 /* TrueKeyword */:
case 107 /* SuperKeyword */:
- case 236 /* NonNullExpression */:
- case 234 /* ExpressionWithTypeArguments */:
- case 237 /* MetaProperty */:
+ case 238 /* NonNullExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 239 /* MetaProperty */:
case 101 /* ImportKeyword */:
return true;
default:
@@ -14739,13 +14750,13 @@ function isUnaryExpression(node) {
}
function isUnaryExpressionKind(kind) {
switch (kind) {
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
- case 221 /* DeleteExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 224 /* AwaitExpression */:
- case 216 /* TypeAssertionExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 223 /* DeleteExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 226 /* AwaitExpression */:
+ case 218 /* TypeAssertionExpression */:
return true;
default:
return isLeftHandSideExpressionKind(kind);
@@ -14753,9 +14764,9 @@ function isUnaryExpressionKind(kind) {
}
function isUnaryExpressionWithWrite(expr) {
switch (expr.kind) {
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return true;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */;
default:
return false;
@@ -14766,16 +14777,16 @@ function isExpression(node) {
}
function isExpressionKind(kind) {
switch (kind) {
- case 228 /* ConditionalExpression */:
- case 230 /* YieldExpression */:
- case 219 /* ArrowFunction */:
- case 227 /* BinaryExpression */:
- case 231 /* SpreadElement */:
- case 235 /* AsExpression */:
- case 233 /* OmittedExpression */:
- case 360 /* CommaListExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 239 /* SatisfiesExpression */:
+ case 230 /* ConditionalExpression */:
+ case 232 /* YieldExpression */:
+ case 221 /* ArrowFunction */:
+ case 229 /* BinaryExpression */:
+ case 233 /* SpreadElement */:
+ case 237 /* AsExpression */:
+ case 235 /* OmittedExpression */:
+ case 363 /* CommaListExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 241 /* SatisfiesExpression */:
return true;
default:
return isUnaryExpressionKind(kind);
@@ -14783,20 +14794,20 @@ function isExpressionKind(kind) {
}
function isAssertionExpression(node) {
const kind = node.kind;
- return kind === 216 /* TypeAssertionExpression */ || kind === 235 /* AsExpression */;
+ return kind === 218 /* TypeAssertionExpression */ || kind === 237 /* AsExpression */;
}
function isNotEmittedOrPartiallyEmittedNode(node) {
return isNotEmittedStatement(node) || isPartiallyEmittedExpression(node);
}
function isIterationStatement(node, lookInLabeledStatements) {
switch (node.kind) {
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return true;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
}
return false;
@@ -14855,7 +14866,7 @@ function allImportsAreAnnotations(imports, resolver) {
});
}
function isForInOrOfStatement(node) {
- return node.kind === 250 /* ForInStatement */ || node.kind === 251 /* ForOfStatement */;
+ return node.kind === 252 /* ForInStatement */ || node.kind === 253 /* ForOfStatement */;
}
function isConciseBody(node) {
return isBlock(node) || isExpression(node);
@@ -14868,35 +14879,35 @@ function isForInitializer(node) {
}
function isModuleBody(node) {
const kind = node.kind;
- return kind === 271 /* ModuleBlock */ || kind === 270 /* ModuleDeclaration */ || kind === 79 /* Identifier */;
+ return kind === 274 /* ModuleBlock */ || kind === 273 /* ModuleDeclaration */ || kind === 79 /* Identifier */;
}
function isNamespaceBody(node) {
const kind = node.kind;
- return kind === 271 /* ModuleBlock */ || kind === 270 /* ModuleDeclaration */;
+ return kind === 274 /* ModuleBlock */ || kind === 273 /* ModuleDeclaration */;
}
function isJSDocNamespaceBody(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 270 /* ModuleDeclaration */;
+ return kind === 79 /* Identifier */ || kind === 273 /* ModuleDeclaration */;
}
function isNamedImportBindings(node) {
const kind = node.kind;
- return kind === 278 /* NamedImports */ || kind === 277 /* NamespaceImport */;
+ return kind === 281 /* NamedImports */ || kind === 280 /* NamespaceImport */;
}
function isModuleOrEnumDeclaration(node) {
- return node.kind === 270 /* ModuleDeclaration */ || node.kind === 269 /* EnumDeclaration */;
+ return node.kind === 273 /* ModuleDeclaration */ || node.kind === 272 /* EnumDeclaration */;
}
function isDeclarationKind(kind) {
- return kind === 219 /* ArrowFunction */ || kind === 208 /* BindingElement */ || kind === 264 /* ClassDeclaration */ || kind === 232 /* ClassExpression */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 176 /* Constructor */ || kind === 269 /* EnumDeclaration */ || kind === 308 /* EnumMember */ || kind === 284 /* ExportSpecifier */ || kind === 263 /* FunctionDeclaration */ || kind === 218 /* FunctionExpression */ || kind === 177 /* GetAccessor */ || kind === 276 /* ImportClause */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 279 /* ImportSpecifier */ || kind === 267 /* InterfaceDeclaration */ || kind === 294 /* JsxAttribute */ || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 270 /* ModuleDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 277 /* NamespaceImport */ || kind === 283 /* NamespaceExport */ || kind === 168 /* Parameter */ || kind === 305 /* PropertyAssignment */ || kind === 171 /* PropertyDeclaration */ || kind === 172 /* AnnotationPropertyDeclaration */ || kind === 170 /* PropertySignature */ || kind === 178 /* SetAccessor */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 268 /* TypeAliasDeclaration */ || kind === 167 /* TypeParameter */ || kind === 261 /* VariableDeclaration */ || kind === 354 /* JSDocTypedefTag */ || kind === 347 /* JSDocCallbackTag */ || kind === 356 /* JSDocPropertyTag */;
+ return kind === 221 /* ArrowFunction */ || kind === 210 /* BindingElement */ || kind === 266 /* ClassDeclaration */ || kind === 234 /* ClassExpression */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 174 /* OverloadPropertyDeclaration */ || kind === 178 /* Constructor */ || kind === 272 /* EnumDeclaration */ || kind === 311 /* EnumMember */ || kind === 287 /* ExportSpecifier */ || kind === 265 /* FunctionDeclaration */ || kind === 220 /* FunctionExpression */ || kind === 179 /* GetAccessor */ || kind === 279 /* ImportClause */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 282 /* ImportSpecifier */ || kind === 270 /* InterfaceDeclaration */ || kind === 297 /* JsxAttribute */ || kind === 176 /* MethodDeclaration */ || kind === 175 /* MethodSignature */ || kind === 273 /* ModuleDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 280 /* NamespaceImport */ || kind === 286 /* NamespaceExport */ || kind === 169 /* Parameter */ || kind === 308 /* PropertyAssignment */ || kind === 172 /* PropertyDeclaration */ || kind === 173 /* AnnotationPropertyDeclaration */ || kind === 171 /* PropertySignature */ || kind === 180 /* SetAccessor */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 271 /* TypeAliasDeclaration */ || kind === 168 /* TypeParameter */ || kind === 263 /* VariableDeclaration */ || kind === 357 /* JSDocTypedefTag */ || kind === 350 /* JSDocCallbackTag */ || kind === 359 /* JSDocPropertyTag */;
}
function isDeclarationStatementKind(kind) {
- return kind === 263 /* FunctionDeclaration */ || kind === 285 /* MissingDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 280 /* ExportAssignment */ || kind === 273 /* NamespaceExportDeclaration */;
+ return kind === 265 /* FunctionDeclaration */ || kind === 288 /* MissingDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 269 /* OverloadDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 276 /* NamespaceExportDeclaration */;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 253 /* BreakStatement */ || kind === 252 /* ContinueStatement */ || kind === 260 /* DebuggerStatement */ || kind === 247 /* DoStatement */ || kind === 245 /* ExpressionStatement */ || kind === 243 /* EmptyStatement */ || kind === 250 /* ForInStatement */ || kind === 251 /* ForOfStatement */ || kind === 249 /* ForStatement */ || kind === 246 /* IfStatement */ || kind === 257 /* LabeledStatement */ || kind === 254 /* ReturnStatement */ || kind === 256 /* SwitchStatement */ || kind === 258 /* ThrowStatement */ || kind === 259 /* TryStatement */ || kind === 244 /* VariableStatement */ || kind === 248 /* WhileStatement */ || kind === 255 /* WithStatement */ || kind === 358 /* NotEmittedStatement */ || kind === 362 /* EndOfDeclarationMarker */ || kind === 361 /* MergeDeclarationMarker */;
+ return kind === 255 /* BreakStatement */ || kind === 254 /* ContinueStatement */ || kind === 262 /* DebuggerStatement */ || kind === 249 /* DoStatement */ || kind === 247 /* ExpressionStatement */ || kind === 245 /* EmptyStatement */ || kind === 252 /* ForInStatement */ || kind === 253 /* ForOfStatement */ || kind === 251 /* ForStatement */ || kind === 248 /* IfStatement */ || kind === 259 /* LabeledStatement */ || kind === 256 /* ReturnStatement */ || kind === 258 /* SwitchStatement */ || kind === 260 /* ThrowStatement */ || kind === 261 /* TryStatement */ || kind === 246 /* VariableStatement */ || kind === 250 /* WhileStatement */ || kind === 257 /* WithStatement */ || kind === 361 /* NotEmittedStatement */ || kind === 365 /* EndOfDeclarationMarker */ || kind === 364 /* MergeDeclarationMarker */;
}
function isDeclaration(node) {
- if (node.kind === 167 /* TypeParameter */) {
- return node.parent && node.parent.kind !== 353 /* JSDocTemplateTag */ || isInJSFile(node);
+ if (node.kind === 168 /* TypeParameter */) {
+ return node.parent && node.parent.kind !== 356 /* JSDocTemplateTag */ || isInJSFile(node);
}
return isDeclarationKind(node.kind);
}
@@ -14911,10 +14922,10 @@ function isStatement(node) {
return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || isBlockStatement(node);
}
function isBlockStatement(node) {
- if (node.kind !== 242 /* Block */)
+ if (node.kind !== 244 /* Block */)
return false;
if (node.parent !== void 0) {
- if (node.parent.kind === 259 /* TryStatement */ || node.parent.kind === 301 /* CatchClause */) {
+ if (node.parent.kind === 261 /* TryStatement */ || node.parent.kind === 304 /* CatchClause */) {
return false;
}
}
@@ -14922,50 +14933,50 @@ function isBlockStatement(node) {
}
function isStatementOrBlock(node) {
const kind = node.kind;
- return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 242 /* Block */;
+ return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 244 /* Block */;
}
function isModuleReference(node) {
const kind = node.kind;
- return kind === 286 /* ExternalModuleReference */ || kind === 165 /* QualifiedName */ || kind === 79 /* Identifier */;
+ return kind === 289 /* ExternalModuleReference */ || kind === 166 /* QualifiedName */ || kind === 79 /* Identifier */;
}
function isJsxTagNameExpression(node) {
const kind = node.kind;
- return kind === 109 /* ThisKeyword */ || kind === 79 /* Identifier */ || kind === 211 /* PropertyAccessExpression */;
+ return kind === 109 /* ThisKeyword */ || kind === 79 /* Identifier */ || kind === 213 /* PropertyAccessExpression */;
}
function isJsxChild(node) {
const kind = node.kind;
- return kind === 287 /* JsxElement */ || kind === 297 /* JsxExpression */ || kind === 288 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ || kind === 291 /* JsxFragment */;
+ return kind === 290 /* JsxElement */ || kind === 300 /* JsxExpression */ || kind === 291 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ || kind === 294 /* JsxFragment */;
}
function isJsxAttributeLike(node) {
const kind = node.kind;
- return kind === 294 /* JsxAttribute */ || kind === 296 /* JsxSpreadAttribute */;
+ return kind === 297 /* JsxAttribute */ || kind === 299 /* JsxSpreadAttribute */;
}
function isStringLiteralOrJsxExpression(node) {
const kind = node.kind;
- return kind === 10 /* StringLiteral */ || kind === 297 /* JsxExpression */;
+ return kind === 10 /* StringLiteral */ || kind === 300 /* JsxExpression */;
}
function isJsxOpeningLikeElement(node) {
const kind = node.kind;
- return kind === 289 /* JsxOpeningElement */ || kind === 288 /* JsxSelfClosingElement */;
+ return kind === 292 /* JsxOpeningElement */ || kind === 291 /* JsxSelfClosingElement */;
}
function isCaseOrDefaultClause(node) {
const kind = node.kind;
- return kind === 298 /* CaseClause */ || kind === 299 /* DefaultClause */;
+ return kind === 301 /* CaseClause */ || kind === 302 /* DefaultClause */;
}
function isJSDocNode(node) {
- return node.kind >= 318 /* FirstJSDocNode */ && node.kind <= 356 /* LastJSDocNode */;
+ return node.kind >= 321 /* FirstJSDocNode */ && node.kind <= 359 /* LastJSDocNode */;
}
function isJSDocCommentContainingNode(node) {
- return node.kind === 329 /* JSDoc */ || node.kind === 328 /* JSDocNamepathType */ || node.kind === 330 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node);
+ return node.kind === 332 /* JSDoc */ || node.kind === 331 /* JSDocNamepathType */ || node.kind === 333 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node);
}
function isJSDocTag(node) {
- return node.kind >= 336 /* FirstJSDocTagNode */ && node.kind <= 356 /* LastJSDocTagNode */;
+ return node.kind >= 339 /* FirstJSDocTagNode */ && node.kind <= 359 /* LastJSDocTagNode */;
}
function isSetAccessor(node) {
- return node.kind === 178 /* SetAccessor */;
+ return node.kind === 180 /* SetAccessor */;
}
function isGetAccessor(node) {
- return node.kind === 177 /* GetAccessor */;
+ return node.kind === 179 /* GetAccessor */;
}
function hasJSDocNodes(node) {
const { jsDoc } = node;
@@ -14979,23 +14990,23 @@ function hasInitializer(node) {
}
function hasOnlyExpressionInitializer(node) {
switch (node.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 305 /* PropertyAssignment */:
- case 308 /* EnumMember */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 308 /* PropertyAssignment */:
+ case 311 /* EnumMember */:
return true;
default:
return false;
}
}
function isObjectLiteralElement(node) {
- return node.kind === 294 /* JsxAttribute */ || node.kind === 296 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);
+ return node.kind === 297 /* JsxAttribute */ || node.kind === 299 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);
}
function isTypeReferenceType(node) {
- return node.kind === 183 /* TypeReference */ || node.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.kind === 185 /* TypeReference */ || node.kind === 236 /* ExpressionWithTypeArguments */;
}
var MAX_SMI_X86 = 1073741823;
function guessIndentation(lines) {
@@ -15023,7 +15034,7 @@ function isStringLiteralLike(node) {
return node.kind === 10 /* StringLiteral */ || node.kind === 14 /* NoSubstitutionTemplateLiteral */;
}
function isJSDocLinkLike(node) {
- return node.kind === 333 /* JSDocLink */ || node.kind === 334 /* JSDocLinkCode */ || node.kind === 335 /* JSDocLinkPlain */;
+ return node.kind === 336 /* JSDocLink */ || node.kind === 337 /* JSDocLinkCode */ || node.kind === 338 /* JSDocLinkPlain */;
}
function hasRestParameter(s) {
const last2 = lastOrUndefined(s.parameters);
@@ -15031,7 +15042,7 @@ function hasRestParameter(s) {
}
function isRestParameter(node) {
const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
- return node.dotDotDotToken !== void 0 || !!type && type.kind === 327 /* JSDocVariadicType */;
+ return node.dotDotDotToken !== void 0 || !!type && type.kind === 330 /* JSDocVariadicType */;
}
var _MemoryUtils = class {
static tryGC() {
@@ -15255,7 +15266,7 @@ function aggregateChildData(node) {
}
}
function getSourceFileOfNode(node) {
- while (node && node.kind !== 314 /* SourceFile */) {
+ while (node && node.kind !== 317 /* SourceFile */) {
node = node.parent;
}
return node;
@@ -15268,11 +15279,11 @@ function isPlainJsFile(file, checkJs) {
}
function isStatementWithLocals(node) {
switch (node.kind) {
- case 242 /* Block */:
- case 272 /* CaseBlock */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 244 /* Block */:
+ case 275 /* CaseBlock */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
return true;
}
return false;
@@ -15429,7 +15440,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
if (includeJsDoc && hasJSDocNodes(node)) {
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
}
- if (node.kind === 357 /* SyntaxList */ && node._children.length > 0) {
+ if (node.kind === 360 /* SyntaxList */ && node._children.length > 0) {
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
}
return node.virtual ? node.pos : skipTrivia(
@@ -15632,7 +15643,7 @@ function isBlockOrCatchScoped(declaration) {
}
function isCatchClauseVariableDeclarationOrBindingElement(declaration) {
const node = getRootDeclaration(declaration);
- return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 301 /* CatchClause */;
+ return node.kind === 263 /* VariableDeclaration */ && node.parent.kind === 304 /* CatchClause */;
}
function isAmbientModule(node) {
return isModuleDeclaration(node) && (node.name.kind === 10 /* StringLiteral */ || isGlobalScopeAugmentation(node));
@@ -15650,10 +15661,10 @@ function isShorthandAmbientModuleSymbol(moduleSymbol) {
return isShorthandAmbientModule(moduleSymbol.valueDeclaration);
}
function isShorthandAmbientModule(node) {
- return !!node && node.kind === 270 /* ModuleDeclaration */ && !node.body;
+ return !!node && node.kind === 273 /* ModuleDeclaration */ && !node.body;
}
function isBlockScopedContainerTopLevel(node) {
- return node.kind === 314 /* SourceFile */ || node.kind === 270 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node);
+ return node.kind === 317 /* SourceFile */ || node.kind === 273 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node);
}
function isGlobalScopeAugmentation(module2) {
return !!(module2.flags & 1024 /* GlobalAugmentation */);
@@ -15663,9 +15674,9 @@ function isExternalModuleAugmentation(node) {
}
function isModuleAugmentationExternal(node) {
switch (node.parent.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return isExternalModule(node.parent);
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return isAmbientModule(node.parent.parent) && isSourceFile(node.parent.parent.parent) && !isExternalModule(node.parent.parent.parent);
}
return false;
@@ -15713,34 +15724,34 @@ function isAmbientPropertyDeclaration(node) {
}
function isBlockScope(node, parentNode) {
switch (node.kind) {
- case 314 /* SourceFile */:
- case 272 /* CaseBlock */:
- case 301 /* CatchClause */:
- case 270 /* ModuleDeclaration */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 317 /* SourceFile */:
+ case 275 /* CaseBlock */:
+ case 304 /* CatchClause */:
+ case 273 /* ModuleDeclaration */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return true;
- case 242 /* Block */:
+ case 244 /* Block */:
return !isFunctionLikeOrClassStaticBlockDeclaration(parentNode);
}
return false;
}
function isDeclarationWithTypeParameters(node) {
switch (node.kind) {
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
- case 332 /* JSDocSignature */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 335 /* JSDocSignature */:
return true;
default:
assertType(node);
@@ -15749,26 +15760,26 @@ function isDeclarationWithTypeParameters(node) {
}
function isDeclarationWithTypeParameterChildren(node) {
switch (node.kind) {
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 326 /* JSDocFunctionType */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 353 /* JSDocTemplateTag */:
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 329 /* JSDocFunctionType */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 356 /* JSDocTemplateTag */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
default:
assertType(node);
@@ -15777,8 +15788,8 @@ function isDeclarationWithTypeParameterChildren(node) {
}
function isAnyImportSyntax(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return true;
default:
return false;
@@ -15789,17 +15800,18 @@ function isAnyImportOrBareOrAccessedRequire(node) {
}
function isLateVisibilityPaintedStatement(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 244 /* VariableStatement */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 246 /* VariableStatement */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
return true;
default:
return false;
@@ -15832,7 +15844,7 @@ function getNameFromIndexInfo(info) {
return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : void 0;
}
function isComputedNonLiteralName(name) {
- return name.kind === 166 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
+ return name.kind === 167 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
}
function tryGetTextOfPropertyName(name) {
switch (name.kind) {
@@ -15843,7 +15855,7 @@ function tryGetTextOfPropertyName(name) {
case 8 /* NumericLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return escapeLeadingUnderscores(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
if (isStringOrNumericLiteralLike(name.expression))
return escapeLeadingUnderscores(name.expression.text);
return void 0;
@@ -15861,15 +15873,15 @@ function entityNameToString(name) {
case 80 /* PrivateIdentifier */:
case 79 /* Identifier */:
return getFullWidth(name) === 0 ? idText(name) : getTextOfNode(name);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return entityNameToString(name.left) + "." + entityNameToString(name.right);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isIdentifier(name.name) || isPrivateIdentifier(name.name)) {
return entityNameToString(name.expression) + "." + entityNameToString(name.name);
} else {
return Debug.assertNever(name.name);
}
- case 320 /* JSDocMemberName */:
+ case 323 /* JSDocMemberName */:
return entityNameToString(name.left) + entityNameToString(name.right);
default:
return Debug.assertNever(name);
@@ -15949,7 +15961,7 @@ function getSpanOfTokenAtPosition(sourceFile, pos) {
}
function getErrorSpanForArrowFunction(sourceFile, node) {
const pos = skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 242 /* Block */) {
+ if (node.body && node.body.kind === 244 /* Block */) {
const { line: startLine } = getLineAndCharacterOfPosition(sourceFile, node.body.pos);
const { line: endLine } = getLineAndCharacterOfPosition(sourceFile, node.body.end);
if (startLine < endLine) {
@@ -15961,37 +15973,37 @@ function getErrorSpanForArrowFunction(sourceFile, node) {
function getErrorSpanForNode(sourceFile, node) {
let errorNode = node;
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
const pos2 = skipTrivia(sourceFile.text, 0, false);
if (pos2 === sourceFile.text.length) {
return createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos2);
- case 261 /* VariableDeclaration */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 268 /* TypeAliasDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 277 /* NamespaceImport */:
+ case 263 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 271 /* TypeAliasDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 280 /* NamespaceImport */:
errorNode = node.name;
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return getErrorSpanForArrowFunction(sourceFile, node);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
const start = skipTrivia(sourceFile.text, node.pos);
const end = node.statements.length > 0 ? node.statements[0].pos : node.end;
return createTextSpanFromBounds(start, end);
@@ -16033,10 +16045,10 @@ function isLet(node) {
return !!(getCombinedNodeFlags(node) & 1 /* Let */);
}
function isSuperCall(n) {
- return n.kind === 213 /* CallExpression */ && n.expression.kind === 107 /* SuperKeyword */;
+ return n.kind === 215 /* CallExpression */ && n.expression.kind === 107 /* SuperKeyword */;
}
function isImportCall(n) {
- return n.kind === 213 /* CallExpression */ && n.expression.kind === 101 /* ImportKeyword */;
+ return n.kind === 215 /* CallExpression */ && n.expression.kind === 101 /* ImportKeyword */;
}
function isImportMeta(n) {
return isMetaProperty(n) && n.keywordToken === 101 /* ImportKeyword */ && n.name.escapedText === "meta";
@@ -16045,7 +16057,7 @@ function isLiteralImportTypeNode(n) {
return isImportTypeNode(n) && isLiteralTypeNode(n.argument) && isStringLiteral(n.argument.literal);
}
function isPrologueDirective(node) {
- return node.kind === 245 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */;
+ return node.kind === 247 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */;
}
function isCustomPrologue(node) {
return !!(getEmitFlags(node) & 1048576 /* CustomPrologue */);
@@ -16060,7 +16072,7 @@ function isHoistedVariableStatement(node) {
return isCustomPrologue(node) && isVariableStatement(node) && every(node.declarationList.declarations, isHoistedVariable);
}
function getJSDocCommentRanges(node, text) {
- const commentRanges = node.kind === 168 /* Parameter */ || node.kind === 167 /* TypeParameter */ || node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */ || node.kind === 217 /* ParenthesizedExpression */ || node.kind === 261 /* VariableDeclaration */ || node.kind === 284 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos);
+ const commentRanges = node.kind === 169 /* Parameter */ || node.kind === 168 /* TypeParameter */ || node.kind === 220 /* FunctionExpression */ || node.kind === 221 /* ArrowFunction */ || node.kind === 219 /* ParenthesizedExpression */ || node.kind === 263 /* VariableDeclaration */ || node.kind === 287 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos);
return filter(commentRanges, (comment) => text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */);
}
var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/;
@@ -16068,7 +16080,7 @@ var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/;
var defaultLibReferenceRegEx = /^(\/\/\/\s*/;
function isPartOfTypeNode(node) {
- if (182 /* FirstTypeNode */ <= node.kind && node.kind <= 205 /* LastTypeNode */) {
+ if (184 /* FirstTypeNode */ <= node.kind && node.kind <= 207 /* LastTypeNode */) {
return true;
}
switch (node.kind) {
@@ -16084,65 +16096,65 @@ function isPartOfTypeNode(node) {
case 145 /* NeverKeyword */:
return true;
case 115 /* VoidKeyword */:
- return node.parent.kind !== 223 /* VoidExpression */;
- case 234 /* ExpressionWithTypeArguments */:
+ return node.parent.kind !== 225 /* VoidExpression */;
+ case 236 /* ExpressionWithTypeArguments */:
return isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node);
- case 167 /* TypeParameter */:
- return node.parent.kind === 200 /* MappedType */ || node.parent.kind === 195 /* InferType */;
+ case 168 /* TypeParameter */:
+ return node.parent.kind === 202 /* MappedType */ || node.parent.kind === 197 /* InferType */;
case 79 /* Identifier */:
- if (node.parent.kind === 165 /* QualifiedName */ && node.parent.right === node) {
+ if (node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node) {
node = node.parent;
- } else if (node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node) {
+ } else if (node.parent.kind === 213 /* PropertyAccessExpression */ && node.parent.name === node) {
node = node.parent;
}
Debug.assert(
- node.kind === 79 /* Identifier */ || node.kind === 165 /* QualifiedName */ || node.kind === 211 /* PropertyAccessExpression */,
+ node.kind === 79 /* Identifier */ || node.kind === 166 /* QualifiedName */ || node.kind === 213 /* PropertyAccessExpression */,
"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."
);
- case 165 /* QualifiedName */:
- case 211 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
case 109 /* ThisKeyword */: {
const { parent: parent2 } = node;
- if (parent2.kind === 186 /* TypeQuery */) {
+ if (parent2.kind === 188 /* TypeQuery */) {
return false;
}
- if (parent2.kind === 205 /* ImportType */) {
+ if (parent2.kind === 207 /* ImportType */) {
return !parent2.isTypeOf;
}
- if (182 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 205 /* LastTypeNode */) {
+ if (184 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 207 /* LastTypeNode */) {
return true;
}
switch (parent2.kind) {
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return isHeritageClause(parent2.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent2);
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return node === parent2.constraint;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return node === parent2.constraint;
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 168 /* Parameter */:
- case 261 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 169 /* Parameter */:
+ case 263 /* VariableDeclaration */:
return node === parent2.type;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return node === parent2.type;
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return node === parent2.type;
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return node === parent2.type;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
return contains(parent2.typeArguments, node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return false;
}
}
@@ -16162,23 +16174,23 @@ function forEachReturnStatement(body, visitor) {
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitor(node);
- case 272 /* CaseBlock */:
- case 242 /* Block */:
- case 246 /* IfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 255 /* WithStatement */:
- case 256 /* SwitchStatement */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 257 /* LabeledStatement */:
- case 259 /* TryStatement */:
- case 301 /* CatchClause */:
+ case 275 /* CaseBlock */:
+ case 244 /* Block */:
+ case 248 /* IfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 257 /* WithStatement */:
+ case 258 /* SwitchStatement */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 259 /* LabeledStatement */:
+ case 261 /* TryStatement */:
+ case 304 /* CatchClause */:
return forEachChild(node, traverse);
}
}
@@ -16187,21 +16199,21 @@ function forEachYieldExpression(body, visitor) {
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
visitor(node);
const operand = node.expression;
if (operand) {
traverse(operand);
}
return;
- case 269 /* EnumDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return;
default:
if (isFunctionLike(node)) {
- if (node.name && node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name && node.name.kind === 167 /* ComputedPropertyName */) {
traverse(node.name.expression);
return;
}
@@ -16212,9 +16224,9 @@ function forEachYieldExpression(body, visitor) {
}
}
function getRestParameterElementType(node) {
- if (node && node.kind === 188 /* ArrayType */) {
+ if (node && node.kind === 190 /* ArrayType */) {
return node.elementType;
- } else if (node && node.kind === 183 /* TypeReference */) {
+ } else if (node && node.kind === 185 /* TypeReference */) {
return singleOrUndefined(node.typeArguments);
} else {
return void 0;
@@ -16222,27 +16234,27 @@ function getRestParameterElementType(node) {
}
function getMembersOfDeclaration(node) {
switch (node.kind) {
- case 267 /* InterfaceDeclaration */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 187 /* TypeLiteral */:
+ case 270 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 189 /* TypeLiteral */:
return node.members;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return node.properties;
}
}
function isVariableLike(node) {
if (node) {
switch (node.kind) {
- case 208 /* BindingElement */:
- case 308 /* EnumMember */:
- case 168 /* Parameter */:
- case 305 /* PropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 306 /* ShorthandPropertyAssignment */:
- case 261 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 311 /* EnumMember */:
+ case 169 /* Parameter */:
+ case 308 /* PropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 263 /* VariableDeclaration */:
return true;
}
}
@@ -16252,7 +16264,7 @@ function isVariableLikeOrAccessor(node) {
return isVariableLike(node) || isAccessor(node);
}
function isVariableDeclarationInVariableStatement(node) {
- return node.parent.kind === 262 /* VariableDeclarationList */ && node.parent.parent.kind === 244 /* VariableStatement */;
+ return node.parent.kind === 264 /* VariableDeclarationList */ && node.parent.parent.kind === 246 /* VariableStatement */;
}
function isCommonJsExportedExpression(node) {
if (!isInJSFile(node))
@@ -16269,13 +16281,13 @@ function isValidESSymbolDeclaration(node) {
}
function introducesArgumentsExoticObject(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return true;
}
return false;
@@ -16285,20 +16297,20 @@ function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) {
if (beforeUnwrapLabelCallback) {
beforeUnwrapLabelCallback(node);
}
- if (node.statement.kind !== 257 /* LabeledStatement */) {
+ if (node.statement.kind !== 259 /* LabeledStatement */) {
return node.statement;
}
node = node.statement;
}
}
function isFunctionBlock(node) {
- return node && node.kind === 242 /* Block */ && isFunctionLike(node.parent);
+ return node && node.kind === 244 /* Block */ && isFunctionLike(node.parent);
}
function isObjectLiteralMethod(node) {
- return node && node.kind === 174 /* MethodDeclaration */ && node.parent.kind === 210 /* ObjectLiteralExpression */;
+ return node && node.kind === 176 /* MethodDeclaration */ && node.parent.kind === 212 /* ObjectLiteralExpression */;
}
function isObjectLiteralOrClassExpressionMethodOrAccessor(node) {
- return (node.kind === 174 /* MethodDeclaration */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */) && (node.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.kind === 232 /* ClassExpression */);
+ return (node.kind === 176 /* MethodDeclaration */ || node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */) && (node.parent.kind === 212 /* ObjectLiteralExpression */ || node.parent.kind === 234 /* ClassExpression */);
}
function isIdentifierTypePredicate(predicate) {
return predicate && predicate.kind === 1 /* Identifier */;
@@ -16308,7 +16320,7 @@ function isThisTypePredicate(predicate) {
}
function getPropertyAssignment(objectLiteral, key, key2) {
return objectLiteral.properties.filter((property) => {
- if (property.kind === 305 /* PropertyAssignment */) {
+ if (property.kind === 308 /* PropertyAssignment */) {
const propName = tryGetTextOfPropertyName(property.name);
return key === propName || !!key2 && key2 === propName;
}
@@ -16358,63 +16370,63 @@ function getContainingStruct(node) {
return findAncestor(node.parent, isStruct);
}
function getThisContainer(node, includeArrowFunctions) {
- Debug.assert(node.kind !== 314 /* SourceFile */);
+ Debug.assert(node.kind !== 317 /* SourceFile */);
while (true) {
node = node.parent;
if (!node) {
return Debug.fail();
}
switch (node.kind) {
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
if (isClassLike(node.parent.parent)) {
return node;
}
node = node.parent;
break;
- case 169 /* Decorator */:
- if (node.parent.kind === 168 /* Parameter */ && isClassElement(node.parent.parent)) {
+ case 170 /* Decorator */:
+ if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) {
node = node.parent.parent;
} else if (isClassElement(node.parent)) {
node = node.parent;
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (!includeArrowFunctions) {
continue;
}
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 270 /* ModuleDeclaration */:
- case 175 /* ClassStaticBlockDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 269 /* EnumDeclaration */:
- case 314 /* SourceFile */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 273 /* ModuleDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 272 /* EnumDeclaration */:
+ case 317 /* SourceFile */:
return node;
}
}
}
function isThisContainerOrFunctionBlock(node) {
switch (node.kind) {
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 171 /* PropertyDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 172 /* PropertyDeclaration */:
return true;
- case 242 /* Block */:
+ case 244 /* Block */:
switch (node.parent.kind) {
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -16434,9 +16446,9 @@ function getNewTargetContainer(node) {
const container = getThisContainer(node, false);
if (container) {
switch (container.kind) {
- case 176 /* Constructor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return container;
}
}
@@ -16449,26 +16461,26 @@ function getSuperContainer(node, stopOnFunctions) {
return node;
}
switch (node.kind) {
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
node = node.parent;
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
if (!stopOnFunctions) {
continue;
}
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
return node;
- case 169 /* Decorator */:
- if (node.parent.kind === 168 /* Parameter */ && isClassElement(node.parent.parent)) {
+ case 170 /* Decorator */:
+ if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) {
node = node.parent.parent;
} else if (isClassElement(node.parent)) {
node = node.parent;
@@ -16478,14 +16490,14 @@ function getSuperContainer(node, stopOnFunctions) {
}
}
function getImmediatelyInvokedFunctionExpression(func) {
- if (func.kind === 218 /* FunctionExpression */ || func.kind === 219 /* ArrowFunction */) {
+ if (func.kind === 220 /* FunctionExpression */ || func.kind === 221 /* ArrowFunction */) {
let prev = func;
let parent2 = func.parent;
- while (parent2.kind === 217 /* ParenthesizedExpression */) {
+ while (parent2.kind === 219 /* ParenthesizedExpression */) {
prev = parent2;
parent2 = parent2.parent;
}
- if (parent2.kind === 213 /* CallExpression */ && parent2.expression === prev) {
+ if (parent2.kind === 215 /* CallExpression */ && parent2.expression === prev) {
return parent2;
}
}
@@ -16495,11 +16507,11 @@ function isSuperOrSuperProperty(node) {
}
function isSuperProperty(node) {
const kind = node.kind;
- return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 107 /* SuperKeyword */;
+ return (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */) && node.expression.kind === 107 /* SuperKeyword */;
}
function isThisProperty(node) {
const kind = node.kind;
- return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 109 /* ThisKeyword */;
+ return (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */) && node.expression.kind === 109 /* ThisKeyword */;
}
function isThisInitializedDeclaration(node) {
var _a2;
@@ -16510,22 +16522,22 @@ function isThisInitializedObjectBindingExpression(node) {
}
function getEntityNameFromTypeNode(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return node.typeName;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return isEntityNameExpression(node.expression) ? node.expression : void 0;
case 79 /* Identifier */:
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return node;
}
return void 0;
}
function getInvokedExpression(node) {
switch (node.kind) {
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return node.tag;
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return node.tagName;
default:
return node.expression;
@@ -16536,20 +16548,20 @@ function nodeCanBeDecorated(node, parent2, grandparent, compilerOptions) {
return false;
}
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
return true;
- case 171 /* PropertyDeclaration */:
- return parent2.kind === 264 /* ClassDeclaration */ || parent2.kind === 265 /* StructDeclaration */;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- return node.body !== void 0 && (parent2.kind === 264 /* ClassDeclaration */ || parent2.kind === 265 /* StructDeclaration */);
- case 168 /* Parameter */:
- return parent2.body !== void 0 && (parent2.kind === 176 /* Constructor */ || parent2.kind === 174 /* MethodDeclaration */ || parent2.kind === 178 /* SetAccessor */) && (grandparent.kind === 264 /* ClassDeclaration */ || grandparent.kind === 265 /* StructDeclaration */);
- case 263 /* FunctionDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ return parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */;
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ return node.body !== void 0 && (parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */);
+ case 169 /* Parameter */:
+ return parent2.body !== void 0 && (parent2.kind === 178 /* Constructor */ || parent2.kind === 176 /* MethodDeclaration */ || parent2.kind === 180 /* SetAccessor */) && (grandparent.kind === 266 /* ClassDeclaration */ || grandparent.kind === 267 /* StructDeclaration */);
+ case 265 /* FunctionDeclaration */:
return isArkTsDecorator(node, compilerOptions) || isSendableFunctionOrType(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return isSendableFunctionOrType(node);
}
return false;
@@ -16562,13 +16574,13 @@ function nodeOrChildIsDecorated(node, parent2, grandparent) {
}
function childIsDecorated(node, parent2) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return some(node.members, (m) => nodeOrChildIsDecorated(m, node, parent2));
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return some(node.members, (m) => nodeOrChildIsDecorated(m, node, parent2));
- case 174 /* MethodDeclaration */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
return some(node.parameters, (p) => nodeIsDecorated(p, node, parent2));
default:
return false;
@@ -16582,7 +16594,7 @@ function classOrConstructorParameterIsDecorated(node) {
}
function isJSXTagName(node) {
const { parent: parent2 } = node;
- if (parent2.kind === 289 /* JsxOpeningElement */ || parent2.kind === 288 /* JsxSelfClosingElement */ || parent2.kind === 290 /* JsxClosingElement */) {
+ if (parent2.kind === 292 /* JsxOpeningElement */ || parent2.kind === 291 /* JsxSelfClosingElement */ || parent2.kind === 293 /* JsxClosingElement */) {
return parent2.tagName === node;
}
return false;
@@ -16594,55 +16606,55 @@ function isExpressionNode(node) {
case 111 /* TrueKeyword */:
case 96 /* FalseKeyword */:
case 13 /* RegularExpressionLiteral */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 211 /* PropertyAccessExpression */:
- case 220 /* EtsComponentExpression */:
- case 212 /* ElementAccessExpression */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 215 /* TaggedTemplateExpression */:
- case 235 /* AsExpression */:
- case 216 /* TypeAssertionExpression */:
- case 239 /* SatisfiesExpression */:
- case 236 /* NonNullExpression */:
- case 217 /* ParenthesizedExpression */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
- case 219 /* ArrowFunction */:
- case 223 /* VoidExpression */:
- case 221 /* DeleteExpression */:
- case 222 /* TypeOfExpression */:
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
- case 227 /* BinaryExpression */:
- case 228 /* ConditionalExpression */:
- case 231 /* SpreadElement */:
- case 229 /* TemplateExpression */:
- case 233 /* OmittedExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
- case 230 /* YieldExpression */:
- case 224 /* AwaitExpression */:
- case 237 /* MetaProperty */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 222 /* EtsComponentExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 237 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 241 /* SatisfiesExpression */:
+ case 238 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 225 /* VoidExpression */:
+ case 223 /* DeleteExpression */:
+ case 224 /* TypeOfExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 229 /* BinaryExpression */:
+ case 230 /* ConditionalExpression */:
+ case 233 /* SpreadElement */:
+ case 231 /* TemplateExpression */:
+ case 235 /* OmittedExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
+ case 232 /* YieldExpression */:
+ case 226 /* AwaitExpression */:
+ case 239 /* MetaProperty */:
return true;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return !isHeritageClause(node.parent);
- case 165 /* QualifiedName */:
- while (node.parent.kind === 165 /* QualifiedName */) {
+ case 166 /* QualifiedName */:
+ while (node.parent.kind === 166 /* QualifiedName */) {
node = node.parent;
}
- return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
- case 320 /* JSDocMemberName */:
+ return node.parent.kind === 188 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
+ case 323 /* JSDocMemberName */:
while (isJSDocMemberName(node.parent)) {
node = node.parent;
}
- return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
+ return node.parent.kind === 188 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node);
case 80 /* PrivateIdentifier */:
return isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 102 /* InKeyword */;
case 79 /* Identifier */:
- if (node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) {
+ if (node.parent.kind === 188 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) {
return true;
}
case 8 /* NumericLiteral */:
@@ -16658,64 +16670,64 @@ function isExpressionNode(node) {
function isInExpressionContext(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 308 /* EnumMember */:
- case 305 /* PropertyAssignment */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 311 /* EnumMember */:
+ case 308 /* PropertyAssignment */:
+ case 210 /* BindingElement */:
return parent2.initializer === node;
- case 245 /* ExpressionStatement */:
- case 246 /* IfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 254 /* ReturnStatement */:
- case 255 /* WithStatement */:
- case 256 /* SwitchStatement */:
- case 298 /* CaseClause */:
- case 258 /* ThrowStatement */:
+ case 247 /* ExpressionStatement */:
+ case 248 /* IfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 256 /* ReturnStatement */:
+ case 257 /* WithStatement */:
+ case 258 /* SwitchStatement */:
+ case 301 /* CaseClause */:
+ case 260 /* ThrowStatement */:
return parent2.expression === node;
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
const forStatement = parent2;
- return forStatement.initializer === node && forStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ return forStatement.initializer === node && forStatement.initializer.kind !== 264 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
const forInStatement = parent2;
- return forInStatement.initializer === node && forInStatement.initializer.kind !== 262 /* VariableDeclarationList */ || forInStatement.expression === node;
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ return forInStatement.initializer === node && forInStatement.initializer.kind !== 264 /* VariableDeclarationList */ || forInStatement.expression === node;
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return node === parent2.expression;
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return node === parent2.expression;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return node === parent2.expression;
- case 169 /* Decorator */:
- case 297 /* JsxExpression */:
- case 296 /* JsxSpreadAttribute */:
- case 307 /* SpreadAssignment */:
+ case 170 /* Decorator */:
+ case 300 /* JsxExpression */:
+ case 299 /* JsxSpreadAttribute */:
+ case 310 /* SpreadAssignment */:
return true;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return parent2.expression === node && !isPartOfTypeNode(parent2);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return parent2.objectAssignmentInitializer === node;
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return node === parent2.expression;
default:
return isExpressionNode(parent2);
}
}
function isPartOfTypeQuery(node) {
- while (node.kind === 165 /* QualifiedName */ || node.kind === 79 /* Identifier */) {
+ while (node.kind === 166 /* QualifiedName */ || node.kind === 79 /* Identifier */) {
node = node.parent;
}
- return node.kind === 186 /* TypeQuery */;
+ return node.kind === 188 /* TypeQuery */;
}
function isNamespaceReexportDeclaration(node) {
return isNamespaceExport(node) && !!node.parent.moduleSpecifier;
}
function isExternalModuleImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 286 /* ExternalModuleReference */;
+ return node.kind === 277 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 289 /* ExternalModuleReference */;
}
function getExternalModuleImportEqualsDeclarationExpression(node) {
Debug.assert(isExternalModuleImportEqualsDeclaration(node));
@@ -16725,7 +16737,7 @@ function getExternalModuleRequireArgument(node) {
return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
}
function isInternalModuleImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 286 /* ExternalModuleReference */;
+ return node.kind === 277 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 289 /* ExternalModuleReference */;
}
function isSourceFileJS(file) {
return isInJSFile(file);
@@ -16784,7 +16796,7 @@ function isInStruct(node) {
return !!container && isStruct(container);
}
function isRequireCall(callExpression, requireStringLiteralLikeArgument) {
- if (callExpression.kind !== 213 /* CallExpression */) {
+ if (callExpression.kind !== 215 /* CallExpression */) {
return false;
}
const { expression, arguments: args } = callExpression;
@@ -16846,9 +16858,9 @@ function getAssignedExpandoInitializer(node) {
function getExpandoInitializer(initializer, isPrototypeAssignment) {
if (isCallExpression(initializer)) {
const e = skipParentheses(initializer.expression);
- return e.kind === 218 /* FunctionExpression */ || e.kind === 219 /* ArrowFunction */ ? initializer : void 0;
+ return e.kind === 220 /* FunctionExpression */ || e.kind === 221 /* ArrowFunction */ ? initializer : void 0;
}
- if (initializer.kind === 218 /* FunctionExpression */ || initializer.kind === 232 /* ClassExpression */ || initializer.kind === 219 /* ArrowFunction */) {
+ if (initializer.kind === 220 /* FunctionExpression */ || initializer.kind === 234 /* ClassExpression */ || initializer.kind === 221 /* ArrowFunction */) {
return initializer;
}
if (isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) {
@@ -17010,7 +17022,7 @@ function isPrototypePropertyAssignment(node) {
return isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 3 /* PrototypeProperty */;
}
function isSpecialPropertyDeclaration(expr) {
- return isInJSFile(expr) && expr.parent && expr.parent.kind === 245 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent);
+ return isInJSFile(expr) && expr.parent && expr.parent.kind === 247 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent);
}
function setValueDeclaration(symbol, node) {
const { valueDeclaration } = symbol;
@@ -17023,16 +17035,16 @@ function isFunctionSymbol(symbol) {
return false;
}
const decl = symbol.valueDeclaration;
- return decl.kind === 263 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer);
+ return decl.kind === 265 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer);
}
function tryGetModuleSpecifierFromDeclaration(node) {
var _a2, _b;
switch (node.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return (_a2 = findAncestor(node.initializer, (node2) => isRequireCall(node2, true))) == null ? void 0 : _a2.arguments[0];
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return tryCast(node.moduleSpecifier, isStringLiteralLike);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
default:
Debug.assertNever(node);
@@ -17043,14 +17055,14 @@ function importFromModuleSpecifier(node) {
}
function tryGetImportFromModuleSpecifier(node) {
switch (node.parent.kind) {
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
return node.parent;
- case 286 /* ExternalModuleReference */:
+ case 289 /* ExternalModuleReference */:
return node.parent.parent;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return isImportCall(node.parent) || isRequireCall(node.parent, false) ? node.parent : void 0;
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
Debug.assert(isStringLiteral(node));
return tryCast(node.parent.parent, isImportTypeNode);
default:
@@ -17059,16 +17071,16 @@ function tryGetImportFromModuleSpecifier(node) {
}
function getExternalModuleName(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
return node.moduleSpecifier;
- case 274 /* ImportEqualsDeclaration */:
- return node.moduleReference.kind === 286 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
- case 205 /* ImportType */:
+ case 277 /* ImportEqualsDeclaration */:
+ return node.moduleReference.kind === 289 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
+ case 207 /* ImportType */:
return isLiteralImportTypeNode(node) ? node.argument.literal : void 0;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return node.arguments[0];
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return node.name.kind === 10 /* StringLiteral */ ? node.name : void 0;
default:
return Debug.assertNever(node);
@@ -17076,18 +17088,18 @@ function getExternalModuleName(node) {
}
function getNamespaceDeclarationNode(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return node.importClause && tryCast(node.importClause.namedBindings, isNamespaceImport);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return node;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return node.exportClause && tryCast(node.exportClause, isNamespaceExport);
default:
return Debug.assertNever(node);
}
}
function isDefaultImport(node) {
- return node.kind === 275 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
+ return node.kind === 278 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
}
function forEachImportClauseDeclaration(node, action) {
if (node.name) {
@@ -17104,13 +17116,13 @@ function forEachImportClauseDeclaration(node, action) {
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
- case 168 /* Parameter */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 306 /* ShorthandPropertyAssignment */:
- case 305 /* PropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 169 /* Parameter */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return node.questionToken !== void 0;
}
}
@@ -17122,7 +17134,7 @@ function isJSDocConstructSignature(node) {
return !!name && name.escapedText === "new";
}
function isJSDocTypeAlias(node) {
- return node.kind === 354 /* JSDocTypedefTag */ || node.kind === 347 /* JSDocCallbackTag */ || node.kind === 348 /* JSDocEnumTag */;
+ return node.kind === 357 /* JSDocTypedefTag */ || node.kind === 350 /* JSDocCallbackTag */ || node.kind === 351 /* JSDocEnumTag */;
}
function isTypeAlias(node) {
return isJSDocTypeAlias(node) || isTypeAliasDeclaration(node);
@@ -17135,14 +17147,14 @@ function getSourceOfDefaultedAssignment(node) {
}
function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
const v = getSingleVariableOfVariableStatement(node);
return v && v.initializer;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return node.initializer;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return node.initializer;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return node.initializer;
}
}
@@ -17150,7 +17162,7 @@ function getSingleVariableOfVariableStatement(node) {
return isVariableStatement(node) ? firstOrUndefined(node.declarationList.declarations) : void 0;
}
function getNestedModuleDeclaration(node) {
- return isModuleDeclaration(node) && node.body && node.body.kind === 270 /* ModuleDeclaration */ ? node.body : void 0;
+ return isModuleDeclaration(node) && node.body && node.body.kind === 273 /* ModuleDeclaration */ ? node.body : void 0;
}
function getJSDocCommentsAndTags(hostNode, noCache) {
let result;
@@ -17162,11 +17174,11 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
if (hasJSDocNodes(node)) {
result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
}
- if (node.kind === 168 /* Parameter */) {
+ if (node.kind === 169 /* Parameter */) {
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
break;
}
- if (node.kind === 167 /* TypeParameter */) {
+ if (node.kind === 168 /* TypeParameter */) {
result = addRange(result, (noCache ? getJSDocTypeParameterTagsNoCache : getJSDocTypeParameterTags)(node));
break;
}
@@ -17186,7 +17198,7 @@ function ownsJSDocTag(hostNode, tag) {
}
function getNextJSDocCommentLocation(node) {
const parent2 = node.parent;
- if (parent2.kind === 305 /* PropertyAssignment */ || parent2.kind === 280 /* ExportAssignment */ || parent2.kind === 171 /* PropertyDeclaration */ || parent2.kind === 245 /* ExpressionStatement */ && node.kind === 211 /* PropertyAccessExpression */ || parent2.kind === 254 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isBinaryExpression(node) && node.operatorToken.kind === 63 /* EqualsToken */) {
+ if (parent2.kind === 308 /* PropertyAssignment */ || parent2.kind === 283 /* ExportAssignment */ || parent2.kind === 172 /* PropertyDeclaration */ || parent2.kind === 247 /* ExpressionStatement */ && node.kind === 213 /* PropertyAccessExpression */ || parent2.kind === 256 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isBinaryExpression(node) && node.operatorToken.kind === 63 /* EqualsToken */) {
return parent2;
} else if (parent2.parent && (getSingleVariableOfVariableStatement(parent2.parent) === node || isBinaryExpression(parent2) && parent2.operatorToken.kind === 63 /* EqualsToken */)) {
return parent2.parent;
@@ -17262,32 +17274,32 @@ function getAssignmentTargetKind(node) {
let parent2 = node.parent;
while (true) {
switch (parent2.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const binaryOperator = parent2.operatorToken.kind;
return isAssignmentOperator(binaryOperator) && parent2.left === node ? binaryOperator === 63 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
const unaryOperator = parent2.operator;
return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
return parent2.initializer === node ? 1 /* Definite */ : 0 /* None */;
- case 217 /* ParenthesizedExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 231 /* SpreadElement */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 233 /* SpreadElement */:
+ case 238 /* NonNullExpression */:
node = parent2;
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
node = parent2.parent;
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
if (parent2.name !== node) {
return 0 /* None */;
}
node = parent2.parent;
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (parent2.name === node) {
return 0 /* None */;
}
@@ -17304,22 +17316,22 @@ function isAssignmentTarget(node) {
}
function isNodeWithPossibleHoistedDeclaration(node) {
switch (node.kind) {
- case 242 /* Block */:
- case 244 /* VariableStatement */:
- case 255 /* WithStatement */:
- case 246 /* IfStatement */:
- case 256 /* SwitchStatement */:
- case 272 /* CaseBlock */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 257 /* LabeledStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 259 /* TryStatement */:
- case 301 /* CatchClause */:
+ case 244 /* Block */:
+ case 246 /* VariableStatement */:
+ case 257 /* WithStatement */:
+ case 248 /* IfStatement */:
+ case 258 /* SwitchStatement */:
+ case 275 /* CaseBlock */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 259 /* LabeledStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 261 /* TryStatement */:
+ case 304 /* CatchClause */:
return true;
}
return false;
@@ -17334,14 +17346,14 @@ function walkUp(node, kind) {
return node;
}
function walkUpParenthesizedTypes(node) {
- return walkUp(node, 196 /* ParenthesizedType */);
+ return walkUp(node, 198 /* ParenthesizedType */);
}
function walkUpParenthesizedExpressions(node) {
- return walkUp(node, 217 /* ParenthesizedExpression */);
+ return walkUp(node, 219 /* ParenthesizedExpression */);
}
function walkUpParenthesizedTypesAndGetParentAndChild(node) {
let child;
- while (node && node.kind === 196 /* ParenthesizedType */) {
+ while (node && node.kind === 198 /* ParenthesizedType */) {
child = node;
node = node.parent;
}
@@ -17357,11 +17369,11 @@ function skipParentheses(node, excludeJSDocTypeAssertions) {
return skipOuterExpressions(node, flags);
}
function isDeleteTarget(node) {
- if (node.kind !== 211 /* PropertyAccessExpression */ && node.kind !== 212 /* ElementAccessExpression */) {
+ if (node.kind !== 213 /* PropertyAccessExpression */ && node.kind !== 214 /* ElementAccessExpression */) {
return false;
}
node = walkUpParenthesizedExpressions(node.parent);
- return node && node.kind === 221 /* DeleteExpression */;
+ return node && node.kind === 223 /* DeleteExpression */;
}
function isNodeDescendantOf(node, ancestor) {
while (node) {
@@ -17399,56 +17411,56 @@ function getDeclarationFromName(name) {
}
}
function isLiteralComputedPropertyDeclarationName(node) {
- return isStringOrNumericLiteralLike(node) && node.parent.kind === 166 /* ComputedPropertyName */ && isDeclaration(node.parent.parent);
+ return isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ && isDeclaration(node.parent.parent);
}
function isIdentifierName(node) {
const parent2 = node.parent;
switch (parent2.kind) {
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 308 /* EnumMember */:
- case 305 /* PropertyAssignment */:
- case 211 /* PropertyAccessExpression */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 311 /* EnumMember */:
+ case 308 /* PropertyAssignment */:
+ case 213 /* PropertyAccessExpression */:
return parent2.name === node;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return parent2.right === node;
- case 208 /* BindingElement */:
- case 279 /* ImportSpecifier */:
+ case 210 /* BindingElement */:
+ case 282 /* ImportSpecifier */:
return parent2.propertyName === node;
- case 284 /* ExportSpecifier */:
- case 294 /* JsxAttribute */:
- case 288 /* JsxSelfClosingElement */:
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
+ case 287 /* ExportSpecifier */:
+ case 297 /* JsxAttribute */:
+ case 291 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
return true;
}
return false;
}
function isAliasSymbolDeclaration(node) {
- if (node.kind === 274 /* ImportEqualsDeclaration */ || node.kind === 273 /* NamespaceExportDeclaration */ || node.kind === 276 /* ImportClause */ && !!node.name || node.kind === 277 /* NamespaceImport */ || node.kind === 283 /* NamespaceExport */ || node.kind === 279 /* ImportSpecifier */ || node.kind === 284 /* ExportSpecifier */ || node.kind === 280 /* ExportAssignment */ && exportAssignmentIsAlias(node)) {
+ if (node.kind === 277 /* ImportEqualsDeclaration */ || node.kind === 276 /* NamespaceExportDeclaration */ || node.kind === 279 /* ImportClause */ && !!node.name || node.kind === 280 /* NamespaceImport */ || node.kind === 286 /* NamespaceExport */ || node.kind === 282 /* ImportSpecifier */ || node.kind === 287 /* ExportSpecifier */ || node.kind === 283 /* ExportAssignment */ && exportAssignmentIsAlias(node)) {
return true;
}
return isInJSFile(node) && (isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isPropertyAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableExpression(node.parent.right));
}
function getAliasDeclarationFromName(node) {
switch (node.parent.kind) {
- case 276 /* ImportClause */:
- case 279 /* ImportSpecifier */:
- case 277 /* NamespaceImport */:
- case 284 /* ExportSpecifier */:
- case 280 /* ExportAssignment */:
- case 274 /* ImportEqualsDeclaration */:
- case 283 /* NamespaceExport */:
+ case 279 /* ImportClause */:
+ case 282 /* ImportSpecifier */:
+ case 280 /* NamespaceImport */:
+ case 287 /* ExportSpecifier */:
+ case 283 /* ExportAssignment */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 286 /* NamespaceExport */:
return node.parent;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
do {
node = node.parent;
- } while (node.parent.kind === 165 /* QualifiedName */);
+ } while (node.parent.kind === 166 /* QualifiedName */);
return getAliasDeclarationFromName(node);
}
}
@@ -17463,7 +17475,7 @@ function getExportAssignmentExpression(node) {
return isExportAssignment(node) ? node.expression : node.right;
}
function getPropertyAssignmentAliasLikeExpression(node) {
- return node.kind === 306 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 305 /* PropertyAssignment */ ? node.initializer : node.parent.right;
+ return node.kind === 309 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 308 /* PropertyAssignment */ ? node.initializer : node.parent.right;
}
function getEffectiveBaseTypeNode(node) {
const baseType = getClassExtendsHeritageElement(node);
@@ -17548,10 +17560,10 @@ function getVirtualEtsComponent(node) {
return void 0;
}
function isKeyword(token) {
- return 81 /* FirstKeyword */ <= token && token <= 164 /* LastKeyword */;
+ return 81 /* FirstKeyword */ <= token && token <= 165 /* LastKeyword */;
}
function isContextualKeyword(token) {
- return 127 /* FirstContextualKeyword */ <= token && token <= 164 /* LastContextualKeyword */;
+ return 127 /* FirstContextualKeyword */ <= token && token <= 165 /* LastContextualKeyword */;
}
function isNonContextualKeyword(token) {
return isKeyword(token) && !isContextualKeyword(token);
@@ -17587,13 +17599,13 @@ function getFunctionFlags(node) {
}
let flags = 0 /* Normal */;
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
if (node.asteriskToken) {
flags |= 1 /* Generator */;
}
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (hasSyntacticModifier(node, 512 /* Async */)) {
flags |= 2 /* Async */;
}
@@ -17606,10 +17618,10 @@ function getFunctionFlags(node) {
}
function isAsyncFunction(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 512 /* Async */);
}
return false;
@@ -17625,7 +17637,7 @@ function hasDynamicName(declaration) {
return !!name && isDynamicName(name);
}
function isDynamicName(name) {
- if (!(name.kind === 166 /* ComputedPropertyName */ || name.kind === 212 /* ElementAccessExpression */)) {
+ if (!(name.kind === 167 /* ComputedPropertyName */ || name.kind === 214 /* ElementAccessExpression */)) {
return false;
}
const expr = isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression;
@@ -17639,7 +17651,7 @@ function getPropertyNameForPropertyNameNode(name) {
case 10 /* StringLiteral */:
case 8 /* NumericLiteral */:
return escapeLeadingUnderscores(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
const nameExpression = name.expression;
if (isStringOrNumericLiteralLike(nameExpression)) {
return escapeLeadingUnderscores(nameExpression.text);
@@ -17691,17 +17703,17 @@ function isPushOrUnshiftIdentifier(node) {
}
function isParameterDeclaration(node) {
const root = getRootDeclaration(node);
- return root.kind === 168 /* Parameter */;
+ return root.kind === 169 /* Parameter */;
}
function getRootDeclaration(node) {
- while (node.kind === 208 /* BindingElement */) {
+ while (node.kind === 210 /* BindingElement */) {
node = node.parent.parent;
}
return node;
}
function nodeStartsNewLexicalEnvironment(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 218 /* FunctionExpression */ || kind === 263 /* FunctionDeclaration */ || kind === 219 /* ArrowFunction */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 270 /* ModuleDeclaration */ || kind === 314 /* SourceFile */;
+ return kind === 178 /* Constructor */ || kind === 220 /* FunctionExpression */ || kind === 265 /* FunctionDeclaration */ || kind === 221 /* ArrowFunction */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 273 /* ModuleDeclaration */ || kind === 317 /* SourceFile */;
}
function nodeIsSynthesized(range) {
return positionIsSynthesized(range.pos) || positionIsSynthesized(range.end);
@@ -17716,22 +17728,22 @@ var Associativity = /* @__PURE__ */ ((Associativity2) => {
})(Associativity || {});
function getExpressionAssociativity(expression) {
const operator = getOperator(expression);
- const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0;
+ const hasArguments = expression.kind === 216 /* NewExpression */ && expression.arguments !== void 0;
return getOperatorAssociativity(expression.kind, operator, hasArguments);
}
function getOperatorAssociativity(kind, operator, hasArguments) {
switch (kind) {
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return hasArguments ? 0 /* Left */ : 1 /* Right */;
- case 225 /* PrefixUnaryExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 221 /* DeleteExpression */:
- case 224 /* AwaitExpression */:
- case 228 /* ConditionalExpression */:
- case 230 /* YieldExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 223 /* DeleteExpression */:
+ case 226 /* AwaitExpression */:
+ case 230 /* ConditionalExpression */:
+ case 232 /* YieldExpression */:
return 1 /* Right */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (operator) {
case 42 /* AsteriskAsteriskToken */:
case 63 /* EqualsToken */:
@@ -17757,13 +17769,13 @@ function getOperatorAssociativity(kind, operator, hasArguments) {
}
function getExpressionPrecedence(expression) {
const operator = getOperator(expression);
- const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0;
+ const hasArguments = expression.kind === 216 /* NewExpression */ && expression.arguments !== void 0;
return getOperatorPrecedence(expression.kind, operator, hasArguments);
}
function getOperator(expression) {
- if (expression.kind === 227 /* BinaryExpression */) {
+ if (expression.kind === 229 /* BinaryExpression */) {
return expression.operatorToken.kind;
- } else if (expression.kind === 225 /* PrefixUnaryExpression */ || expression.kind === 226 /* PostfixUnaryExpression */) {
+ } else if (expression.kind === 227 /* PrefixUnaryExpression */ || expression.kind === 228 /* PostfixUnaryExpression */) {
return expression.operator;
} else {
return expression.kind;
@@ -17799,15 +17811,15 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => {
})(OperatorPrecedence || {});
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return 0 /* Comma */;
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return 1 /* Spread */;
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return 2 /* Yield */;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return 4 /* Conditional */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (operatorKind) {
case 27 /* CommaToken */:
return 0 /* Comma */;
@@ -17831,27 +17843,27 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
default:
return getBinaryOperatorPrecedence(operatorKind);
}
- case 216 /* TypeAssertionExpression */:
- case 236 /* NonNullExpression */:
- case 225 /* PrefixUnaryExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 221 /* DeleteExpression */:
- case 224 /* AwaitExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 238 /* NonNullExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 223 /* DeleteExpression */:
+ case 226 /* AwaitExpression */:
return 16 /* Unary */;
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return 17 /* Update */;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return 18 /* LeftHandSide */;
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */;
- case 215 /* TaggedTemplateExpression */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
- case 237 /* MetaProperty */:
+ case 217 /* TaggedTemplateExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 239 /* MetaProperty */:
return 19 /* Member */;
- case 235 /* AsExpression */:
- case 239 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 241 /* SatisfiesExpression */:
return 11 /* Relational */;
case 109 /* ThisKeyword */:
case 107 /* SuperKeyword */:
@@ -17863,19 +17875,19 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
case 8 /* NumericLiteral */:
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 232 /* ClassExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
case 13 /* RegularExpressionLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
- case 217 /* ParenthesizedExpression */:
- case 233 /* OmittedExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
+ case 231 /* TemplateExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 235 /* OmittedExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
return 20 /* Primary */;
default:
return -1 /* Invalid */;
@@ -17928,7 +17940,7 @@ function getBinaryOperatorPrecedence(kind) {
function getSemanticJsxChildren(children) {
return filter(children, (i) => {
switch (i.kind) {
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return !!i.expression;
case 11 /* JsxText */:
return !i.containsOnlyTriviaWhiteSpaces;
@@ -18319,7 +18331,7 @@ function isThisInTypeQuery(node) {
while (isQualifiedName(node.parent) && node.parent.left === node) {
node = node.parent;
}
- return node.parent.kind === 186 /* TypeQuery */;
+ return node.parent.kind === 188 /* TypeQuery */;
}
function identifierIsThisKeyword(id) {
return id.originalKeywordKind === 109 /* ThisKeyword */;
@@ -18331,9 +18343,9 @@ function getAllAccessorDeclarations(declarations, accessor) {
let setAccessor;
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
- if (accessor.kind === 177 /* GetAccessor */) {
+ if (accessor.kind === 179 /* GetAccessor */) {
getAccessor = accessor;
- } else if (accessor.kind === 178 /* SetAccessor */) {
+ } else if (accessor.kind === 180 /* SetAccessor */) {
setAccessor = accessor;
} else {
Debug.fail("Accessor has wrong kind");
@@ -18349,10 +18361,10 @@ function getAllAccessorDeclarations(declarations, accessor) {
} else if (!secondAccessor) {
secondAccessor = member;
}
- if (member.kind === 177 /* GetAccessor */ && !getAccessor) {
+ if (member.kind === 179 /* GetAccessor */ && !getAccessor) {
getAccessor = member;
}
- if (member.kind === 178 /* SetAccessor */ && !setAccessor) {
+ if (member.kind === 180 /* SetAccessor */ && !setAccessor) {
setAccessor = member;
}
}
@@ -18384,7 +18396,7 @@ function getJSDocTypeParameterDeclarations(node) {
return flatMap(getJSDocTags(node), (tag) => isNonTypeAliasTemplate(tag) ? tag.typeParameters : void 0);
}
function isNonTypeAliasTemplate(tag) {
- return isJSDocTemplateTag(tag) && !(tag.parent.kind === 329 /* JSDoc */ && tag.parent.tags.some(isJSDocTypeAlias));
+ return isJSDocTemplateTag(tag) && !(tag.parent.kind === 332 /* JSDoc */ && tag.parent.tags.some(isJSDocTypeAlias));
}
function getEffectiveSetAccessorTypeAnnotationNode(node) {
const parameter = getSetAccessorValueParameter(node);
@@ -18569,7 +18581,7 @@ function getSelectedSyntacticModifierFlags(node, flags) {
return getSyntacticModifierFlags(node) & flags;
}
function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) {
- if (node.kind >= 0 /* FirstToken */ && node.kind <= 164 /* LastToken */) {
+ if (node.kind >= 0 /* FirstToken */ && node.kind <= 165 /* LastToken */) {
return 0 /* None */;
}
if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) {
@@ -18660,7 +18672,7 @@ function modifierToFlag(token) {
return 32768 /* In */;
case 146 /* OutKeyword */:
return 65536 /* Out */;
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return 131072 /* Decorator */;
}
return 0 /* None */;
@@ -18693,7 +18705,7 @@ function isLeftHandSideOfAssignment(node) {
function isDestructuringAssignment(node) {
if (isAssignmentExpression(node, true)) {
const kind = node.left.kind;
- return kind === 210 /* ObjectLiteralExpression */ || kind === 209 /* ArrayLiteralExpression */;
+ return kind === 212 /* ObjectLiteralExpression */ || kind === 211 /* ArrayLiteralExpression */;
}
return false;
}
@@ -18707,12 +18719,12 @@ function getFirstIdentifier(node) {
switch (node.kind) {
case 79 /* Identifier */:
return node;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
do {
node = node.left;
} while (node.kind !== 79 /* Identifier */);
return node;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
do {
node = node.expression;
} while (node.kind !== 79 /* Identifier */);
@@ -18720,7 +18732,7 @@ function getFirstIdentifier(node) {
}
}
function isDottedName(node) {
- return node.kind === 79 /* Identifier */ || node.kind === 109 /* ThisKeyword */ || node.kind === 107 /* SuperKeyword */ || node.kind === 237 /* MetaProperty */ || node.kind === 211 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 217 /* ParenthesizedExpression */ && isDottedName(node.expression);
+ return node.kind === 79 /* Identifier */ || node.kind === 109 /* ThisKeyword */ || node.kind === 107 /* SuperKeyword */ || node.kind === 239 /* MetaProperty */ || node.kind === 213 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 219 /* ParenthesizedExpression */ && isDottedName(node.expression);
}
function isPropertyAccessEntityNameExpression(node) {
return isPropertyAccessExpression(node) && isIdentifier(node.name) && isEntityNameExpression(node.expression);
@@ -18745,7 +18757,7 @@ function isPrototypeAccess(node) {
return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype";
}
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
- return node.parent.kind === 165 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node;
+ return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 213 /* PropertyAccessExpression */ && node.parent.name === node;
}
function isRightSideOfAccessExpression(node) {
return isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node;
@@ -18754,10 +18766,10 @@ function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) {
return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node || isJSDocMemberName(node.parent) && node.parent.right === node;
}
function isEmptyObjectLiteral(expression) {
- return expression.kind === 210 /* ObjectLiteralExpression */ && expression.properties.length === 0;
+ return expression.kind === 212 /* ObjectLiteralExpression */ && expression.properties.length === 0;
}
function isEmptyArrayLiteral(expression) {
- return expression.kind === 209 /* ArrayLiteralExpression */ && expression.elements.length === 0;
+ return expression.kind === 211 /* ArrayLiteralExpression */ && expression.elements.length === 0;
}
function getLocalSymbolForExportDefault(symbol) {
if (!isExportDefaultSymbol(symbol) || !symbol.declarations)
@@ -18985,8 +18997,8 @@ function isDeclarationNameOfEnumOrNamespace(node) {
const parseNode = getParseTreeNode(node);
if (parseNode) {
switch (parseNode.parent.kind) {
- case 269 /* EnumDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
return parseNode === parseNode.parent.name;
}
}
@@ -19047,30 +19059,30 @@ function accessKind(node) {
if (!parent2)
return 0 /* Read */;
switch (parent2.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return accessKind(parent2);
- case 226 /* PostfixUnaryExpression */:
- case 225 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const { operator } = parent2;
return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const { left, operatorToken } = parent2;
return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 63 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return parent2.name !== node ? 0 /* Read */ : accessKind(parent2);
- case 305 /* PropertyAssignment */: {
+ case 308 /* PropertyAssignment */: {
const parentAccess = accessKind(parent2.parent);
return node === parent2.name ? reverseAccessKind(parentAccess) : parentAccess;
}
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return node === parent2.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent2.parent);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return accessKind(parent2);
default:
return 0 /* Read */;
}
function writeOrReadWrite() {
- return parent2.parent && walkUpParenthesizedExpressions(parent2.parent).kind === 245 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
+ return parent2.parent && walkUpParenthesizedExpressions(parent2.parent).kind === 247 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
}
}
function reverseAccessKind(a) {
@@ -19183,16 +19195,16 @@ function isObjectTypeDeclaration(node) {
return isClassLike(node) || isInterfaceDeclaration(node) || isTypeLiteralNode(node);
}
function isTypeNodeKind(kind) {
- return kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */ || kind === 132 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 149 /* NumberKeyword */ || kind === 162 /* BigIntKeyword */ || kind === 150 /* ObjectKeyword */ || kind === 135 /* BooleanKeyword */ || kind === 153 /* StringKeyword */ || kind === 154 /* SymbolKeyword */ || kind === 115 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 145 /* NeverKeyword */ || kind === 234 /* ExpressionWithTypeArguments */ || kind === 321 /* JSDocAllType */ || kind === 322 /* JSDocUnknownType */ || kind === 323 /* JSDocNullableType */ || kind === 324 /* JSDocNonNullableType */ || kind === 325 /* JSDocOptionalType */ || kind === 326 /* JSDocFunctionType */ || kind === 327 /* JSDocVariadicType */;
+ return kind >= 184 /* FirstTypeNode */ && kind <= 207 /* LastTypeNode */ || kind === 132 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 149 /* NumberKeyword */ || kind === 162 /* BigIntKeyword */ || kind === 150 /* ObjectKeyword */ || kind === 135 /* BooleanKeyword */ || kind === 153 /* StringKeyword */ || kind === 154 /* SymbolKeyword */ || kind === 115 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 145 /* NeverKeyword */ || kind === 236 /* ExpressionWithTypeArguments */ || kind === 324 /* JSDocAllType */ || kind === 325 /* JSDocUnknownType */ || kind === 326 /* JSDocNullableType */ || kind === 327 /* JSDocNonNullableType */ || kind === 328 /* JSDocOptionalType */ || kind === 329 /* JSDocFunctionType */ || kind === 330 /* JSDocVariadicType */;
}
function isAccessExpression(node) {
- return node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */;
+ return node.kind === 213 /* PropertyAccessExpression */ || node.kind === 214 /* ElementAccessExpression */;
}
function getNameOfAccessExpression(node) {
- if (node.kind === 211 /* PropertyAccessExpression */) {
+ if (node.kind === 213 /* PropertyAccessExpression */) {
return node.name;
}
- Debug.assert(node.kind === 212 /* ElementAccessExpression */);
+ Debug.assert(node.kind === 214 /* ElementAccessExpression */);
return node.argumentExpression;
}
function isBundleFileTextLike(section) {
@@ -19205,7 +19217,7 @@ function isBundleFileTextLike(section) {
}
}
function isNamedImportsOrExports(node) {
- return node.kind === 278 /* NamedImports */ || node.kind === 282 /* NamedExports */;
+ return node.kind === 281 /* NamedImports */ || node.kind === 285 /* NamedExports */;
}
function getLeftmostAccessExpression(expr) {
while (isAccessExpression(expr)) {
@@ -19218,12 +19230,12 @@ function forEachNameInAccessChainWalkingLeft(name, action) {
return walkAccessExpression(name.parent);
}
function walkAccessExpression(access) {
- if (access.kind === 211 /* PropertyAccessExpression */) {
+ if (access.kind === 213 /* PropertyAccessExpression */) {
const res = action(access.name);
if (res !== void 0) {
return res;
}
- } else if (access.kind === 212 /* ElementAccessExpression */) {
+ } else if (access.kind === 214 /* ElementAccessExpression */) {
if (isIdentifier(access.argumentExpression) || isStringLiteralLike(access.argumentExpression)) {
const res = action(access.argumentExpression);
if (res !== void 0) {
@@ -19245,28 +19257,28 @@ function forEachNameInAccessChainWalkingLeft(name, action) {
function getLeftmostExpression(node, stopAtCallExpressions) {
while (true) {
switch (node.kind) {
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
node = node.operand;
continue;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
node = node.left;
continue;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
node = node.condition;
continue;
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
node = node.tag;
continue;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (stopAtCallExpressions) {
return node;
}
- case 235 /* AsExpression */:
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
- case 236 /* NonNullExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 239 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 238 /* NonNullExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 241 /* SatisfiesExpression */:
node = node.expression;
continue;
}
@@ -20230,33 +20242,33 @@ function isShorthandPropertyNameUseSite(useSite) {
return isIdentifier(useSite) && isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite;
}
function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) {
- while (node.kind === 79 /* Identifier */ || node.kind === 211 /* PropertyAccessExpression */) {
+ while (node.kind === 79 /* Identifier */ || node.kind === 213 /* PropertyAccessExpression */) {
node = node.parent;
}
- if (node.kind !== 166 /* ComputedPropertyName */) {
+ if (node.kind !== 167 /* ComputedPropertyName */) {
return false;
}
if (hasSyntacticModifier(node.parent, 256 /* Abstract */)) {
return true;
}
const containerKind = node.parent.parent.kind;
- return containerKind === 267 /* InterfaceDeclaration */ || containerKind === 187 /* TypeLiteral */;
+ return containerKind === 270 /* InterfaceDeclaration */ || containerKind === 189 /* TypeLiteral */;
}
function isIdentifierInNonEmittingHeritageClause(node) {
if (node.kind !== 79 /* Identifier */)
return false;
const heritageClause = findAncestor(node.parent, (parent2) => {
switch (parent2.kind) {
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return true;
- case 211 /* PropertyAccessExpression */:
- case 234 /* ExpressionWithTypeArguments */:
+ case 213 /* PropertyAccessExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
return false;
default:
return "quit";
}
});
- return (heritageClause == null ? void 0 : heritageClause.token) === 118 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 267 /* InterfaceDeclaration */;
+ return (heritageClause == null ? void 0 : heritageClause.token) === 118 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 270 /* InterfaceDeclaration */;
}
function isIdentifierTypeReference(node) {
return isTypeReferenceNode(node) && isIdentifier(node.typeName);
@@ -20345,20 +20357,20 @@ function getContainingNodeArray(node) {
if (!node.parent)
return void 0;
switch (node.kind) {
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
const { parent: parent3 } = node;
- return parent3.kind === 195 /* InferType */ ? void 0 : parent3.typeParameters;
- case 168 /* Parameter */:
+ return parent3.kind === 197 /* InferType */ ? void 0 : parent3.typeParameters;
+ case 169 /* Parameter */:
return node.parent.parameters;
- case 204 /* TemplateLiteralTypeSpan */:
+ case 206 /* TemplateLiteralTypeSpan */:
return node.parent.templateSpans;
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return node.parent.templateSpans;
- case 169 /* Decorator */: {
+ case 170 /* Decorator */: {
const { parent: parent4 } = node;
return canHaveDecorators(parent4) ? parent4.modifiers : canHaveIllegalDecorators(parent4) ? parent4.illegalDecorators : void 0;
}
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return node.parent.heritageClauses;
}
const { parent: parent2 } = node;
@@ -20366,43 +20378,43 @@ function getContainingNodeArray(node) {
return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags;
}
switch (parent2.kind) {
- case 187 /* TypeLiteral */:
- case 267 /* InterfaceDeclaration */:
+ case 189 /* TypeLiteral */:
+ case 270 /* InterfaceDeclaration */:
return isTypeElement(node) ? parent2.members : void 0;
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return parent2.types;
- case 189 /* TupleType */:
- case 209 /* ArrayLiteralExpression */:
- case 360 /* CommaListExpression */:
- case 278 /* NamedImports */:
- case 282 /* NamedExports */:
+ case 191 /* TupleType */:
+ case 211 /* ArrayLiteralExpression */:
+ case 363 /* CommaListExpression */:
+ case 281 /* NamedImports */:
+ case 285 /* NamedExports */:
return parent2.elements;
- case 210 /* ObjectLiteralExpression */:
- case 295 /* JsxAttributes */:
+ case 212 /* ObjectLiteralExpression */:
+ case 298 /* JsxAttributes */:
return parent2.properties;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
return isTypeNode(node) ? parent2.typeArguments : parent2.expression === node ? void 0 : parent2.arguments;
- case 287 /* JsxElement */:
- case 291 /* JsxFragment */:
+ case 290 /* JsxElement */:
+ case 294 /* JsxFragment */:
return isJsxChild(node) ? parent2.children : void 0;
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return isTypeNode(node) ? parent2.typeArguments : void 0;
- case 242 /* Block */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 274 /* ModuleBlock */:
return parent2.statements;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return parent2.clauses;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return isClassElement(node) ? parent2.members : void 0;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return isEnumMember(node) ? parent2.members : void 0;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return parent2.statements;
}
}
@@ -20411,7 +20423,7 @@ function hasContextSensitiveParameters(node) {
if (some(node.parameters, (p) => !getEffectiveTypeAnnotationNode(p))) {
return true;
}
- if (node.kind !== 219 /* ArrowFunction */) {
+ if (node.kind !== 221 /* ArrowFunction */) {
const parameter = firstOrUndefined(node.parameters);
if (!(parameter && parameterIsThisKeyword(parameter))) {
return true;
@@ -20424,14 +20436,14 @@ function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "-Infinity" || name === "NaN";
}
function isCatchClauseVariableDeclaration(node) {
- return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 301 /* CatchClause */;
+ return node.kind === 263 /* VariableDeclaration */ && node.parent.kind === 304 /* CatchClause */;
}
function isParameterOrCatchClauseVariable(symbol) {
const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
return !!declaration && (isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
}
function isFunctionExpressionOrArrowFunction(node) {
- return node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */;
+ return node.kind === 220 /* FunctionExpression */ || node.kind === 221 /* ArrowFunction */;
}
function escapeSnippetText(text) {
return text.replace(/\$/gm, () => "\\$");
@@ -20494,23 +20506,23 @@ function getNodeModulePathParts(fullPath, modulePathPart) {
}
function getParameterTypeNode(parameter) {
var _a2;
- return parameter.kind === 349 /* JSDocParameterTag */ ? (_a2 = parameter.typeExpression) == null ? void 0 : _a2.type : parameter.type;
+ return parameter.kind === 352 /* JSDocParameterTag */ ? (_a2 = parameter.typeExpression) == null ? void 0 : _a2.type : parameter.type;
}
function isTypeDeclaration(node) {
switch (node.kind) {
- case 167 /* TypeParameter */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 168 /* TypeParameter */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return true;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return node.isTypeOnly;
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return node.parent.parent.isTypeOnly;
default:
return false;
@@ -20523,7 +20535,7 @@ function isCalledStructDeclaration(declarations) {
if (!declarations) {
return false;
}
- return declarations.some((declaration) => declaration.kind === 265 /* StructDeclaration */);
+ return declarations.some((declaration) => declaration.kind === 267 /* StructDeclaration */);
}
function getNameOfDecorator(node) {
const expression = node.expression;
@@ -20755,16 +20767,16 @@ function createParenthesizerRules(factory2) {
return parenthesizerRule;
}
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
- const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator);
- const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator);
+ const binaryOperatorPrecedence = getOperatorPrecedence(229 /* BinaryExpression */, binaryOperator);
+ const binaryOperatorAssociativity = getOperatorAssociativity(229 /* BinaryExpression */, binaryOperator);
const emittedOperand = skipPartiallyEmittedExpressions(operand);
- if (!isLeftSideOfBinary && operand.kind === 219 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
+ if (!isLeftSideOfBinary && operand.kind === 221 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
return true;
}
const operandPrecedence = getExpressionPrecedence(emittedOperand);
switch (compareValues(operandPrecedence, binaryOperatorPrecedence)) {
case -1 /* LessThan */:
- if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 230 /* YieldExpression */) {
+ if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 232 /* YieldExpression */) {
return false;
}
return true;
@@ -20798,7 +20810,7 @@ function createParenthesizerRules(factory2) {
if (isLiteralKind(node.kind)) {
return node.kind;
}
- if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {
+ if (node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {
if (node.cachedLiteralKind !== void 0) {
return node.cachedLiteralKind;
}
@@ -20811,7 +20823,7 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
const skipped = skipPartiallyEmittedExpressions(operand);
- if (skipped.kind === 217 /* ParenthesizedExpression */) {
+ if (skipped.kind === 219 /* ParenthesizedExpression */) {
return operand;
}
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory2.createParenthesizedExpression(operand) : operand;
@@ -20826,7 +20838,7 @@ function createParenthesizerRules(factory2) {
return isCommaSequence(expression) ? factory2.createParenthesizedExpression(expression) : expression;
}
function parenthesizeConditionOfConditionalExpression(condition) {
- const conditionalPrecedence = getOperatorPrecedence(228 /* ConditionalExpression */, 57 /* QuestionToken */);
+ const conditionalPrecedence = getOperatorPrecedence(230 /* ConditionalExpression */, 57 /* QuestionToken */);
const emittedCondition = skipPartiallyEmittedExpressions(condition);
const conditionPrecedence = getExpressionPrecedence(emittedCondition);
if (compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) {
@@ -20843,8 +20855,8 @@ function createParenthesizerRules(factory2) {
let needsParens = isCommaSequence(check);
if (!needsParens) {
switch (getLeftmostExpression(check, false).kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
needsParens = true;
}
}
@@ -20853,16 +20865,16 @@ function createParenthesizerRules(factory2) {
function parenthesizeExpressionOfNew(expression) {
const leftmostExpr = getLeftmostExpression(expression, true);
switch (leftmostExpr.kind) {
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return factory2.createParenthesizedExpression(expression);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return !leftmostExpr.arguments ? factory2.createParenthesizedExpression(expression) : expression;
}
return parenthesizeLeftSideOfAccess(expression);
}
function parenthesizeLeftSideOfAccess(expression, optionalChain) {
const emittedExpression = skipPartiallyEmittedExpressions(expression);
- if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 214 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) {
+ if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 216 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) {
return expression;
}
return setTextRange(factory2.createParenthesizedExpression(expression), expression);
@@ -20880,7 +20892,7 @@ function createParenthesizerRules(factory2) {
function parenthesizeExpressionForDisallowedComma(expression) {
const emittedExpression = skipPartiallyEmittedExpressions(expression);
const expressionPrecedence = getExpressionPrecedence(emittedExpression);
- const commaPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, 27 /* CommaToken */);
+ const commaPrecedence = getOperatorPrecedence(229 /* BinaryExpression */, 27 /* CommaToken */);
return expressionPrecedence > commaPrecedence ? expression : setTextRange(factory2.createParenthesizedExpression(expression), expression);
}
function parenthesizeExpressionOfExpressionStatement(expression) {
@@ -20888,7 +20900,7 @@ function createParenthesizerRules(factory2) {
if (isCallExpression(emittedExpression)) {
const callee = emittedExpression.expression;
const kind = skipPartiallyEmittedExpressions(callee).kind;
- if (kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */) {
+ if (kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */) {
const updated = factory2.updateCallExpression(
emittedExpression,
setTextRange(factory2.createParenthesizedExpression(callee), callee),
@@ -20899,37 +20911,37 @@ function createParenthesizerRules(factory2) {
}
}
const leftmostExpressionKind = getLeftmostExpression(emittedExpression, false).kind;
- if (leftmostExpressionKind === 210 /* ObjectLiteralExpression */ || leftmostExpressionKind === 218 /* FunctionExpression */) {
+ if (leftmostExpressionKind === 212 /* ObjectLiteralExpression */ || leftmostExpressionKind === 220 /* FunctionExpression */) {
return setTextRange(factory2.createParenthesizedExpression(expression), expression);
}
return expression;
}
function parenthesizeConciseBodyOfArrowFunction(body) {
- if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 210 /* ObjectLiteralExpression */)) {
+ if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 212 /* ObjectLiteralExpression */)) {
return setTextRange(factory2.createParenthesizedExpression(body), body);
}
return body;
}
function parenthesizeCheckTypeOfConditionalType(checkType) {
switch (checkType.kind) {
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 194 /* ConditionalType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 196 /* ConditionalType */:
return factory2.createParenthesizedType(checkType);
}
return checkType;
}
function parenthesizeExtendsTypeOfConditionalType(extendsType) {
switch (extendsType.kind) {
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return factory2.createParenthesizedType(extendsType);
}
return extendsType;
}
function parenthesizeConstituentTypeOfUnionType(type) {
switch (type.kind) {
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeCheckTypeOfConditionalType(type);
@@ -20939,8 +20951,8 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeConstituentTypeOfIntersectionType(type) {
switch (type.kind) {
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeConstituentTypeOfUnionType(type);
@@ -20950,23 +20962,23 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeOperandOfTypeOperator(type) {
switch (type.kind) {
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeConstituentTypeOfIntersectionType(type);
}
function parenthesizeOperandOfReadonlyTypeOperator(type) {
switch (type.kind) {
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return factory2.createParenthesizedType(type);
}
return parenthesizeOperandOfTypeOperator(type);
}
function parenthesizeNonArrayTypeOfPostfixType(type) {
switch (type.kind) {
- case 195 /* InferType */:
- case 198 /* TypeOperator */:
- case 186 /* TypeQuery */:
+ case 197 /* InferType */:
+ case 200 /* TypeOperator */:
+ case 188 /* TypeQuery */:
return factory2.createParenthesizedType(type);
}
return parenthesizeOperandOfTypeOperator(type);
@@ -21120,11 +21132,11 @@ function createNodeConverters(factory2) {
}
function convertToAssignmentPattern(node) {
switch (node.kind) {
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return convertToArrayAssignmentPattern(node);
- case 206 /* ObjectBindingPattern */:
- case 210 /* ObjectLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 212 /* ObjectLiteralExpression */:
return convertToObjectAssignmentPattern(node);
}
}
@@ -21249,6 +21261,8 @@ function createNodeFactory(flags, baseFactory2) {
updatePropertyDeclaration: updatePropertyDeclaration2,
createAnnotationPropertyDeclaration,
updateAnnotationPropertyDeclaration,
+ createOverloadPropertyDeclaration,
+ updateOverloadPropertyDeclaration,
createMethodSignature: createMethodSignature3,
updateMethodSignature: updateMethodSignature3,
createMethodDeclaration,
@@ -21444,6 +21458,8 @@ function createNodeFactory(flags, baseFactory2) {
updateStructDeclaration,
createAnnotationDeclaration,
updateAnnotationDeclaration,
+ createOverloadDeclaration,
+ updateOverloadDeclaration,
createInterfaceDeclaration: createInterfaceDeclaration2,
updateInterfaceDeclaration: updateInterfaceDeclaration2,
createTypeAliasDeclaration: createTypeAliasDeclaration2,
@@ -21490,40 +21506,40 @@ function createNodeFactory(flags, baseFactory2) {
createExternalModuleReference: createExternalModuleReference2,
updateExternalModuleReference: updateExternalModuleReference2,
get createJSDocAllType() {
- return getJSDocPrimaryTypeCreateFunction(321 /* JSDocAllType */);
+ return getJSDocPrimaryTypeCreateFunction(324 /* JSDocAllType */);
},
get createJSDocUnknownType() {
- return getJSDocPrimaryTypeCreateFunction(322 /* JSDocUnknownType */);
+ return getJSDocPrimaryTypeCreateFunction(325 /* JSDocUnknownType */);
},
get createJSDocNonNullableType() {
- return getJSDocPrePostfixUnaryTypeCreateFunction(324 /* JSDocNonNullableType */);
+ return getJSDocPrePostfixUnaryTypeCreateFunction(327 /* JSDocNonNullableType */);
},
get updateJSDocNonNullableType() {
- return getJSDocPrePostfixUnaryTypeUpdateFunction(324 /* JSDocNonNullableType */);
+ return getJSDocPrePostfixUnaryTypeUpdateFunction(327 /* JSDocNonNullableType */);
},
get createJSDocNullableType() {
- return getJSDocPrePostfixUnaryTypeCreateFunction(323 /* JSDocNullableType */);
+ return getJSDocPrePostfixUnaryTypeCreateFunction(326 /* JSDocNullableType */);
},
get updateJSDocNullableType() {
- return getJSDocPrePostfixUnaryTypeUpdateFunction(323 /* JSDocNullableType */);
+ return getJSDocPrePostfixUnaryTypeUpdateFunction(326 /* JSDocNullableType */);
},
get createJSDocOptionalType() {
- return getJSDocUnaryTypeCreateFunction(325 /* JSDocOptionalType */);
+ return getJSDocUnaryTypeCreateFunction(328 /* JSDocOptionalType */);
},
get updateJSDocOptionalType() {
- return getJSDocUnaryTypeUpdateFunction(325 /* JSDocOptionalType */);
+ return getJSDocUnaryTypeUpdateFunction(328 /* JSDocOptionalType */);
},
get createJSDocVariadicType() {
- return getJSDocUnaryTypeCreateFunction(327 /* JSDocVariadicType */);
+ return getJSDocUnaryTypeCreateFunction(330 /* JSDocVariadicType */);
},
get updateJSDocVariadicType() {
- return getJSDocUnaryTypeUpdateFunction(327 /* JSDocVariadicType */);
+ return getJSDocUnaryTypeUpdateFunction(330 /* JSDocVariadicType */);
},
get createJSDocNamepathType() {
- return getJSDocUnaryTypeCreateFunction(328 /* JSDocNamepathType */);
+ return getJSDocUnaryTypeCreateFunction(331 /* JSDocNamepathType */);
},
get updateJSDocNamepathType() {
- return getJSDocUnaryTypeUpdateFunction(328 /* JSDocNamepathType */);
+ return getJSDocUnaryTypeUpdateFunction(331 /* JSDocNamepathType */);
},
createJSDocFunctionType,
updateJSDocFunctionType,
@@ -21560,76 +21576,76 @@ function createNodeFactory(flags, baseFactory2) {
createJSDocLinkPlain,
updateJSDocLinkPlain,
get createJSDocTypeTag() {
- return getJSDocTypeLikeTagCreateFunction(352 /* JSDocTypeTag */);
+ return getJSDocTypeLikeTagCreateFunction(355 /* JSDocTypeTag */);
},
get updateJSDocTypeTag() {
- return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocTypeTag */);
+ return getJSDocTypeLikeTagUpdateFunction(355 /* JSDocTypeTag */);
},
get createJSDocReturnTag() {
- return getJSDocTypeLikeTagCreateFunction(350 /* JSDocReturnTag */);
+ return getJSDocTypeLikeTagCreateFunction(353 /* JSDocReturnTag */);
},
get updateJSDocReturnTag() {
- return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocReturnTag */);
+ return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocReturnTag */);
},
get createJSDocThisTag() {
- return getJSDocTypeLikeTagCreateFunction(351 /* JSDocThisTag */);
+ return getJSDocTypeLikeTagCreateFunction(354 /* JSDocThisTag */);
},
get updateJSDocThisTag() {
- return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocThisTag */);
+ return getJSDocTypeLikeTagUpdateFunction(354 /* JSDocThisTag */);
},
get createJSDocEnumTag() {
- return getJSDocTypeLikeTagCreateFunction(348 /* JSDocEnumTag */);
+ return getJSDocTypeLikeTagCreateFunction(351 /* JSDocEnumTag */);
},
get updateJSDocEnumTag() {
- return getJSDocTypeLikeTagUpdateFunction(348 /* JSDocEnumTag */);
+ return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocEnumTag */);
},
get createJSDocAuthorTag() {
- return getJSDocSimpleTagCreateFunction(339 /* JSDocAuthorTag */);
+ return getJSDocSimpleTagCreateFunction(342 /* JSDocAuthorTag */);
},
get updateJSDocAuthorTag() {
- return getJSDocSimpleTagUpdateFunction(339 /* JSDocAuthorTag */);
+ return getJSDocSimpleTagUpdateFunction(342 /* JSDocAuthorTag */);
},
get createJSDocClassTag() {
- return getJSDocSimpleTagCreateFunction(341 /* JSDocClassTag */);
+ return getJSDocSimpleTagCreateFunction(344 /* JSDocClassTag */);
},
get updateJSDocClassTag() {
- return getJSDocSimpleTagUpdateFunction(341 /* JSDocClassTag */);
+ return getJSDocSimpleTagUpdateFunction(344 /* JSDocClassTag */);
},
get createJSDocPublicTag() {
- return getJSDocSimpleTagCreateFunction(342 /* JSDocPublicTag */);
+ return getJSDocSimpleTagCreateFunction(345 /* JSDocPublicTag */);
},
get updateJSDocPublicTag() {
- return getJSDocSimpleTagUpdateFunction(342 /* JSDocPublicTag */);
+ return getJSDocSimpleTagUpdateFunction(345 /* JSDocPublicTag */);
},
get createJSDocPrivateTag() {
- return getJSDocSimpleTagCreateFunction(343 /* JSDocPrivateTag */);
+ return getJSDocSimpleTagCreateFunction(346 /* JSDocPrivateTag */);
},
get updateJSDocPrivateTag() {
- return getJSDocSimpleTagUpdateFunction(343 /* JSDocPrivateTag */);
+ return getJSDocSimpleTagUpdateFunction(346 /* JSDocPrivateTag */);
},
get createJSDocProtectedTag() {
- return getJSDocSimpleTagCreateFunction(344 /* JSDocProtectedTag */);
+ return getJSDocSimpleTagCreateFunction(347 /* JSDocProtectedTag */);
},
get updateJSDocProtectedTag() {
- return getJSDocSimpleTagUpdateFunction(344 /* JSDocProtectedTag */);
+ return getJSDocSimpleTagUpdateFunction(347 /* JSDocProtectedTag */);
},
get createJSDocReadonlyTag() {
- return getJSDocSimpleTagCreateFunction(345 /* JSDocReadonlyTag */);
+ return getJSDocSimpleTagCreateFunction(348 /* JSDocReadonlyTag */);
},
get updateJSDocReadonlyTag() {
- return getJSDocSimpleTagUpdateFunction(345 /* JSDocReadonlyTag */);
+ return getJSDocSimpleTagUpdateFunction(348 /* JSDocReadonlyTag */);
},
get createJSDocOverrideTag() {
- return getJSDocSimpleTagCreateFunction(346 /* JSDocOverrideTag */);
+ return getJSDocSimpleTagCreateFunction(349 /* JSDocOverrideTag */);
},
get updateJSDocOverrideTag() {
- return getJSDocSimpleTagUpdateFunction(346 /* JSDocOverrideTag */);
+ return getJSDocSimpleTagUpdateFunction(349 /* JSDocOverrideTag */);
},
get createJSDocDeprecatedTag() {
- return getJSDocSimpleTagCreateFunction(340 /* JSDocDeprecatedTag */);
+ return getJSDocSimpleTagCreateFunction(343 /* JSDocDeprecatedTag */);
},
get updateJSDocDeprecatedTag() {
- return getJSDocSimpleTagUpdateFunction(340 /* JSDocDeprecatedTag */);
+ return getJSDocSimpleTagUpdateFunction(343 /* JSDocDeprecatedTag */);
},
createJSDocUnknownTag,
updateJSDocUnknownTag,
@@ -21880,12 +21896,13 @@ function createNodeFactory(flags, baseFactory2) {
}
if (name) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 305 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 308 /* PropertyAssignment */:
if (isIdentifier(name)) {
node.transformFlags |= propagateIdentifierNameFlags(name);
break;
@@ -22152,7 +22169,7 @@ function createNodeFactory(flags, baseFactory2) {
return baseFactory2.createBaseTokenNode(kind);
}
function createToken3(token) {
- Debug.assert(token >= 0 /* FirstToken */ && token <= 164 /* LastToken */, "Invalid token");
+ Debug.assert(token >= 0 /* FirstToken */ && token <= 165 /* LastToken */, "Invalid token");
Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals.");
Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals.");
Debug.assert(token !== 79 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers");
@@ -22256,7 +22273,7 @@ function createNodeFactory(flags, baseFactory2) {
return result.length ? result : void 0;
}
function createQualifiedName2(left, right) {
- const node = createBaseNode(165 /* QualifiedName */);
+ const node = createBaseNode(166 /* QualifiedName */);
node.left = left;
node.right = asName(right);
node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right);
@@ -22266,7 +22283,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.right !== right ? update(createQualifiedName2(left, right), node) : node;
}
function createComputedPropertyName2(expression) {
- const node = createBaseNode(166 /* ComputedPropertyName */);
+ const node = createBaseNode(167 /* ComputedPropertyName */);
node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */;
return node;
@@ -22276,7 +22293,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createTypeParameterDeclaration2(modifiers, name, constraint, defaultType) {
const node = createBaseNamedDeclaration(
- 167 /* TypeParameter */,
+ 168 /* TypeParameter */,
modifiers,
name
);
@@ -22290,7 +22307,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 168 /* Parameter */,
+ 169 /* Parameter */,
modifiers,
name,
type,
@@ -22315,7 +22332,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? update(createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer), node) : node;
}
function createDecorator2(expression, annotationDeclaration) {
- const node = createBaseNode(169 /* Decorator */);
+ const node = createBaseNode(170 /* Decorator */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.annotationDeclaration = annotationDeclaration;
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */ | 8192 /* ContainsTypeScriptClassSyntax */ | 33554432 /* ContainsDecorators */;
@@ -22326,7 +22343,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertySignature3(modifiers, name, questionToken, type) {
const node = createBaseNamedDeclaration(
- 170 /* PropertySignature */,
+ 171 /* PropertySignature */,
modifiers,
name
);
@@ -22339,6 +22356,21 @@ function createNodeFactory(flags, baseFactory2) {
function updatePropertySignature3(node, modifiers, name, questionToken, type) {
return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature3(modifiers, name, questionToken, type), node) : node;
}
+ function createOverloadPropertyDeclaration(modifiers, name, questionToken, type) {
+ const node = createBaseNamedDeclaration(
+ 174 /* OverloadPropertyDeclaration */,
+ modifiers,
+ name
+ );
+ node.type = type;
+ node.questionToken = questionToken;
+ node.transformFlags = 1 /* ContainsTypeScript */;
+ node.initializer = void 0;
+ return node;
+ }
+ function updateOverloadPropertyDeclaration(node, modifiers, name, questionToken, type) {
+ return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createOverloadPropertyDeclaration(modifiers, name, questionToken, type), node) : node;
+ }
function finishUpdatePropertySignature(updated, original) {
if (updated !== original) {
updated.initializer = original.initializer;
@@ -22347,7 +22379,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 171 /* PropertyDeclaration */,
+ 172 /* PropertyDeclaration */,
modifiers,
name,
type,
@@ -22369,7 +22401,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createAnnotationPropertyDeclaration(name, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
void 0,
name,
type,
@@ -22383,7 +22415,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createMethodSignature3(modifiers, name, questionToken, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 173 /* MethodSignature */,
+ 175 /* MethodSignature */,
modifiers,
name,
typeParameters,
@@ -22399,7 +22431,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 174 /* MethodDeclaration */,
+ 176 /* MethodDeclaration */,
modifiers,
name,
typeParameters,
@@ -22436,7 +22468,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassStaticBlockDeclaration(body) {
const node = createBaseGenericNamedDeclaration(
- 175 /* ClassStaticBlockDeclaration */,
+ 177 /* ClassStaticBlockDeclaration */,
void 0,
void 0,
void 0
@@ -22459,7 +22491,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructorDeclaration(modifiers, parameters, body) {
const node = createBaseFunctionLikeDeclaration(
- 176 /* Constructor */,
+ 178 /* Constructor */,
modifiers,
void 0,
void 0,
@@ -22486,7 +22518,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createGetAccessorDeclaration(modifiers, name, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 177 /* GetAccessor */,
+ 179 /* GetAccessor */,
modifiers,
name,
void 0,
@@ -22508,7 +22540,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createSetAccessorDeclaration(modifiers, name, parameters, body) {
const node = createBaseFunctionLikeDeclaration(
- 178 /* SetAccessor */,
+ 180 /* SetAccessor */,
modifiers,
name,
void 0,
@@ -22532,7 +22564,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createCallSignature2(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 179 /* CallSignature */,
+ 181 /* CallSignature */,
void 0,
void 0,
typeParameters,
@@ -22547,7 +22579,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructSignature2(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 180 /* ConstructSignature */,
+ 182 /* ConstructSignature */,
void 0,
void 0,
typeParameters,
@@ -22562,7 +22594,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createIndexSignature3(modifiers, parameters, type) {
const node = createBaseSignatureDeclaration(
- 181 /* IndexSignature */,
+ 183 /* IndexSignature */,
modifiers,
void 0,
void 0,
@@ -22576,7 +22608,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature3(modifiers, parameters, type), node) : node;
}
function createTemplateLiteralTypeSpan(type, literal) {
- const node = createBaseNode(204 /* TemplateLiteralTypeSpan */);
+ const node = createBaseNode(206 /* TemplateLiteralTypeSpan */);
node.type = type;
node.literal = literal;
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22589,7 +22621,7 @@ function createNodeFactory(flags, baseFactory2) {
return createToken3(kind);
}
function createTypePredicateNode3(assertsModifier, parameterName, type) {
- const node = createBaseNode(182 /* TypePredicate */);
+ const node = createBaseNode(184 /* TypePredicate */);
node.assertsModifier = assertsModifier;
node.parameterName = asName(parameterName);
node.type = type;
@@ -22600,7 +22632,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode3(assertsModifier, parameterName, type), node) : node;
}
function createTypeReferenceNode2(typeName, typeArguments) {
- const node = createBaseNode(183 /* TypeReference */);
+ const node = createBaseNode(185 /* TypeReference */);
node.typeName = asName(typeName);
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray2(typeArguments));
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22611,7 +22643,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionTypeNode2(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 184 /* FunctionType */,
+ 186 /* FunctionType */,
void 0,
void 0,
typeParameters,
@@ -22636,7 +22668,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 185 /* ConstructorType */,
+ 187 /* ConstructorType */,
modifiers,
void 0,
typeParameters,
@@ -22659,7 +22691,7 @@ function createNodeFactory(flags, baseFactory2) {
return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);
}
function createTypeQueryNode2(exprName, typeArguments) {
- const node = createBaseNode(186 /* TypeQuery */);
+ const node = createBaseNode(188 /* TypeQuery */);
node.exprName = exprName;
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22669,7 +22701,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode2(exprName, typeArguments), node) : node;
}
function createTypeLiteralNode2(members) {
- const node = createBaseNode(187 /* TypeLiteral */);
+ const node = createBaseNode(189 /* TypeLiteral */);
node.members = createNodeArray2(members);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22678,7 +22710,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.members !== members ? update(createTypeLiteralNode2(members), node) : node;
}
function createArrayTypeNode2(elementType) {
- const node = createBaseNode(188 /* ArrayType */);
+ const node = createBaseNode(190 /* ArrayType */);
node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22687,7 +22719,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elementType !== elementType ? update(createArrayTypeNode2(elementType), node) : node;
}
function createTupleTypeNode2(elements) {
- const node = createBaseNode(189 /* TupleType */);
+ const node = createBaseNode(191 /* TupleType */);
node.elements = createNodeArray2(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements));
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22696,7 +22728,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createTupleTypeNode2(elements), node) : node;
}
function createNamedTupleMember(dotDotDotToken, name, questionToken, type) {
- const node = createBaseNode(202 /* NamedTupleMember */);
+ const node = createBaseNode(204 /* NamedTupleMember */);
node.dotDotDotToken = dotDotDotToken;
node.name = name;
node.questionToken = questionToken;
@@ -22708,7 +22740,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node) : node;
}
function createOptionalTypeNode2(type) {
- const node = createBaseNode(190 /* OptionalType */);
+ const node = createBaseNode(192 /* OptionalType */);
node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22717,7 +22749,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createOptionalTypeNode2(type), node) : node;
}
function createRestTypeNode2(type) {
- const node = createBaseNode(191 /* RestType */);
+ const node = createBaseNode(193 /* RestType */);
node.type = type;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22735,19 +22767,19 @@ function createNodeFactory(flags, baseFactory2) {
return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node;
}
function createUnionTypeNode2(types) {
- return createUnionOrIntersectionTypeNode(192 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
+ return createUnionOrIntersectionTypeNode(194 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
}
function updateUnionTypeNode2(node, types) {
return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
}
function createIntersectionTypeNode2(types) {
- return createUnionOrIntersectionTypeNode(193 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
+ return createUnionOrIntersectionTypeNode(195 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
}
function updateIntersectionTypeNode2(node, types) {
return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
}
function createConditionalTypeNode2(checkType, extendsType, trueType, falseType) {
- const node = createBaseNode(194 /* ConditionalType */);
+ const node = createBaseNode(196 /* ConditionalType */);
node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType);
node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType);
node.trueType = trueType;
@@ -22759,7 +22791,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode2(checkType, extendsType, trueType, falseType), node) : node;
}
function createInferTypeNode2(typeParameter) {
- const node = createBaseNode(195 /* InferType */);
+ const node = createBaseNode(197 /* InferType */);
node.typeParameter = typeParameter;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22768,7 +22800,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.typeParameter !== typeParameter ? update(createInferTypeNode2(typeParameter), node) : node;
}
function createTemplateLiteralType(head, templateSpans) {
- const node = createBaseNode(203 /* TemplateLiteralType */);
+ const node = createBaseNode(205 /* TemplateLiteralType */);
node.head = head;
node.templateSpans = createNodeArray2(templateSpans);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22778,7 +22810,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
}
function createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf = false) {
- const node = createBaseNode(205 /* ImportType */);
+ const node = createBaseNode(207 /* ImportType */);
node.argument = argument;
node.assertions = assertions;
node.qualifier = qualifier;
@@ -22791,7 +22823,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode2(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node;
}
function createParenthesizedType2(type) {
- const node = createBaseNode(196 /* ParenthesizedType */);
+ const node = createBaseNode(198 /* ParenthesizedType */);
node.type = type;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22800,12 +22832,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createParenthesizedType2(type), node) : node;
}
function createThisTypeNode2() {
- const node = createBaseNode(197 /* ThisType */);
+ const node = createBaseNode(199 /* ThisType */);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
}
function createTypeOperatorNode3(operator, type) {
- const node = createBaseNode(198 /* TypeOperator */);
+ const node = createBaseNode(200 /* TypeOperator */);
node.operator = operator;
node.type = operator === 147 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22815,7 +22847,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createTypeOperatorNode3(node.operator, type), node) : node;
}
function createIndexedAccessTypeNode2(objectType, indexType) {
- const node = createBaseNode(199 /* IndexedAccessType */);
+ const node = createBaseNode(201 /* IndexedAccessType */);
node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType);
node.indexType = indexType;
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -22825,7 +22857,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode2(objectType, indexType), node) : node;
}
function createMappedTypeNode2(readonlyToken, typeParameter, nameType, questionToken, type, members) {
- const node = createBaseNode(200 /* MappedType */);
+ const node = createBaseNode(202 /* MappedType */);
node.readonlyToken = readonlyToken;
node.typeParameter = typeParameter;
node.nameType = nameType;
@@ -22839,7 +22871,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode2(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node;
}
function createLiteralTypeNode2(literal) {
- const node = createBaseNode(201 /* LiteralType */);
+ const node = createBaseNode(203 /* LiteralType */);
node.literal = literal;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -22848,7 +22880,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.literal !== literal ? update(createLiteralTypeNode2(literal), node) : node;
}
function createObjectBindingPattern2(elements) {
- const node = createBaseNode(206 /* ObjectBindingPattern */);
+ const node = createBaseNode(208 /* ObjectBindingPattern */);
node.elements = createNodeArray2(elements);
node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */;
if (node.transformFlags & 32768 /* ContainsRestOrSpread */) {
@@ -22860,7 +22892,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createObjectBindingPattern2(elements), node) : node;
}
function createArrayBindingPattern2(elements) {
- const node = createBaseNode(207 /* ArrayBindingPattern */);
+ const node = createBaseNode(209 /* ArrayBindingPattern */);
node.elements = createNodeArray2(elements);
node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */;
return node;
@@ -22870,7 +22902,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createBindingElement2(dotDotDotToken, propertyName, name, initializer) {
const node = createBaseBindingLikeDeclaration(
- 208 /* BindingElement */,
+ 210 /* BindingElement */,
void 0,
name,
initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
@@ -22893,7 +22925,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createArrayLiteralExpression(elements, multiLine) {
- const node = createBaseExpression(209 /* ArrayLiteralExpression */);
+ const node = createBaseExpression(211 /* ArrayLiteralExpression */);
const lastElement = elements && lastOrUndefined(elements);
const elementsArray = createNodeArray2(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0);
node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray);
@@ -22905,7 +22937,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node;
}
function createObjectLiteralExpression(properties, multiLine) {
- const node = createBaseExpression(210 /* ObjectLiteralExpression */);
+ const node = createBaseExpression(212 /* ObjectLiteralExpression */);
node.properties = createNodeArray2(properties);
node.multiLine = multiLine;
node.transformFlags |= propagateChildrenFlags(node.properties);
@@ -22915,7 +22947,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node;
}
function createPropertyAccessExpression(expression, name) {
- const node = createBaseExpression(211 /* PropertyAccessExpression */);
+ const node = createBaseExpression(213 /* PropertyAccessExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.name = asName(name);
node.transformFlags = propagateChildFlags(node.expression) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
@@ -22931,7 +22963,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node;
}
function createPropertyAccessChain2(expression, questionDotToken, name) {
- const node = createBaseExpression(211 /* PropertyAccessExpression */);
+ const node = createBaseExpression(213 /* PropertyAccessExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -22944,7 +22976,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain2(expression, questionDotToken, name), node) : node;
}
function createElementAccessExpression(expression, index) {
- const node = createBaseExpression(212 /* ElementAccessExpression */);
+ const node = createBaseExpression(214 /* ElementAccessExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.argumentExpression = asExpression(index);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.argumentExpression);
@@ -22960,7 +22992,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node;
}
function createElementAccessChain2(expression, questionDotToken, index) {
- const node = createBaseExpression(212 /* ElementAccessExpression */);
+ const node = createBaseExpression(214 /* ElementAccessExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -22973,7 +23005,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain2(expression, questionDotToken, argumentExpression), node) : node;
}
function createCallExpression(expression, typeArguments, argumentsArray) {
- const node = createBaseExpression(213 /* CallExpression */);
+ const node = createBaseExpression(215 /* CallExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray2(argumentsArray));
@@ -22995,7 +23027,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node;
}
function createCallChain2(expression, questionDotToken, typeArguments, argumentsArray) {
- const node = createBaseExpression(213 /* CallExpression */);
+ const node = createBaseExpression(215 /* CallExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -23015,7 +23047,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain2(expression, questionDotToken, typeArguments, argumentsArray), node) : node;
}
function createNewExpression(expression, typeArguments, argumentsArray) {
- const node = createBaseExpression(214 /* NewExpression */);
+ const node = createBaseExpression(216 /* NewExpression */);
node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0;
@@ -23029,7 +23061,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createNewExpression(expression, typeArguments, argumentsArray), node) : node;
}
function createTaggedTemplateExpression(tag, typeArguments, template) {
- const node = createBaseExpression(215 /* TaggedTemplateExpression */);
+ const node = createBaseExpression(217 /* TaggedTemplateExpression */);
node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag, false);
node.typeArguments = asNodeArray(typeArguments);
node.template = template;
@@ -23046,7 +23078,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node;
}
function createTypeAssertion2(type, expression) {
- const node = createBaseExpression(216 /* TypeAssertionExpression */);
+ const node = createBaseExpression(218 /* TypeAssertionExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -23056,7 +23088,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type || node.expression !== expression ? update(createTypeAssertion2(type, expression), node) : node;
}
function createParenthesizedExpression(expression) {
- const node = createBaseExpression(217 /* ParenthesizedExpression */);
+ const node = createBaseExpression(219 /* ParenthesizedExpression */);
node.expression = expression;
node.transformFlags = propagateChildFlags(node.expression);
return node;
@@ -23066,7 +23098,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionExpression2(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 218 /* FunctionExpression */,
+ 220 /* FunctionExpression */,
modifiers,
name,
typeParameters,
@@ -23094,7 +23126,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression2(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node;
}
function createEtsComponentExpression(name, argumentsArray, body) {
- const node = createBaseExpression(220 /* EtsComponentExpression */);
+ const node = createBaseExpression(222 /* EtsComponentExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(name);
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray2(argumentsArray));
node.body = body;
@@ -23105,7 +23137,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createArrowFunction3(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
const node = createBaseFunctionLikeDeclaration(
- 219 /* ArrowFunction */,
+ 221 /* ArrowFunction */,
modifiers,
void 0,
typeParameters,
@@ -23124,7 +23156,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction3(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node;
}
function createDeleteExpression(expression) {
- const node = createBaseExpression(221 /* DeleteExpression */);
+ const node = createBaseExpression(223 /* DeleteExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23133,7 +23165,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createDeleteExpression(expression), node) : node;
}
function createTypeOfExpression(expression) {
- const node = createBaseExpression(222 /* TypeOfExpression */);
+ const node = createBaseExpression(224 /* TypeOfExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23142,7 +23174,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node;
}
function createVoidExpression(expression) {
- const node = createBaseExpression(223 /* VoidExpression */);
+ const node = createBaseExpression(225 /* VoidExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23151,7 +23183,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createVoidExpression(expression), node) : node;
}
function createAwaitExpression(expression) {
- const node = createBaseExpression(224 /* AwaitExpression */);
+ const node = createBaseExpression(226 /* AwaitExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */;
return node;
@@ -23160,7 +23192,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createAwaitExpression(expression), node) : node;
}
function createPrefixUnaryExpression(operator, operand) {
- const node = createBaseExpression(225 /* PrefixUnaryExpression */);
+ const node = createBaseExpression(227 /* PrefixUnaryExpression */);
node.operator = operator;
node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand);
node.transformFlags |= propagateChildFlags(node.operand);
@@ -23173,7 +23205,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node;
}
function createPostfixUnaryExpression(operand, operator) {
- const node = createBaseExpression(226 /* PostfixUnaryExpression */);
+ const node = createBaseExpression(228 /* PostfixUnaryExpression */);
node.operator = operator;
node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand);
node.transformFlags |= propagateChildFlags(node.operand);
@@ -23186,7 +23218,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node;
}
function createBinaryExpression(left, operator, right) {
- const node = createBaseExpression(227 /* BinaryExpression */);
+ const node = createBaseExpression(229 /* BinaryExpression */);
const operatorToken = asToken(operator);
const operatorKind = operatorToken.kind;
node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left);
@@ -23235,7 +23267,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node;
}
function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) {
- const node = createBaseExpression(228 /* ConditionalExpression */);
+ const node = createBaseExpression(230 /* ConditionalExpression */);
node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition);
node.questionToken = questionToken != null ? questionToken : createToken3(57 /* QuestionToken */);
node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue);
@@ -23248,7 +23280,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node;
}
function createTemplateExpression2(head, templateSpans) {
- const node = createBaseExpression(229 /* TemplateExpression */);
+ const node = createBaseExpression(231 /* TemplateExpression */);
node.head = head;
node.templateSpans = createNodeArray2(templateSpans);
node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */;
@@ -23301,7 +23333,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createYieldExpression(asteriskToken, expression) {
Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression.");
- const node = createBaseExpression(230 /* YieldExpression */);
+ const node = createBaseExpression(232 /* YieldExpression */);
node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.asteriskToken = asteriskToken;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */;
@@ -23311,7 +23343,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node;
}
function createSpreadElement(expression) {
- const node = createBaseExpression(231 /* SpreadElement */);
+ const node = createBaseExpression(233 /* SpreadElement */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */;
return node;
@@ -23321,7 +23353,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassExpression3(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 232 /* ClassExpression */,
+ 234 /* ClassExpression */,
modifiers,
name,
typeParameters,
@@ -23335,10 +23367,10 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression3(modifiers, name, typeParameters, heritageClauses, members), node) : node;
}
function createOmittedExpression2() {
- return createBaseExpression(233 /* OmittedExpression */);
+ return createBaseExpression(235 /* OmittedExpression */);
}
function createExpressionWithTypeArguments3(expression, typeArguments) {
- const node = createBaseNode(234 /* ExpressionWithTypeArguments */);
+ const node = createBaseNode(236 /* ExpressionWithTypeArguments */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | 1024 /* ContainsES2015 */;
@@ -23348,7 +23380,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments3(expression, typeArguments), node) : node;
}
function createAsExpression2(expression, type) {
- const node = createBaseExpression(235 /* AsExpression */);
+ const node = createBaseExpression(237 /* AsExpression */);
node.expression = expression;
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -23358,7 +23390,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.type !== type ? update(createAsExpression2(expression, type), node) : node;
}
function createNonNullExpression2(expression) {
- const node = createBaseExpression(236 /* NonNullExpression */);
+ const node = createBaseExpression(238 /* NonNullExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
return node;
@@ -23370,7 +23402,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createNonNullExpression2(expression), node) : node;
}
function createSatisfiesExpression(expression, type) {
- const node = createBaseExpression(239 /* SatisfiesExpression */);
+ const node = createBaseExpression(241 /* SatisfiesExpression */);
node.expression = expression;
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -23380,7 +23412,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node;
}
function createNonNullChain2(expression) {
- const node = createBaseExpression(236 /* NonNullExpression */);
+ const node = createBaseExpression(238 /* NonNullExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -23391,7 +23423,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createNonNullChain2(expression), node) : node;
}
function createMetaProperty2(keywordToken, name) {
- const node = createBaseExpression(237 /* MetaProperty */);
+ const node = createBaseExpression(239 /* MetaProperty */);
node.keywordToken = keywordToken;
node.name = name;
node.transformFlags |= propagateChildFlags(node.name);
@@ -23411,7 +23443,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createMetaProperty2(node.keywordToken, name), node) : node;
}
function createTemplateSpan2(expression, literal) {
- const node = createBaseNode(240 /* TemplateSpan */);
+ const node = createBaseNode(242 /* TemplateSpan */);
node.expression = expression;
node.literal = literal;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */;
@@ -23421,12 +23453,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan2(expression, literal), node) : node;
}
function createSemicolonClassElement2() {
- const node = createBaseNode(241 /* SemicolonClassElement */);
+ const node = createBaseNode(243 /* SemicolonClassElement */);
node.transformFlags |= 1024 /* ContainsES2015 */;
return node;
}
function createBlock2(statements, multiLine) {
- const node = createBaseNode(242 /* Block */);
+ const node = createBaseNode(244 /* Block */);
node.statements = createNodeArray2(statements);
node.multiLine = multiLine;
node.transformFlags |= propagateChildrenFlags(node.statements);
@@ -23436,7 +23468,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createBlock2(statements, node.multiLine), node) : node;
}
function createVariableStatement2(modifiers, declarationList) {
- const node = createBaseDeclaration(244 /* VariableStatement */);
+ const node = createBaseDeclaration(246 /* VariableStatement */);
node.modifiers = asNodeArray(modifiers);
node.declarationList = isArray(declarationList) ? createVariableDeclarationList2(declarationList) : declarationList;
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList);
@@ -23449,10 +23481,10 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement2(modifiers, declarationList), node) : node;
}
function createEmptyStatement2() {
- return createBaseNode(243 /* EmptyStatement */);
+ return createBaseNode(245 /* EmptyStatement */);
}
function createExpressionStatement2(expression) {
- const node = createBaseNode(245 /* ExpressionStatement */);
+ const node = createBaseNode(247 /* ExpressionStatement */);
node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23461,7 +23493,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createExpressionStatement2(expression), node) : node;
}
function createIfStatement(expression, thenStatement, elseStatement) {
- const node = createBaseNode(246 /* IfStatement */);
+ const node = createBaseNode(248 /* IfStatement */);
node.expression = expression;
node.thenStatement = asEmbeddedStatement(thenStatement);
node.elseStatement = asEmbeddedStatement(elseStatement);
@@ -23472,7 +23504,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? update(createIfStatement(expression, thenStatement, elseStatement), node) : node;
}
function createDoStatement(statement, expression) {
- const node = createBaseNode(247 /* DoStatement */);
+ const node = createBaseNode(249 /* DoStatement */);
node.statement = asEmbeddedStatement(statement);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression);
@@ -23482,7 +23514,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statement !== statement || node.expression !== expression ? update(createDoStatement(statement, expression), node) : node;
}
function createWhileStatement(expression, statement) {
- const node = createBaseNode(248 /* WhileStatement */);
+ const node = createBaseNode(250 /* WhileStatement */);
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
@@ -23492,7 +23524,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statement !== statement ? update(createWhileStatement(expression, statement), node) : node;
}
function createForStatement(initializer, condition, incrementor, statement) {
- const node = createBaseNode(249 /* ForStatement */);
+ const node = createBaseNode(251 /* ForStatement */);
node.initializer = initializer;
node.condition = condition;
node.incrementor = incrementor;
@@ -23504,7 +23536,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement ? update(createForStatement(initializer, condition, incrementor, statement), node) : node;
}
function createForInStatement(initializer, expression, statement) {
- const node = createBaseNode(250 /* ForInStatement */);
+ const node = createBaseNode(252 /* ForInStatement */);
node.initializer = initializer;
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
@@ -23515,7 +23547,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForInStatement(initializer, expression, statement), node) : node;
}
function createForOfStatement(awaitModifier, initializer, expression, statement) {
- const node = createBaseNode(251 /* ForOfStatement */);
+ const node = createBaseNode(253 /* ForOfStatement */);
node.awaitModifier = awaitModifier;
node.initializer = initializer;
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
@@ -23529,7 +23561,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForOfStatement(awaitModifier, initializer, expression, statement), node) : node;
}
function createContinueStatement(label) {
- const node = createBaseNode(252 /* ContinueStatement */);
+ const node = createBaseNode(254 /* ContinueStatement */);
node.label = asName(label);
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -23538,7 +23570,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label ? update(createContinueStatement(label), node) : node;
}
function createBreakStatement(label) {
- const node = createBaseNode(253 /* BreakStatement */);
+ const node = createBaseNode(255 /* BreakStatement */);
node.label = asName(label);
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -23547,7 +23579,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label ? update(createBreakStatement(label), node) : node;
}
function createReturnStatement(expression) {
- const node = createBaseNode(254 /* ReturnStatement */);
+ const node = createBaseNode(256 /* ReturnStatement */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -23556,7 +23588,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createReturnStatement(expression), node) : node;
}
function createWithStatement(expression, statement) {
- const node = createBaseNode(255 /* WithStatement */);
+ const node = createBaseNode(257 /* WithStatement */);
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
@@ -23566,7 +23598,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statement !== statement ? update(createWithStatement(expression, statement), node) : node;
}
function createSwitchStatement(expression, caseBlock) {
- const node = createBaseNode(256 /* SwitchStatement */);
+ const node = createBaseNode(258 /* SwitchStatement */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.caseBlock = caseBlock;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock);
@@ -23576,7 +23608,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.caseBlock !== caseBlock ? update(createSwitchStatement(expression, caseBlock), node) : node;
}
function createLabeledStatement(label, statement) {
- const node = createBaseNode(257 /* LabeledStatement */);
+ const node = createBaseNode(259 /* LabeledStatement */);
node.label = asName(label);
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement);
@@ -23586,7 +23618,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label || node.statement !== statement ? update(createLabeledStatement(label, statement), node) : node;
}
function createThrowStatement(expression) {
- const node = createBaseNode(258 /* ThrowStatement */);
+ const node = createBaseNode(260 /* ThrowStatement */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -23595,7 +23627,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createThrowStatement(expression), node) : node;
}
function createTryStatement(tryBlock, catchClause, finallyBlock) {
- const node = createBaseNode(259 /* TryStatement */);
+ const node = createBaseNode(261 /* TryStatement */);
node.tryBlock = tryBlock;
node.catchClause = catchClause;
node.finallyBlock = finallyBlock;
@@ -23606,11 +23638,11 @@ function createNodeFactory(flags, baseFactory2) {
return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node;
}
function createDebuggerStatement2() {
- return createBaseNode(260 /* DebuggerStatement */);
+ return createBaseNode(262 /* DebuggerStatement */);
}
function createVariableDeclaration3(name, exclamationToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 261 /* VariableDeclaration */,
+ 263 /* VariableDeclaration */,
void 0,
name,
type,
@@ -23627,7 +23659,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration3(name, exclamationToken, type, initializer), node) : node;
}
function createVariableDeclarationList2(declarations, flags2 = 0 /* None */) {
- const node = createBaseNode(262 /* VariableDeclarationList */);
+ const node = createBaseNode(264 /* VariableDeclarationList */);
node.flags |= flags2 & 3 /* BlockScoped */;
node.declarations = createNodeArray2(declarations);
node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
@@ -23641,7 +23673,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionDeclaration2(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 263 /* FunctionDeclaration */,
+ 265 /* FunctionDeclaration */,
modifiers,
name,
typeParameters,
@@ -23678,7 +23710,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassDeclaration2(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 264 /* ClassDeclaration */,
+ 266 /* ClassDeclaration */,
modifiers,
name,
typeParameters,
@@ -23700,7 +23732,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createStructDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 265 /* StructDeclaration */,
+ 267 /* StructDeclaration */,
modifiers,
name,
typeParameters,
@@ -23722,7 +23754,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createAnnotationDeclaration(modifiers, name, members) {
const node = createBaseNamedDeclaration(
- 266 /* AnnotationDeclaration */,
+ 268 /* AnnotationDeclaration */,
modifiers,
name
);
@@ -23739,9 +23771,28 @@ function createNodeFactory(flags, baseFactory2) {
function updateAnnotationDeclaration(node, modifiers, name, members) {
return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createAnnotationDeclaration(modifiers, name, members), node) : node;
}
+ function createOverloadDeclaration(modifiers, name, members) {
+ const node = createBaseNamedDeclaration(
+ 269 /* OverloadDeclaration */,
+ modifiers,
+ name
+ );
+ node.members = createNodeArray2(members);
+ node.transformFlags |= propagateChildrenFlags(node.members);
+ if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
+ node.transformFlags = 1 /* ContainsTypeScript */;
+ } else {
+ node.transformFlags |= 1024 /* ContainsES2015 */;
+ node.transformFlags |= 1 /* ContainsTypeScript */;
+ }
+ return node;
+ }
+ function updateOverloadDeclaration(node, modifiers, name, members) {
+ return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createOverloadDeclaration(modifiers, name, members), node) : node;
+ }
function createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseInterfaceOrClassLikeDeclaration(
- 267 /* InterfaceDeclaration */,
+ 270 /* InterfaceDeclaration */,
modifiers,
name,
typeParameters,
@@ -23763,7 +23814,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createTypeAliasDeclaration2(modifiers, name, typeParameters, type) {
const node = createBaseGenericNamedDeclaration(
- 268 /* TypeAliasDeclaration */,
+ 271 /* TypeAliasDeclaration */,
modifiers,
name,
typeParameters
@@ -23784,7 +23835,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createEnumDeclaration2(modifiers, name, members) {
const node = createBaseNamedDeclaration(
- 269 /* EnumDeclaration */,
+ 272 /* EnumDeclaration */,
modifiers,
name
);
@@ -23804,7 +23855,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createModuleDeclaration2(modifiers, name, body, flags2 = 0 /* None */) {
- const node = createBaseDeclaration(270 /* ModuleDeclaration */);
+ const node = createBaseDeclaration(273 /* ModuleDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.flags |= flags2 & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */);
node.name = name;
@@ -23828,7 +23879,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createModuleBlock2(statements) {
- const node = createBaseNode(271 /* ModuleBlock */);
+ const node = createBaseNode(274 /* ModuleBlock */);
node.statements = createNodeArray2(statements);
node.transformFlags |= propagateChildrenFlags(node.statements);
return node;
@@ -23837,7 +23888,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createModuleBlock2(statements), node) : node;
}
function createCaseBlock2(clauses) {
- const node = createBaseNode(272 /* CaseBlock */);
+ const node = createBaseNode(275 /* CaseBlock */);
node.clauses = createNodeArray2(clauses);
node.transformFlags |= propagateChildrenFlags(node.clauses);
return node;
@@ -23847,7 +23898,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createNamespaceExportDeclaration2(name) {
const node = createBaseNamedDeclaration(
- 273 /* NamespaceExportDeclaration */,
+ 276 /* NamespaceExportDeclaration */,
void 0,
name
);
@@ -23868,7 +23919,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createImportEqualsDeclaration2(modifiers, isTypeOnly, name, moduleReference) {
const node = createBaseNamedDeclaration(
- 274 /* ImportEqualsDeclaration */,
+ 277 /* ImportEqualsDeclaration */,
modifiers,
name
);
@@ -23891,7 +23942,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause) {
- const node = createBaseDeclaration(275 /* ImportDeclaration */);
+ const node = createBaseDeclaration(278 /* ImportDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.importClause = importClause;
node.moduleSpecifier = moduleSpecifier;
@@ -23911,7 +23962,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createImportClause3(isTypeOnly, name, namedBindings) {
- const node = createBaseNode(276 /* ImportClause */);
+ const node = createBaseNode(279 /* ImportClause */);
node.isTypeOnly = isTypeOnly;
node.name = name;
node.namedBindings = namedBindings;
@@ -23933,7 +23984,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createAssertClause(elements, multiLine) {
- const node = createBaseNode(302 /* AssertClause */);
+ const node = createBaseNode(305 /* AssertClause */);
node.elements = createNodeArray2(elements);
node.multiLine = multiLine;
node.transformFlags |= 4 /* ContainsESNext */;
@@ -23943,7 +23994,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements || node.multiLine !== multiLine ? update(createAssertClause(elements, multiLine), node) : node;
}
function createAssertEntry(name, value) {
- const node = createBaseNode(303 /* AssertEntry */);
+ const node = createBaseNode(306 /* AssertEntry */);
node.name = name;
node.value = value;
node.transformFlags |= 4 /* ContainsESNext */;
@@ -23953,7 +24004,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.value !== value ? update(createAssertEntry(name, value), node) : node;
}
function createImportTypeAssertionContainer(clause, multiLine) {
- const node = createBaseNode(304 /* ImportTypeAssertionContainer */);
+ const node = createBaseNode(307 /* ImportTypeAssertionContainer */);
node.assertClause = clause;
node.multiLine = multiLine;
return node;
@@ -23962,7 +24013,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
}
function createNamespaceImport2(name) {
- const node = createBaseNode(277 /* NamespaceImport */);
+ const node = createBaseNode(280 /* NamespaceImport */);
node.name = name;
node.transformFlags |= propagateChildFlags(node.name);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -23972,7 +24023,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createNamespaceImport2(name), node) : node;
}
function createNamespaceExport2(name) {
- const node = createBaseNode(283 /* NamespaceExport */);
+ const node = createBaseNode(286 /* NamespaceExport */);
node.name = name;
node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */;
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -23982,7 +24033,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createNamespaceExport2(name), node) : node;
}
function createNamedImports2(elements) {
- const node = createBaseNode(278 /* NamedImports */);
+ const node = createBaseNode(281 /* NamedImports */);
node.elements = createNodeArray2(elements);
node.transformFlags |= propagateChildrenFlags(node.elements);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -23992,7 +24043,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createNamedImports2(elements), node) : node;
}
function createImportSpecifier2(isTypeOnly, propertyName, name) {
- const node = createBaseNode(279 /* ImportSpecifier */);
+ const node = createBaseNode(282 /* ImportSpecifier */);
node.isTypeOnly = isTypeOnly;
node.propertyName = propertyName;
node.name = name;
@@ -24004,7 +24055,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier2(isTypeOnly, propertyName, name), node) : node;
}
function createExportAssignment3(modifiers, isExportEquals, expression) {
- const node = createBaseDeclaration(280 /* ExportAssignment */);
+ const node = createBaseDeclaration(283 /* ExportAssignment */);
node.modifiers = asNodeArray(modifiers);
node.isExportEquals = isExportEquals;
node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary(63 /* EqualsToken */, void 0, expression) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression);
@@ -24023,7 +24074,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createExportDeclaration3(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
- const node = createBaseDeclaration(281 /* ExportDeclaration */);
+ const node = createBaseDeclaration(284 /* ExportDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.isTypeOnly = isTypeOnly;
node.exportClause = exportClause;
@@ -24044,7 +24095,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createNamedExports2(elements) {
- const node = createBaseNode(282 /* NamedExports */);
+ const node = createBaseNode(285 /* NamedExports */);
node.elements = createNodeArray2(elements);
node.transformFlags |= propagateChildrenFlags(node.elements);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -24054,7 +24105,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createNamedExports2(elements), node) : node;
}
function createExportSpecifier2(isTypeOnly, propertyName, name) {
- const node = createBaseNode(284 /* ExportSpecifier */);
+ const node = createBaseNode(287 /* ExportSpecifier */);
node.isTypeOnly = isTypeOnly;
node.propertyName = asName(propertyName);
node.name = asName(name);
@@ -24066,11 +24117,11 @@ function createNodeFactory(flags, baseFactory2) {
return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier2(isTypeOnly, propertyName, name), node) : node;
}
function createMissingDeclaration() {
- const node = createBaseDeclaration(285 /* MissingDeclaration */);
+ const node = createBaseDeclaration(288 /* MissingDeclaration */);
return node;
}
function createExternalModuleReference2(expression) {
- const node = createBaseNode(286 /* ExternalModuleReference */);
+ const node = createBaseNode(289 /* ExternalModuleReference */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -24103,7 +24154,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createJSDocFunctionType(parameters, type) {
const node = createBaseSignatureDeclaration(
- 326 /* JSDocFunctionType */,
+ 329 /* JSDocFunctionType */,
void 0,
void 0,
void 0,
@@ -24116,7 +24167,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node;
}
function createJSDocTypeLiteral2(propertyTags, isArrayType = false) {
- const node = createBaseNode(331 /* JSDocTypeLiteral */);
+ const node = createBaseNode(334 /* JSDocTypeLiteral */);
node.jsDocPropertyTags = asNodeArray(propertyTags);
node.isArrayType = isArrayType;
return node;
@@ -24125,7 +24176,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral2(propertyTags, isArrayType), node) : node;
}
function createJSDocTypeExpression2(type) {
- const node = createBaseNode(318 /* JSDocTypeExpression */);
+ const node = createBaseNode(321 /* JSDocTypeExpression */);
node.type = type;
return node;
}
@@ -24133,7 +24184,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createJSDocTypeExpression2(type), node) : node;
}
function createJSDocSignature2(typeParameters, parameters, type) {
- const node = createBaseNode(332 /* JSDocSignature */);
+ const node = createBaseNode(335 /* JSDocSignature */);
node.typeParameters = asNodeArray(typeParameters);
node.parameters = createNodeArray2(parameters);
node.type = type;
@@ -24153,7 +24204,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createJSDocTemplateTag2(tagName, constraint, typeParameters, comment) {
- const node = createBaseJSDocTag(353 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier3("template"), comment);
+ const node = createBaseJSDocTag(356 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier3("template"), comment);
node.constraint = constraint;
node.typeParameters = createNodeArray2(typeParameters);
return node;
@@ -24162,7 +24213,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag2(tagName, constraint, typeParameters, comment), node) : node;
}
function createJSDocTypedefTag2(tagName, typeExpression, fullName, comment) {
- const node = createBaseJSDocTag(354 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier3("typedef"), comment);
+ const node = createBaseJSDocTag(357 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier3("typedef"), comment);
node.typeExpression = typeExpression;
node.fullName = fullName;
node.name = getJSDocTypeAliasName(fullName);
@@ -24172,7 +24223,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag2(tagName, typeExpression, fullName, comment), node) : node;
}
function createJSDocParameterTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
- const node = createBaseJSDocTag(349 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier3("param"), comment);
+ const node = createBaseJSDocTag(352 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier3("param"), comment);
node.typeExpression = typeExpression;
node.name = name;
node.isNameFirst = !!isNameFirst;
@@ -24183,7 +24234,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node;
}
function createJSDocPropertyTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
- const node = createBaseJSDocTag(356 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier3("prop"), comment);
+ const node = createBaseJSDocTag(359 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier3("prop"), comment);
node.typeExpression = typeExpression;
node.name = name;
node.isNameFirst = !!isNameFirst;
@@ -24194,7 +24245,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag2(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node;
}
function createJSDocCallbackTag2(tagName, typeExpression, fullName, comment) {
- const node = createBaseJSDocTag(347 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier3("callback"), comment);
+ const node = createBaseJSDocTag(350 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier3("callback"), comment);
node.typeExpression = typeExpression;
node.fullName = fullName;
node.name = getJSDocTypeAliasName(fullName);
@@ -24204,7 +24255,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag2(tagName, typeExpression, fullName, comment), node) : node;
}
function createJSDocAugmentsTag2(tagName, className, comment) {
- const node = createBaseJSDocTag(337 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier3("augments"), comment);
+ const node = createBaseJSDocTag(340 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier3("augments"), comment);
node.class = className;
return node;
}
@@ -24212,12 +24263,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag2(tagName, className, comment), node) : node;
}
function createJSDocImplementsTag2(tagName, className, comment) {
- const node = createBaseJSDocTag(338 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier3("implements"), comment);
+ const node = createBaseJSDocTag(341 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier3("implements"), comment);
node.class = className;
return node;
}
function createJSDocSeeTag(tagName, name, comment) {
- const node = createBaseJSDocTag(355 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier3("see"), comment);
+ const node = createBaseJSDocTag(358 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier3("see"), comment);
node.name = name;
return node;
}
@@ -24225,7 +24276,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.comment !== comment ? update(createJSDocSeeTag(tagName, name, comment), node) : node;
}
function createJSDocNameReference(name) {
- const node = createBaseNode(319 /* JSDocNameReference */);
+ const node = createBaseNode(322 /* JSDocNameReference */);
node.name = name;
return node;
}
@@ -24233,7 +24284,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocNameReference(name), node) : node;
}
function createJSDocMemberName(left, right) {
- const node = createBaseNode(320 /* JSDocMemberName */);
+ const node = createBaseNode(323 /* JSDocMemberName */);
node.left = left;
node.right = right;
node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.right);
@@ -24243,7 +24294,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.right !== right ? update(createJSDocMemberName(left, right), node) : node;
}
function createJSDocLink(name, text) {
- const node = createBaseNode(333 /* JSDocLink */);
+ const node = createBaseNode(336 /* JSDocLink */);
node.name = name;
node.text = text;
return node;
@@ -24252,7 +24303,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocLink(name, text), node) : node;
}
function createJSDocLinkCode(name, text) {
- const node = createBaseNode(334 /* JSDocLinkCode */);
+ const node = createBaseNode(337 /* JSDocLinkCode */);
node.name = name;
node.text = text;
return node;
@@ -24261,7 +24312,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocLinkCode(name, text), node) : node;
}
function createJSDocLinkPlain(name, text) {
- const node = createBaseNode(335 /* JSDocLinkPlain */);
+ const node = createBaseNode(338 /* JSDocLinkPlain */);
node.name = name;
node.text = text;
return node;
@@ -24288,14 +24339,14 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment), node) : node;
}
function createJSDocUnknownTag(tagName, comment) {
- const node = createBaseJSDocTag(336 /* JSDocTag */, tagName, comment);
+ const node = createBaseJSDocTag(339 /* JSDocTag */, tagName, comment);
return node;
}
function updateJSDocUnknownTag(node, tagName, comment) {
return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node;
}
function createJSDocText(text) {
- const node = createBaseNode(330 /* JSDocText */);
+ const node = createBaseNode(333 /* JSDocText */);
node.text = text;
return node;
}
@@ -24303,7 +24354,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.text !== text ? update(createJSDocText(text), node) : node;
}
function createJSDocComment2(comment, tags) {
- const node = createBaseNode(329 /* JSDoc */);
+ const node = createBaseNode(332 /* JSDoc */);
node.comment = comment;
node.tags = asNodeArray(tags);
return node;
@@ -24312,7 +24363,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.comment !== comment || node.tags !== tags ? update(createJSDocComment2(comment, tags), node) : node;
}
function createJsxElement2(openingElement, children, closingElement) {
- const node = createBaseNode(287 /* JsxElement */);
+ const node = createBaseNode(290 /* JsxElement */);
node.openingElement = openingElement;
node.children = createNodeArray2(children);
node.closingElement = closingElement;
@@ -24323,7 +24374,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement2(openingElement, children, closingElement), node) : node;
}
function createJsxSelfClosingElement2(tagName, typeArguments, attributes) {
- const node = createBaseNode(288 /* JsxSelfClosingElement */);
+ const node = createBaseNode(291 /* JsxSelfClosingElement */);
node.tagName = tagName;
node.typeArguments = asNodeArray(typeArguments);
node.attributes = attributes;
@@ -24337,7 +24388,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement2(tagName, typeArguments, attributes), node) : node;
}
function createJsxOpeningElement2(tagName, typeArguments, attributes) {
- const node = createBaseNode(289 /* JsxOpeningElement */);
+ const node = createBaseNode(292 /* JsxOpeningElement */);
node.tagName = tagName;
node.typeArguments = asNodeArray(typeArguments);
node.attributes = attributes;
@@ -24351,7 +24402,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement2(tagName, typeArguments, attributes), node) : node;
}
function createJsxClosingElement2(tagName) {
- const node = createBaseNode(290 /* JsxClosingElement */);
+ const node = createBaseNode(293 /* JsxClosingElement */);
node.tagName = tagName;
node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */;
return node;
@@ -24360,7 +24411,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName ? update(createJsxClosingElement2(tagName), node) : node;
}
function createJsxFragment2(openingFragment, children, closingFragment) {
- const node = createBaseNode(291 /* JsxFragment */);
+ const node = createBaseNode(294 /* JsxFragment */);
node.openingFragment = openingFragment;
node.children = createNodeArray2(children);
node.closingFragment = closingFragment;
@@ -24381,17 +24432,17 @@ function createNodeFactory(flags, baseFactory2) {
return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText2(text, containsOnlyTriviaWhiteSpaces), node) : node;
}
function createJsxOpeningFragment2() {
- const node = createBaseNode(292 /* JsxOpeningFragment */);
+ const node = createBaseNode(295 /* JsxOpeningFragment */);
node.transformFlags |= 2 /* ContainsJsx */;
return node;
}
function createJsxJsxClosingFragment2() {
- const node = createBaseNode(293 /* JsxClosingFragment */);
+ const node = createBaseNode(296 /* JsxClosingFragment */);
node.transformFlags |= 2 /* ContainsJsx */;
return node;
}
function createJsxAttribute2(name, initializer) {
- const node = createBaseNode(294 /* JsxAttribute */);
+ const node = createBaseNode(297 /* JsxAttribute */);
node.name = name;
node.initializer = initializer;
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */;
@@ -24401,7 +24452,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute2(name, initializer), node) : node;
}
function createJsxAttributes2(properties) {
- const node = createBaseNode(295 /* JsxAttributes */);
+ const node = createBaseNode(298 /* JsxAttributes */);
node.properties = createNodeArray2(properties);
node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */;
return node;
@@ -24410,7 +24461,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.properties !== properties ? update(createJsxAttributes2(properties), node) : node;
}
function createJsxSpreadAttribute2(expression) {
- const node = createBaseNode(296 /* JsxSpreadAttribute */);
+ const node = createBaseNode(299 /* JsxSpreadAttribute */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */;
return node;
@@ -24419,7 +24470,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createJsxSpreadAttribute2(expression), node) : node;
}
function createJsxExpression2(dotDotDotToken, expression) {
- const node = createBaseNode(297 /* JsxExpression */);
+ const node = createBaseNode(300 /* JsxExpression */);
node.dotDotDotToken = dotDotDotToken;
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */;
@@ -24429,7 +24480,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createJsxExpression2(node.dotDotDotToken, expression), node) : node;
}
function createCaseClause2(expression, statements) {
- const node = createBaseNode(298 /* CaseClause */);
+ const node = createBaseNode(301 /* CaseClause */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.statements = createNodeArray2(statements);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements);
@@ -24439,7 +24490,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statements !== statements ? update(createCaseClause2(expression, statements), node) : node;
}
function createDefaultClause2(statements) {
- const node = createBaseNode(299 /* DefaultClause */);
+ const node = createBaseNode(302 /* DefaultClause */);
node.statements = createNodeArray2(statements);
node.transformFlags = propagateChildrenFlags(node.statements);
return node;
@@ -24448,7 +24499,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createDefaultClause2(statements), node) : node;
}
function createHeritageClause2(token, types) {
- const node = createBaseNode(300 /* HeritageClause */);
+ const node = createBaseNode(303 /* HeritageClause */);
node.token = token;
node.types = createNodeArray2(types);
node.transformFlags |= propagateChildrenFlags(node.types);
@@ -24468,7 +24519,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.types !== types ? update(createHeritageClause2(node.token, types), node) : node;
}
function createCatchClause2(variableDeclaration, block) {
- const node = createBaseNode(301 /* CatchClause */);
+ const node = createBaseNode(304 /* CatchClause */);
if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
variableDeclaration = createVariableDeclaration3(
variableDeclaration,
@@ -24489,7 +24540,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertyAssignment2(name, initializer) {
const node = createBaseNamedDeclaration(
- 305 /* PropertyAssignment */,
+ 308 /* PropertyAssignment */,
void 0,
name
);
@@ -24515,7 +24566,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createShorthandPropertyAssignment2(name, objectAssignmentInitializer) {
const node = createBaseNamedDeclaration(
- 306 /* ShorthandPropertyAssignment */,
+ 309 /* ShorthandPropertyAssignment */,
void 0,
name
);
@@ -24542,7 +24593,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createSpreadAssignment2(expression) {
- const node = createBaseNode(307 /* SpreadAssignment */);
+ const node = createBaseNode(310 /* SpreadAssignment */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */;
return node;
@@ -24551,7 +24602,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createSpreadAssignment2(expression), node) : node;
}
function createEnumMember2(name, initializer) {
- const node = createBaseNode(308 /* EnumMember */);
+ const node = createBaseNode(311 /* EnumMember */);
node.name = asName(name);
node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */;
@@ -24561,7 +24612,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.initializer !== initializer ? update(createEnumMember2(name, initializer), node) : node;
}
function createSourceFile2(statements, endOfFileToken, flags2) {
- const node = baseFactory2.createBaseSourceFileNode(314 /* SourceFile */);
+ const node = baseFactory2.createBaseSourceFileNode(317 /* SourceFile */);
node.statements = createNodeArray2(statements);
node.endOfFileToken = endOfFileToken;
node.flags |= flags2;
@@ -24576,7 +24627,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
- const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(314 /* SourceFile */);
+ const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(317 /* SourceFile */);
for (const p in source) {
if (p === "emitNode" || hasProperty(node, p) || !hasProperty(source, p))
continue;
@@ -24598,7 +24649,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node;
}
function createBundle2(sourceFiles, prepends = emptyArray) {
- const node = createBaseNode(315 /* Bundle */);
+ const node = createBaseNode(318 /* Bundle */);
node.prepends = prepends;
node.sourceFiles = sourceFiles;
return node;
@@ -24607,7 +24658,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle2(sourceFiles, prepends), node) : node;
}
function createUnparsedSource(prologues, syntheticReferences, texts) {
- const node = createBaseNode(316 /* UnparsedSource */);
+ const node = createBaseNode(319 /* UnparsedSource */);
node.prologues = prologues;
node.syntheticReferences = syntheticReferences;
node.texts = texts;
@@ -24624,48 +24675,48 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createUnparsedPrologue(data) {
- return createBaseUnparsedNode(309 /* UnparsedPrologue */, data);
+ return createBaseUnparsedNode(312 /* UnparsedPrologue */, data);
}
function createUnparsedPrepend(data, texts) {
- const node = createBaseUnparsedNode(310 /* UnparsedPrepend */, data);
+ const node = createBaseUnparsedNode(313 /* UnparsedPrepend */, data);
node.texts = texts;
return node;
}
function createUnparsedTextLike(data, internal) {
- return createBaseUnparsedNode(internal ? 312 /* UnparsedInternalText */ : 311 /* UnparsedText */, data);
+ return createBaseUnparsedNode(internal ? 315 /* UnparsedInternalText */ : 314 /* UnparsedText */, data);
}
function createUnparsedSyntheticReference(section) {
- const node = createBaseNode(313 /* UnparsedSyntheticReference */);
+ const node = createBaseNode(316 /* UnparsedSyntheticReference */);
node.data = section.data;
node.section = section;
return node;
}
function createInputFiles2() {
- const node = createBaseNode(317 /* InputFiles */);
+ const node = createBaseNode(320 /* InputFiles */);
node.javascriptText = "";
node.declarationText = "";
return node;
}
function createSyntheticExpression(type, isSpread = false, tupleNameSource) {
- const node = createBaseNode(238 /* SyntheticExpression */);
+ const node = createBaseNode(240 /* SyntheticExpression */);
node.type = type;
node.isSpread = isSpread;
node.tupleNameSource = tupleNameSource;
return node;
}
function createSyntaxList3(children) {
- const node = createBaseNode(357 /* SyntaxList */);
+ const node = createBaseNode(360 /* SyntaxList */);
node._children = children;
return node;
}
function createNotEmittedStatement2(original) {
- const node = createBaseNode(358 /* NotEmittedStatement */);
+ const node = createBaseNode(361 /* NotEmittedStatement */);
node.original = original;
setTextRange(node, original);
return node;
}
function createPartiallyEmittedExpression2(expression, original) {
- const node = createBaseNode(359 /* PartiallyEmittedExpression */);
+ const node = createBaseNode(362 /* PartiallyEmittedExpression */);
node.expression = expression;
node.original = original;
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -24687,7 +24738,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createCommaListExpression(elements) {
- const node = createBaseNode(360 /* CommaListExpression */);
+ const node = createBaseNode(363 /* CommaListExpression */);
node.elements = createNodeArray2(sameFlatMap(elements, flattenCommaElements));
node.transformFlags |= propagateChildrenFlags(node.elements);
return node;
@@ -24696,19 +24747,19 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
}
function createEndOfDeclarationMarker(original) {
- const node = createBaseNode(362 /* EndOfDeclarationMarker */);
+ const node = createBaseNode(365 /* EndOfDeclarationMarker */);
node.emitNode = {};
node.original = original;
return node;
}
function createMergeDeclarationMarker(original) {
- const node = createBaseNode(361 /* MergeDeclarationMarker */);
+ const node = createBaseNode(364 /* MergeDeclarationMarker */);
node.emitNode = {};
node.original = original;
return node;
}
function createSyntheticReferenceExpression(expression, thisArg) {
- const node = createBaseNode(363 /* SyntheticReferenceExpression */);
+ const node = createBaseNode(366 /* SyntheticReferenceExpression */);
node.expression = expression;
node.thisArg = thisArg;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -24721,7 +24772,7 @@ function createNodeFactory(flags, baseFactory2) {
if (node === void 0) {
return node;
}
- const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(314 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
+ const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(317 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
clone2.flags |= node.flags & ~8 /* Synthesized */;
clone2.transformFlags = node.transformFlags;
setOriginalNode(clone2, node);
@@ -24846,17 +24897,17 @@ function createNodeFactory(flags, baseFactory2) {
}
function updateOuterExpression(outerExpression, expression) {
switch (outerExpression.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return updateParenthesizedExpression(outerExpression, expression);
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return updateTypeAssertion2(outerExpression, outerExpression.type, expression);
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return updateAsExpression2(outerExpression, expression, outerExpression.type);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return updateNonNullExpression2(outerExpression, expression);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return updatePartiallyEmittedExpression2(outerExpression, expression);
}
}
@@ -24896,13 +24947,13 @@ function createNodeFactory(flags, baseFactory2) {
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
return false;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
const elements = target.elements;
if (elements.length === 0) {
return false;
}
return true;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return target.properties.length > 0;
default:
return true;
@@ -25149,7 +25200,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray2(array) : void 0;
@@ -25182,41 +25233,41 @@ function updateWithOriginal(updated, original) {
}
function getDefaultTagNameForKind(kind) {
switch (kind) {
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return "type";
- case 350 /* JSDocReturnTag */:
+ case 353 /* JSDocReturnTag */:
return "returns";
- case 351 /* JSDocThisTag */:
+ case 354 /* JSDocThisTag */:
return "this";
- case 348 /* JSDocEnumTag */:
+ case 351 /* JSDocEnumTag */:
return "enum";
- case 339 /* JSDocAuthorTag */:
+ case 342 /* JSDocAuthorTag */:
return "author";
- case 341 /* JSDocClassTag */:
+ case 344 /* JSDocClassTag */:
return "class";
- case 342 /* JSDocPublicTag */:
+ case 345 /* JSDocPublicTag */:
return "public";
- case 343 /* JSDocPrivateTag */:
+ case 346 /* JSDocPrivateTag */:
return "private";
- case 344 /* JSDocProtectedTag */:
+ case 347 /* JSDocProtectedTag */:
return "protected";
- case 345 /* JSDocReadonlyTag */:
+ case 348 /* JSDocReadonlyTag */:
return "readonly";
- case 346 /* JSDocOverrideTag */:
+ case 349 /* JSDocOverrideTag */:
return "override";
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return "template";
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return "typedef";
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
return "param";
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
return "prop";
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
return "callback";
- case 337 /* JSDocAugmentsTag */:
+ case 340 /* JSDocAugmentsTag */:
return "augments";
- case 338 /* JSDocImplementsTag */:
+ case 341 /* JSDocImplementsTag */:
return "implements";
default:
return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`);
@@ -25289,35 +25340,35 @@ function aggregateChildrenFlags(children) {
children.transformFlags = subtreeFlags;
}
function getTransformFlagsSubtreeExclusions(kind) {
- if (kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */) {
+ if (kind >= 184 /* FirstTypeNode */ && kind <= 207 /* LastTypeNode */) {
return -2 /* TypeExcludes */;
}
switch (kind) {
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 211 /* ArrayLiteralExpression */:
return -2147450880 /* ArrayLiteralOrCallOrNewExcludes */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return -1941676032 /* ModuleExcludes */;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return -2147483648 /* ParameterExcludes */;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return -2072174592 /* ArrowFunctionExcludes */;
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
return -1937940480 /* FunctionExcludes */;
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return -2146893824 /* VariableDeclarationListExcludes */;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return -2147344384 /* ClassExcludes */;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return -1937948672 /* ConstructorExcludes */;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return -2013249536 /* PropertyExcludes */;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return -2005057536 /* MethodOrAccessorExcludes */;
case 132 /* AnyKeyword */:
case 149 /* NumberKeyword */:
@@ -25328,31 +25379,31 @@ function getTransformFlagsSubtreeExclusions(kind) {
case 135 /* BooleanKeyword */:
case 154 /* SymbolKeyword */:
case 115 /* VoidKeyword */:
- case 167 /* TypeParameter */:
- case 170 /* PropertySignature */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 168 /* TypeParameter */:
+ case 171 /* PropertySignature */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return -2 /* TypeExcludes */;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return -2147278848 /* ObjectLiteralExcludes */;
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return -2147418112 /* CatchClauseExcludes */;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return -2147450880 /* BindingPatternExcludes */;
- case 216 /* TypeAssertionExpression */:
- case 239 /* SatisfiesExpression */:
- case 235 /* AsExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 241 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 219 /* ParenthesizedExpression */:
case 107 /* SuperKeyword */:
return -2147483648 /* OuterExpressionExcludes */;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return -2147483648 /* PropertyAccessExcludes */;
default:
return -2147483648 /* NodeExcludes */;
@@ -25653,7 +25704,7 @@ function getOrCreateEmitNode(node) {
var _a2;
if (!node.emitNode) {
if (isParseTreeNode(node)) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return node.emitNode = { annotatedNodes: [node] };
}
const sourceFile = (_a2 = getSourceFileOfNode(getParseTreeNode(getSourceFileOfNode(node)))) != null ? _a2 : Debug.fail("Could not determine parsed source file.");
@@ -26652,589 +26703,595 @@ function isImportKeyword(node) {
return node.kind === 101 /* ImportKeyword */;
}
function isQualifiedName(node) {
- return node.kind === 165 /* QualifiedName */;
+ return node.kind === 166 /* QualifiedName */;
}
function isComputedPropertyName(node) {
- return node.kind === 166 /* ComputedPropertyName */;
+ return node.kind === 167 /* ComputedPropertyName */;
}
function isTypeParameterDeclaration(node) {
- return node.kind === 167 /* TypeParameter */;
+ return node.kind === 168 /* TypeParameter */;
}
function isParameter(node) {
- return node.kind === 168 /* Parameter */;
+ return node.kind === 169 /* Parameter */;
}
function isDecoratorOrAnnotation(node) {
- return node.kind === 169 /* Decorator */;
+ return node.kind === 170 /* Decorator */;
}
function isDecorator(node) {
- return node.kind === 169 /* Decorator */ && node.annotationDeclaration === void 0;
+ return node.kind === 170 /* Decorator */ && node.annotationDeclaration === void 0;
}
function isAnnotation(node) {
- return node.kind === 169 /* Decorator */ && node.annotationDeclaration !== void 0;
+ return node.kind === 170 /* Decorator */ && node.annotationDeclaration !== void 0;
}
function isPropertySignature(node) {
- return node.kind === 170 /* PropertySignature */;
+ return node.kind === 171 /* PropertySignature */;
+}
+function isOverloadPropertyDeclaration(node) {
+ return node.kind === 174 /* OverloadPropertyDeclaration */;
}
function isPropertyDeclaration(node) {
- return node.kind === 171 /* PropertyDeclaration */;
+ return node.kind === 172 /* PropertyDeclaration */;
}
function isAnnotationPropertyDeclaration(node) {
- return node.kind === 172 /* AnnotationPropertyDeclaration */;
+ return node.kind === 173 /* AnnotationPropertyDeclaration */;
}
function isMethodSignature(node) {
- return node.kind === 173 /* MethodSignature */;
+ return node.kind === 175 /* MethodSignature */;
}
function isMethodDeclaration(node) {
- return node.kind === 174 /* MethodDeclaration */;
+ return node.kind === 176 /* MethodDeclaration */;
}
function isClassStaticBlockDeclaration(node) {
- return node.kind === 175 /* ClassStaticBlockDeclaration */;
+ return node.kind === 177 /* ClassStaticBlockDeclaration */;
}
function isConstructorDeclaration(node) {
- return node.kind === 176 /* Constructor */;
+ return node.kind === 178 /* Constructor */;
}
function isGetAccessorDeclaration(node) {
- return node.kind === 177 /* GetAccessor */;
+ return node.kind === 179 /* GetAccessor */;
}
function isSetAccessorDeclaration(node) {
- return node.kind === 178 /* SetAccessor */;
+ return node.kind === 180 /* SetAccessor */;
}
function isCallSignatureDeclaration(node) {
- return node.kind === 179 /* CallSignature */;
+ return node.kind === 181 /* CallSignature */;
}
function isConstructSignatureDeclaration(node) {
- return node.kind === 180 /* ConstructSignature */;
+ return node.kind === 182 /* ConstructSignature */;
}
function isIndexSignatureDeclaration(node) {
- return node.kind === 181 /* IndexSignature */;
+ return node.kind === 183 /* IndexSignature */;
}
function isTypePredicateNode(node) {
- return node.kind === 182 /* TypePredicate */;
+ return node.kind === 184 /* TypePredicate */;
}
function isTypeReferenceNode(node) {
- return node.kind === 183 /* TypeReference */;
+ return node.kind === 185 /* TypeReference */;
}
function isFunctionTypeNode(node) {
- return node.kind === 184 /* FunctionType */;
+ return node.kind === 186 /* FunctionType */;
}
function isConstructorTypeNode(node) {
- return node.kind === 185 /* ConstructorType */;
+ return node.kind === 187 /* ConstructorType */;
}
function isTypeQueryNode(node) {
- return node.kind === 186 /* TypeQuery */;
+ return node.kind === 188 /* TypeQuery */;
}
function isTypeLiteralNode(node) {
- return node.kind === 187 /* TypeLiteral */;
+ return node.kind === 189 /* TypeLiteral */;
}
function isArrayTypeNode(node) {
- return node.kind === 188 /* ArrayType */;
+ return node.kind === 190 /* ArrayType */;
}
function isTupleTypeNode(node) {
- return node.kind === 189 /* TupleType */;
+ return node.kind === 191 /* TupleType */;
}
function isNamedTupleMember(node) {
- return node.kind === 202 /* NamedTupleMember */;
+ return node.kind === 204 /* NamedTupleMember */;
}
function isOptionalTypeNode(node) {
- return node.kind === 190 /* OptionalType */;
+ return node.kind === 192 /* OptionalType */;
}
function isRestTypeNode(node) {
- return node.kind === 191 /* RestType */;
+ return node.kind === 193 /* RestType */;
}
function isUnionTypeNode(node) {
- return node.kind === 192 /* UnionType */;
+ return node.kind === 194 /* UnionType */;
}
function isIntersectionTypeNode(node) {
- return node.kind === 193 /* IntersectionType */;
+ return node.kind === 195 /* IntersectionType */;
}
function isConditionalTypeNode(node) {
- return node.kind === 194 /* ConditionalType */;
+ return node.kind === 196 /* ConditionalType */;
}
function isInferTypeNode(node) {
- return node.kind === 195 /* InferType */;
+ return node.kind === 197 /* InferType */;
}
function isParenthesizedTypeNode(node) {
- return node.kind === 196 /* ParenthesizedType */;
+ return node.kind === 198 /* ParenthesizedType */;
}
function isThisTypeNode(node) {
- return node.kind === 197 /* ThisType */;
+ return node.kind === 199 /* ThisType */;
}
function isTypeOperatorNode(node) {
- return node.kind === 198 /* TypeOperator */;
+ return node.kind === 200 /* TypeOperator */;
}
function isIndexedAccessTypeNode(node) {
- return node.kind === 199 /* IndexedAccessType */;
+ return node.kind === 201 /* IndexedAccessType */;
}
function isMappedTypeNode(node) {
- return node.kind === 200 /* MappedType */;
+ return node.kind === 202 /* MappedType */;
}
function isLiteralTypeNode(node) {
- return node.kind === 201 /* LiteralType */;
+ return node.kind === 203 /* LiteralType */;
}
function isImportTypeNode(node) {
- return node.kind === 205 /* ImportType */;
+ return node.kind === 207 /* ImportType */;
}
function isTemplateLiteralTypeSpan(node) {
- return node.kind === 204 /* TemplateLiteralTypeSpan */;
+ return node.kind === 206 /* TemplateLiteralTypeSpan */;
}
function isTemplateLiteralTypeNode(node) {
- return node.kind === 203 /* TemplateLiteralType */;
+ return node.kind === 205 /* TemplateLiteralType */;
}
function isObjectBindingPattern(node) {
- return node.kind === 206 /* ObjectBindingPattern */;
+ return node.kind === 208 /* ObjectBindingPattern */;
}
function isArrayBindingPattern(node) {
- return node.kind === 207 /* ArrayBindingPattern */;
+ return node.kind === 209 /* ArrayBindingPattern */;
}
function isBindingElement(node) {
- return node.kind === 208 /* BindingElement */;
+ return node.kind === 210 /* BindingElement */;
}
function isArrayLiteralExpression(node) {
- return node.kind === 209 /* ArrayLiteralExpression */;
+ return node.kind === 211 /* ArrayLiteralExpression */;
}
function isObjectLiteralExpression(node) {
- return node.kind === 210 /* ObjectLiteralExpression */;
+ return node.kind === 212 /* ObjectLiteralExpression */;
}
function isPropertyAccessExpression(node) {
- return node.kind === 211 /* PropertyAccessExpression */;
+ return node.kind === 213 /* PropertyAccessExpression */;
}
function isElementAccessExpression(node) {
- return node.kind === 212 /* ElementAccessExpression */;
+ return node.kind === 214 /* ElementAccessExpression */;
}
function isCallExpression(node) {
- return node.kind === 213 /* CallExpression */;
+ return node.kind === 215 /* CallExpression */;
}
function isNewExpression(node) {
- return node.kind === 214 /* NewExpression */;
+ return node.kind === 216 /* NewExpression */;
}
function isTaggedTemplateExpression(node) {
- return node.kind === 215 /* TaggedTemplateExpression */;
+ return node.kind === 217 /* TaggedTemplateExpression */;
}
function isTypeAssertionExpression(node) {
- return node.kind === 216 /* TypeAssertionExpression */;
+ return node.kind === 218 /* TypeAssertionExpression */;
}
function isParenthesizedExpression(node) {
- return node.kind === 217 /* ParenthesizedExpression */;
+ return node.kind === 219 /* ParenthesizedExpression */;
}
function isFunctionExpression(node) {
- return node.kind === 218 /* FunctionExpression */;
+ return node.kind === 220 /* FunctionExpression */;
}
function isEtsComponentExpression(node) {
- return node.kind === 220 /* EtsComponentExpression */;
+ return node.kind === 222 /* EtsComponentExpression */;
}
function isArrowFunction(node) {
- return node.kind === 219 /* ArrowFunction */;
+ return node.kind === 221 /* ArrowFunction */;
}
function isDeleteExpression(node) {
- return node.kind === 221 /* DeleteExpression */;
+ return node.kind === 223 /* DeleteExpression */;
}
function isTypeOfExpression(node) {
- return node.kind === 222 /* TypeOfExpression */;
+ return node.kind === 224 /* TypeOfExpression */;
}
function isVoidExpression(node) {
- return node.kind === 223 /* VoidExpression */;
+ return node.kind === 225 /* VoidExpression */;
}
function isAwaitExpression(node) {
- return node.kind === 224 /* AwaitExpression */;
+ return node.kind === 226 /* AwaitExpression */;
}
function isPrefixUnaryExpression(node) {
- return node.kind === 225 /* PrefixUnaryExpression */;
+ return node.kind === 227 /* PrefixUnaryExpression */;
}
function isPostfixUnaryExpression(node) {
- return node.kind === 226 /* PostfixUnaryExpression */;
+ return node.kind === 228 /* PostfixUnaryExpression */;
}
function isBinaryExpression(node) {
- return node.kind === 227 /* BinaryExpression */;
+ return node.kind === 229 /* BinaryExpression */;
}
function isConditionalExpression(node) {
- return node.kind === 228 /* ConditionalExpression */;
+ return node.kind === 230 /* ConditionalExpression */;
}
function isTemplateExpression(node) {
- return node.kind === 229 /* TemplateExpression */;
+ return node.kind === 231 /* TemplateExpression */;
}
function isYieldExpression(node) {
- return node.kind === 230 /* YieldExpression */;
+ return node.kind === 232 /* YieldExpression */;
}
function isSpreadElement(node) {
- return node.kind === 231 /* SpreadElement */;
+ return node.kind === 233 /* SpreadElement */;
}
function isClassExpression(node) {
- return node.kind === 232 /* ClassExpression */;
+ return node.kind === 234 /* ClassExpression */;
}
function isOmittedExpression(node) {
- return node.kind === 233 /* OmittedExpression */;
+ return node.kind === 235 /* OmittedExpression */;
}
function isExpressionWithTypeArguments(node) {
- return node.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.kind === 236 /* ExpressionWithTypeArguments */;
}
function isAsExpression(node) {
- return node.kind === 235 /* AsExpression */;
+ return node.kind === 237 /* AsExpression */;
}
function isSatisfiesExpression(node) {
- return node.kind === 239 /* SatisfiesExpression */;
+ return node.kind === 241 /* SatisfiesExpression */;
}
function isNonNullExpression(node) {
- return node.kind === 236 /* NonNullExpression */;
+ return node.kind === 238 /* NonNullExpression */;
}
function isMetaProperty(node) {
- return node.kind === 237 /* MetaProperty */;
+ return node.kind === 239 /* MetaProperty */;
}
function isSyntheticExpression(node) {
- return node.kind === 238 /* SyntheticExpression */;
+ return node.kind === 240 /* SyntheticExpression */;
}
function isPartiallyEmittedExpression(node) {
- return node.kind === 359 /* PartiallyEmittedExpression */;
+ return node.kind === 362 /* PartiallyEmittedExpression */;
}
function isCommaListExpression(node) {
- return node.kind === 360 /* CommaListExpression */;
+ return node.kind === 363 /* CommaListExpression */;
}
function isTemplateSpan(node) {
- return node.kind === 240 /* TemplateSpan */;
+ return node.kind === 242 /* TemplateSpan */;
}
function isSemicolonClassElement(node) {
- return node.kind === 241 /* SemicolonClassElement */;
+ return node.kind === 243 /* SemicolonClassElement */;
}
function isBlock(node) {
- return node.kind === 242 /* Block */;
+ return node.kind === 244 /* Block */;
}
function isVariableStatement(node) {
- return node.kind === 244 /* VariableStatement */;
+ return node.kind === 246 /* VariableStatement */;
}
function isEmptyStatement(node) {
- return node.kind === 243 /* EmptyStatement */;
+ return node.kind === 245 /* EmptyStatement */;
}
function isExpressionStatement(node) {
- return node.kind === 245 /* ExpressionStatement */;
+ return node.kind === 247 /* ExpressionStatement */;
}
function isIfStatement(node) {
- return node.kind === 246 /* IfStatement */;
+ return node.kind === 248 /* IfStatement */;
}
function isDoStatement(node) {
- return node.kind === 247 /* DoStatement */;
+ return node.kind === 249 /* DoStatement */;
}
function isWhileStatement(node) {
- return node.kind === 248 /* WhileStatement */;
+ return node.kind === 250 /* WhileStatement */;
}
function isForStatement(node) {
- return node.kind === 249 /* ForStatement */;
+ return node.kind === 251 /* ForStatement */;
}
function isForInStatement(node) {
- return node.kind === 250 /* ForInStatement */;
+ return node.kind === 252 /* ForInStatement */;
}
function isForOfStatement(node) {
- return node.kind === 251 /* ForOfStatement */;
+ return node.kind === 253 /* ForOfStatement */;
}
function isContinueStatement(node) {
- return node.kind === 252 /* ContinueStatement */;
+ return node.kind === 254 /* ContinueStatement */;
}
function isBreakStatement(node) {
- return node.kind === 253 /* BreakStatement */;
+ return node.kind === 255 /* BreakStatement */;
}
function isReturnStatement(node) {
- return node.kind === 254 /* ReturnStatement */;
+ return node.kind === 256 /* ReturnStatement */;
}
function isWithStatement(node) {
- return node.kind === 255 /* WithStatement */;
+ return node.kind === 257 /* WithStatement */;
}
function isSwitchStatement(node) {
- return node.kind === 256 /* SwitchStatement */;
+ return node.kind === 258 /* SwitchStatement */;
}
function isLabeledStatement(node) {
- return node.kind === 257 /* LabeledStatement */;
+ return node.kind === 259 /* LabeledStatement */;
}
function isThrowStatement(node) {
- return node.kind === 258 /* ThrowStatement */;
+ return node.kind === 260 /* ThrowStatement */;
}
function isTryStatement(node) {
- return node.kind === 259 /* TryStatement */;
+ return node.kind === 261 /* TryStatement */;
}
function isDebuggerStatement(node) {
- return node.kind === 260 /* DebuggerStatement */;
+ return node.kind === 262 /* DebuggerStatement */;
}
function isVariableDeclaration(node) {
- return node.kind === 261 /* VariableDeclaration */;
+ return node.kind === 263 /* VariableDeclaration */;
}
function isVariableDeclarationList(node) {
- return node.kind === 262 /* VariableDeclarationList */;
+ return node.kind === 264 /* VariableDeclarationList */;
}
function isFunctionDeclaration(node) {
- return node.kind === 263 /* FunctionDeclaration */;
+ return node.kind === 265 /* FunctionDeclaration */;
}
function isClassDeclaration(node) {
- return node.kind === 264 /* ClassDeclaration */;
+ return node.kind === 266 /* ClassDeclaration */;
}
function isStructDeclaration(node) {
- return node.kind === 265 /* StructDeclaration */;
+ return node.kind === 267 /* StructDeclaration */;
}
function isAnnotationDeclaration(node) {
- return node.kind === 266 /* AnnotationDeclaration */;
+ return node.kind === 268 /* AnnotationDeclaration */;
+}
+function isOverloadDeclaration(node) {
+ return node.kind === 269 /* OverloadDeclaration */;
}
function isInterfaceDeclaration(node) {
- return node.kind === 267 /* InterfaceDeclaration */;
+ return node.kind === 270 /* InterfaceDeclaration */;
}
function isTypeAliasDeclaration(node) {
- return node.kind === 268 /* TypeAliasDeclaration */;
+ return node.kind === 271 /* TypeAliasDeclaration */;
}
function isEnumDeclaration(node) {
- return node.kind === 269 /* EnumDeclaration */;
+ return node.kind === 272 /* EnumDeclaration */;
}
function isModuleDeclaration(node) {
- return node.kind === 270 /* ModuleDeclaration */;
+ return node.kind === 273 /* ModuleDeclaration */;
}
function isModuleBlock(node) {
- return node.kind === 271 /* ModuleBlock */;
+ return node.kind === 274 /* ModuleBlock */;
}
function isCaseBlock(node) {
- return node.kind === 272 /* CaseBlock */;
+ return node.kind === 275 /* CaseBlock */;
}
function isNamespaceExportDeclaration(node) {
- return node.kind === 273 /* NamespaceExportDeclaration */;
+ return node.kind === 276 /* NamespaceExportDeclaration */;
}
function isImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */;
+ return node.kind === 277 /* ImportEqualsDeclaration */;
}
function isImportDeclaration(node) {
- return node.kind === 275 /* ImportDeclaration */;
+ return node.kind === 278 /* ImportDeclaration */;
}
function isImportClause(node) {
- return node.kind === 276 /* ImportClause */;
+ return node.kind === 279 /* ImportClause */;
}
function isImportTypeAssertionContainer(node) {
- return node.kind === 304 /* ImportTypeAssertionContainer */;
+ return node.kind === 307 /* ImportTypeAssertionContainer */;
}
function isAssertClause(node) {
- return node.kind === 302 /* AssertClause */;
+ return node.kind === 305 /* AssertClause */;
}
function isAssertEntry(node) {
- return node.kind === 303 /* AssertEntry */;
+ return node.kind === 306 /* AssertEntry */;
}
function isNamespaceImport(node) {
- return node.kind === 277 /* NamespaceImport */;
+ return node.kind === 280 /* NamespaceImport */;
}
function isNamespaceExport(node) {
- return node.kind === 283 /* NamespaceExport */;
+ return node.kind === 286 /* NamespaceExport */;
}
function isNamedImports(node) {
- return node.kind === 278 /* NamedImports */;
+ return node.kind === 281 /* NamedImports */;
}
function isImportSpecifier(node) {
- return node.kind === 279 /* ImportSpecifier */;
+ return node.kind === 282 /* ImportSpecifier */;
}
function isExportAssignment(node) {
- return node.kind === 280 /* ExportAssignment */;
+ return node.kind === 283 /* ExportAssignment */;
}
function isExportDeclaration(node) {
- return node.kind === 281 /* ExportDeclaration */;
+ return node.kind === 284 /* ExportDeclaration */;
}
function isNamedExports(node) {
- return node.kind === 282 /* NamedExports */;
+ return node.kind === 285 /* NamedExports */;
}
function isExportSpecifier(node) {
- return node.kind === 284 /* ExportSpecifier */;
+ return node.kind === 287 /* ExportSpecifier */;
}
function isMissingDeclaration(node) {
- return node.kind === 285 /* MissingDeclaration */;
+ return node.kind === 288 /* MissingDeclaration */;
}
function isNotEmittedStatement(node) {
- return node.kind === 358 /* NotEmittedStatement */;
+ return node.kind === 361 /* NotEmittedStatement */;
}
function isSyntheticReference(node) {
- return node.kind === 363 /* SyntheticReferenceExpression */;
+ return node.kind === 366 /* SyntheticReferenceExpression */;
}
function isMergeDeclarationMarker(node) {
- return node.kind === 361 /* MergeDeclarationMarker */;
+ return node.kind === 364 /* MergeDeclarationMarker */;
}
function isEndOfDeclarationMarker(node) {
- return node.kind === 362 /* EndOfDeclarationMarker */;
+ return node.kind === 365 /* EndOfDeclarationMarker */;
}
function isExternalModuleReference(node) {
- return node.kind === 286 /* ExternalModuleReference */;
+ return node.kind === 289 /* ExternalModuleReference */;
}
function isJsxElement(node) {
- return node.kind === 287 /* JsxElement */;
+ return node.kind === 290 /* JsxElement */;
}
function isJsxSelfClosingElement(node) {
- return node.kind === 288 /* JsxSelfClosingElement */;
+ return node.kind === 291 /* JsxSelfClosingElement */;
}
function isJsxOpeningElement(node) {
- return node.kind === 289 /* JsxOpeningElement */;
+ return node.kind === 292 /* JsxOpeningElement */;
}
function isJsxClosingElement(node) {
- return node.kind === 290 /* JsxClosingElement */;
+ return node.kind === 293 /* JsxClosingElement */;
}
function isJsxFragment(node) {
- return node.kind === 291 /* JsxFragment */;
+ return node.kind === 294 /* JsxFragment */;
}
function isJsxOpeningFragment(node) {
- return node.kind === 292 /* JsxOpeningFragment */;
+ return node.kind === 295 /* JsxOpeningFragment */;
}
function isJsxClosingFragment(node) {
- return node.kind === 293 /* JsxClosingFragment */;
+ return node.kind === 296 /* JsxClosingFragment */;
}
function isJsxAttribute(node) {
- return node.kind === 294 /* JsxAttribute */;
+ return node.kind === 297 /* JsxAttribute */;
}
function isJsxAttributes(node) {
- return node.kind === 295 /* JsxAttributes */;
+ return node.kind === 298 /* JsxAttributes */;
}
function isJsxSpreadAttribute(node) {
- return node.kind === 296 /* JsxSpreadAttribute */;
+ return node.kind === 299 /* JsxSpreadAttribute */;
}
function isJsxExpression(node) {
- return node.kind === 297 /* JsxExpression */;
+ return node.kind === 300 /* JsxExpression */;
}
function isCaseClause(node) {
- return node.kind === 298 /* CaseClause */;
+ return node.kind === 301 /* CaseClause */;
}
function isDefaultClause(node) {
- return node.kind === 299 /* DefaultClause */;
+ return node.kind === 302 /* DefaultClause */;
}
function isHeritageClause(node) {
- return node.kind === 300 /* HeritageClause */;
+ return node.kind === 303 /* HeritageClause */;
}
function isCatchClause(node) {
- return node.kind === 301 /* CatchClause */;
+ return node.kind === 304 /* CatchClause */;
}
function isPropertyAssignment(node) {
- return node.kind === 305 /* PropertyAssignment */;
+ return node.kind === 308 /* PropertyAssignment */;
}
function isShorthandPropertyAssignment(node) {
- return node.kind === 306 /* ShorthandPropertyAssignment */;
+ return node.kind === 309 /* ShorthandPropertyAssignment */;
}
function isSpreadAssignment(node) {
- return node.kind === 307 /* SpreadAssignment */;
+ return node.kind === 310 /* SpreadAssignment */;
}
function isEnumMember(node) {
- return node.kind === 308 /* EnumMember */;
+ return node.kind === 311 /* EnumMember */;
}
function isUnparsedPrepend(node) {
- return node.kind === 310 /* UnparsedPrepend */;
+ return node.kind === 313 /* UnparsedPrepend */;
}
function isSourceFile(node) {
- return node.kind === 314 /* SourceFile */;
+ return node.kind === 317 /* SourceFile */;
}
function isBundle(node) {
- return node.kind === 315 /* Bundle */;
+ return node.kind === 318 /* Bundle */;
}
function isUnparsedSource(node) {
- return node.kind === 316 /* UnparsedSource */;
+ return node.kind === 319 /* UnparsedSource */;
}
function isJSDocTypeExpression(node) {
- return node.kind === 318 /* JSDocTypeExpression */;
+ return node.kind === 321 /* JSDocTypeExpression */;
}
function isJSDocNameReference(node) {
- return node.kind === 319 /* JSDocNameReference */;
+ return node.kind === 322 /* JSDocNameReference */;
}
function isJSDocMemberName(node) {
- return node.kind === 320 /* JSDocMemberName */;
+ return node.kind === 323 /* JSDocMemberName */;
}
function isJSDocLink(node) {
- return node.kind === 333 /* JSDocLink */;
+ return node.kind === 336 /* JSDocLink */;
}
function isJSDocLinkCode(node) {
- return node.kind === 334 /* JSDocLinkCode */;
+ return node.kind === 337 /* JSDocLinkCode */;
}
function isJSDocLinkPlain(node) {
- return node.kind === 335 /* JSDocLinkPlain */;
+ return node.kind === 338 /* JSDocLinkPlain */;
}
function isJSDocAllType(node) {
- return node.kind === 321 /* JSDocAllType */;
+ return node.kind === 324 /* JSDocAllType */;
}
function isJSDocUnknownType(node) {
- return node.kind === 322 /* JSDocUnknownType */;
+ return node.kind === 325 /* JSDocUnknownType */;
}
function isJSDocNullableType(node) {
- return node.kind === 323 /* JSDocNullableType */;
+ return node.kind === 326 /* JSDocNullableType */;
}
function isJSDocNonNullableType(node) {
- return node.kind === 324 /* JSDocNonNullableType */;
+ return node.kind === 327 /* JSDocNonNullableType */;
}
function isJSDocOptionalType(node) {
- return node.kind === 325 /* JSDocOptionalType */;
+ return node.kind === 328 /* JSDocOptionalType */;
}
function isJSDocFunctionType(node) {
- return node.kind === 326 /* JSDocFunctionType */;
+ return node.kind === 329 /* JSDocFunctionType */;
}
function isJSDocVariadicType(node) {
- return node.kind === 327 /* JSDocVariadicType */;
+ return node.kind === 330 /* JSDocVariadicType */;
}
function isJSDocNamepathType(node) {
- return node.kind === 328 /* JSDocNamepathType */;
+ return node.kind === 331 /* JSDocNamepathType */;
}
function isJSDoc(node) {
- return node.kind === 329 /* JSDoc */;
+ return node.kind === 332 /* JSDoc */;
}
function isJSDocTypeLiteral(node) {
- return node.kind === 331 /* JSDocTypeLiteral */;
+ return node.kind === 334 /* JSDocTypeLiteral */;
}
function isJSDocSignature(node) {
- return node.kind === 332 /* JSDocSignature */;
+ return node.kind === 335 /* JSDocSignature */;
}
function isJSDocAugmentsTag(node) {
- return node.kind === 337 /* JSDocAugmentsTag */;
+ return node.kind === 340 /* JSDocAugmentsTag */;
}
function isJSDocAuthorTag(node) {
- return node.kind === 339 /* JSDocAuthorTag */;
+ return node.kind === 342 /* JSDocAuthorTag */;
}
function isJSDocClassTag(node) {
- return node.kind === 341 /* JSDocClassTag */;
+ return node.kind === 344 /* JSDocClassTag */;
}
function isJSDocCallbackTag(node) {
- return node.kind === 347 /* JSDocCallbackTag */;
+ return node.kind === 350 /* JSDocCallbackTag */;
}
function isJSDocPublicTag(node) {
- return node.kind === 342 /* JSDocPublicTag */;
+ return node.kind === 345 /* JSDocPublicTag */;
}
function isJSDocPrivateTag(node) {
- return node.kind === 343 /* JSDocPrivateTag */;
+ return node.kind === 346 /* JSDocPrivateTag */;
}
function isJSDocProtectedTag(node) {
- return node.kind === 344 /* JSDocProtectedTag */;
+ return node.kind === 347 /* JSDocProtectedTag */;
}
function isJSDocReadonlyTag(node) {
- return node.kind === 345 /* JSDocReadonlyTag */;
+ return node.kind === 348 /* JSDocReadonlyTag */;
}
function isJSDocOverrideTag(node) {
- return node.kind === 346 /* JSDocOverrideTag */;
+ return node.kind === 349 /* JSDocOverrideTag */;
}
function isJSDocDeprecatedTag(node) {
- return node.kind === 340 /* JSDocDeprecatedTag */;
+ return node.kind === 343 /* JSDocDeprecatedTag */;
}
function isJSDocSeeTag(node) {
- return node.kind === 355 /* JSDocSeeTag */;
+ return node.kind === 358 /* JSDocSeeTag */;
}
function isJSDocEnumTag(node) {
- return node.kind === 348 /* JSDocEnumTag */;
+ return node.kind === 351 /* JSDocEnumTag */;
}
function isJSDocParameterTag(node) {
- return node.kind === 349 /* JSDocParameterTag */;
+ return node.kind === 352 /* JSDocParameterTag */;
}
function isJSDocReturnTag(node) {
- return node.kind === 350 /* JSDocReturnTag */;
+ return node.kind === 353 /* JSDocReturnTag */;
}
function isJSDocThisTag(node) {
- return node.kind === 351 /* JSDocThisTag */;
+ return node.kind === 354 /* JSDocThisTag */;
}
function isJSDocTypeTag(node) {
- return node.kind === 352 /* JSDocTypeTag */;
+ return node.kind === 355 /* JSDocTypeTag */;
}
function isJSDocTemplateTag(node) {
- return node.kind === 353 /* JSDocTemplateTag */;
+ return node.kind === 356 /* JSDocTemplateTag */;
}
function isJSDocTypedefTag(node) {
- return node.kind === 354 /* JSDocTypedefTag */;
+ return node.kind === 357 /* JSDocTypedefTag */;
}
function isJSDocUnknownTag(node) {
- return node.kind === 336 /* JSDocTag */;
+ return node.kind === 339 /* JSDocTag */;
}
function isJSDocPropertyTag(node) {
- return node.kind === 356 /* JSDocPropertyTag */;
+ return node.kind === 359 /* JSDocPropertyTag */;
}
function isJSDocImplementsTag(node) {
- return node.kind === 338 /* JSDocImplementsTag */;
+ return node.kind === 341 /* JSDocImplementsTag */;
}
function isSyntaxList(n) {
- return n.kind === 357 /* SyntaxList */;
+ return n.kind === 360 /* SyntaxList */;
}
// src/compiler/factory/utilities.ts
@@ -27478,14 +27535,14 @@ function createExpressionForObjectLiteralElementLike(factory2, node, property, r
Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals.");
}
switch (property.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return createExpressionForAccessorDeclaration(factory2, node.properties, property, receiver, !!node.multiLine);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return createExpressionForPropertyAssignment(factory2, property, receiver);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return createExpressionForShorthandPropertyAssignment(factory2, property, receiver);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return createExpressionForMethodDeclaration(factory2, property, receiver);
}
}
@@ -27538,7 +27595,7 @@ function startsWithUseStrict(statements) {
return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement);
}
function isCommaSequence(node) {
- return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 360 /* CommaListExpression */;
+ return node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 363 /* CommaListExpression */;
}
function isJSDocTypeAssertion(node) {
return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
@@ -27550,18 +27607,18 @@ function getJSDocTypeAssertionType(node) {
}
function isOuterExpression(node, kinds = 15 /* All */) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
if (kinds & 16 /* ExcludeJSDocTypeAssertion */ && isJSDocTypeAssertion(node)) {
return false;
}
return (kinds & 1 /* Parentheses */) !== 0;
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
- case 239 /* SatisfiesExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
+ case 241 /* SatisfiesExpression */:
return (kinds & 2 /* TypeAssertions */) !== 0;
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return (kinds & 4 /* NonNullAssertions */) !== 0;
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
}
return false;
@@ -27667,10 +27724,10 @@ function getLocalNameForExternalImport(factory2, node, sourceFile) {
const name = namespaceDeclaration.name;
return isGeneratedIdentifier(name) ? name : factory2.createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name) || idText(name));
}
- if (node.kind === 275 /* ImportDeclaration */ && node.importClause) {
+ if (node.kind === 278 /* ImportDeclaration */ && node.importClause) {
return factory2.getGeneratedNameForNode(node);
}
- if (node.kind === 281 /* ExportDeclaration */ && node.moduleSpecifier) {
+ if (node.kind === 284 /* ExportDeclaration */ && node.moduleSpecifier) {
return factory2.getGeneratedNameForNode(node);
}
return void 0;
@@ -27725,11 +27782,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) {
}
if (isObjectLiteralElementLike(bindingElement)) {
switch (bindingElement.kind) {
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return bindingElement.name;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return getTargetOfBindingOrAssignmentElement(bindingElement.expression);
}
}
@@ -27743,11 +27800,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) {
}
function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
return bindingElement.dotDotDotToken;
- case 231 /* SpreadElement */:
- case 307 /* SpreadAssignment */:
+ case 233 /* SpreadElement */:
+ case 310 /* SpreadAssignment */:
return bindingElement;
}
return void 0;
@@ -27759,7 +27816,7 @@ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) {
}
function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
if (bindingElement.propertyName) {
const propertyName = bindingElement.propertyName;
if (isPrivateIdentifier(propertyName)) {
@@ -27768,7 +27825,7 @@ function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName;
}
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (bindingElement.name) {
const propertyName = bindingElement.name;
if (isPrivateIdentifier(propertyName)) {
@@ -27777,7 +27834,7 @@ function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {
return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName;
}
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
if (bindingElement.name && isPrivateIdentifier(bindingElement.name)) {
return Debug.failBadSyntaxKind(bindingElement.name);
}
@@ -27794,11 +27851,11 @@ function isStringOrNumericLiteral(node) {
}
function getElementsOfBindingOrAssignmentPattern(name) {
switch (name.kind) {
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return name.elements;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return name.properties;
}
}
@@ -27815,19 +27872,19 @@ function getJSDocTypeAliasName(fullName) {
}
function canHaveIllegalType(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 178 /* SetAccessor */;
+ return kind === 178 /* Constructor */ || kind === 180 /* SetAccessor */;
}
function canHaveIllegalTypeParameters(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function canHaveIllegalDecorators(node) {
const kind = node.kind;
- return kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 263 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 285 /* MissingDeclaration */ || kind === 244 /* VariableStatement */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 280 /* ExportAssignment */;
+ return kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 265 /* FunctionDeclaration */ || kind === 178 /* Constructor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 288 /* MissingDeclaration */ || kind === 246 /* VariableStatement */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 283 /* ExportAssignment */;
}
function canHaveIllegalModifiers(node) {
const kind = node.kind;
- return kind === 175 /* ClassStaticBlockDeclaration */ || kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 184 /* FunctionType */ || kind === 285 /* MissingDeclaration */ || kind === 273 /* NamespaceExportDeclaration */;
+ return kind === 177 /* ClassStaticBlockDeclaration */ || kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 186 /* FunctionType */ || kind === 288 /* MissingDeclaration */ || kind === 276 /* NamespaceExportDeclaration */;
}
var isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration);
var isQuestionOrExclamationToken = or(isQuestionToken, isExclamationToken);
@@ -28113,11 +28170,11 @@ function setTextRange(range, location) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 167 /* TypeParameter */ || kind === 168 /* Parameter */ || kind === 170 /* PropertySignature */ || kind === 171 /* PropertyDeclaration */ || kind === 173 /* MethodSignature */ || kind === 174 /* MethodDeclaration */ || kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 185 /* ConstructorType */ || kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || kind === 232 /* ClassExpression */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 244 /* VariableStatement */ || kind === 263 /* FunctionDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 280 /* ExportAssignment */ || kind === 281 /* ExportDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 168 /* Parameter */ || kind === 171 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 232 /* ClassExpression */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* StructDeclaration */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */;
}
// src/compiler/parser.ts
@@ -28187,430 +28244,434 @@ function isImportMeta2(node) {
return isMetaProperty(node) && node.keywordToken === 101 /* ImportKeyword */ && node.name.escapedText === "meta";
}
var forEachChildTable = {
- [165 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) {
+ [166 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right);
},
- [167 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) {
+ [168 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression);
},
- [306 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) {
+ [309 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer);
},
- [307 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) {
+ [310 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [168 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) {
+ [169 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [171 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) {
+ [172 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [172 /* AnnotationPropertyDeclaration */]: function forEachChildInAnnotationPropertyDeclaration(node, cbNode, _cbNodes) {
+ [173 /* AnnotationPropertyDeclaration */]: function forEachChildInAnnotationPropertyDeclaration(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [170 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) {
+ [171 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) {
+ return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
+ },
+ [174 /* OverloadPropertyDeclaration */]: function forEachChildInOverloadPropertyDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [305 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) {
+ [308 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer);
},
- [261 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) {
+ [263 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [208 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) {
+ [210 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [181 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) {
+ [183 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [185 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) {
+ [187 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [184 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) {
+ [186 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [179 /* CallSignature */]: forEachChildInCallOrConstructSignature,
- [180 /* ConstructSignature */]: forEachChildInCallOrConstructSignature,
- [220 /* EtsComponentExpression */]: function forEachChildInEtsComponentExpression(node, cbNode, cbNodes) {
+ [181 /* CallSignature */]: forEachChildInCallOrConstructSignature,
+ [182 /* ConstructSignature */]: forEachChildInCallOrConstructSignature,
+ [222 /* EtsComponentExpression */]: function forEachChildInEtsComponentExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.arguments) || visitNode2(cbNode, node.body);
},
- [174 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) {
+ [176 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [173 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) {
+ [175 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [176 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) {
+ [178 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [177 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) {
+ [179 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [178 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) {
+ [180 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [263 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) {
+ [265 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [218 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) {
+ [220 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [219 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) {
+ [221 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body);
},
- [175 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) {
+ [177 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body);
},
- [183 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) {
+ [185 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [182 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) {
+ [184 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.assertsModifier) || visitNode2(cbNode, node.parameterName) || visitNode2(cbNode, node.type);
},
- [186 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) {
+ [188 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.exprName) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [187 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) {
+ [189 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.members);
},
- [188 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) {
+ [190 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.elementType);
},
- [189 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) {
+ [191 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [192 /* UnionType */]: forEachChildInUnionOrIntersectionType,
- [193 /* IntersectionType */]: forEachChildInUnionOrIntersectionType,
- [194 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) {
+ [194 /* UnionType */]: forEachChildInUnionOrIntersectionType,
+ [195 /* IntersectionType */]: forEachChildInUnionOrIntersectionType,
+ [196 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.checkType) || visitNode2(cbNode, node.extendsType) || visitNode2(cbNode, node.trueType) || visitNode2(cbNode, node.falseType);
},
- [195 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) {
+ [197 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.typeParameter);
},
- [205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
+ [207 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.assertions) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [304 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
+ [307 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.assertClause);
},
- [196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
- [198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
- [199 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) {
+ [198 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
+ [200 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
+ [201 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.objectType) || visitNode2(cbNode, node.indexType);
},
- [200 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) {
+ [202 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.readonlyToken) || visitNode2(cbNode, node.typeParameter) || visitNode2(cbNode, node.nameType) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNodes(cbNode, cbNodes, node.members);
},
- [201 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) {
+ [203 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.literal);
},
- [202 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) {
+ [204 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type);
},
- [206 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
- [207 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
- [209 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) {
+ [208 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
+ [209 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
+ [211 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [210 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) {
+ [212 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.properties);
},
- [211 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) {
+ [213 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.name);
},
- [212 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) {
+ [214 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.argumentExpression);
},
- [213 /* CallExpression */]: forEachChildInCallOrNewExpression,
- [214 /* NewExpression */]: forEachChildInCallOrNewExpression,
- [215 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) {
+ [215 /* CallExpression */]: forEachChildInCallOrNewExpression,
+ [216 /* NewExpression */]: forEachChildInCallOrNewExpression,
+ [217 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tag) || visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.template);
},
- [216 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) {
+ [218 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.expression);
},
- [217 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) {
+ [219 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [221 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) {
+ [223 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [222 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) {
+ [224 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [223 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) {
+ [225 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [225 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) {
+ [227 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.operand);
},
- [230 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) {
+ [232 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.expression);
},
- [224 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) {
+ [226 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [226 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) {
+ [228 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.operand);
},
- [227 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) {
+ [229 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.operatorToken) || visitNode2(cbNode, node.right);
},
- [235 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) {
+ [237 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type);
},
- [236 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) {
+ [238 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [239 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) {
+ [241 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type);
},
- [237 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) {
+ [239 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [228 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) {
+ [230 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.whenTrue) || visitNode2(cbNode, node.colonToken) || visitNode2(cbNode, node.whenFalse);
},
- [231 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) {
+ [233 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [242 /* Block */]: forEachChildInBlock,
- [271 /* ModuleBlock */]: forEachChildInBlock,
- [314 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) {
+ [244 /* Block */]: forEachChildInBlock,
+ [274 /* ModuleBlock */]: forEachChildInBlock,
+ [317 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken);
},
- [244 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) {
+ [246 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList);
},
- [262 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) {
+ [264 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.declarations);
},
- [245 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) {
+ [247 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [246 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) {
+ [248 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.thenStatement) || visitNode2(cbNode, node.elseStatement);
},
- [247 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) {
+ [249 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.statement) || visitNode2(cbNode, node.expression);
},
- [248 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) {
+ [250 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [249 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) {
+ [251 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.incrementor) || visitNode2(cbNode, node.statement);
},
- [250 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) {
+ [252 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [251 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) {
+ [253 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.awaitModifier) || visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [252 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement,
- [253 /* BreakStatement */]: forEachChildInContinueOrBreakStatement,
- [254 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) {
+ [254 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement,
+ [255 /* BreakStatement */]: forEachChildInContinueOrBreakStatement,
+ [256 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [255 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) {
+ [257 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [256 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) {
+ [258 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.caseBlock);
},
- [272 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) {
+ [275 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.clauses);
},
- [298 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) {
+ [301 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements);
},
- [299 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) {
+ [302 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.statements);
},
- [257 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) {
+ [259 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.label) || visitNode2(cbNode, node.statement);
},
- [258 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) {
+ [260 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [259 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) {
+ [261 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.tryBlock) || visitNode2(cbNode, node.catchClause) || visitNode2(cbNode, node.finallyBlock);
},
- [301 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) {
+ [304 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.variableDeclaration) || visitNode2(cbNode, node.block);
},
- [169 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) {
+ [170 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [264 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression,
- [232 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression,
- [265 /* StructDeclaration */]: forEachChildInClassDeclarationOrExpression,
- [266 /* AnnotationDeclaration */]: forEachChildInAnnotationDeclaration,
- [267 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) {
+ [266 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression,
+ [234 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression,
+ [267 /* StructDeclaration */]: forEachChildInClassDeclarationOrExpression,
+ [268 /* AnnotationDeclaration */]: forEachChildInAnnotationDeclaration,
+ [269 /* OverloadDeclaration */]: forEachChildInOverloadDeclaration,
+ [270 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members);
},
- [268 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) {
+ [271 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type);
},
- [269 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) {
+ [272 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
},
- [308 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) {
+ [311 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [270 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) {
+ [273 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body);
},
- [274 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) {
+ [277 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
},
- [275 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
+ [278 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
},
- [276 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
+ [279 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
},
- [302 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) {
+ [305 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [303 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) {
+ [306 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
},
- [273 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
+ [276 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNode2(cbNode, node.name);
},
- [277 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) {
+ [280 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [283 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) {
+ [286 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [278 /* NamedImports */]: forEachChildInNamedImportsOrExports,
- [282 /* NamedExports */]: forEachChildInNamedImportsOrExports,
- [281 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
+ [281 /* NamedImports */]: forEachChildInNamedImportsOrExports,
+ [285 /* NamedExports */]: forEachChildInNamedImportsOrExports,
+ [284 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
},
- [279 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
- [284 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
- [280 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) {
+ [282 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
+ [287 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
+ [283 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression);
},
- [229 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) {
+ [231 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
},
- [240 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) {
+ [242 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.literal);
},
- [203 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) {
+ [205 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
},
- [204 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) {
+ [206 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.literal);
},
- [166 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) {
+ [167 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [300 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) {
+ [303 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.types);
},
- [234 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) {
+ [236 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [286 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) {
+ [289 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [285 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
+ [288 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
},
- [360 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
+ [363 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [287 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
+ [290 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingElement);
},
- [291 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) {
+ [294 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingFragment);
},
- [288 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
- [289 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
- [295 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) {
+ [291 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
+ [292 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
+ [298 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.properties);
},
- [294 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) {
+ [297 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [296 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) {
+ [299 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [297 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) {
+ [300 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.expression);
},
- [290 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) {
+ [293 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.tagName);
},
- [190 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [191 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [318 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [324 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [323 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [325 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [327 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [326 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) {
+ [192 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [193 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [321 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [327 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [326 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [328 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [330 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [329 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [329 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) {
+ [332 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) {
return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags);
},
- [355 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
+ [358 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [319 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) {
+ [322 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [320 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) {
+ [323 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right);
},
- [349 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
- [356 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
- [339 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) {
+ [352 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
+ [359 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
+ [342 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [338 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) {
+ [341 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [337 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) {
+ [340 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [353 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
+ [356 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [354 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
- return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 318 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)));
+ [357 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
+ return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 321 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)));
},
- [347 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
+ [350 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [350 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
- [352 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
- [351 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
- [348 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
- [332 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
+ [353 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
+ [355 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
+ [354 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
+ [351 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
+ [335 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type);
},
- [333 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain,
- [334 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain,
- [335 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain,
- [331 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) {
+ [336 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain,
+ [337 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain,
+ [338 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain,
+ [334 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) {
return forEach(node.jsDocPropertyTags, cbNode);
},
- [336 /* JSDocTag */]: forEachChildInJSDocTag,
- [341 /* JSDocClassTag */]: forEachChildInJSDocTag,
- [342 /* JSDocPublicTag */]: forEachChildInJSDocTag,
- [343 /* JSDocPrivateTag */]: forEachChildInJSDocTag,
- [344 /* JSDocProtectedTag */]: forEachChildInJSDocTag,
- [345 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
- [340 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
- [346 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
- [359 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
+ [339 /* JSDocTag */]: forEachChildInJSDocTag,
+ [344 /* JSDocClassTag */]: forEachChildInJSDocTag,
+ [345 /* JSDocPublicTag */]: forEachChildInJSDocTag,
+ [346 /* JSDocPrivateTag */]: forEachChildInJSDocTag,
+ [347 /* JSDocProtectedTag */]: forEachChildInJSDocTag,
+ [348 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
+ [343 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
+ [349 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
+ [362 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
};
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
@@ -28639,6 +28700,9 @@ function forEachChildInClassDeclarationOrExpression(node, cbNode, cbNodes) {
function forEachChildInAnnotationDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
}
+function forEachChildInOverloadDeclaration(node, cbNode, cbNodes) {
+ return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
+}
function forEachChildInNamedImportsOrExports(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
}
@@ -28667,7 +28731,7 @@ function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
}
function forEachChild(node, cbNode, cbNodes) {
- if (node === void 0 || node.kind <= 164 /* LastToken */) {
+ if (node === void 0 || node.kind <= 165 /* LastToken */) {
return;
}
const fn = forEachChildTable[node.kind];
@@ -28702,7 +28766,7 @@ function forEachChildRecursively(rootNode, cbNode, cbNodes) {
continue;
return res;
}
- if (current.kind >= 165 /* FirstNode */) {
+ if (current.kind >= 166 /* FirstNode */) {
for (const child of gatherPossibleChildren(current)) {
queue.push(child);
parents.push(current);
@@ -29678,7 +29742,7 @@ var Parser;
parseErrorAtCurrentToken(diagnosticMessage, arg0);
}
const pos = getNodePos();
- const result = kind === 79 /* Identifier */ ? factory2.createIdentifier("", void 0, void 0) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, "", "", void 0) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral("", void 0) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral("", void 0) : kind === 285 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind);
+ const result = kind === 79 /* Identifier */ ? factory2.createIdentifier("", void 0, void 0) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, "", "", void 0) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral("", void 0) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral("", void 0) : kind === 288 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind);
return finishNode(result, pos);
}
function internIdentifier(text) {
@@ -29803,6 +29867,9 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
+ if (token() === 164 /* OverloadKeyword */) {
+ return true;
+ }
return canFollowExportModifier();
case 89 /* DefaultKeyword */:
return nextTokenCanFollowDefaultKeyword();
@@ -29827,7 +29894,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -30102,15 +30169,15 @@ var Parser;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 181 /* IndexSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 241 /* SemicolonClassElement */:
+ case 178 /* Constructor */:
+ case 183 /* IndexSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 243 /* SemicolonClassElement */:
return true;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return !inStructContext();
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
const methodDeclaration = node;
const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 136 /* ConstructorKeyword */;
return !nameIsConstructor;
@@ -30121,8 +30188,8 @@ var Parser;
function isReusableSwitchClause(node) {
if (node) {
switch (node.kind) {
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return true;
}
}
@@ -30131,66 +30198,66 @@ var Parser;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 244 /* VariableStatement */:
- case 242 /* Block */:
- case 246 /* IfStatement */:
- case 245 /* ExpressionStatement */:
- case 258 /* ThrowStatement */:
- case 254 /* ReturnStatement */:
- case 256 /* SwitchStatement */:
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 249 /* ForStatement */:
- case 248 /* WhileStatement */:
- case 255 /* WithStatement */:
- case 243 /* EmptyStatement */:
- case 259 /* TryStatement */:
- case 257 /* LabeledStatement */:
- case 247 /* DoStatement */:
- case 260 /* DebuggerStatement */:
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 246 /* VariableStatement */:
+ case 244 /* Block */:
+ case 248 /* IfStatement */:
+ case 247 /* ExpressionStatement */:
+ case 260 /* ThrowStatement */:
+ case 256 /* ReturnStatement */:
+ case 258 /* SwitchStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 250 /* WhileStatement */:
+ case 257 /* WithStatement */:
+ case 245 /* EmptyStatement */:
+ case 261 /* TryStatement */:
+ case 259 /* LabeledStatement */:
+ case 249 /* DoStatement */:
+ case 262 /* DebuggerStatement */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
}
}
return false;
}
function isReusableEnumMember(node) {
- return node.kind === 308 /* EnumMember */;
+ return node.kind === 311 /* EnumMember */;
}
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 170 /* PropertySignature */:
- case 179 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 171 /* PropertySignature */:
+ case 181 /* CallSignature */:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 261 /* VariableDeclaration */) {
+ if (node.kind !== 263 /* VariableDeclaration */) {
return false;
}
const variableDeclarator = node;
return variableDeclarator.initializer === void 0;
}
function isReusableParameter(node) {
- if (node.kind !== 168 /* Parameter */) {
+ if (node.kind !== 169 /* Parameter */) {
return false;
}
const parameter = node;
@@ -30481,14 +30548,14 @@ var Parser;
}
function typeHasArrowFunctionBlockingParseError(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return nodeIsMissing(node.typeName);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */: {
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */: {
const { parameters, type } = node;
return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type);
}
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return typeHasArrowFunctionBlockingParseError(node.type);
default:
return false;
@@ -30729,14 +30796,14 @@ var Parser;
function parseSignatureMember(kind) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
- if (kind === 180 /* ConstructSignature */) {
+ if (kind === 182 /* ConstructSignature */) {
parseExpected(104 /* NewKeyword */);
}
const typeParameters = parseTypeParameters();
const parameters = parseParameters(4 /* Type */);
const type = parseReturnType(58 /* ColonToken */, true);
parseTypeMemberSemicolon();
- const node = kind === 179 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type);
+ const node = kind === 181 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function isIndexSignature() {
@@ -30774,6 +30841,17 @@ var Parser;
node.illegalDecorators = decorators;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+ function parseOverloadPropertyDeclaration(pos, hasJSDoc, modifiers) {
+ const name = parsePropertyName();
+ const questionToken = parseOptionalToken(57 /* QuestionToken */);
+ let node;
+ const type = parseTypeAnnotation();
+ node = factory2.createOverloadPropertyDeclaration(modifiers, name, questionToken, type);
+ if (token() === 63 /* EqualsToken */)
+ node.initializer = parseInitializer();
+ parseTypeMemberSemicolon();
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
+ }
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
@@ -30815,19 +30893,19 @@ var Parser;
}
function parseTypeMember() {
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) {
- return parseSignatureMember(179 /* CallSignature */);
+ return parseSignatureMember(181 /* CallSignature */);
}
if (token() === 104 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) {
- return parseSignatureMember(180 /* ConstructSignature */);
+ return parseSignatureMember(182 /* ConstructSignature */);
}
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 177 /* GetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 179 /* GetAccessor */, 4 /* Type */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 178 /* SetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 180 /* SetAccessor */, 4 /* Type */);
}
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
@@ -31703,7 +31781,7 @@ var Parser;
return void 0;
}
let unwrappedType = type;
- while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 196 /* ParenthesizedType */) {
+ while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 198 /* ParenthesizedType */) {
unwrappedType = unwrappedType.type;
}
const hasJSDocFunctionType = unwrappedType && isJSDocFunctionType(unwrappedType);
@@ -31766,7 +31844,7 @@ var Parser;
return parseBinaryExpressionRest(precedence, leftOperand, pos);
}
function isInOrOfKeyword(t) {
- return t === 102 /* InKeyword */ || t === 164 /* OfKeyword */;
+ return t === 102 /* InKeyword */ || t === 165 /* OfKeyword */;
}
function parseBinaryExpressionRest(precedence, leftOperand, pos) {
while (true) {
@@ -31848,7 +31926,7 @@ var Parser;
if (token() === 42 /* AsteriskAsteriskToken */) {
const pos = skipTrivia(sourceText, simpleUnaryExpression.pos);
const { end } = simpleUnaryExpression;
- if (simpleUnaryExpression.kind === 216 /* TypeAssertionExpression */) {
+ if (simpleUnaryExpression.kind === 218 /* TypeAssertionExpression */) {
parseErrorAt(pos, end, Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
} else {
parseErrorAt(pos, end, Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator));
@@ -31971,11 +32049,11 @@ var Parser;
const pos = getNodePos();
const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext);
let result;
- if (opening.kind === 289 /* JsxOpeningElement */) {
+ if (opening.kind === 292 /* JsxOpeningElement */) {
let children = parseJsxChildren(opening);
let closingElement;
const lastChild = children[children.length - 1];
- if ((lastChild == null ? void 0 : lastChild.kind) === 287 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) {
+ if ((lastChild == null ? void 0 : lastChild.kind) === 290 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) {
const end = lastChild.children.end;
const newLast = finishNode(
factory2.createJsxElement(
@@ -31999,10 +32077,10 @@ var Parser;
}
}
result = finishNode(factory2.createJsxElement(opening, children, closingElement), pos);
- } else if (opening.kind === 292 /* JsxOpeningFragment */) {
+ } else if (opening.kind === 295 /* JsxOpeningFragment */) {
result = finishNode(factory2.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos);
} else {
- Debug.assert(opening.kind === 288 /* JsxSelfClosingElement */);
+ Debug.assert(opening.kind === 291 /* JsxSelfClosingElement */);
result = opening;
}
if (inExpressionContext && token() === 29 /* LessThanToken */) {
@@ -32058,7 +32136,7 @@ var Parser;
if (!child)
break;
list.push(child);
- if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 287 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) {
+ if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 290 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) {
break;
}
}
@@ -32266,7 +32344,7 @@ var Parser;
continue;
}
if (isTemplateStartOfTaggedTemplate()) {
- expression = !questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest(pos, expression, questionDotToken, void 0);
+ expression = !questionDotToken && expression.kind === 236 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest(pos, expression, questionDotToken, void 0);
continue;
}
if (!questionDotToken) {
@@ -32314,7 +32392,7 @@ var Parser;
}
}
if (typeArguments || token() === 20 /* OpenParenToken */) {
- if (!questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (!questionDotToken && expression.kind === 236 /* ExpressionWithTypeArguments */) {
typeArguments = expression.typeArguments;
expression = expression.expression;
}
@@ -32541,10 +32619,10 @@ var Parser;
const decorators = parseDecorators();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 177 /* GetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 0 /* None */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 178 /* SetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 0 /* None */);
}
const asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
const tokenIsIdentifier = isIdentifier2();
@@ -32614,7 +32692,7 @@ var Parser;
const expressionPos = getNodePos();
let expression = parseMemberExpressionRest(expressionPos, parsePrimaryExpression(), false);
let typeArguments;
- if (expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (expression.kind === 236 /* ExpressionWithTypeArguments */) {
typeArguments = expression.typeArguments;
expression = expression.expression;
}
@@ -32722,7 +32800,7 @@ var Parser;
}
}
let node;
- if (awaitToken ? parseExpected(164 /* OfKeyword */) : parseOptional(164 /* OfKeyword */)) {
+ if (awaitToken ? parseExpected(165 /* OfKeyword */) : parseOptional(165 /* OfKeyword */)) {
const expression = allowInAnd(() => parseAssignmentExpressionOrHigher(true));
parseExpected(21 /* CloseParenToken */);
node = factory2.createForOfStatement(awaitToken, initializer, expression, parseStatement());
@@ -32743,10 +32821,10 @@ var Parser;
function parseBreakOrContinueStatement(kind) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
- parseExpected(kind === 253 /* BreakStatement */ ? 81 /* BreakKeyword */ : 87 /* ContinueKeyword */);
+ parseExpected(kind === 255 /* BreakStatement */ ? 81 /* BreakKeyword */ : 87 /* ContinueKeyword */);
const label = canParseSemicolon() ? void 0 : parseIdentifier();
parseSemicolon();
- const node = kind === 253 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label);
+ const node = kind === 255 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseReturnStatement() {
@@ -32900,6 +32978,8 @@ var Parser;
return inEtsContext();
case 59 /* AtToken */:
return inAllowAnnotationContext() && nextToken() === 119 /* InterfaceKeyword */;
+ case 164 /* OverloadKeyword */:
+ return nextTokenIsIdentifierOnSameLine();
case 119 /* InterfaceKeyword */:
case 155 /* TypeKeyword */:
return nextTokenIsIdentifierOnSameLine();
@@ -33034,9 +33114,9 @@ var Parser;
case 98 /* ForKeyword */:
return parseForOrForInOrForOfStatement();
case 87 /* ContinueKeyword */:
- return parseBreakOrContinueStatement(252 /* ContinueStatement */);
+ return parseBreakOrContinueStatement(254 /* ContinueStatement */);
case 81 /* BreakKeyword */:
- return parseBreakOrContinueStatement(253 /* BreakStatement */);
+ return parseBreakOrContinueStatement(255 /* BreakStatement */);
case 106 /* ReturnKeyword */:
return parseReturnStatement();
case 117 /* WithKeyword */:
@@ -33052,6 +33132,7 @@ var Parser;
case 88 /* DebuggerKeyword */:
return parseDebuggerStatement();
case 59 /* AtToken */:
+ case 164 /* OverloadKeyword */:
return parseDeclaration();
case 133 /* AsyncKeyword */:
case 119 /* InterfaceKeyword */:
@@ -33100,6 +33181,19 @@ var Parser;
const node = factory2.createAnnotationDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+ function parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers) {
+ parseExpected(164 /* OverloadKeyword */);
+ const name = createIdentifier3(isBindingIdentifier());
+ let members;
+ if (parseExpected(18 /* OpenBraceToken */)) {
+ members = parseOverloadMembers();
+ parseExpected(19 /* CloseBraceToken */);
+ } else {
+ members = createMissingList();
+ }
+ const node = factory2.createOverloadDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
+ }
function parseDeclaration() {
var _a2, _b;
const pos = getNodePos();
@@ -33169,6 +33263,8 @@ var Parser;
return parseAnnotationDeclaration(pos, hasJSDoc, decorators, modifiers);
}
return parseDeclarationDefault(pos, decorators, modifiers);
+ case 164 /* OverloadKeyword */:
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
case 119 /* InterfaceKeyword */:
return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
case 155 /* TypeKeyword */:
@@ -33198,7 +33294,7 @@ var Parser;
}
function parseDeclarationDefault(pos, decorators, modifiers) {
if (decorators || modifiers) {
- const missing = createMissingNode(285 /* MissingDeclaration */, true, Diagnostics.Declaration_expected);
+ const missing = createMissingNode(288 /* MissingDeclaration */, true, Diagnostics.Declaration_expected);
setTextRangePos(missing, pos);
missing.illegalDecorators = decorators;
missing.modifiers = modifiers;
@@ -33308,7 +33404,7 @@ var Parser;
}
nextToken();
let declarations;
- if (token() === 164 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {
+ if (token() === 165 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {
declarations = createMissingList();
} else {
const savedDisallowIn = inDisallowInContext();
@@ -33338,7 +33434,7 @@ var Parser;
const asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
const name = modifierFlags & 1024 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier();
if (name && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
- fileStylesComponents.set(name.escapedText.toString(), 263 /* FunctionDeclaration */);
+ fileStylesComponents.set(name.escapedText.toString(), 265 /* FunctionDeclaration */);
}
const originalUICallbackContext = inUICallbackContext();
setEtsBuilderContext(hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions));
@@ -33442,7 +33538,7 @@ var Parser;
setUICallbackContext(inBuildContext() || inBuilderContext());
if (inStructContext() && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
if (methodName && currentStructName) {
- structStylesComponents.set(methodName, { structName: currentStructName, kind: 174 /* MethodDeclaration */ });
+ structStylesComponents.set(methodName, { structName: currentStructName, kind: 176 /* MethodDeclaration */ });
}
const stylesEtsComponentDecoratorNames = getEtsStylesDecoratorComponentNames(decorators, sourceFileCompilerOptions);
if (stylesEtsComponentDecoratorNames.length > 0) {
@@ -33531,7 +33627,7 @@ var Parser;
const parameters = parseParameters(0 /* None */);
const type = parseReturnType(58 /* ColonToken */, false);
const body = parseFunctionBlockOrSemicolon(flags);
- const node = kind === 177 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body);
+ const node = kind === 179 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body);
node.typeParameters = typeParameters;
if (isSetAccessorDeclaration(node))
node.type = type;
@@ -33743,10 +33839,10 @@ var Parser;
return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 177 /* GetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 0 /* None */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 178 /* SetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 0 /* None */);
}
if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers);
@@ -33782,35 +33878,35 @@ var Parser;
const hasJSDoc = hasPrecedingJSDocComment();
if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (parseContextualModifier(138 /* GetKeyword */)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (isIndexSignature()) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
@@ -33821,11 +33917,66 @@ var Parser;
}
return Debug.fail("Should not have attempted to parse annotation member declaration.");
}
+ function parseOverloadElement() {
+ const pos = getNodePos();
+ if (token() === 26 /* SemicolonToken */) {
+ parseErrorAt(pos, pos, Diagnostics.Unexpected_keyword_or_identifier);
+ }
+ const hasJSDoc = hasPrecedingJSDocComment();
+ if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (parseContextualModifier(138 /* GetKeyword */)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (parseContextualModifier(152 /* SetKeyword */)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (isIndexSignature()) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (tokenIsIdentifierOrKeyword(token())) {
+ const modifiers = parseModifiers();
+ let overloadPropertyDeclaration = parseOverloadPropertyDeclaration(pos, hasJSDoc, modifiers);
+ if (overloadPropertyDeclaration.kind === 174 /* OverloadPropertyDeclaration */) {
+ return overloadPropertyDeclaration;
+ }
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ return Debug.fail("Should not have attempted to parse annotation member declaration.");
+ }
function parseClassExpression() {
- return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0, 232 /* ClassExpression */);
+ return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0, 234 /* ClassExpression */);
}
function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) {
- return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 264 /* ClassDeclaration */);
+ return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 266 /* ClassDeclaration */);
}
function parseStructDeclaration(pos, hasJSDoc, decorators, modifiers) {
return parseStructDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers);
@@ -33846,7 +33997,7 @@ var Parser;
members = createMissingList();
}
setAwaitContext(savedAwaitContext);
- const node = kind === 264 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
+ const node = kind === 266 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseStructDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers) {
@@ -33910,7 +34061,7 @@ var Parser;
function parseExpressionWithTypeArguments() {
const pos = getNodePos();
const expression = parseLeftHandSideExpressionOrHigher();
- if (expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (expression.kind === 236 /* ExpressionWithTypeArguments */) {
return expression;
}
const typeArguments = tryParseTypeArguments();
@@ -33928,13 +34079,16 @@ var Parser;
function parseAnnotationMembers() {
return parseList(ParsingContext.AnnotationMembers, parseAnnotationElement);
}
+ function parseOverloadMembers() {
+ return parseList(ParsingContext.TypeMembers, parseOverloadElement);
+ }
function parseStructMembers(pos) {
const structMembers = parseList(ParsingContext.ClassMembers, parseClassElement);
const virtualStructMembers = [];
const virtualParameterProperties = [];
structMembers.forEach((member) => {
virtualStructMembers.push(member);
- if (member.kind === 171 /* PropertyDeclaration */) {
+ if (member.kind === 172 /* PropertyDeclaration */) {
const property = member;
virtualParameterProperties.push(
finishVirtualNode(
@@ -34181,7 +34335,7 @@ var Parser;
function parseImportClause(identifier, pos, isTypeOnly) {
let namedBindings;
if (!identifier || parseOptional(27 /* CommaToken */)) {
- namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(278 /* NamedImports */);
+ namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(281 /* NamedImports */);
}
return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos);
}
@@ -34214,15 +34368,15 @@ var Parser;
}
function parseNamedImportsOrExports(kind) {
const pos = getNodePos();
- const node = kind === 278 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */));
+ const node = kind === 281 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */));
return finishNode(node, pos);
}
function parseExportSpecifier() {
const hasJSDoc = hasPrecedingJSDocComment();
- return withJSDoc(parseImportOrExportSpecifier(284 /* ExportSpecifier */), hasJSDoc);
+ return withJSDoc(parseImportOrExportSpecifier(287 /* ExportSpecifier */), hasJSDoc);
}
function parseImportSpecifier() {
- return parseImportOrExportSpecifier(279 /* ImportSpecifier */);
+ return parseImportOrExportSpecifier(282 /* ImportSpecifier */);
}
function parseImportOrExportSpecifier(kind) {
const pos = getNodePos();
@@ -34266,10 +34420,10 @@ var Parser;
parseExpected(129 /* AsKeyword */);
name = parseNameWithKeywordCheck();
}
- if (kind === 279 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
+ if (kind === 282 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected);
}
- const node = kind === 279 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
+ const node = kind === 282 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
return finishNode(node, pos);
function parseNameWithKeywordCheck() {
checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2();
@@ -34296,7 +34450,7 @@ var Parser;
parseExpected(160 /* FromKeyword */);
moduleSpecifier = parseModuleSpecifier();
} else {
- exportClause = parseNamedImportsOrExports(282 /* NamedExports */);
+ exportClause = parseNamedImportsOrExports(285 /* NamedExports */);
if (token() === 160 /* FromKeyword */ || token() === 10 /* StringLiteral */ && !scanner2.hasPrecedingLineBreak()) {
parseExpected(160 /* FromKeyword */);
moduleSpecifier = parseModuleSpecifier();
@@ -34870,7 +35024,7 @@ var Parser;
switch (node.kind) {
case 150 /* ObjectKeyword */:
return true;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return isObjectOrObjectArrayTypeReference(node.elementType);
default:
return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments;
@@ -34900,12 +35054,12 @@ var Parser;
let child;
let children;
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) {
- if (child.kind === 349 /* JSDocParameterTag */ || child.kind === 356 /* JSDocPropertyTag */) {
+ if (child.kind === 352 /* JSDocParameterTag */ || child.kind === 359 /* JSDocPropertyTag */) {
children = append(children, child);
}
}
if (children) {
- const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 188 /* ArrayType */), pos);
+ const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 190 /* ArrayType */), pos);
return finishNode(factory2.createJSDocTypeExpression(literal), pos);
}
}
@@ -35018,7 +35172,7 @@ var Parser;
let hasChildren = false;
while (child = tryParse(() => parseChildPropertyTag(indent2))) {
hasChildren = true;
- if (child.kind === 352 /* JSDocTypeTag */) {
+ if (child.kind === 355 /* JSDocTypeTag */) {
if (childTypeTag) {
const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
if (lastError) {
@@ -35033,7 +35187,7 @@ var Parser;
}
}
if (hasChildren) {
- const isArrayType = typeExpression && typeExpression.type.kind === 188 /* ArrayType */;
+ const isArrayType = typeExpression && typeExpression.type.kind === 190 /* ArrayType */;
const jsdocTypeLiteral = factory2.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType);
typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral, start2);
end2 = typeExpression.end;
@@ -35084,7 +35238,7 @@ var Parser;
const returnTag = tryParse(() => {
if (parseOptionalJsdoc(59 /* AtToken */)) {
const tag = parseTag(indent2);
- if (tag && tag.kind === 350 /* JSDocReturnTag */) {
+ if (tag && tag.kind === 353 /* JSDocReturnTag */) {
return tag;
}
}
@@ -35118,7 +35272,7 @@ var Parser;
case 59 /* AtToken */:
if (canParseTag) {
const child = tryParseChildTag(target, indent2);
- if (child && (child.kind === 349 /* JSDocParameterTag */ || child.kind === 356 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
+ if (child && (child.kind === 352 /* JSDocParameterTag */ || child.kind === 359 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
return false;
}
return child;
@@ -37638,7 +37792,7 @@ function convertConfigFileToObject(sourceFile, errors, reportOptionsErrors, opti
var _a2;
const rootExpression = (_a2 = sourceFile.statements[0]) == null ? void 0 : _a2.expression;
const knownRootOptions = reportOptionsErrors ? getTsconfigRootOptionsMap() : void 0;
- if (rootExpression && rootExpression.kind !== 210 /* ObjectLiteralExpression */) {
+ if (rootExpression && rootExpression.kind !== 212 /* ObjectLiteralExpression */) {
errors.push(createDiagnosticForNodeInSourceFile(
sourceFile,
rootExpression,
@@ -37670,7 +37824,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) {
const result = returnValue ? {} : void 0;
for (const element of node.properties) {
- if (element.kind !== 305 /* PropertyAssignment */) {
+ if (element.kind !== 308 /* PropertyAssignment */) {
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element, Diagnostics.Property_assignment_expected));
continue;
}
@@ -37758,13 +37912,13 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
case 8 /* NumericLiteral */:
reportInvalidOptionValue(option && option.type !== "number");
return validateValue(Number(valueExpression.text));
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) {
break;
}
reportInvalidOptionValue(option && option.type !== "number");
return validateValue(-Number(valueExpression.operand.text));
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
reportInvalidOptionValue(option && option.type !== "object");
const objectLiteralExpression = valueExpression;
if (option) {
@@ -37783,7 +37937,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
void 0
));
}
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
reportInvalidOptionValue(option && option.type !== "list");
return validateValue(convertArrayLiteralExpressionToJson(
valueExpression.elements,
@@ -40828,7 +40982,7 @@ function getReservedDecoratorsOfEtsFile(node, host) {
}
function getReservedDecoratorsOfStructDeclaration(node, host) {
let reservedDecorators;
- if (node.parent.kind === 265 /* StructDeclaration */) {
+ if (node.parent.kind === 267 /* StructDeclaration */) {
reservedDecorators = ensureEtsDecorators(node, host);
}
return reservedDecorators;
@@ -41045,10 +41199,10 @@ function isTokenInsideBuilder(decorators, compilerOptions) {
return false;
}
function getEtsComponentExpressionInnerCallExpressionNode(node) {
- while (node && node.kind !== 220 /* EtsComponentExpression */) {
- if (node.kind === 213 /* CallExpression */) {
+ while (node && node.kind !== 222 /* EtsComponentExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
node = node.expression;
- } else if (node.kind === 211 /* PropertyAccessExpression */) {
+ } else if (node.kind === 213 /* PropertyAccessExpression */) {
node = node.expression;
} else {
node = void 0;
@@ -41061,7 +41215,7 @@ function getRootEtsComponentInnerCallExpressionNode(node) {
return node;
}
while (node) {
- const ancestor = getAncestor(isCallExpression(node) ? node.parent : node, 213 /* CallExpression */);
+ const ancestor = getAncestor(isCallExpression(node) ? node.parent : node, 215 /* CallExpression */);
const target = getRootEtsComponent(ancestor);
if (target && isInStateStylesObject(node)) {
return target;
@@ -41090,7 +41244,7 @@ function getEtsComponentExpressionInnerExpressionStatementNode(node) {
return void 0;
}
function isInStateStylesObject(node) {
- const ancestor = getAncestor(node, 210 /* ObjectLiteralExpression */);
+ const ancestor = getAncestor(node, 212 /* ObjectLiteralExpression */);
return ancestor !== void 0 && ancestor.parent !== void 0 && isPropertyAssignment(ancestor.parent);
}
function getEtsExtendDecoratorsComponentNames(decorators, compilerOptions) {
@@ -41098,7 +41252,7 @@ function getEtsExtendDecoratorsComponentNames(decorators, compilerOptions) {
const extendComponents = [];
const extendDecorator = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.extend) == null ? void 0 : _b.decorator) != null ? _c : "Extend";
decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (decorator.expression.kind === 213 /* CallExpression */) {
+ if (decorator.expression.kind === 215 /* CallExpression */) {
const identifier = decorator.expression.expression;
const args = decorator.expression.arguments;
if (identifier.kind === 79 /* Identifier */ && (extendDecorator == null ? void 0 : extendDecorator.includes(identifier.escapedText.toString())) && args.length) {
@@ -41115,7 +41269,7 @@ function getEtsStylesDecoratorComponentNames(decorators, compilerOptions) {
const stylesComponents = [];
const stylesDecorator = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.styles) == null ? void 0 : _b.decorator) != null ? _c : "Styles";
decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (decorator.kind === 169 /* Decorator */ && decorator.expression.kind === 79 /* Identifier */) {
+ if (decorator.kind === 170 /* Decorator */ && decorator.expression.kind === 79 /* Identifier */) {
const identifier = decorator.expression;
if (identifier.kind === 79 /* Identifier */ && identifier.escapedText === stylesDecorator) {
stylesComponents.push(identifier.escapedText);
@@ -41161,7 +41315,7 @@ function transformAnnotation(context) {
}
function visitAnnotationsDeclarations(node) {
switch (node.kind) {
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return visitAnnotationDeclaration(node);
default:
return visitEachChild(node, visitAnnotationsDeclarations, context);
@@ -41169,9 +41323,9 @@ function transformAnnotation(context) {
}
function visitAnnotations(node) {
switch (node.kind) {
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return visitImportSpecifier(node);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return visitAnnotation(node);
default:
return visitEachChild(node, visitAnnotations, context);
@@ -41211,14 +41365,14 @@ function transformAnnotation(context) {
return factory.createIdentifier(
annotationMagicNamePrefix + expr.escapedText
);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
const propAccessExpr = expr;
return factory.updatePropertyAccessExpression(
propAccessExpr,
propAccessExpr.expression,
addMagicPrefixToAnnotationNameIdentifier(propAccessExpr.name)
);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
const callExpr = expr;
return factory.updateCallExpression(
callExpr,
@@ -41299,16 +41453,16 @@ function transformTypeExportImportAndConstEnumInTypeScript(context) {
}
function visitImportExportAndConstEnumMember(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitConstEnum(node);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return visitEnumMember(node);
default:
return visitEachChild(node, visitImportExportAndConstEnumMember, context);
@@ -41354,7 +41508,7 @@ function transformTypeExportImportAndConstEnumInTypeScript(context) {
return name || namedBindings ? factory.updateImportClause(node, false, name, namedBindings) : void 0;
}
function visitNamedImportBindings(node) {
- if (node.kind === 277 /* NamespaceImport */) {
+ if (node.kind === 280 /* NamespaceImport */) {
if (resolver.isReferencedAliasDeclaration(node)) {
return node;
}
@@ -41954,23 +42108,23 @@ function getModuleInstanceStateCached(node, visited = new Map2()) {
}
function getModuleInstanceStateWorker(node, visited) {
switch (node.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return 0 /* NonInstantiated */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (isEnumConst(node)) {
return 2 /* ConstEnumOnly */;
}
break;
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
if (!hasSyntacticModifier(node, 1 /* Export */)) {
return 0 /* NonInstantiated */;
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportDeclaration = node;
- if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 282 /* NamedExports */) {
+ if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 285 /* NamedExports */) {
let state = 0 /* NonInstantiated */;
for (const specifier of exportDeclaration.exportClause.elements) {
const specifierState = getModuleInstanceStateForAliasTarget(specifier, visited);
@@ -41984,7 +42138,7 @@ function getModuleInstanceStateWorker(node, visited) {
return state;
}
break;
- case 271 /* ModuleBlock */: {
+ case 274 /* ModuleBlock */: {
let state = 0 /* NonInstantiated */;
forEachChild(node, (n) => {
const childState = getModuleInstanceStateCached(n, visited);
@@ -42003,7 +42157,7 @@ function getModuleInstanceStateWorker(node, visited) {
});
return state;
}
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return getModuleInstanceState(node, visited);
case 79 /* Identifier */:
if (node.isInJSDocNamespace) {
@@ -42175,7 +42329,7 @@ function createBinder() {
}
}
function getDeclarationName(node) {
- if (node.kind === 280 /* ExportAssignment */) {
+ if (node.kind === 283 /* ExportAssignment */) {
return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
}
const name = getNameOfDeclaration(node);
@@ -42184,7 +42338,7 @@ function createBinder() {
const moduleName = getTextOfIdentifierOrLiteral(name);
return isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName}"`;
}
- if (name.kind === 166 /* ComputedPropertyName */) {
+ if (name.kind === 167 /* ComputedPropertyName */) {
const nameExpression = name.expression;
if (isStringOrNumericLiteralLike(nameExpression)) {
return escapeLeadingUnderscores(nameExpression.text);
@@ -42206,30 +42360,30 @@ function createBinder() {
return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0;
}
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return "__constructor" /* Constructor */;
- case 184 /* FunctionType */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
+ case 186 /* FunctionType */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
return "__call" /* Call */;
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
return "__new" /* New */;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return "__index" /* Index */;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return "__export" /* ExportStar */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return "export=" /* ExportEquals */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) {
return "export=" /* ExportEquals */;
}
Debug.fail("Unknown binary declaration kind");
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */;
- case 168 /* Parameter */:
- Debug.assert(node.parent.kind === 326 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
+ case 169 /* Parameter */:
+ Debug.assert(node.parent.kind === 329 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
const functionType = node.parent;
const index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -42276,7 +42430,7 @@ function createBinder() {
messageNeedsName = false;
multipleDefaultExports = true;
} else {
- if (symbol.declarations && symbol.declarations.length && (node.kind === 280 /* ExportAssignment */ && !node.isExportEquals)) {
+ if (symbol.declarations && symbol.declarations.length && (node.kind === 283 /* ExportAssignment */ && !node.isExportEquals)) {
message = Diagnostics.A_module_cannot_have_multiple_default_exports;
messageNeedsName = false;
multipleDefaultExports = true;
@@ -42315,7 +42469,7 @@ function createBinder() {
function declareModuleMember(node, symbolFlags, symbolExcludes) {
const hasExportModifier = !!(getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node);
if (symbolFlags & 2097152 /* Alias */) {
- if (node.kind === 284 /* ExportSpecifier */ || node.kind === 274 /* ImportEqualsDeclaration */ && hasExportModifier) {
+ if (node.kind === 287 /* ExportSpecifier */ || node.kind === 277 /* ImportEqualsDeclaration */ && hasExportModifier) {
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
} else {
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
@@ -42359,7 +42513,7 @@ function createBinder() {
const saveThisParentContainer = thisParentContainer;
const savedBlockScopeContainer = blockScopeContainer;
if (containerFlags & 1 /* IsContainer */) {
- if (node.kind !== 219 /* ArrowFunction */) {
+ if (node.kind !== 221 /* ArrowFunction */) {
thisParentContainer = container;
}
container = blockScopeContainer = node;
@@ -42379,14 +42533,14 @@ function createBinder() {
const saveExceptionTarget = currentExceptionTarget;
const saveActiveLabelList = activeLabelList;
const saveHasExplicitReturn = hasExplicitReturn;
- const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 512 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */;
+ const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 512 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 177 /* ClassStaticBlockDeclaration */;
if (!isImmediatelyInvoked) {
currentFlow = initFlowNode({ flags: 2 /* Start */ });
if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) {
currentFlow.node = node;
}
}
- currentReturnTarget = isImmediatelyInvoked || node.kind === 176 /* Constructor */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */) ? createBranchLabel() : void 0;
+ currentReturnTarget = isImmediatelyInvoked || node.kind === 178 /* Constructor */ || isInJSFile(node) && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */) ? createBranchLabel() : void 0;
currentExceptionTarget = void 0;
currentBreakTarget = void 0;
currentContinueTarget = void 0;
@@ -42400,14 +42554,14 @@ function createBinder() {
node.flags |= 512 /* HasExplicitReturn */;
node.endFlowNode = currentFlow;
}
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
node.flags |= emitFlags;
node.endFlowNode = currentFlow;
}
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
currentFlow = finishFlowLabel(currentReturnTarget);
- if (node.kind === 176 /* Constructor */ || node.kind === 175 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) {
+ if (node.kind === 178 /* Constructor */ || node.kind === 177 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */)) {
node.returnFlowNode = currentFlow;
}
}
@@ -42432,8 +42586,8 @@ function createBinder() {
blockScopeContainer = savedBlockScopeContainer;
}
function bindEachFunctionsFirst(nodes) {
- bindEach(nodes, (n) => n.kind === 263 /* FunctionDeclaration */ ? bind(n) : void 0);
- bindEach(nodes, (n) => n.kind !== 263 /* FunctionDeclaration */ ? bind(n) : void 0);
+ bindEach(nodes, (n) => n.kind === 265 /* FunctionDeclaration */ ? bind(n) : void 0);
+ bindEach(nodes, (n) => n.kind !== 265 /* FunctionDeclaration */ ? bind(n) : void 0);
}
function bindEach(nodes, bindFunction = bind) {
if (nodes === void 0) {
@@ -42453,59 +42607,59 @@ function createBinder() {
inAssignmentPattern = saveInAssignmentPattern;
return;
}
- if (node.kind >= 244 /* FirstStatement */ && node.kind <= 260 /* LastStatement */ && !options.allowUnreachableCode) {
+ if (node.kind >= 246 /* FirstStatement */ && node.kind <= 262 /* LastStatement */ && !options.allowUnreachableCode) {
node.flowNode = currentFlow;
}
switch (node.kind) {
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
bindWhileStatement(node);
break;
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
bindDoStatement(node);
break;
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
bindForStatement(node);
break;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
bindForInOrForOfStatement(node);
break;
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
bindIfStatement(node);
break;
- case 254 /* ReturnStatement */:
- case 258 /* ThrowStatement */:
+ case 256 /* ReturnStatement */:
+ case 260 /* ThrowStatement */:
bindReturnOrThrow(node);
break;
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
bindBreakOrContinueStatement(node);
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
bindTryStatement(node);
break;
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
bindSwitchStatement(node);
break;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
bindCaseBlock(node);
break;
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
bindCaseClause(node);
break;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
bindExpressionStatement(node);
break;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
bindLabeledStatement(node);
break;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
bindPrefixUnaryExpressionFlow(node);
break;
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
bindPostfixUnaryExpressionFlow(node);
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
inAssignmentPattern = saveInAssignmentPattern;
bindDestructuringAssignmentFlow(node);
@@ -42513,49 +42667,49 @@ function createBinder() {
}
bindBinaryExpressionFlow(node);
break;
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
bindDeleteExpressionFlow(node);
break;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
bindConditionalExpressionFlow(node);
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
bindVariableDeclarationFlow(node);
break;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
bindAccessExpressionFlow(node);
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
bindCallExpressionFlow(node);
break;
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
bindNonNullExpressionFlow(node);
break;
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
bindJSDocTypeAlias(node);
break;
- case 314 /* SourceFile */: {
+ case 317 /* SourceFile */: {
bindEachFunctionsFirst(node.statements);
bind(node.endOfFileToken);
break;
}
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
bindEachFunctionsFirst(node.statements);
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
bindBindingElementFlow(node);
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
bindParameterFlow(node);
break;
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 305 /* PropertyAssignment */:
- case 231 /* SpreadElement */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 308 /* PropertyAssignment */:
+ case 233 /* SpreadElement */:
inAssignmentPattern = saveInAssignmentPattern;
default:
bindEachChild(node);
@@ -42569,19 +42723,19 @@ function createBinder() {
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
case 109 /* ThisKeyword */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return containsNarrowableReference(expr);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return hasNarrowableArgument(expr);
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return isNarrowingExpression(expr.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isNarrowingBinaryExpression(expr);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return isNarrowingExpression(expr.expression);
}
return false;
@@ -42600,7 +42754,7 @@ function createBinder() {
}
}
}
- if (expr.expression.kind === 211 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) {
+ if (expr.expression.kind === 213 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) {
return true;
}
return false;
@@ -42631,9 +42785,9 @@ function createBinder() {
}
function isNarrowableOperand(expr) {
switch (expr.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isNarrowableOperand(expr.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (expr.operatorToken.kind) {
case 63 /* EqualsToken */:
return isNarrowableOperand(expr.left);
@@ -42706,24 +42860,24 @@ function createBinder() {
function isStatementCondition(node) {
const parent3 = node.parent;
switch (parent3.kind) {
- case 246 /* IfStatement */:
- case 248 /* WhileStatement */:
- case 247 /* DoStatement */:
+ case 248 /* IfStatement */:
+ case 250 /* WhileStatement */:
+ case 249 /* DoStatement */:
return parent3.expression === node;
- case 249 /* ForStatement */:
- case 228 /* ConditionalExpression */:
+ case 251 /* ForStatement */:
+ case 230 /* ConditionalExpression */:
return parent3.condition === node;
}
return false;
}
function isLogicalExpression(node) {
while (true) {
- if (node.kind === 217 /* ParenthesizedExpression */) {
+ if (node.kind === 219 /* ParenthesizedExpression */) {
node = node.expression;
- } else if (node.kind === 225 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
+ } else if (node.kind === 227 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
node = node.operand;
} else {
- return node.kind === 227 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */);
+ return node.kind === 229 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */);
}
}
}
@@ -42764,7 +42918,7 @@ function createBinder() {
}
function setContinueTarget(node, target) {
let label = activeLabelList;
- while (label && node.parent.kind === 257 /* LabeledStatement */) {
+ while (label && node.parent.kind === 259 /* LabeledStatement */) {
label.continueTarget = target;
label = label.next;
node = node.parent;
@@ -42815,12 +42969,12 @@ function createBinder() {
bind(node.expression);
addAntecedent(preLoopLabel, currentFlow);
currentFlow = preLoopLabel;
- if (node.kind === 251 /* ForOfStatement */) {
+ if (node.kind === 253 /* ForOfStatement */) {
bind(node.awaitModifier);
}
addAntecedent(postLoopLabel, currentFlow);
bind(node.initializer);
- if (node.initializer.kind !== 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind !== 264 /* VariableDeclarationList */) {
bindAssignmentTargetFlow(node.initializer);
}
bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
@@ -42842,7 +42996,7 @@ function createBinder() {
}
function bindReturnOrThrow(node) {
bind(node.expression);
- if (node.kind === 254 /* ReturnStatement */) {
+ if (node.kind === 256 /* ReturnStatement */) {
hasExplicitReturn = true;
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
@@ -42859,7 +43013,7 @@ function createBinder() {
return void 0;
}
function bindBreakOrContinueFlow(node, breakTarget, continueTarget) {
- const flowLabel = node.kind === 253 /* BreakStatement */ ? breakTarget : continueTarget;
+ const flowLabel = node.kind === 255 /* BreakStatement */ ? breakTarget : continueTarget;
if (flowLabel) {
addAntecedent(flowLabel, currentFlow);
currentFlow = unreachableFlow;
@@ -42929,7 +43083,7 @@ function createBinder() {
preSwitchCaseFlow = currentFlow;
bind(node.caseBlock);
addAntecedent(postSwitchLabel, currentFlow);
- const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 299 /* DefaultClause */);
+ const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 302 /* DefaultClause */);
node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents;
if (!hasDefault) {
addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0));
@@ -42972,7 +43126,7 @@ function createBinder() {
maybeBindExpressionFlowIfCall(node.expression);
}
function maybeBindExpressionFlowIfCall(node) {
- if (node.kind === 213 /* CallExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
const call = node;
if (call.expression.kind !== 107 /* SuperKeyword */ && isDottedName(call.expression)) {
currentFlow = createFlowCall(currentFlow, call);
@@ -42998,7 +43152,7 @@ function createBinder() {
currentFlow = finishFlowLabel(postStatementLabel);
}
function bindDestructuringTargetFlow(node) {
- if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */) {
+ if (node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */) {
bindAssignmentTargetFlow(node.left);
} else {
bindAssignmentTargetFlow(node);
@@ -43007,21 +43161,21 @@ function createBinder() {
function bindAssignmentTargetFlow(node) {
if (isNarrowableReference(node)) {
currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node);
- } else if (node.kind === 209 /* ArrayLiteralExpression */) {
+ } else if (node.kind === 211 /* ArrayLiteralExpression */) {
for (const e of node.elements) {
- if (e.kind === 231 /* SpreadElement */) {
+ if (e.kind === 233 /* SpreadElement */) {
bindAssignmentTargetFlow(e.expression);
} else {
bindDestructuringTargetFlow(e);
}
}
- } else if (node.kind === 210 /* ObjectLiteralExpression */) {
+ } else if (node.kind === 212 /* ObjectLiteralExpression */) {
for (const p of node.properties) {
- if (p.kind === 305 /* PropertyAssignment */) {
+ if (p.kind === 308 /* PropertyAssignment */) {
bindDestructuringTargetFlow(p.initializer);
- } else if (p.kind === 306 /* ShorthandPropertyAssignment */) {
+ } else if (p.kind === 309 /* ShorthandPropertyAssignment */) {
bindAssignmentTargetFlow(p.name);
- } else if (p.kind === 307 /* SpreadAssignment */) {
+ } else if (p.kind === 310 /* SpreadAssignment */) {
bindAssignmentTargetFlow(p.expression);
}
}
@@ -43144,7 +43298,7 @@ function createBinder() {
const operator = node.operatorToken.kind;
if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
- if (operator === 63 /* EqualsToken */ && node.left.kind === 212 /* ElementAccessExpression */) {
+ if (operator === 63 /* EqualsToken */ && node.left.kind === 214 /* ElementAccessExpression */) {
const elementAccess = node.left;
if (isNarrowableOperand(elementAccess.expression)) {
currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
@@ -43172,7 +43326,7 @@ function createBinder() {
}
function bindDeleteExpressionFlow(node) {
bindEachChild(node);
- if (node.expression.kind === 211 /* PropertyAccessExpression */) {
+ if (node.expression.kind === 213 /* PropertyAccessExpression */) {
bindAssignmentTargetFlow(node.expression);
}
}
@@ -43237,7 +43391,7 @@ function createBinder() {
}
function bindJSDocTypeAlias(node) {
bind(node.tagName);
- if (node.kind !== 348 /* JSDocEnumTag */ && node.fullName) {
+ if (node.kind !== 351 /* JSDocEnumTag */ && node.fullName) {
setParent(node.fullName, node);
setParentRecursive(node.fullName, false);
}
@@ -43248,7 +43402,7 @@ function createBinder() {
function bindJSDocClassTag(node) {
bindEachChild(node);
const host = getHostSignatureFromJSDoc(node);
- if (host && host.kind !== 174 /* MethodDeclaration */) {
+ if (host && host.kind !== 176 /* MethodDeclaration */) {
addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
}
}
@@ -43261,15 +43415,15 @@ function createBinder() {
}
function bindOptionalChainRest(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
bind(node.questionDotToken);
bind(node.name);
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
bind(node.questionDotToken);
bind(node.argumentExpression);
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
bind(node.questionDotToken);
bindEach(node.typeArguments);
bindEach(node.arguments);
@@ -43316,7 +43470,7 @@ function createBinder() {
bindOptionalChainFlow(node);
} else {
const expr = skipParentheses(node.expression);
- if (expr.kind === 218 /* FunctionExpression */ || expr.kind === 219 /* ArrowFunction */) {
+ if (expr.kind === 220 /* FunctionExpression */ || expr.kind === 221 /* ArrowFunction */) {
bindEach(node.typeArguments);
bindEach(node.arguments);
bind(node.expression);
@@ -43327,7 +43481,7 @@ function createBinder() {
}
}
}
- if (node.expression.kind === 211 /* PropertyAccessExpression */) {
+ if (node.expression.kind === 213 /* PropertyAccessExpression */) {
const propertyAccess = node.expression;
if (isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && isPushOrUnshiftIdentifier(propertyAccess.name)) {
currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
@@ -43336,58 +43490,60 @@ function createBinder() {
}
function getContainerFlags(node) {
switch (node.kind) {
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 269 /* EnumDeclaration */:
- case 210 /* ObjectLiteralExpression */:
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 295 /* JsxAttributes */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 212 /* ObjectLiteralExpression */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 298 /* JsxAttributes */:
return 1 /* IsContainer */;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return 1 /* IsContainer */ | 64 /* IsInterface */;
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 200 /* MappedType */:
- case 181 /* IndexSignature */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 202 /* MappedType */:
+ case 183 /* IndexSignature */:
return 1 /* IsContainer */ | 32 /* HasLocals */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
}
- case 176 /* Constructor */:
- case 263 /* FunctionDeclaration */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
- case 326 /* JSDocFunctionType */:
- case 184 /* FunctionType */:
- case 180 /* ConstructSignature */:
- case 185 /* ConstructorType */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 265 /* FunctionDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
+ case 329 /* JSDocFunctionType */:
+ case 186 /* FunctionType */:
+ case 182 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 177 /* ClassStaticBlockDeclaration */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return 4 /* IsControlFlowContainer */;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
- case 301 /* CatchClause */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 272 /* CaseBlock */:
+ case 304 /* CatchClause */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 275 /* CaseBlock */:
return 2 /* IsBlockScopedContainer */;
- case 242 /* Block */:
+ case 244 /* Block */:
return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */;
}
return 0 /* None */;
@@ -43400,43 +43556,44 @@ function createBinder() {
}
function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) {
switch (container.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return declareModuleMember(node, symbolFlags, symbolExcludes);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
return declareClassMember(node, symbolFlags, symbolExcludes);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 210 /* ObjectLiteralExpression */:
- case 267 /* InterfaceDeclaration */:
- case 295 /* JsxAttributes */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 212 /* ObjectLiteralExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 298 /* JsxAttributes */:
return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 332 /* JSDocSignature */:
- case 181 /* IndexSignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 326 /* JSDocFunctionType */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 175 /* ClassStaticBlockDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 200 /* MappedType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 335 /* JSDocSignature */:
+ case 183 /* IndexSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 329 /* JSDocFunctionType */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 202 /* MappedType */:
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
}
}
@@ -43522,10 +43679,10 @@ function createBinder() {
}
function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {
switch (blockScopeContainer.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (isExternalOrCommonJsModule(container)) {
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
@@ -43715,7 +43872,7 @@ function createBinder() {
}
function checkStrictModeFunctionDeclaration(node) {
if (languageVersion < 2 /* ES2015 */) {
- if (blockScopeContainer.kind !== 314 /* SourceFile */ && blockScopeContainer.kind !== 270 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
+ if (blockScopeContainer.kind !== 317 /* SourceFile */ && blockScopeContainer.kind !== 273 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
const errorSpan = getErrorSpanForNode(file, node);
file.bindDiagnostics.push(createFileDiagnostic(
file,
@@ -43782,7 +43939,7 @@ function createBinder() {
node.tracingPath = file.path;
const saveInStrictMode = inStrictMode;
bindWorker(node);
- if (node.kind > 164 /* LastToken */) {
+ if (node.kind > 165 /* LastToken */) {
const saveParent = parent2;
parent2 = node;
const containerFlags = getContainerFlags(node);
@@ -43844,23 +44001,23 @@ function createBinder() {
break;
}
case 109 /* ThisKeyword */:
- if (currentFlow && (isExpression(node) || parent2.kind === 306 /* ShorthandPropertyAssignment */)) {
+ if (currentFlow && (isExpression(node) || parent2.kind === 309 /* ShorthandPropertyAssignment */)) {
node.flowNode = currentFlow;
}
return checkContextualIdentifier(node);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
if (currentFlow && isPartOfTypeQuery(node)) {
node.flowNode = currentFlow;
}
break;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
case 107 /* SuperKeyword */:
node.flowNode = currentFlow;
break;
case 80 /* PrivateIdentifier */:
return checkPrivateIdentifier(node);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = node;
if (currentFlow && isNarrowableReference(expr)) {
expr.flowNode = currentFlow;
@@ -43878,7 +44035,7 @@ function createBinder() {
);
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const specialKind = getAssignmentDeclarationKind(node);
switch (specialKind) {
case 1 /* ExportsProperty */:
@@ -43913,79 +44070,80 @@ function createBinder() {
Debug.fail("Unknown binary expression special property assignment kind");
}
return checkStrictModeBinaryExpression(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return checkStrictModeCatchClause(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return checkStrictModeDeleteExpression(node);
case 8 /* NumericLiteral */:
return checkStrictModeNumericLiteral(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return checkStrictModePostfixUnaryExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return checkStrictModePrefixUnaryExpression(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return checkStrictModeWithStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return checkStrictModeLabeledStatement(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
seenThisKeyword = true;
return;
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
break;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return bindTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return bindParameter(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return bindVariableDeclarationOrBindingElement(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
node.flowNode = currentFlow;
return bindVariableDeclarationOrBindingElement(node);
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 174 /* OverloadPropertyDeclaration */:
return bindPropertyWorker(node);
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */);
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return bindPropertyOrMethodOrAccessor(
node,
8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */),
isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */
);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return bindFunctionDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, 0 /* None */);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */);
- case 184 /* FunctionType */:
- case 326 /* JSDocFunctionType */:
- case 332 /* JSDocSignature */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 329 /* JSDocFunctionType */:
+ case 335 /* JSDocSignature */:
+ case 187 /* ConstructorType */:
return bindFunctionOrConstructorType(node);
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 200 /* MappedType */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 202 /* MappedType */:
return bindAnonymousTypeWorker(node);
- case 341 /* JSDocClassTag */:
+ case 344 /* JSDocClassTag */:
return bindJSDocClassTag(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return bindObjectLiteralExpression(node);
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return bindFunctionExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
const assignmentKind = getAssignmentDeclarationKind(node);
switch (assignmentKind) {
case 7 /* ObjectDefinePropertyValue */:
@@ -44003,61 +44161,63 @@ function createBinder() {
bindCallExpression(node);
}
break;
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
inStrictMode = true;
return bindClassLikeDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return bindAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return bindOverloadDeclaration(node);
+ case 270 /* InterfaceDeclaration */:
return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return bindEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return bindModuleDeclaration(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return bindJsxAttributes(node);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */);
- case 274 /* ImportEqualsDeclaration */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return bindNamespaceExportDeclaration(node);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return bindImportClause(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return bindExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return bindExportAssignment(node);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
updateStrictModeStatementList(node.statements);
return bindSourceFileIfExternalModule();
- case 242 /* Block */:
+ case 244 /* Block */:
if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) {
return;
}
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return updateStrictModeStatementList(node.statements);
- case 349 /* JSDocParameterTag */:
- if (node.parent.kind === 332 /* JSDocSignature */) {
+ case 352 /* JSDocParameterTag */:
+ if (node.parent.kind === 335 /* JSDocSignature */) {
return bindParameter(node);
}
- if (node.parent.kind !== 331 /* JSDocTypeLiteral */) {
+ if (node.parent.kind !== 334 /* JSDocTypeLiteral */) {
break;
}
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
const propTag = node;
- const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 325 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
+ const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 328 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */);
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
}
}
@@ -44195,8 +44355,8 @@ function createBinder() {
}
const thisContainer = getThisContainer(node, false);
switch (thisContainer.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
let constructorSymbol = thisContainer.symbol;
if (isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 63 /* EqualsToken */) {
const l = thisContainer.parent.left;
@@ -44214,13 +44374,14 @@ function createBinder() {
addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */);
}
break;
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
const containingClass = thisContainer.parent;
const symbolTable = isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members;
if (hasDynamicName(node)) {
@@ -44229,7 +44390,7 @@ function createBinder() {
declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, true);
}
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (hasDynamicName(node)) {
break;
} else if (thisContainer.commonJsModuleIndicator) {
@@ -44254,7 +44415,7 @@ function createBinder() {
function bindSpecialPropertyDeclaration(node) {
if (node.expression.kind === 109 /* ThisKeyword */) {
bindThisPropertyAssignment(node);
- } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 314 /* SourceFile */) {
+ } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 317 /* SourceFile */) {
if (isPrototypeAccess(node.expression)) {
bindPrototypePropertyAssignment(node, node.parent);
} else {
@@ -44284,7 +44445,7 @@ function createBinder() {
}
function bindObjectDefinePropertyAssignment(node) {
let namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]);
- const isToplevel = node.parent.parent.kind === 314 /* SourceFile */;
+ const isToplevel = node.parent.parent.kind === 317 /* SourceFile */;
namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, false, false);
bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, false);
}
@@ -44370,7 +44531,7 @@ function createBinder() {
declareSymbol(symbolTable, namespaceSymbol, declaration, includes | 67108864 /* Assignment */, excludes & ~67108864 /* Assignment */);
}
function isTopLevelNamespaceAssignment(propertyAccess) {
- return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 314 /* SourceFile */ : propertyAccess.parent.parent.kind === 314 /* SourceFile */;
+ return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 317 /* SourceFile */ : propertyAccess.parent.parent.kind === 317 /* SourceFile */;
}
function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) {
let namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer);
@@ -44428,7 +44589,7 @@ function createBinder() {
}
}
function bindClassLikeDeclaration(node) {
- if (node.kind === 264 /* ClassDeclaration */ || node.kind === 265 /* StructDeclaration */) {
+ if (node.kind === 266 /* ClassDeclaration */ || node.kind === 267 /* StructDeclaration */) {
bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */);
} else {
const bindingName = node.name ? node.name.escapedText : "__class" /* Class */;
@@ -44450,7 +44611,7 @@ function createBinder() {
prototypeSymbol.parent = symbol;
}
function bindAnnotationDeclaration(node) {
- Debug.assert(node.kind === 266 /* AnnotationDeclaration */);
+ Debug.assert(node.kind === 268 /* AnnotationDeclaration */);
bindBlockScopedDeclaration(node, 32 /* Class */ | 268435456 /* Annotation */, 899503 /* ClassExcludes */);
const { symbol } = node;
const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype");
@@ -44464,6 +44625,21 @@ function createBinder() {
symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);
prototypeSymbol.parent = symbol;
}
+ function bindOverloadDeclaration(node) {
+ Debug.assert(node.kind === 269 /* OverloadDeclaration */);
+ bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */);
+ const { symbol } = node;
+ const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype");
+ const symbolExport = symbol.exports.get(prototypeSymbol.escapedName);
+ if (symbolExport) {
+ if (node.name) {
+ setParent(node.name, node);
+ }
+ file.bindDiagnostics.push(createDiagnosticForNode2(symbolExport.declarations[0], Diagnostics.Duplicate_identifier_0, symbolName(prototypeSymbol)));
+ }
+ symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);
+ prototypeSymbol.parent = symbol;
+ }
function bindEnumDeclaration(node) {
return isEnumConst(node) ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */);
}
@@ -44472,7 +44648,7 @@ function createBinder() {
checkStrictModeEvalOrArguments(node, node.name);
}
if (!isBindingPattern(node.name)) {
- const possibleVariableDecl = node.kind === 261 /* VariableDeclaration */ ? node : node.parent.parent;
+ const possibleVariableDecl = node.kind === 263 /* VariableDeclaration */ ? node : node.parent.parent;
if (isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) {
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
} else if (isBlockOrCatchScoped(node)) {
@@ -44485,7 +44661,7 @@ function createBinder() {
}
}
function bindParameter(node) {
- if (node.kind === 349 /* JSDocParameterTag */ && container.kind !== 332 /* JSDocSignature */) {
+ if (node.kind === 352 /* JSDocParameterTag */ && container.kind !== 335 /* JSDocSignature */) {
return;
}
if (inStrictMode && !(node.flags & 16777216 /* Ambient */)) {
@@ -44552,7 +44728,7 @@ function createBinder() {
} else {
declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
}
- } else if (node.parent.kind === 195 /* InferType */) {
+ } else if (node.parent.kind === 197 /* InferType */) {
const container2 = getInferTypeContainer(node.parent);
if (container2) {
if (!container2.locals) {
@@ -44575,7 +44751,7 @@ function createBinder() {
return false;
}
if (currentFlow === unreachableFlow) {
- const reportError = isStatementButNotDeclaration(node) && node.kind !== 243 /* EmptyStatement */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 270 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
+ const reportError = isStatementButNotDeclaration(node) && node.kind !== 245 /* EmptyStatement */ || node.kind === 266 /* ClassDeclaration */ || node.kind === 273 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
if (reportError) {
currentFlow = reportedUnreachableFlow;
if (!options.allowUnreachableCode) {
@@ -44601,12 +44777,12 @@ function isExecutableStatement(s) {
}
function isPurelyTypeDeclaration(s) {
switch (s.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return getModuleInstanceState(s) !== 1 /* Instantiated */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return hasSyntacticModifier(s, 2048 /* Const */);
default:
return false;
@@ -44788,7 +44964,7 @@ function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignatu
symbol.exports.forEach(visitSymbol);
}
forEach(symbol.declarations, (d) => {
- if (d.type && d.type.kind === 186 /* TypeQuery */) {
+ if (d.type && d.type.kind === 188 /* TypeQuery */) {
const query = d.type;
const entity = getResolvedSymbol(getFirstIdentifier2(query.exprName));
visitSymbol(entity);
@@ -46854,7 +47030,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks());
}
function isGlobalSourceFile(node) {
- return node.kind === 314 /* SourceFile */ && !isExternalOrCommonJsModule(node);
+ return node.kind === 317 /* SourceFile */ && !isExternalOrCommonJsModule(node);
}
function isValidFromLibs(symbol, node) {
var _a2;
@@ -46931,13 +47107,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile);
}
if (declaration.pos <= usage.pos && !(isPropertyDeclaration(declaration) && isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) {
- if (declaration.kind === 208 /* BindingElement */) {
- const errorBindingElement = getAncestor(usage, 208 /* BindingElement */);
+ if (declaration.kind === 210 /* BindingElement */) {
+ const errorBindingElement = getAncestor(usage, 210 /* BindingElement */);
if (errorBindingElement) {
return findAncestor(errorBindingElement, isBindingElement) !== findAncestor(declaration, isBindingElement) || declaration.pos < errorBindingElement.pos;
}
- return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 261 /* VariableDeclaration */), usage);
- } else if (declaration.kind === 261 /* VariableDeclaration */) {
+ return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 263 /* VariableDeclaration */), usage);
+ } else if (declaration.kind === 263 /* VariableDeclaration */) {
return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
} else if (isClassDeclaration(declaration)) {
return !findAncestor(usage, (n) => isComputedPropertyName(n) && n.parent.parent === declaration);
@@ -46948,10 +47124,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return true;
}
- if (usage.parent.kind === 284 /* ExportSpecifier */ || usage.parent.kind === 280 /* ExportAssignment */ && usage.parent.isExportEquals) {
+ if (usage.parent.kind === 287 /* ExportSpecifier */ || usage.parent.kind === 283 /* ExportAssignment */ && usage.parent.isExportEquals) {
return true;
}
- if (usage.kind === 280 /* ExportAssignment */ && usage.isExportEquals) {
+ if (usage.kind === 283 /* ExportAssignment */ && usage.isExportEquals) {
return true;
}
if (!!(usage.flags & 8388608 /* JSDoc */) || isInTypeQuery(usage) || usageInTypeDeclaration()) {
@@ -46970,9 +47146,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration2, usage2) {
switch (declaration2.parent.parent.kind) {
- case 244 /* VariableStatement */:
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
+ case 246 /* VariableStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
if (isSameScopeDescendentOf(usage2, declaration2, declContainer)) {
return true;
}
@@ -46997,7 +47173,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const initializerOfProperty = propertyDeclaration.initializer === current;
if (initializerOfProperty) {
if (isStatic(current.parent)) {
- if (declaration2.kind === 174 /* MethodDeclaration */) {
+ if (declaration2.kind === 176 /* MethodDeclaration */) {
return true;
}
if (isPropertyDeclaration(declaration2) && getContainingClass(usage2) === getContainingClass(declaration2)) {
@@ -47011,7 +47187,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
} else {
- const isDeclarationInstanceProperty = declaration2.kind === 171 /* PropertyDeclaration */ && !isStatic(declaration2);
+ const isDeclarationInstanceProperty = declaration2.kind === 172 /* PropertyDeclaration */ && !isStatic(declaration2);
if (!isDeclarationInstanceProperty || getContainingClass(usage2) !== getContainingClass(declaration2)) {
return true;
}
@@ -47030,15 +47206,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return "quit";
}
switch (node.kind) {
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return true;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return stopAtAnyPropertyDeclaration && (isPropertyDeclaration(declaration2) && node.parent === declaration2.parent || isParameterPropertyDeclaration(declaration2, declaration2.parent) && node.parent === declaration2.parent.parent) ? "quit" : true;
- case 242 /* Block */:
+ case 244 /* Block */:
switch (node.parent.kind) {
- case 177 /* GetAccessor */:
- case 174 /* MethodDeclaration */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -47068,22 +47244,22 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function requiresScopeChangeWorker(node) {
switch (node.kind) {
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 176 /* Constructor */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 178 /* Constructor */:
return false;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 305 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 308 /* PropertyAssignment */:
return requiresScopeChangeWorker(node.name);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (hasStaticModifier(node)) {
return target < 99 /* ESNext */ || !useDefineForClassFields;
}
return requiresScopeChangeWorker(node.name);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return requiresScopeChangeWorker(node.name);
default:
if (isNullishCoalesce(node) || isOptionalChain(node)) {
@@ -47125,17 +47301,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (result = lookup(location.locals, name, meaning)) {
let useResult = true;
if (isFunctionLike(location) && lastLocation && lastLocation !== location.body) {
- if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 329 /* JSDoc */) {
- useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || lastLocation.kind === 168 /* Parameter */ || lastLocation.kind === 349 /* JSDocParameterTag */ || lastLocation.kind === 350 /* JSDocReturnTag */ || lastLocation.kind === 167 /* TypeParameter */ : false;
+ if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 332 /* JSDoc */) {
+ useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || lastLocation.kind === 169 /* Parameter */ || lastLocation.kind === 352 /* JSDocParameterTag */ || lastLocation.kind === 353 /* JSDocReturnTag */ || lastLocation.kind === 168 /* TypeParameter */ : false;
}
if (meaning & result.flags & 3 /* Variable */) {
if (useOuterVariableScopeInParameter(result, location, lastLocation)) {
useResult = false;
} else if (result.flags & 1 /* FunctionScopedVariable */) {
- useResult = lastLocation.kind === 168 /* Parameter */ || lastLocation === location.type && !!findAncestor(result.valueDeclaration, isParameter);
+ useResult = lastLocation.kind === 169 /* Parameter */ || lastLocation === location.type && !!findAncestor(result.valueDeclaration, isParameter);
}
}
- } else if (location.kind === 194 /* ConditionalType */) {
+ } else if (location.kind === 196 /* ConditionalType */) {
useResult = lastLocation === location.trueType;
}
if (useResult) {
@@ -47147,13 +47323,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation);
switch (location.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (!isExternalOrCommonJsModule(location))
break;
isInExternalModule = true;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const moduleExports = getSymbolOfNode(location) ? ((_a2 = getSymbolOfNode(location)) == null ? void 0 : _a2.exports) || emptySymbols : emptySymbols;
- if (location.kind === 314 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 16777216 /* Ambient */ && !isGlobalScopeAugmentation(location)) {
+ if (location.kind === 317 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 16777216 /* Ambient */ && !isGlobalScopeAugmentation(location)) {
if (result = moduleExports.get("default" /* Default */)) {
const localSymbol = getLocalSymbolForExportDefault(result);
if (localSymbol && result.flags & meaning && localSymbol.escapedName === name) {
@@ -47162,7 +47338,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
result = void 0;
}
const moduleExport = moduleExports.get(name);
- if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 284 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 283 /* NamespaceExport */))) {
+ if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 287 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 286 /* NamespaceExport */))) {
break;
}
}
@@ -47174,12 +47350,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (result = lookup(((_c = getSymbolOfNode(location)) == null ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) {
break loop;
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (!isStatic(location)) {
const ctor = findConstructorDeclaration(location.parent);
if (ctor && ctor.locals) {
@@ -47190,9 +47366,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
if (result = lookup(getSymbolOfNode(location).members || emptySymbols, name, meaning & 788968 /* Type */)) {
if (!isTypeParameterSymbolDeclaredInContainer(result, location)) {
result = void 0;
@@ -47206,7 +47382,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
break loop;
}
- if (location.kind === 232 /* ClassExpression */ && meaning & 32 /* Class */) {
+ if (location.kind === 234 /* ClassExpression */ && meaning & 32 /* Class */) {
const className = location.name;
if (className && name === className.escapedText) {
result = location.symbol;
@@ -47214,7 +47390,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
if (lastLocation === location.expression && location.parent.token === 95 /* ExtendsKeyword */) {
const container = location.parent.parent;
if (isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 788968 /* Type */))) {
@@ -47225,9 +47401,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
grandparent = location.parent.parent;
- if (isClassLike(grandparent) || grandparent.kind === 267 /* InterfaceDeclaration */) {
+ if (isClassLike(grandparent) || grandparent.kind === 270 /* InterfaceDeclaration */) {
if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) {
if (nameNotFoundMessage) {
error(errorLocation, Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
@@ -47236,21 +47412,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */) {
break;
}
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
if (meaning & 3 /* Variable */ && name === "arguments") {
result = argumentsSymbol;
break loop;
}
break;
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
if (meaning & 3 /* Variable */ && name === "arguments") {
result = argumentsSymbol;
break loop;
@@ -47263,37 +47439,37 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 169 /* Decorator */:
- if (location.parent && location.parent.kind === 168 /* Parameter */) {
+ case 170 /* Decorator */:
+ if (location.parent && location.parent.kind === 169 /* Parameter */) {
location = location.parent;
}
- if (location.parent && (isClassElement(location.parent) || location.parent.kind === 264 /* ClassDeclaration */)) {
+ if (location.parent && (isClassElement(location.parent) || location.parent.kind === 266 /* ClassDeclaration */)) {
location = location.parent;
}
break;
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
const root = getJSDocRoot(location);
if (root) {
location = root.parent;
}
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) {
if (!associatedDeclarationForContainingInitializerOrBindingName) {
associatedDeclarationForContainingInitializerOrBindingName = location;
}
}
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) {
if (isParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) {
associatedDeclarationForContainingInitializerOrBindingName = location;
}
}
break;
- case 195 /* InferType */:
+ case 197 /* InferType */:
if (meaning & 262144 /* TypeParameter */) {
const parameterName = location.typeParameter.name;
if (parameterName && name === parameterName.escapedText) {
@@ -47314,7 +47490,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (!result) {
if (lastLocation) {
- Debug.assert(lastLocation.kind === 314 /* SourceFile */);
+ Debug.assert(lastLocation.kind === 317 /* SourceFile */);
if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) {
return lastLocation.symbol;
}
@@ -47411,7 +47587,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) {
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */);
if (typeOnlyDeclaration) {
- const message = typeOnlyDeclaration.kind === 284 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
+ const message = typeOnlyDeclaration.kind === 287 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
const unescapedName = unescapeLeadingUnderscores(name);
addTypeOnlyDeclarationRelatedInfo(
error(errorLocation, message, unescapedName),
@@ -47431,14 +47607,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
diagnostic,
createDiagnosticForNode(
typeOnlyDeclaration,
- typeOnlyDeclaration.kind === 284 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
+ typeOnlyDeclaration.kind === 287 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
unescapedName
)
);
}
function getIsDeferredContext(location, lastLocation) {
- if (location.kind !== 219 /* ArrowFunction */ && location.kind !== 218 /* FunctionExpression */) {
- return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 171 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name);
+ if (location.kind !== 221 /* ArrowFunction */ && location.kind !== 220 /* FunctionExpression */) {
+ return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 172 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name);
}
if (lastLocation && lastLocation === location.name) {
return false;
@@ -47450,12 +47626,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isSelfReferenceLocation(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 273 /* ModuleDeclaration */:
return true;
default:
return false;
@@ -47467,7 +47643,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isTypeParameterSymbolDeclaredInContainer(symbol, container) {
if (symbol.declarations) {
for (const decl of symbol.declarations) {
- if (decl.kind === 167 /* TypeParameter */) {
+ if (decl.kind === 168 /* TypeParameter */) {
const parent2 = isJSDocTemplateTag(decl.parent) ? getJSDocHost(decl.parent) : decl.parent;
if (parent2 === container) {
return !(isJSDocTemplateTag(decl.parent) && find(decl.parent.parent.tags, isJSDocTypeAlias));
@@ -47517,9 +47693,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getEntityNameForExtendingInterface(node) {
switch (node.kind) {
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return node.parent ? getEntityNameForExtendingInterface(node.parent) : void 0;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
if (isEntityNameExpression(node.expression)) {
return node.expression;
}
@@ -47567,7 +47743,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown";
}
function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) {
- if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 284 /* ExportSpecifier */) {
+ if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 287 /* ExportSpecifier */) {
error(errorLocation, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name);
return true;
}
@@ -47656,7 +47832,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const declaration = (_a2 = result.declarations) == null ? void 0 : _a2.find(
- (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || d.kind === 269 /* EnumDeclaration */
+ (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || d.kind === 272 /* EnumDeclaration */
);
if (declaration === void 0)
return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");
@@ -47690,13 +47866,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getAnyImportSyntax(node) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return node;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return node.parent;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return node.parent.parent;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return node.parent.parent.parent;
default:
return void 0;
@@ -47706,7 +47882,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return symbol.declarations && findLast(symbol.declarations, isAliasSymbolDeclaration2);
}
function isAliasSymbolDeclaration2(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */ || node.kind === 273 /* NamespaceExportDeclaration */ || node.kind === 276 /* ImportClause */ && !!node.name || node.kind === 277 /* NamespaceImport */ || node.kind === 283 /* NamespaceExport */ || node.kind === 279 /* ImportSpecifier */ || node.kind === 284 /* ExportSpecifier */ || node.kind === 280 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 306 /* ShorthandPropertyAssignment */ || node.kind === 305 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 261 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 208 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
+ return node.kind === 277 /* ImportEqualsDeclaration */ || node.kind === 276 /* NamespaceExportDeclaration */ || node.kind === 279 /* ImportClause */ && !!node.name || node.kind === 280 /* NamespaceImport */ || node.kind === 286 /* NamespaceExport */ || node.kind === 282 /* ImportSpecifier */ || node.kind === 287 /* ExportSpecifier */ || node.kind === 283 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 309 /* ShorthandPropertyAssignment */ || node.kind === 308 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 263 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 210 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
}
function isAliasableOrJsExpression(e) {
return isAliasableExpression(e) || isFunctionExpression(e) && isJSConstructor(e);
@@ -47717,7 +47893,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const name = getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0];
return isIdentifier(commonJSPropertyAccess.name) ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) : void 0;
}
- if (isVariableDeclaration(node) || node.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ if (isVariableDeclaration(node) || node.moduleReference.kind === 289 /* ExternalModuleReference */) {
const immediate = resolveExternalModuleName(
node,
getExternalModuleRequireArgument(node) || getExternalModuleImportEqualsDeclarationExpression(node)
@@ -47733,7 +47909,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) {
if (markSymbolOfAliasDeclarationIfTypeOnly(node, void 0, resolved, false) && !node.isTypeOnly) {
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfNode(node));
- const isExport = typeOnlyDeclaration.kind === 284 /* ExportSpecifier */;
+ const isExport = typeOnlyDeclaration.kind === 287 /* ExportSpecifier */;
const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here;
const name = unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
@@ -47835,15 +48011,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getModuleSpecifierForImportOrExport(node) {
switch (node.kind) {
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return node.parent.moduleSpecifier;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : void 0;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return node.parent.parent.moduleSpecifier;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return node.parent.parent.parent.moduleSpecifier;
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return node.parent.parent.moduleSpecifier;
default:
return Debug.assertNever(node);
@@ -48088,31 +48264,31 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTargetOfAliasDeclaration(node, dontRecursivelyResolve = false) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
- case 261 /* VariableDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 263 /* VariableDeclaration */:
return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return getTargetOfImportClause(node, dontRecursivelyResolve);
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return getTargetOfNamespaceImport(node, dontRecursivelyResolve);
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
return getTargetOfNamespaceExport(node, dontRecursivelyResolve);
- case 279 /* ImportSpecifier */:
- case 208 /* BindingElement */:
+ case 282 /* ImportSpecifier */:
+ case 210 /* BindingElement */:
return getTargetOfImportSpecifier(node, dontRecursivelyResolve);
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve);
- case 280 /* ExportAssignment */:
- case 227 /* BinaryExpression */:
+ case 283 /* ExportAssignment */:
+ case 229 /* BinaryExpression */:
return getTargetOfExportAssignment(node, dontRecursivelyResolve);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, true, dontRecursivelyResolve);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getTargetOfAliasLikeExpression(node.initializer, dontRecursivelyResolve);
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return getTargetOfAccessExpression(node, dontRecursivelyResolve);
default:
return Debug.fail();
@@ -48243,10 +48419,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (entityName.kind === 79 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
- if (entityName.kind === 79 /* Identifier */ || entityName.parent.kind === 165 /* QualifiedName */) {
+ if (entityName.kind === 79 /* Identifier */ || entityName.parent.kind === 166 /* QualifiedName */) {
return resolveEntityName(entityName, 1920 /* Namespace */, false, dontResolveAlias);
} else {
- Debug.assert(entityName.parent.kind === 274 /* ImportEqualsDeclaration */);
+ Debug.assert(entityName.parent.kind === 277 /* ImportEqualsDeclaration */);
return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, false, dontResolveAlias);
}
}
@@ -48306,9 +48482,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!symbol) {
return getMergedSymbol(symbolFromJSPrototype);
}
- } else if (name.kind === 165 /* QualifiedName */ || name.kind === 211 /* PropertyAccessExpression */) {
- const left = name.kind === 165 /* QualifiedName */ ? name.left : name.expression;
- const right = name.kind === 165 /* QualifiedName */ ? name.right : name.name;
+ } else if (name.kind === 166 /* QualifiedName */ || name.kind === 213 /* PropertyAccessExpression */) {
+ const left = name.kind === 166 /* QualifiedName */ ? name.left : name.expression;
+ const right = name.kind === 166 /* QualifiedName */ ? name.right : name.name;
let namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, false, location);
if (!namespace || nodeIsMissing(right)) {
return void 0;
@@ -48365,7 +48541,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
throw Debug.assertNever(name, "Unknown entity name kind.");
}
Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here.");
- if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 280 /* ExportAssignment */)) {
+ if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 283 /* ExportAssignment */)) {
markSymbolOfAliasDeclarationIfTypeOnly(getAliasDeclarationFromName(name), symbol, void 0, true);
}
return symbol.flags & meaning || dontResolveAlias ? symbol : resolveAlias(symbol);
@@ -48668,7 +48844,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
var _a2;
const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
if (!dontResolveAlias && symbol) {
- if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 314 /* SourceFile */)) {
+ if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 317 /* SourceFile */)) {
const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop";
error(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName);
return symbol;
@@ -48986,7 +49162,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function findConstructorDeclaration(node) {
const members = node.members;
for (const member of members) {
- if (member.kind === 176 /* Constructor */ && nodeIsPresent(member.body)) {
+ if (member.kind === 178 /* Constructor */ && nodeIsPresent(member.body)) {
return member;
}
}
@@ -49096,19 +49272,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
switch (location.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (!isExternalOrCommonJsModule(location)) {
break;
}
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const sym = getSymbolOfNode(location);
if (result = callback((sym == null ? void 0 : sym.exports) || emptySymbols, void 0, true, location)) {
return result;
}
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
let table;
(getSymbolOfNode(location).members || emptySymbols).forEach((memberSymbol, key) => {
if (memberSymbol.flags & (788968 /* Type */ & ~67108864 /* Assignment */)) {
@@ -49164,7 +49340,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return [symbol];
}
const result2 = forEachEntry(symbols, (symbolFromSymbolTable) => {
- if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 284 /* ExportSpecifier */))) {
+ if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 287 /* ExportSpecifier */))) {
const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
const candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification);
if (candidate) {
@@ -49200,7 +49376,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (symbolFromSymbolTable === symbol) {
return true;
}
- const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 284 /* ExportSpecifier */);
+ const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 287 /* ExportSpecifier */);
symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
const flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
if (flags & meaning) {
@@ -49215,10 +49391,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (symbol.declarations && symbol.declarations.length) {
for (const declaration of symbol.declarations) {
switch (declaration.kind) {
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
continue;
default:
return false;
@@ -49317,10 +49493,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return node && getSymbolOfNode(node);
}
function hasExternalModuleSymbol(declaration) {
- return isAmbientModule(declaration) || declaration.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
+ return isAmbientModule(declaration) || declaration.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
}
function hasNonGlobalAugmentationExternalModuleSymbol(declaration) {
- return isModuleWithStringLiteralName(declaration) || declaration.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
+ return isModuleWithStringLiteralName(declaration) || declaration.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(declaration);
}
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
let aliasesToMakeVisible;
@@ -49366,9 +49542,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
let meaning;
- if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 234 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 166 /* ComputedPropertyName */) {
+ if (entityName.parent.kind === 188 /* TypeQuery */ || entityName.parent.kind === 236 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
- } else if (entityName.kind === 165 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 274 /* ImportEqualsDeclaration */) {
+ } else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 213 /* PropertyAccessExpression */ || entityName.parent.kind === 277 /* ImportEqualsDeclaration */) {
meaning = 1920 /* Namespace */;
} else {
meaning = 788968 /* Type */;
@@ -49408,7 +49584,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
function symbolToStringWorker(writer2) {
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
- const printer3 = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 314 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
+ const printer3 = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 317 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
printer3.writeNode(4 /* Unspecified */, entity, sourceFile, writer2);
return writer2;
@@ -49419,9 +49595,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function signatureToStringWorker(writer2) {
let sigOutput;
if (flags & 262144 /* WriteArrowStyleSignature */) {
- sigOutput = kind === 1 /* Construct */ ? 185 /* ConstructorType */ : 184 /* FunctionType */;
+ sigOutput = kind === 1 /* Construct */ ? 187 /* ConstructorType */ : 186 /* FunctionType */;
} else {
- sigOutput = kind === 1 /* Construct */ ? 180 /* ConstructSignature */ : 179 /* CallSignature */;
+ sigOutput = kind === 1 /* Construct */ ? 182 /* ConstructSignature */ : 181 /* CallSignature */;
}
const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
const printer3 = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
@@ -49915,7 +50091,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function shouldWriteTypeOfFunctionSymbol() {
var _a3;
const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && some(symbol.declarations, (declaration) => isStatic(declaration));
- const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || forEach(symbol.declarations, (declaration) => declaration.parent.kind === 314 /* SourceFile */ || declaration.parent.kind === 271 /* ModuleBlock */));
+ const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || forEach(symbol.declarations, (declaration) => declaration.parent.kind === 317 /* SourceFile */ || declaration.parent.kind === 274 /* ModuleBlock */));
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a3 = context.visitedTypes) == null ? void 0 : _a3.has(typeId))) && (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
}
@@ -49994,12 +50170,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
const signature = resolved.callSignatures[0];
- const signatureNode = signatureToSignatureDeclarationHelper(signature, 184 /* FunctionType */, context);
+ const signatureNode = signatureToSignatureDeclarationHelper(signature, 186 /* FunctionType */, context);
return signatureNode;
}
if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {
const signature = resolved.constructSignatures[0];
- const signatureNode = signatureToSignatureDeclarationHelper(signature, 185 /* ConstructorType */, context);
+ const signatureNode = signatureToSignatureDeclarationHelper(signature, 187 /* ConstructorType */, context);
return signatureNode;
}
}
@@ -50167,12 +50343,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const typeElements = [];
for (const signature of resolvedType.callSignatures) {
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 179 /* CallSignature */, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 181 /* CallSignature */, context));
}
for (const signature of resolvedType.constructSignatures) {
if (signature.flags & 4 /* Abstract */)
continue;
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 182 /* ConstructSignature */, context));
}
for (const info of resolvedType.indexInfos) {
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
@@ -50244,7 +50420,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {
const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */);
for (const signature of signatures) {
- const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 173 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
+ const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 175 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
typeElements.push(preserveCommentsOn(methodDeclaration));
}
} else {
@@ -50275,8 +50451,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function preserveCommentsOn(node) {
var _a3;
- if (some(propertySymbol.declarations, (d) => d.kind === 356 /* JSDocPropertyTag */)) {
- const d = (_a3 = propertySymbol.declarations) == null ? void 0 : _a3.find((d2) => d2.kind === 356 /* JSDocPropertyTag */);
+ if (some(propertySymbol.declarations, (d) => d.kind === 359 /* JSDocPropertyTag */)) {
+ const d = (_a3 = propertySymbol.declarations) == null ? void 0 : _a3.find((d2) => d2.kind === 359 /* JSDocPropertyTag */);
const commentText = getTextOfJSDocComment(d.comment);
if (commentText) {
setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
@@ -50379,7 +50555,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
typeParameters = signature.typeParameters && signature.typeParameters.map((parameter) => typeParameterToDeclaration(parameter, context));
}
const expandedParams = getExpandedParameters(signature, true)[0];
- const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
+ const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 178 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
if (thisParameter) {
parameters.unshift(thisParameter);
@@ -50400,11 +50576,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
let modifiers = options == null ? void 0 : options.modifiers;
- if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
+ if (kind === 187 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
const flags = modifiersToFlags(modifiers);
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
}
- const node = kind === 179 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 180 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 173 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 176 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0) : kind === 177 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 178 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 181 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 326 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 184 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 185 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 263 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 218 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 219 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
+ const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
if (typeArguments) {
node.typeArguments = factory.createNodeArray(typeArguments);
}
@@ -50442,9 +50618,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return typeParameterToDeclarationWithConstraint(type, context, constraintNode);
}
function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) {
- let parameterDeclaration = getDeclarationOfKind(parameterSymbol, 168 /* Parameter */);
+ let parameterDeclaration = getDeclarationOfKind(parameterSymbol, 169 /* Parameter */);
if (!parameterDeclaration && !isTransientSymbol(parameterSymbol)) {
- parameterDeclaration = getDeclarationOfKind(parameterSymbol, 349 /* JSDocParameterTag */);
+ parameterDeclaration = getDeclarationOfKind(parameterSymbol, 352 /* JSDocParameterTag */);
}
let parameterType = getTypeOfSymbol(parameterSymbol);
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
@@ -50454,7 +50630,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && preserveModifierFlags && parameterDeclaration && canHaveModifiers(parameterDeclaration) ? map(getModifiers(parameterDeclaration), factory.cloneNode) : void 0;
const isRest = parameterDeclaration && isRestParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 32768 /* RestParameter */;
const dotDotDotToken = isRest ? factory.createToken(25 /* DotDotDotToken */) : void 0;
- const name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 79 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 165 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol);
+ const name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 79 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 166 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol);
const isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 16384 /* OptionalParameter */;
const questionToken = isOptional ? factory.createToken(57 /* QuestionToken */) : void 0;
const parameterNode = factory.createParameterDeclaration(
@@ -50602,11 +50778,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getSpecifierForModuleSymbol(symbol, context, overrideImportMode) {
var _a2;
- let file = getDeclarationOfKind(symbol, 314 /* SourceFile */);
+ let file = getDeclarationOfKind(symbol, 317 /* SourceFile */);
if (!file) {
const equivalentFileSymbol = firstDefined(symbol.declarations, (d) => getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol));
if (equivalentFileSymbol) {
- file = getDeclarationOfKind(equivalentFileSymbol, 314 /* SourceFile */);
+ file = getDeclarationOfKind(equivalentFileSymbol, 317 /* SourceFile */);
}
}
if (file && file.moduleName !== void 0) {
@@ -51046,7 +51222,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return transformed === existing ? setTextRange(factory.cloneNode(existing), existing) : transformed;
function visitExistingNodeTreeSymbols(node) {
- if (isJSDocAllType(node) || node.kind === 328 /* JSDocNamepathType */) {
+ if (isJSDocAllType(node) || node.kind === 331 /* JSDocNamepathType */) {
return factory.createKeywordTypeNode(132 /* AnyKeyword */);
}
if (isJSDocUnknownType(node)) {
@@ -51186,8 +51362,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function symbolTableToDeclarationStatements(symbolTable, context, bundled) {
- const serializePropertySymbolForClass = makeSerializePropertySymbol(factory.createPropertyDeclaration, 174 /* MethodDeclaration */, true);
- const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol((mods, name, question, type) => factory.createPropertySignature(mods, name, question, type), 173 /* MethodSignature */, false);
+ const serializePropertySymbolForClass = makeSerializePropertySymbol(factory.createPropertyDeclaration, 176 /* MethodDeclaration */, true);
+ const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol((mods, name, question, type) => factory.createPropertySignature(mods, name, question, type), 175 /* MethodSignature */, false);
const enclosingDeclaration = context.enclosingDeclaration;
let results = [];
const visitedSymbols = new Set2();
@@ -51561,8 +51737,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const baseTypes = getBaseTypes(interfaceType);
const baseType = length(baseTypes) ? getIntersectionType(baseTypes) : void 0;
const members = flatMap(getPropertiesOfType(interfaceType), (p) => serializePropertySymbolForInterface(p, baseType));
- const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 179 /* CallSignature */);
- const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 180 /* ConstructSignature */);
+ const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 181 /* CallSignature */);
+ const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 182 /* ConstructSignature */);
const indexSignatures = serializeIndexSignatures(interfaceType, baseType);
const heritageClauses = !length(baseTypes) ? void 0 : [factory.createHeritageClause(95 /* ExtendsKeyword */, mapDefined(baseTypes, (b) => trySerializeAsTypeReference(b, 111551 /* Value */)))];
addResult(factory.createInterfaceDeclaration(
@@ -51630,7 +51806,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags) {
const signatures = getSignaturesOfType(type, 0 /* Call */);
for (const sig of signatures) {
- const decl = signatureToSignatureDeclarationHelper(sig, 263 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled });
+ const decl = signatureToSignatureDeclarationHelper(sig, 265 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled });
addResult(setTextRange(decl, getSignatureTextRangeLocation(sig)), modifierFlags);
}
if (!(symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && !!symbol.exports && !!symbol.exports.size)) {
@@ -51765,7 +51941,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
(p) => serializePropertySymbolForClass(p, true, staticBaseType)
);
const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */));
- const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 176 /* Constructor */);
+ const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 178 /* Constructor */);
const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]);
context.enclosingDeclaration = oldEnclosing;
addResult(setTextRange(factory.createClassDeclaration(
@@ -51812,8 +51988,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const targetName = getInternalSymbolName(target, verbatimTargetName);
includePrivateSymbol(target);
switch (node.kind) {
- case 208 /* BindingElement */:
- if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 261 /* VariableDeclaration */) {
+ case 210 /* BindingElement */:
+ if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 263 /* VariableDeclaration */) {
const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context);
const { propertyName } = node;
addResult(factory.createImportDeclaration(
@@ -51829,15 +52005,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
Debug.failBadSyntaxKind(((_c = node.parent) == null ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization");
- case 306 /* ShorthandPropertyAssignment */:
- if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 227 /* BinaryExpression */) {
+ case 309 /* ShorthandPropertyAssignment */:
+ if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 229 /* BinaryExpression */) {
serializeExportSpecifier(
unescapeLeadingUnderscores(symbol.escapedName),
targetName
);
}
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
if (isPropertyAccessExpression(node.initializer)) {
const initializer = node.initializer;
const uniqueName = factory.createUniqueName(localName);
@@ -51856,7 +52032,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
), modifierFlags);
break;
}
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, isJsonSourceFile)) {
serializeMaybeAliasAssignment(symbol);
break;
@@ -51869,10 +52045,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
isLocalImport ? symbolToName(target, context, 67108863 /* All */, false) : factory.createExternalModuleReference(factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))
), isLocalImport ? modifierFlags : 0 /* None */);
break;
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
addResult(factory.createNamespaceExportDeclaration(idText(node.name)), 0 /* None */);
break;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
addResult(factory.createImportDeclaration(
void 0,
factory.createImportClause(false, factory.createIdentifier(localName), void 0),
@@ -51880,7 +52056,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void 0
), 0 /* None */);
break;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
addResult(factory.createImportDeclaration(
void 0,
factory.createImportClause(false, void 0, factory.createNamespaceImport(factory.createIdentifier(localName))),
@@ -51888,7 +52064,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void 0
), 0 /* None */);
break;
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
addResult(factory.createExportDeclaration(
void 0,
false,
@@ -51896,7 +52072,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))
), 0 /* None */);
break;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
addResult(factory.createImportDeclaration(
void 0,
factory.createImportClause(
@@ -51914,7 +52090,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void 0
), 0 /* None */);
break;
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
const specifier = node.parent.parent.moduleSpecifier;
serializeExportSpecifier(
unescapeLeadingUnderscores(symbol.escapedName),
@@ -51922,12 +52098,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
specifier && isStringLiteralLike(specifier) ? factory.createStringLiteral(specifier.text) : void 0
);
break;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
serializeMaybeAliasAssignment(symbol);
break;
- case 227 /* BinaryExpression */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 229 /* BinaryExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (symbol.escapedName === "default" /* Default */ || symbol.escapedName === "export=" /* ExportEquals */) {
serializeMaybeAliasAssignment(symbol);
} else {
@@ -52303,17 +52479,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeAliasForTypeLiteral(type) {
if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */ && type.symbol.declarations) {
const node = walkUpParenthesizedTypes(type.symbol.declarations[0].parent);
- if (node.kind === 268 /* TypeAliasDeclaration */) {
+ if (node.kind === 271 /* TypeAliasDeclaration */) {
return getSymbolOfNode(node);
}
}
return void 0;
}
function isTopLevelInExternalModuleAugmentation(node) {
- return node && node.parent && node.parent.kind === 271 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent);
+ return node && node.parent && node.parent.kind === 274 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent);
}
function isDefaultBindingContext(location) {
- return location.kind === 314 /* SourceFile */ || isAmbientModule(location);
+ return location.kind === 317 /* SourceFile */ || isAmbientModule(location);
}
function getNameOfSymbolFromNameType(symbol, context) {
const nameType = getSymbolLinks(symbol).nameType;
@@ -52358,17 +52534,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!declaration) {
declaration = symbol.declarations[0];
}
- if (declaration.parent && declaration.parent.kind === 261 /* VariableDeclaration */) {
+ if (declaration.parent && declaration.parent.kind === 263 /* VariableDeclaration */) {
return declarationNameToString(declaration.parent.name);
}
switch (declaration.kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) {
context.encounteredError = true;
}
- return declaration.kind === 232 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)";
+ return declaration.kind === 234 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)";
}
}
const name = getNameOfSymbolFromNameType(symbol, context);
@@ -52385,68 +52561,68 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
function determineIfDeclarationIsVisible() {
switch (node.kind) {
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
- case 348 /* JSDocEnumTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 351 /* JSDocEnumTag */:
return !!(node.parent && node.parent.parent && node.parent.parent.parent && isSourceFile(node.parent.parent.parent));
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return isDeclarationVisible(node.parent.parent);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
if (isBindingPattern(node.name) && !node.name.elements.length) {
return false;
}
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 269 /* EnumDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 268 /* AnnotationDeclaration */:
if (isExternalModuleAugmentation(node)) {
return true;
}
const parent2 = getDeclarationContainer(node);
- if (!(getCombinedModifierFlags(node) & 1 /* Export */) && !(node.kind !== 274 /* ImportEqualsDeclaration */ && parent2.kind !== 314 /* SourceFile */ && parent2.flags & 16777216 /* Ambient */)) {
+ if (!(getCombinedModifierFlags(node) & 1 /* Export */) && !(node.kind !== 277 /* ImportEqualsDeclaration */ && parent2.kind !== 317 /* SourceFile */ && parent2.flags & 16777216 /* Ambient */)) {
return isGlobalSourceFile(parent2);
}
return isDeclarationVisible(parent2);
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (hasEffectiveModifier(node, 8 /* Private */ | 16 /* Protected */)) {
return false;
}
- case 176 /* Constructor */:
- case 180 /* ConstructSignature */:
- case 179 /* CallSignature */:
- case 181 /* IndexSignature */:
- case 168 /* Parameter */:
- case 271 /* ModuleBlock */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 187 /* TypeLiteral */:
- case 183 /* TypeReference */:
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 196 /* ParenthesizedType */:
- case 202 /* NamedTupleMember */:
+ case 178 /* Constructor */:
+ case 182 /* ConstructSignature */:
+ case 181 /* CallSignature */:
+ case 183 /* IndexSignature */:
+ case 169 /* Parameter */:
+ case 274 /* ModuleBlock */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 189 /* TypeLiteral */:
+ case 185 /* TypeReference */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 198 /* ParenthesizedType */:
+ case 204 /* NamedTupleMember */:
return isDeclarationVisible(node.parent);
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
return false;
- case 167 /* TypeParameter */:
- case 314 /* SourceFile */:
- case 273 /* NamespaceExportDeclaration */:
+ case 168 /* TypeParameter */:
+ case 317 /* SourceFile */:
+ case 276 /* NamespaceExportDeclaration */:
return true;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return false;
default:
return false;
@@ -52455,9 +52631,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function collectLinkedAliases(node, setVisibility) {
let exportSymbol;
- if (node.parent && node.parent.kind === 280 /* ExportAssignment */) {
+ if (node.parent && node.parent.kind === 283 /* ExportAssignment */) {
exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, void 0, node, false);
- } else if (node.parent.kind === 284 /* ExportSpecifier */) {
+ } else if (node.parent.kind === 287 /* ExportSpecifier */) {
exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */);
}
let result;
@@ -52552,12 +52728,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getDeclarationContainer(node) {
return findAncestor(getRootDeclaration(node), (node2) => {
switch (node2.kind) {
- case 261 /* VariableDeclaration */:
- case 262 /* VariableDeclarationList */:
- case 279 /* ImportSpecifier */:
- case 278 /* NamedImports */:
- case 277 /* NamespaceImport */:
- case 276 /* ImportClause */:
+ case 263 /* VariableDeclaration */:
+ case 264 /* VariableDeclarationList */:
+ case 282 /* ImportSpecifier */:
+ case 281 /* NamedImports */:
+ case 280 /* NamespaceImport */:
+ case 279 /* ImportClause */:
return false;
default:
return true;
@@ -52661,23 +52837,23 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getParentElementAccess(node) {
const ancestor = node.parent.parent;
switch (ancestor.kind) {
- case 208 /* BindingElement */:
- case 305 /* PropertyAssignment */:
+ case 210 /* BindingElement */:
+ case 308 /* PropertyAssignment */:
return getSyntheticElementAccess(ancestor);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return getSyntheticElementAccess(node.parent);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return ancestor.initializer;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return ancestor.right;
}
}
function getDestructuringPropertyName(node) {
const parent2 = node.parent;
- if (node.kind === 208 /* BindingElement */ && parent2.kind === 206 /* ObjectBindingPattern */) {
+ if (node.kind === 210 /* BindingElement */ && parent2.kind === 208 /* ObjectBindingPattern */) {
return getLiteralPropertyNameText(node.propertyName || node.name);
}
- if (node.kind === 305 /* PropertyAssignment */ || node.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.kind === 308 /* PropertyAssignment */ || node.kind === 309 /* ShorthandPropertyAssignment */) {
return getLiteralPropertyNameText(node.name);
}
return "" + parent2.elements.indexOf(node);
@@ -52702,7 +52878,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */);
}
let type;
- if (pattern.kind === 206 /* ObjectBindingPattern */) {
+ if (pattern.kind === 208 /* ObjectBindingPattern */) {
if (declaration.dotDotDotToken) {
parentType = getReducedType(parentType);
if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) {
@@ -52757,17 +52933,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isEmptyArrayLiteral2(node) {
const expr = skipParentheses(node, true);
- return expr.kind === 209 /* ArrayLiteralExpression */ && expr.elements.length === 0;
+ return expr.kind === 211 /* ArrayLiteralExpression */ && expr.elements.length === 0;
}
function addOptionality(type, isProperty = false, isOptional = true) {
return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type;
}
function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) {
- if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250 /* ForInStatement */) {
+ if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 252 /* ForInStatement */) {
const indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression, checkMode)));
return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType;
}
- if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) {
+ if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 253 /* ForOfStatement */) {
const forOfStatement = declaration.parent.parent;
return checkRightHandSideOfForOf(forOfStatement) || anyType;
}
@@ -52790,8 +52966,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (isParameter(declaration)) {
const func = declaration.parent;
- if (func.kind === 178 /* SetAccessor */ && hasBindableName(func)) {
- const getter = getDeclarationOfKind(getSymbolOfNode(declaration.parent), 177 /* GetAccessor */);
+ if (func.kind === 180 /* SetAccessor */ && hasBindableName(func)) {
+ const getter = getDeclarationOfKind(getSymbolOfNode(declaration.parent), 179 /* GetAccessor */);
if (getter) {
const getterSignature = getSignatureFromDeclaration(getter);
const thisParameter = getAccessorThisParameter(func);
@@ -52844,7 +53020,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const links = getSymbolLinks(symbol);
if (links.isConstructorDeclaredProperty === void 0) {
links.isConstructorDeclaredProperty = false;
- links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 212 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(void 0, declaration, symbol, declaration));
+ links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 214 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(void 0, declaration, symbol, declaration));
}
return links.isConstructorDeclaredProperty;
}
@@ -52860,7 +53036,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
for (const declaration of symbol.declarations) {
const container = getThisContainer(declaration, false);
- if (container && (container.kind === 176 /* Constructor */ || isJSConstructor(container))) {
+ if (container && (container.kind === 178 /* Constructor */ || isJSConstructor(container))) {
return container;
}
}
@@ -53122,7 +53298,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isDeclarationInConstructor(expression) {
const thisContainer = getThisContainer(expression, false);
- return thisContainer.kind === 176 /* Constructor */ || thisContainer.kind === 263 /* FunctionDeclaration */ || thisContainer.kind === 218 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent);
+ return thisContainer.kind === 178 /* Constructor */ || thisContainer.kind === 265 /* FunctionDeclaration */ || thisContainer.kind === 220 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent);
}
function getConstructorDefinedThisAssignmentTypes(types, declarations) {
Debug.assert(types.length === declarations.length);
@@ -53178,7 +53354,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2) {
const elements = pattern.elements;
const lastElement = lastOrUndefined(elements);
- const restElement = lastElement && lastElement.kind === 208 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0;
+ const restElement = lastElement && lastElement.kind === 210 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0;
if (elements.length === 0 || elements.length === 1 && restElement) {
return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType;
}
@@ -53194,7 +53370,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
}
function getTypeFromBindingPattern(pattern, includePatternInType = false, reportErrors2 = false) {
- return pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2);
+ return pattern.kind === 208 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2);
}
function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors2) {
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, true, 0 /* Normal */), declaration, reportErrors2);
@@ -53227,7 +53403,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function declarationBelongsToPrivateAmbientMember(declaration) {
const root = getRootDeclaration(declaration);
- const memberDeclaration = root.kind === 168 /* Parameter */ ? root.parent : root;
+ const memberDeclaration = root.kind === 169 /* Parameter */ ? root.parent : root;
return isPrivateWithinAmbient(memberDeclaration);
}
function tryGetTypeFromEffectiveTypeNode(node) {
@@ -53295,7 +53471,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return reportCircularityError(symbol);
}
let type;
- if (declaration.kind === 280 /* ExportAssignment */) {
+ if (declaration.kind === 283 /* ExportAssignment */) {
type = widenTypeForVariableLikeDeclaration(tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionCached(declaration.expression), declaration);
} else if (isBinaryExpression(declaration) || isInJSFile(declaration) && (isCallExpression(declaration) || (isPropertyAccessExpression(declaration) || isBindableStaticElementAccessExpression(declaration)) && isBinaryExpression(declaration.parent))) {
type = getWidenedTypeForAssignmentDeclaration(symbol);
@@ -53312,7 +53488,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, 0 /* Normal */);
} else if (isObjectLiteralMethod(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, 0 /* Normal */);
- } else if (isParameter(declaration) || isPropertyDeclaration(declaration) || isPropertySignature(declaration) || isAnnotationPropertyDeclaration(declaration) || isVariableDeclaration(declaration) || isBindingElement(declaration) || isJSDocPropertyLikeTag(declaration)) {
+ } else if (isParameter(declaration) || isPropertyDeclaration(declaration) || isPropertySignature(declaration) || isAnnotationPropertyDeclaration(declaration) || isVariableDeclaration(declaration) || isBindingElement(declaration) || isOverloadPropertyDeclaration(declaration) || isJSDocPropertyLikeTag(declaration)) {
type = getWidenedTypeForVariableLikeDeclaration(declaration, true);
} else if (isEnumDeclaration(declaration)) {
type = getTypeOfFuncClassEnumModule(symbol);
@@ -53332,13 +53508,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getAnnotatedAccessorTypeNode(accessor) {
if (accessor) {
switch (accessor.kind) {
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
const getterTypeAnnotation = getEffectiveReturnTypeNode(accessor);
return getterTypeAnnotation;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
const setterTypeAnnotation = getEffectiveSetAccessorTypeAnnotationNode(accessor);
return setterTypeAnnotation;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
Debug.assert(hasAccessorModifier(accessor));
const accessorTypeAnnotation = getEffectiveTypeAnnotationNode(accessor);
return accessorTypeAnnotation;
@@ -53363,9 +53539,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!pushTypeResolution(symbol, 0 /* Type */)) {
return errorType;
}
- const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */);
- const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */);
- const accessor = tryCast(getDeclarationOfKind(symbol, 171 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
+ const getter = getDeclarationOfKind(symbol, 179 /* GetAccessor */);
+ const setter = getDeclarationOfKind(symbol, 180 /* SetAccessor */);
+ const accessor = tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && accessor.initializer && getWidenedTypeForVariableLikeDeclaration(accessor, true);
if (!type) {
if (setter && !isPrivateWithinAmbient(setter)) {
@@ -53400,7 +53576,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!pushTypeResolution(symbol, 8 /* WriteType */)) {
return errorType;
}
- const setter = (_a2 = getDeclarationOfKind(symbol, 178 /* SetAccessor */)) != null ? _a2 : tryCast(getDeclarationOfKind(symbol, 171 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
+ const setter = (_a2 = getDeclarationOfKind(symbol, 180 /* SetAccessor */)) != null ? _a2 : tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration);
let writeType = getAnnotatedAccessorType(setter);
if (!popTypeResolution()) {
if (getAnnotatedAccessorTypeNode(setter)) {
@@ -53435,7 +53611,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const declaration = symbol.valueDeclaration;
if (symbol.flags & 1536 /* Module */ && isShorthandAmbientModuleSymbol(symbol)) {
return anyType;
- } else if (declaration && (declaration.kind === 227 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 227 /* BinaryExpression */)) {
+ } else if (declaration && (declaration.kind === 229 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 229 /* BinaryExpression */)) {
return getWidenedTypeForAssignmentDeclaration(symbol);
} else if (symbol.flags & 512 /* ValueModule */ && declaration && isSourceFile(declaration) && declaration.commonJsModuleIndicator) {
const resolvedModule = resolveExternalModuleSymbol(symbol);
@@ -53491,7 +53667,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
);
return errorType;
}
- if (noImplicitAny && (declaration.kind !== 168 /* Parameter */ || declaration.initializer)) {
+ if (noImplicitAny && (declaration.kind !== 169 /* Parameter */ || declaration.initializer)) {
error(
symbol.valueDeclaration,
Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,
@@ -53602,43 +53778,43 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 326 /* JSDocFunctionType */:
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 268 /* TypeAliasDeclaration */:
- case 353 /* JSDocTemplateTag */:
- case 354 /* JSDocTypedefTag */:
- case 348 /* JSDocEnumTag */:
- case 347 /* JSDocCallbackTag */:
- case 200 /* MappedType */:
- case 194 /* ConditionalType */: {
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 329 /* JSDocFunctionType */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 271 /* TypeAliasDeclaration */:
+ case 356 /* JSDocTemplateTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 351 /* JSDocEnumTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 202 /* MappedType */:
+ case 196 /* ConditionalType */: {
const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
- if (node.kind === 200 /* MappedType */) {
+ if (node.kind === 202 /* MappedType */) {
return append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)));
- } else if (node.kind === 194 /* ConditionalType */) {
+ } else if (node.kind === 196 /* ConditionalType */) {
return concatenate(outerTypeParameters, getInferTypeParameters(node));
}
const outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, getEffectiveTypeParameterDeclarations(node));
- const thisType = includeThisTypes && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || node.kind === 267 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
+ const thisType = includeThisTypes && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 270 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
return thisType ? append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters;
}
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
const paramSymbol = getParameterSymbolFromJSDoc(node);
if (paramSymbol) {
node = paramSymbol.valueDeclaration;
}
break;
- case 329 /* JSDoc */: {
+ case 332 /* JSDoc */: {
const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
return node.tags ? appendTypeParameters(outerTypeParameters, flatMap(node.tags, (t) => isJSDocTemplateTag(t) ? t.typeParameters : void 0)) : outerTypeParameters;
}
@@ -53646,7 +53822,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getOuterTypeParametersOfClassOrInterface(symbol) {
- const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 267 /* InterfaceDeclaration */);
+ const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 270 /* InterfaceDeclaration */);
Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
return getOuterTypeParameters(declaration);
}
@@ -53656,7 +53832,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let result;
for (const node of symbol.declarations) {
- if (node.kind === 267 /* InterfaceDeclaration */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) {
+ if (node.kind === 270 /* InterfaceDeclaration */ || node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) {
const declaration = node;
result = appendTypeParameters(result, getEffectiveTypeParameterDeclarations(declaration));
}
@@ -53789,7 +53965,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (!popTypeResolution() && type.symbol.declarations) {
for (const declaration of type.symbol.declarations) {
- if (declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 267 /* InterfaceDeclaration */) {
+ if (declaration.kind === 266 /* ClassDeclaration */ || declaration.kind === 270 /* InterfaceDeclaration */) {
reportCircularBaseType(declaration, type);
}
}
@@ -53872,7 +54048,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray;
if (type.symbol.declarations) {
for (const declaration of type.symbol.declarations) {
- if (declaration.kind === 267 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) {
+ if (declaration.kind === 270 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) {
for (const node of getInterfaceBaseTypeNodes(declaration)) {
const baseType = getReducedType(getTypeFromTypeNode(node));
if (!isErrorType(baseType)) {
@@ -53900,7 +54076,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
for (const declaration of symbol.declarations) {
- if (declaration.kind === 267 /* InterfaceDeclaration */) {
+ if (declaration.kind === 270 /* InterfaceDeclaration */) {
if (declaration.flags & 128 /* ContainsThis */) {
return false;
}
@@ -53966,7 +54142,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
} else {
type = errorType;
- if (declaration.kind === 348 /* JSDocEnumTag */) {
+ if (declaration.kind === 351 /* JSDocEnumTag */) {
error(declaration.typeExpression.type, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
} else {
error(isNamedDeclaration(declaration) ? declaration.name || declaration : declaration, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
@@ -53979,7 +54155,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isStringConcatExpression(expr) {
if (isStringLiteralLike(expr)) {
return true;
- } else if (expr.kind === 227 /* BinaryExpression */) {
+ } else if (expr.kind === 229 /* BinaryExpression */) {
return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right);
}
return false;
@@ -53994,11 +54170,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return true;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */;
case 79 /* Identifier */:
return nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isStringConcatExpression(expr);
default:
return false;
@@ -54012,7 +54188,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let hasNonLiteralMember = false;
if (symbol.declarations) {
for (const declaration of symbol.declarations) {
- if (declaration.kind === 269 /* EnumDeclaration */) {
+ if (declaration.kind === 272 /* EnumDeclaration */) {
for (const member of declaration.members) {
if (member.initializer && isStringLiteralLike(member.initializer)) {
return links.enumKind = 1 /* Literal */;
@@ -54039,7 +54215,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const memberTypeList = [];
if (symbol.declarations) {
for (const declaration of symbol.declarations) {
- if (declaration.kind === 269 /* EnumDeclaration */) {
+ if (declaration.kind === 272 /* EnumDeclaration */) {
for (const member of declaration.members) {
const value = getEnumMemberValue(member);
const memberType = getFreshTypeOfLiteralType(getEnumLiteralType(value !== void 0 ? value : 0, enumCount, getSymbolOfNode(member)));
@@ -54117,11 +54293,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 115 /* VoidKeyword */:
case 157 /* UndefinedKeyword */:
case 145 /* NeverKeyword */:
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return true;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return isThislessType(node.elementType);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return !node.typeArguments || node.typeArguments.every(isThislessType);
}
return false;
@@ -54137,21 +54313,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isThislessFunctionLikeDeclaration(node) {
const returnType = getEffectiveReturnTypeNode(node);
const typeParameters = getEffectiveTypeParameterDeclarations(node);
- return (node.kind === 176 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter);
+ return (node.kind === 178 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter);
}
function isThisless(symbol) {
if (symbol.declarations && symbol.declarations.length === 1) {
const declaration = symbol.declarations[0];
if (declaration) {
switch (declaration.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return isThislessVariableLikeDeclaration(declaration);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return isThislessFunctionLikeDeclaration(declaration);
}
}
@@ -55016,7 +55192,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isMappedTypeWithKeyofConstraintDeclaration(type) {
const constraintDeclaration = getConstraintDeclarationForMappedType(type);
- return constraintDeclaration.kind === 198 /* TypeOperator */ && constraintDeclaration.operator === 142 /* KeyOfKeyword */;
+ return constraintDeclaration.kind === 200 /* TypeOperator */ && constraintDeclaration.operator === 142 /* KeyOfKeyword */;
}
function getModifiersTypeFromMappedType(type) {
if (!type.modifiersType) {
@@ -55743,7 +55919,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
}
function isJSDocOptionalParameter(node) {
- return isInJSFile(node) && (node.type && node.type.kind === 325 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 325 /* JSDocOptionalType */));
+ return isInJSFile(node) && (node.type && node.type.kind === 328 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 328 /* JSDocOptionalType */));
}
function tryFindAmbientModule(moduleName, withAugmentations) {
if (isExternalModuleNameRelative(moduleName)) {
@@ -55776,7 +55952,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
const { isBracketed, typeExpression } = node;
- return isBracketed || !!typeExpression && typeExpression.type.kind === 325 /* JSDocOptionalType */;
+ return isBracketed || !!typeExpression && typeExpression.type.kind === 328 /* JSDocOptionalType */;
}
function createTypePredicate(kind, parameterName, parameterIndex, type) {
return { kind, parameterName, parameterIndex, type };
@@ -55844,7 +56020,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
parameters.push(paramSymbol);
}
- if (type && type.kind === 201 /* LiteralType */) {
+ if (type && type.kind === 203 /* LiteralType */) {
flags |= 2 /* HasLiteralTypes */;
}
const isOptionalParameter2 = isOptionalJSDocPropertyLikeTag(param) || param.initializer || param.questionToken || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type || isJSDocOptionalParameter(param);
@@ -55852,14 +56028,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
minArgumentCount = parameters.length;
}
}
- if ((declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) {
- const otherKind = declaration.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */;
+ if ((declaration.kind === 179 /* GetAccessor */ || declaration.kind === 180 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) {
+ const otherKind = declaration.kind === 179 /* GetAccessor */ ? 180 /* SetAccessor */ : 179 /* GetAccessor */;
const other = getDeclarationOfKind(getSymbolOfNode(declaration), otherKind);
if (other) {
thisParameter = getAnnotatedAccessorThisParameter(other);
}
}
- const classType = declaration.kind === 176 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
+ const classType = declaration.kind === 178 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
flags |= 1 /* HasRestParameter */;
@@ -55935,15 +56111,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
return node.escapedText === argumentsSymbol.escapedName && getReferencedValueSymbol(node) === argumentsSymbol;
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- return node.name.kind === 166 /* ComputedPropertyName */ && traverse(node.name);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ return node.name.kind === 167 /* ComputedPropertyName */ && traverse(node.name);
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return traverse(node.expression);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return traverse(node.initializer);
default:
return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && !!forEachChild(node, traverse);
@@ -56010,7 +56186,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function createTypePredicateFromTypePredicateNode(node, signature) {
const parameterName = node.parameterName;
const type = node.type && getTypeFromTypeNode(node.type);
- return parameterName.kind === 197 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, void 0, void 0, type) : createTypePredicate(
+ return parameterName.kind === 199 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, void 0, void 0, type) : createTypePredicate(
node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */,
parameterName.escapedText,
findIndex(signature.parameters, (p) => p.escapedName === parameterName.escapedText),
@@ -56053,7 +56229,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return signature.resolvedReturnType;
}
function getReturnTypeFromAnnotation(declaration) {
- if (declaration.kind === 176 /* Constructor */) {
+ if (declaration.kind === 178 /* Constructor */) {
return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol));
}
if (isJSDocConstructSignature(declaration)) {
@@ -56063,12 +56239,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (typeNode) {
return getTypeFromTypeNode(typeNode);
}
- if (declaration.kind === 177 /* GetAccessor */ && hasBindableName(declaration)) {
+ if (declaration.kind === 179 /* GetAccessor */ && hasBindableName(declaration)) {
const jsDocType = isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration);
if (jsDocType) {
return jsDocType;
}
- const setter = getDeclarationOfKind(getSymbolOfNode(declaration), 178 /* SetAccessor */);
+ const setter = getDeclarationOfKind(getSymbolOfNode(declaration), 180 /* SetAccessor */);
const setterType = getAnnotatedAccessorType(setter);
if (setterType) {
return setterType;
@@ -56156,7 +56332,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
var _a2;
if (!signature.isolatedSignatureType) {
const kind = (_a2 = signature.declaration) == null ? void 0 : _a2.kind;
- const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
+ const isConstructor = kind === void 0 || kind === 178 /* Constructor */ || kind === 182 /* ConstructSignature */ || kind === 187 /* ConstructorType */;
const type = createObjectType(16 /* Anonymous */);
type.members = emptySymbols;
type.properties = emptyArray;
@@ -56215,9 +56391,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let inferences;
if ((_a2 = typeParameter.symbol) == null ? void 0 : _a2.declarations) {
for (const declaration of typeParameter.symbol.declarations) {
- if (declaration.parent.kind === 195 /* InferType */) {
+ if (declaration.parent.kind === 197 /* InferType */) {
const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent);
- if (grandParent.kind === 183 /* TypeReference */ && !omitTypeReferences) {
+ if (grandParent.kind === 185 /* TypeReference */ && !omitTypeReferences) {
const typeReference = grandParent;
const typeParameters = getTypeParametersForTypeReference(typeReference);
if (typeParameters) {
@@ -56235,13 +56411,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- } else if (grandParent.kind === 168 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 191 /* RestType */ || grandParent.kind === 202 /* NamedTupleMember */ && grandParent.dotDotDotToken) {
+ } else if (grandParent.kind === 169 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 193 /* RestType */ || grandParent.kind === 204 /* NamedTupleMember */ && grandParent.dotDotDotToken) {
inferences = append(inferences, createArrayType(unknownType));
- } else if (grandParent.kind === 204 /* TemplateLiteralTypeSpan */) {
+ } else if (grandParent.kind === 206 /* TemplateLiteralTypeSpan */) {
inferences = append(inferences, stringType);
- } else if (grandParent.kind === 167 /* TypeParameter */ && grandParent.parent.kind === 200 /* MappedType */) {
+ } else if (grandParent.kind === 168 /* TypeParameter */ && grandParent.parent.kind === 202 /* MappedType */) {
inferences = append(inferences, keyofConstraintType);
- } else if (grandParent.kind === 200 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 194 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 200 /* MappedType */ && grandParent.parent.checkType.type) {
+ } else if (grandParent.kind === 202 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 196 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 202 /* MappedType */ && grandParent.parent.checkType.type) {
const checkMappedType2 = grandParent.parent.checkType;
const nodeType = getTypeFromTypeNode(checkMappedType2.type);
inferences = append(inferences, instantiateType(
@@ -56266,7 +56442,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
let type = getTypeFromTypeNode(constraintDeclaration);
if (type.flags & 1 /* Any */ && !isErrorType(type)) {
- type = constraintDeclaration.parent.parent.kind === 200 /* MappedType */ ? keyofConstraintType : unknownType;
+ type = constraintDeclaration.parent.parent.kind === 202 /* MappedType */ ? keyofConstraintType : unknownType;
}
typeParameter.constraint = type;
}
@@ -56275,7 +56451,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return typeParameter.constraint === noConstraintType ? void 0 : typeParameter.constraint;
}
function getParentSymbolOfTypeParameter(typeParameter) {
- const tp = getDeclarationOfKind(typeParameter.symbol, 167 /* TypeParameter */);
+ const tp = getDeclarationOfKind(typeParameter.symbol, 168 /* TypeParameter */);
const host2 = isJSDocTemplateTag(tp.parent) ? getEffectiveContainerForJSDocTemplateTag(tp.parent) : tp.parent;
return host2 && getSymbolOfNode(host2);
}
@@ -56355,7 +56531,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return ((_a2 = type.target.localTypeParameters) == null ? void 0 : _a2.map(() => errorType)) || emptyArray;
}
const node = type.node;
- const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
+ const typeArguments = !node ? emptyArray : node.kind === 185 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 190 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
if (popTypeResolution()) {
type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
} else {
@@ -56389,7 +56565,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return errorType;
}
}
- if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
+ if (node.kind === 185 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
return createDeferredTypeReference(type, node, void 0);
}
const typeArguments = concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgumentsFromTypeReferenceNode(node), typeParameters, minTypeArgumentCount, isJs));
@@ -56457,9 +56633,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTypeReferenceName(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return node.typeName;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
const expr = node.expression;
if (isEntityNameExpression(expr)) {
return expr;
@@ -56471,10 +56647,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return symbol.parent ? `${getSymbolPath(symbol.parent)}.${symbol.escapedName}` : symbol.escapedName;
}
function getUnresolvedSymbolForEntityName(name) {
- const identifier = name.kind === 165 /* QualifiedName */ ? name.right : name.kind === 211 /* PropertyAccessExpression */ ? name.name : name;
+ const identifier = name.kind === 166 /* QualifiedName */ ? name.right : name.kind === 213 /* PropertyAccessExpression */ ? name.name : name;
const text = identifier.escapedText;
if (text) {
- const parentSymbol = name.kind === 165 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 211 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0;
+ const parentSymbol = name.kind === 166 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 213 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0;
const path2 = parentSymbol ? `${getSymbolPath(parentSymbol)}.${text}` : text;
let result = unresolvedSymbols.get(path2);
if (!result) {
@@ -56550,7 +56726,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const valueType = getTypeOfSymbol(symbol);
let typeType = valueType;
if (symbol.valueDeclaration) {
- const isImportTypeWithQualifier = node.kind === 205 /* ImportType */ && node.qualifier;
+ const isImportTypeWithQualifier = node.kind === 207 /* ImportType */ && node.qualifier;
if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) {
typeType = getTypeReferenceType(node, valueType.symbol);
}
@@ -56578,7 +56754,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
}
function isUnaryTupleTypeNode(node) {
- return node.kind === 189 /* TupleType */ && node.elements.length === 1;
+ return node.kind === 191 /* TupleType */ && node.elements.length === 1;
}
function getImpliedConstraint(type, checkNode, extendsNode) {
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) : void 0;
@@ -56586,17 +56762,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getConditionalFlowTypeOfType(type, node) {
let constraints;
let covariant = true;
- while (node && !isStatement(node) && node.kind !== 329 /* JSDoc */) {
+ while (node && !isStatement(node) && node.kind !== 332 /* JSDoc */) {
const parent2 = node.parent;
- if (parent2.kind === 168 /* Parameter */) {
+ if (parent2.kind === 169 /* Parameter */) {
covariant = !covariant;
}
- if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 194 /* ConditionalType */ && node === parent2.trueType) {
+ if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 196 /* ConditionalType */ && node === parent2.trueType) {
const constraint = getImpliedConstraint(type, parent2.checkType, parent2.extendsType);
if (constraint) {
constraints = append(constraints, constraint);
}
- } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && node === parent2.type) {
+ } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 202 /* MappedType */ && node === parent2.type) {
const mappedType = getTypeFromTypeNode(parent2);
if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
const typeParameter = getHomomorphicTypeVariable(mappedType);
@@ -56613,7 +56789,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return constraints ? getSubstitutionType(type, getIntersectionType(constraints)) : type;
}
function isJSDocTypeReference(node) {
- return !!(node.flags & 8388608 /* JSDoc */) && (node.kind === 183 /* TypeReference */ || node.kind === 205 /* ImportType */);
+ return !!(node.flags & 8388608 /* JSDoc */) && (node.kind === 185 /* TypeReference */ || node.kind === 207 /* ImportType */);
}
function checkNoTypeArguments(node, symbol) {
if (node.typeArguments) {
@@ -56719,9 +56895,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (declarations) {
for (const declaration of declarations) {
switch (declaration.kind) {
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
return declaration;
}
}
@@ -56882,11 +57058,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTupleElementFlags(node) {
switch (node.kind) {
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return 2 /* Optional */;
- case 191 /* RestType */:
+ case 193 /* RestType */:
return getRestTypeElementFlags(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */;
default:
return 1 /* Required */;
@@ -56902,55 +57078,55 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return readonly ? globalReadonlyArrayType : globalArrayType;
}
const elementFlags = map(node.elements, getTupleElementFlags);
- const missingName = some(node.elements, (e) => e.kind !== 202 /* NamedTupleMember */);
+ const missingName = some(node.elements, (e) => e.kind !== 204 /* NamedTupleMember */);
return getTupleTargetType(elementFlags, readonly, missingName ? void 0 : node.elements);
}
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
- return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
+ return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 190 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 191 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
}
function isResolvedByTypeAlias(node) {
const parent2 = node.parent;
switch (parent2.kind) {
- case 196 /* ParenthesizedType */:
- case 202 /* NamedTupleMember */:
- case 183 /* TypeReference */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 199 /* IndexedAccessType */:
- case 194 /* ConditionalType */:
- case 198 /* TypeOperator */:
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
+ case 198 /* ParenthesizedType */:
+ case 204 /* NamedTupleMember */:
+ case 185 /* TypeReference */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 201 /* IndexedAccessType */:
+ case 196 /* ConditionalType */:
+ case 200 /* TypeOperator */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
return isResolvedByTypeAlias(parent2);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
}
return false;
}
function mayResolveTypeAlias(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node, 788968 /* Type */).flags & 524288 /* TypeAlias */);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return true;
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return node.operator !== 158 /* UniqueKeyword */ && mayResolveTypeAlias(node.type);
- case 196 /* ParenthesizedType */:
- case 190 /* OptionalType */:
- case 202 /* NamedTupleMember */:
- case 325 /* JSDocOptionalType */:
- case 323 /* JSDocNullableType */:
- case 324 /* JSDocNonNullableType */:
- case 318 /* JSDocTypeExpression */:
+ case 198 /* ParenthesizedType */:
+ case 192 /* OptionalType */:
+ case 204 /* NamedTupleMember */:
+ case 328 /* JSDocOptionalType */:
+ case 326 /* JSDocNullableType */:
+ case 327 /* JSDocNonNullableType */:
+ case 321 /* JSDocTypeExpression */:
return mayResolveTypeAlias(node.type);
- case 191 /* RestType */:
- return node.type.kind !== 188 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 193 /* RestType */:
+ return node.type.kind !== 190 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return some(node.types, mayResolveTypeAlias);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType);
}
return false;
@@ -56961,10 +57137,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const target = getArrayOrTupleTargetType(node);
if (target === emptyGenericType) {
links.resolvedType = emptyObjectType;
- } else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
- links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, void 0);
+ } else if (!(node.kind === 191 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
+ links.resolvedType = node.kind === 191 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, void 0);
} else {
- const elementTypes = node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
+ const elementTypes = node.kind === 190 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
links.resolvedType = createNormalizedTypeReference(target, elementTypes);
}
}
@@ -57945,7 +58121,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, accessNode, accessFlags) {
var _a2;
- const accessExpression = accessNode && accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode : void 0;
+ const accessExpression = accessNode && accessNode.kind === 214 /* ElementAccessExpression */ ? accessNode : void 0;
const propName = accessNode && isPrivateIdentifier(accessNode) ? void 0 : getPropertyNameFromIndex(indexType, accessNode);
if (propName !== void 0) {
if (accessFlags & 256 /* Contextual */) {
@@ -58113,7 +58289,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getIndexNodeForAccessExpression(accessNode) {
- return accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 199 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 166 /* ComputedPropertyName */ ? accessNode.expression : accessNode;
+ return accessNode.kind === 214 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 201 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 167 /* ComputedPropertyName */ ? accessNode.expression : accessNode;
}
function isPatternLiteralPlaceholderType(type) {
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
@@ -58244,7 +58420,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
accessFlags |= 1 /* IncludeUndefined */;
- if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
+ if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 201 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
if (objectType.flags & 3 /* AnyOrUnknown */) {
return objectType;
}
@@ -58784,7 +58960,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getThisType(node) {
const container = getThisContainer(node, false);
const parent2 = container && container.parent;
- if (parent2 && (isClassLike(parent2) || parent2.kind === 267 /* InterfaceDeclaration */)) {
+ if (parent2 && (isClassLike(parent2) || parent2.kind === 270 /* InterfaceDeclaration */)) {
if (!isStatic(container) && (!isConstructorDeclaration(container) || isNodeDescendantOf(node, container.body))) {
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent2)).thisType;
}
@@ -58814,17 +58990,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getArrayElementTypeNode(node) {
switch (node.kind) {
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return getArrayElementTypeNode(node.type);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
if (node.elements.length === 1) {
node = node.elements[0];
- if (node.kind === 191 /* RestType */ || node.kind === 202 /* NamedTupleMember */ && node.dotDotDotToken) {
+ if (node.kind === 193 /* RestType */ || node.kind === 204 /* NamedTupleMember */ && node.dotDotDotToken) {
return getArrayElementTypeNode(node.type);
}
}
break;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return node.elementType;
}
return void 0;
@@ -58839,8 +59015,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeFromTypeNodeWorker(node) {
switch (node.kind) {
case 132 /* AnyKeyword */:
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
return anyType;
case 159 /* UnknownKeyword */:
return unknownType;
@@ -58866,66 +59042,66 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return node.flags & 262144 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType;
case 140 /* IntrinsicKeyword */:
return intrinsicMarkerType;
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 109 /* ThisKeyword */:
return getTypeFromThisTypeNode(node);
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return getTypeFromLiteralTypeNode(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return getTypeFromTypeReference(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return node.assertsModifier ? voidType : booleanType;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return getTypeFromTypeReference(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return getTypeFromTypeQueryNode(node);
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
return getTypeFromArrayOrTupleTypeNode(node);
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return getTypeFromOptionalTypeNode(node);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return getTypeFromUnionTypeNode(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return getTypeFromIntersectionTypeNode(node);
- case 323 /* JSDocNullableType */:
+ case 326 /* JSDocNullableType */:
return getTypeFromJSDocNullableTypeNode(node);
- case 325 /* JSDocOptionalType */:
+ case 328 /* JSDocOptionalType */:
return addOptionality(getTypeFromTypeNode(node.type));
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return getTypeFromNamedTupleTypeNode(node);
- case 196 /* ParenthesizedType */:
- case 324 /* JSDocNonNullableType */:
- case 318 /* JSDocTypeExpression */:
+ case 198 /* ParenthesizedType */:
+ case 327 /* JSDocNonNullableType */:
+ case 321 /* JSDocTypeExpression */:
return getTypeFromTypeNode(node.type);
- case 191 /* RestType */:
+ case 193 /* RestType */:
return getTypeFromRestTypeNode(node);
- case 327 /* JSDocVariadicType */:
+ case 330 /* JSDocVariadicType */:
return getTypeFromJSDocVariadicType(node);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 326 /* JSDocFunctionType */:
- case 332 /* JSDocSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 329 /* JSDocFunctionType */:
+ case 335 /* JSDocSignature */:
return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return getTypeFromTypeOperatorNode(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return getTypeFromIndexedAccessTypeNode(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return getTypeFromMappedTypeNode(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return getTypeFromConditionalTypeNode(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return getTypeFromInferTypeNode(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return getTypeFromTemplateTypeNode(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return getTypeFromImportTypeNode(node);
case 79 /* Identifier */:
- case 165 /* QualifiedName */:
- case 211 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
const symbol = getSymbolAtLocation(node);
return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType;
default:
@@ -59120,13 +59296,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type;
}
function maybeTypeParameterReference(node) {
- return !(node.parent.kind === 183 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 205 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
+ return !(node.parent.kind === 185 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 207 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);
}
function isTypeParameterPossiblyReferenced(tp, node) {
if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {
const container = tp.symbol.declarations[0].parent;
for (let n = node; n !== container; n = n.parent) {
- if (!n || n.kind === 242 /* Block */ || n.kind === 194 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) {
+ if (!n || n.kind === 244 /* Block */ || n.kind === 196 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) {
return true;
}
}
@@ -59135,17 +59311,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
function containsReference(node2) {
switch (node2.kind) {
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return !!tp.isThisType;
case 79 /* Identifier */:
return !tp.isThisType && isPartOfTypeNode(node2) && maybeTypeParameterReference(node2) && getTypeFromTypeNodeWorker(node2) === tp;
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
const entityName = node2.exprName;
const firstIdentifier = getFirstIdentifier(entityName);
const firstIdentifierSymbol = getResolvedSymbol(firstIdentifier);
const tpDeclaration = tp.symbol.declarations[0];
let tpScope;
- if (tpDeclaration.kind === 167 /* TypeParameter */) {
+ if (tpDeclaration.kind === 168 /* TypeParameter */) {
tpScope = tpDeclaration.parent;
} else if (tp.isThisType) {
tpScope = tpDeclaration;
@@ -59156,8 +59332,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return some(firstIdentifierSymbol.declarations, (idDecl) => isNodeDescendantOf(idDecl, tpScope)) || some(node2.typeArguments, containsReference);
}
return true;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return !node2.type && !!node2.body || some(node2.typeParameters, containsReference) || some(node2.parameters, containsReference) || !!node2.type && containsReference(node2.type);
}
return !!forEachChild(node2, containsReference);
@@ -59388,32 +59564,32 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
}
function isContextSensitive(node) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
switch (node.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
return isContextSensitiveFunctionLikeDeclaration(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return some(node.properties, isContextSensitive);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return some(node.elements, isContextSensitive);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right));
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return isContextSensitive(node.initializer);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isContextSensitive(node.expression);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return some(node.properties, isContextSensitive) || isJsxOpeningElement(node.parent) && some(node.parent.parent.children, isContextSensitive);
- case 294 /* JsxAttribute */: {
+ case 297 /* JsxAttribute */: {
const { initializer } = node;
return !!initializer && isContextSensitive(initializer);
}
- case 297 /* JsxExpression */: {
+ case 300 /* JsxExpression */: {
const { expression } = node;
return !!expression && isContextSensitive(expression);
}
@@ -59424,7 +59600,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
}
function hasContextSensitiveReturnExpression(node) {
- return !node.typeParameters && !getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 242 /* Block */ && isContextSensitive(node.body);
+ return !node.typeParameters && !getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 244 /* Block */ && isContextSensitive(node.body);
}
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func);
@@ -59497,23 +59673,23 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
switch (node.kind) {
- case 297 /* JsxExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 300 /* JsxExpression */:
+ case 219 /* ParenthesizedExpression */:
return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (node.operatorToken.kind) {
case 63 /* EqualsToken */:
case 27 /* CommaToken */:
return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
}
break;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer);
}
return false;
@@ -59687,16 +59863,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) {
switch (child.kind) {
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return { errorNode: child, innerExpression: child.expression, nameType };
case 11 /* JsxText */:
if (child.containsOnlyTriviaWhiteSpaces) {
break;
}
return { errorNode: child, innerExpression: void 0, nameType, errorMessage: getInvalidTextDiagnostic() };
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
return { errorNode: child, innerExpression: child, nameType };
default:
return Debug.assertNever(child, "Found invalid jsx child");
@@ -59822,13 +59998,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
}
switch (prop.kind) {
- case 178 /* SetAccessor */:
- case 177 /* GetAccessor */:
- case 174 /* MethodDeclaration */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 180 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 309 /* ShorthandPropertyAssignment */:
yield { errorNode: prop.name, innerExpression: void 0, nameType: type };
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type, errorMessage: isComputedNonLiteralName(prop.name) ? Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 : void 0 };
break;
default:
@@ -59882,7 +60058,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers);
}
const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
- const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 174 /* MethodDeclaration */ && kind !== 173 /* MethodSignature */ && kind !== 176 /* Constructor */;
+ const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 176 /* MethodDeclaration */ && kind !== 175 /* MethodSignature */ && kind !== 178 /* Constructor */;
let result = -1 /* True */;
const sourceThisType = getThisTypeOfSignature(source);
if (sourceThisType && sourceThisType !== voidType) {
@@ -61728,7 +61904,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const sourceSignature = first(sourceSignatures);
const targetSignature = first(targetSignatures);
result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, incompatibleReporter(sourceSignature, targetSignature));
- if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 176 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 176 /* Constructor */)) {
+ if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 178 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 178 /* Constructor */)) {
const constructSignatureToString = (signature) => signatureToString(signature, void 0, 262144 /* WriteArrowStyleSignature */, kind);
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature));
reportError(Diagnostics.Types_of_construct_signatures_are_incompatible);
@@ -62346,7 +62522,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const target = type.target;
if (getObjectFlags(target) & 1 /* Class */) {
const baseTypeNode = getBaseTypeNodeOfClass(target);
- if (baseTypeNode && baseTypeNode.expression.kind !== 79 /* Identifier */ && baseTypeNode.expression.kind !== 211 /* PropertyAccessExpression */) {
+ if (baseTypeNode && baseTypeNode.expression.kind !== 79 /* Identifier */ && baseTypeNode.expression.kind !== 213 /* PropertyAccessExpression */) {
return void 0;
}
}
@@ -62713,12 +62889,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let diagnostic;
switch (declaration.kind) {
- case 227 /* BinaryExpression */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 229 /* BinaryExpression */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
diagnostic = noImplicitAny ? Diagnostics.Member_0_implicitly_has_an_1_type : Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
const param = declaration;
if (isIdentifier(param.name) && (isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(param, param.name.escapedText, 788968 /* Type */, void 0, param.name.escapedText, true) || param.name.originalKeywordKind && isTypeNodeKind(param.name.originalKeywordKind))) {
const newName = "arg" + param.parent.parameters.indexOf(param);
@@ -62728,22 +62904,22 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
diagnostic = Diagnostics.Binding_element_0_implicitly_has_an_1_type;
if (!noImplicitAny) {
return;
}
break;
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
return;
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
if (noImplicitAny && !declaration.name) {
if (wideningKind === 3 /* GeneratorYield */) {
error(declaration, Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString);
@@ -62754,7 +62930,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
diagnostic = !noImplicitAny ? Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage : wideningKind === 3 /* GeneratorYield */ ? Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type;
break;
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
if (noImplicitAny) {
error(declaration, Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type);
}
@@ -62851,7 +63027,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function inferFromIntraExpressionSites(context) {
if (context.intraExpressionInferenceSites) {
for (const { node, type } of context.intraExpressionInferenceSites) {
- const contextualType = node.kind === 174 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */);
+ const contextualType = node.kind === 176 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */);
if (contextualType) {
inferTypes(context.inferences, type, contextualType);
}
@@ -62903,8 +63079,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isNonGenericTopLevelType(type) {
if (type.aliasSymbol && !type.aliasTypeArguments) {
- const declaration = getDeclarationOfKind(type.aliasSymbol, 268 /* TypeAliasDeclaration */);
- return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 314 /* SourceFile */ ? true : n.kind === 270 /* ModuleDeclaration */ ? false : "quit"));
+ const declaration = getDeclarationOfKind(type.aliasSymbol, 271 /* TypeAliasDeclaration */);
+ return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 317 /* SourceFile */ ? true : n.kind === 273 /* ModuleDeclaration */ ? false : "quit"));
}
return false;
}
@@ -63649,7 +63825,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function inferFromSignature(source, target) {
const saveBivariant = bivariant;
const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
- bivariant = bivariant || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 176 /* Constructor */;
+ bivariant = bivariant || kind === 176 /* MethodDeclaration */ || kind === 175 /* MethodSignature */ || kind === 178 /* Constructor */;
applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
bivariant = saveBivariant;
applyToReturnTypes(source, target, inferFromTypes);
@@ -63805,7 +63981,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function;
}
default:
- if (node.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.parent.kind === 309 /* ShorthandPropertyAssignment */) {
return Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;
} else {
return Diagnostics.Cannot_find_name_0;
@@ -63830,7 +64006,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isInTypeQuery(node) {
return !!findAncestor(
node,
- (n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 79 /* Identifier */ || n.kind === 165 /* QualifiedName */ ? false : "quit"
+ (n) => n.kind === 188 /* TypeQuery */ ? true : n.kind === 79 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit"
);
}
function getFlowCacheKey(node, declaredType, initialType, flowContainer) {
@@ -63842,59 +64018,59 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
case 109 /* ThisKeyword */:
return `0|${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}`;
- case 236 /* NonNullExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
const left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer);
return left && left + "." + node.right.escapedText;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const propName = getAccessedPropertyName(node);
if (propName !== void 0) {
const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
return key && key + "." + propName;
}
break;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
return `${getNodeId(node)}#${getTypeId(declaredType)}`;
}
return void 0;
}
function isMatchingReference(source, target) {
switch (target.kind) {
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return isMatchingReference(source, target.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isAssignmentExpression(target) && isMatchingReference(source, target.left) || isBinaryExpression(target) && target.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source, target.right);
}
switch (source.kind) {
- case 237 /* MetaProperty */:
- return target.kind === 237 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText;
+ case 239 /* MetaProperty */:
+ return target.kind === 239 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText;
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
- return isThisInTypeQuery(source) ? target.kind === 109 /* ThisKeyword */ : target.kind === 79 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || (target.kind === 261 /* VariableDeclaration */ || target.kind === 208 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
+ return isThisInTypeQuery(source) ? target.kind === 109 /* ThisKeyword */ : target.kind === 79 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || (target.kind === 263 /* VariableDeclaration */ || target.kind === 210 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
case 109 /* ThisKeyword */:
return target.kind === 109 /* ThisKeyword */;
case 107 /* SuperKeyword */:
return target.kind === 107 /* SuperKeyword */;
- case 236 /* NonNullExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
return isMatchingReference(source.expression, target);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const sourcePropertyName = getAccessedPropertyName(source);
const targetPropertyName = isAccessExpression(target) ? getAccessedPropertyName(target) : void 0;
return sourcePropertyName !== void 0 && targetPropertyName !== void 0 && targetPropertyName === sourcePropertyName && isMatchingReference(source.expression, target.expression);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return isAccessExpression(target) && source.right.escapedText === getAccessedPropertyName(target) && isMatchingReference(source.left, target.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isBinaryExpression(source) && source.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source.right, target);
}
return false;
@@ -64044,7 +64220,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getMatchingUnionConstituentForObjectLiteral(unionType, node) {
const keyPropertyName = getKeyPropertyName(unionType);
- const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 305 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer));
+ const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 308 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer));
const propType = propNode && getContextFreeTypeOfExpression(propNode.initializer);
return propType && getConstituentTypeForKeyType(unionType, propType);
}
@@ -64059,7 +64235,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (expression.expression.kind === 211 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) {
+ if (expression.expression.kind === 213 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) {
return true;
}
return false;
@@ -64220,11 +64396,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, void 0) || errorType);
}
function getAssignedTypeOfBinaryExpression(node) {
- const isDestructuringDefaultAssignment = node.parent.kind === 209 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 305 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);
+ const isDestructuringDefaultAssignment = node.parent.kind === 211 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 308 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);
return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right);
}
function isDestructuringAssignmentTarget(parent2) {
- return parent2.parent.kind === 227 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 251 /* ForOfStatement */ && parent2.parent.initializer === parent2;
+ return parent2.parent.kind === 229 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 253 /* ForOfStatement */ && parent2.parent.initializer === parent2;
}
function getAssignedTypeOfArrayLiteralElement(node, element) {
return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element));
@@ -64241,21 +64417,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getAssignedType(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return stringType;
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return checkRightHandSideOfForOf(parent2) || errorType;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return getAssignedTypeOfBinaryExpression(parent2);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return undefinedType;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return getAssignedTypeOfArrayLiteralElement(parent2, node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return getAssignedTypeOfSpreadExpression(parent2);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getAssignedTypeOfPropertyAssignment(parent2);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return getAssignedTypeOfShorthandPropertyAssignment(parent2);
}
return errorType;
@@ -64263,7 +64439,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getInitialTypeOfBindingElement(node) {
const pattern = node.parent;
const parentType = getInitialType(pattern.parent);
- const type = pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType);
+ const type = pattern.kind === 208 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType);
return getTypeWithDefault(type, node.initializer);
}
function getTypeOfInitializer(node) {
@@ -64274,25 +64450,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.initializer) {
return getTypeOfInitializer(node.initializer);
}
- if (node.parent.parent.kind === 250 /* ForInStatement */) {
+ if (node.parent.parent.kind === 252 /* ForInStatement */) {
return stringType;
}
- if (node.parent.parent.kind === 251 /* ForOfStatement */) {
+ if (node.parent.parent.kind === 253 /* ForOfStatement */) {
return checkRightHandSideOfForOf(node.parent.parent) || errorType;
}
return errorType;
}
function getInitialType(node) {
- return node.kind === 261 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node);
+ return node.kind === 263 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node);
}
function isEmptyArrayAssignment(node) {
- return node.kind === 261 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 208 /* BindingElement */ && node.parent.kind === 227 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right);
+ return node.kind === 263 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 210 /* BindingElement */ && node.parent.kind === 229 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right);
}
function getReferenceCandidate(node) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return getReferenceCandidate(node.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (node.operatorToken.kind) {
case 63 /* EqualsToken */:
case 75 /* BarBarEqualsToken */:
@@ -64307,10 +64483,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getReferenceRoot(node) {
const { parent: parent2 } = node;
- return parent2.kind === 217 /* ParenthesizedExpression */ || parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 63 /* EqualsToken */ && parent2.left === node || parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 27 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node;
+ return parent2.kind === 219 /* ParenthesizedExpression */ || parent2.kind === 229 /* BinaryExpression */ && parent2.operatorToken.kind === 63 /* EqualsToken */ && parent2.left === node || parent2.kind === 229 /* BinaryExpression */ && parent2.operatorToken.kind === 27 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node;
}
function getTypeOfSwitchClause(clause) {
- if (clause.kind === 298 /* CaseClause */) {
+ if (clause.kind === 301 /* CaseClause */) {
return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression));
}
return neverType;
@@ -64326,12 +64502,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return links.switchTypes;
}
function getSwitchClauseTypeOfWitnesses(switchStatement) {
- if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 298 /* CaseClause */ && !isStringLiteralLike(clause.expression))) {
+ if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 301 /* CaseClause */ && !isStringLiteralLike(clause.expression))) {
return void 0;
}
const witnesses = [];
for (const clause of switchStatement.caseBlock.clauses) {
- const text = clause.kind === 298 /* CaseClause */ ? clause.expression.text : void 0;
+ const text = clause.kind === 301 /* CaseClause */ ? clause.expression.text : void 0;
witnesses.push(text && !contains(witnesses, text) ? text : void 0);
}
return witnesses;
@@ -64481,8 +64657,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isEvolvingArrayOperationTarget(node) {
const root = getReferenceRoot(node);
const parent2 = root.parent;
- const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 213 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name));
- const isElementAssignment = parent2.kind === 212 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 227 /* BinaryExpression */ && parent2.parent.operatorToken.kind === 63 /* EqualsToken */ && parent2.parent.left === parent2 && !isAssignmentTarget(parent2.parent) && isTypeAssignableToKind(getTypeOfExpression(parent2.argumentExpression), 296 /* NumberLike */);
+ const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 215 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name));
+ const isElementAssignment = parent2.kind === 214 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 229 /* BinaryExpression */ && parent2.parent.operatorToken.kind === 63 /* EqualsToken */ && parent2.parent.left === parent2 && !isAssignmentTarget(parent2.parent) && isTypeAssignableToKind(getTypeOfExpression(parent2.argumentExpression), 296 /* NumberLike */);
return isLengthPushOrUnshift || isElementAssignment;
}
function isDeclarationWithExplicitTypeAnnotation(node) {
@@ -64505,7 +64681,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isDeclarationWithExplicitTypeAnnotation(declaration)) {
return getTypeOfSymbol(symbol);
}
- if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 251 /* ForOfStatement */) {
+ if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 253 /* ForOfStatement */) {
const statement = declaration.parent.parent;
const expressionType = getTypeOfDottedName(statement.expression, void 0);
if (expressionType) {
@@ -64529,7 +64705,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getExplicitThisType(node);
case 107 /* SuperKeyword */:
return checkSuperExpression(node);
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const type = getTypeOfDottedName(node.expression, diagnostic);
if (type) {
const name = node.name;
@@ -64546,7 +64722,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return void 0;
}
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return getTypeOfDottedName(node.expression, diagnostic);
}
}
@@ -64556,7 +64732,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let signature = links.effectsSignature;
if (signature === void 0) {
let funcType;
- if (node.parent.kind === 245 /* ExpressionStatement */) {
+ if (node.parent.kind === 247 /* ExpressionStatement */) {
funcType = getTypeOfDottedName(node.expression, void 0);
} else if (node.expression.kind !== 107 /* SuperKeyword */) {
if (isOptionalChain(node)) {
@@ -64598,7 +64774,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isFalseExpression(expr) {
const node = skipParentheses(expr, true);
- return node.kind === 96 /* FalseKeyword */ || node.kind === 227 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right));
+ return node.kind === 96 /* FalseKeyword */ || node.kind === 229 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right));
}
function isReachableFlowNodeWorker(flow, noCacheCheck) {
while (true) {
@@ -64697,8 +64873,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const symbol = getResolvedSymbol(node);
return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
}
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
}
return false;
@@ -64718,7 +64894,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode));
sharedFlowCount = sharedFlowStart;
const resultType = getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
- if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 236 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
+ if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 238 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
return declaredType;
}
return resultType === nonNullUnknownType ? unknownType : resultType;
@@ -64787,7 +64963,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
target.antecedents = saveAntecedents;
} else if (flags & 2 /* Start */) {
const container = flow.node;
- if (container && container !== flowContainer && reference.kind !== 211 /* PropertyAccessExpression */ && reference.kind !== 212 /* ElementAccessExpression */ && reference.kind !== 109 /* ThisKeyword */) {
+ if (container && container !== flowContainer && reference.kind !== 213 /* PropertyAccessExpression */ && reference.kind !== 214 /* ElementAccessExpression */ && reference.kind !== 109 /* ThisKeyword */) {
flow = container.flowNode;
continue;
}
@@ -64806,7 +64982,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getInitialOrAssignedType(flow) {
const node = flow.node;
- return getNarrowableTypeForReference(node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference);
+ return getNarrowableTypeForReference(node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference);
}
function getTypeAtFlowAssignment(flow) {
const node = flow.node;
@@ -64836,13 +65012,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (isVariableDeclaration(node) && (isInJSFile(node) || isVarConst(node))) {
const init = getDeclaredExpandoInitializer(node);
- if (init && (init.kind === 218 /* FunctionExpression */ || init.kind === 219 /* ArrowFunction */)) {
+ if (init && (init.kind === 220 /* FunctionExpression */ || init.kind === 221 /* ArrowFunction */)) {
return getTypeAtFlowNode(flow.antecedent);
}
}
return declaredType;
}
- if (isVariableDeclaration(node) && node.parent.parent.kind === 250 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
+ if (isVariableDeclaration(node) && node.parent.parent.kind === 252 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {
return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))));
}
return void 0;
@@ -64852,7 +65028,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.kind === 96 /* FalseKeyword */) {
return unreachableNeverType;
}
- if (node.kind === 227 /* BinaryExpression */) {
+ if (node.kind === 229 /* BinaryExpression */) {
if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) {
return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right);
}
@@ -64881,13 +65057,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getTypeAtFlowArrayMutation(flow) {
if (declaredType === autoType || declaredType === autoArrayType) {
const node = flow.node;
- const expr = node.kind === 213 /* CallExpression */ ? node.expression.expression : node.left.expression;
+ const expr = node.kind === 215 /* CallExpression */ ? node.expression.expression : node.left.expression;
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
const flowType = getTypeAtFlowNode(flow.antecedent);
const type = getTypeFromFlowType(flowType);
if (getObjectFlags(type) & 256 /* EvolvingArray */) {
let evolvedType2 = type;
- if (node.kind === 213 /* CallExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
for (const arg of node.arguments) {
evolvedType2 = addEvolvingArrayElementType(evolvedType2, arg);
}
@@ -64924,7 +65100,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let type = getTypeFromFlowType(flowType);
if (isMatchingReference(reference, expr)) {
type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
- } else if (expr.kind === 222 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
+ } else if (expr.kind === 224 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
} else {
if (strictNullChecks) {
@@ -64936,7 +65112,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
flow.clauseEnd,
(t) => !(t.flags & (32768 /* Undefined */ | 131072 /* Never */))
);
- } else if (expr.kind === 222 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) {
+ } else if (expr.kind === 224 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) {
type = narrowTypeBySwitchOptionalChainContainment(
type,
flow.switchStatement,
@@ -65185,10 +65361,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const operator = expr.operatorToken.kind;
const left = getReferenceCandidate(expr.left);
const right = getReferenceCandidate(expr.right);
- if (left.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(right)) {
+ if (left.kind === 224 /* TypeOfExpression */ && isStringLiteralLike(right)) {
return narrowTypeByTypeof(type, left, operator, right, assumeTrue);
}
- if (right.kind === 222 /* TypeOfExpression */ && isStringLiteralLike(left)) {
+ if (right.kind === 224 /* TypeOfExpression */ && isStringLiteralLike(left)) {
return narrowTypeByTypeof(type, right, operator, left, assumeTrue);
}
if (isMatchingReference(reference, left)) {
@@ -65386,7 +65562,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!witnesses) {
return type;
}
- const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 299 /* DefaultClause */);
+ const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 302 /* DefaultClause */);
const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd;
if (hasDefaultClause) {
const notEqualFacts = getNotEqualFactsFromTypeofSwitch(clauseStart, clauseEnd, witnesses);
@@ -65539,17 +65715,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
case 109 /* ThisKeyword */:
case 107 /* SuperKeyword */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return narrowTypeByTruthiness(type, expr, assumeTrue);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return narrowTypeByCallExpression(type, expr, assumeTrue);
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return narrowType(type, expr.expression, assumeTrue);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
if (expr.operator === 53 /* ExclamationToken */) {
return narrowType(type, expr.operand, !assumeTrue);
}
@@ -65587,7 +65763,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getNonMissingTypeOfSymbol(symbol);
}
function getControlFlowContainer(node) {
- return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 271 /* ModuleBlock */ || node2.kind === 314 /* SourceFile */ || node2.kind === 171 /* PropertyDeclaration */ || node2.kind === 172 /* AnnotationPropertyDeclaration */);
+ return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 274 /* ModuleBlock */ || node2.kind === 317 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */ || node2.kind === 173 /* AnnotationPropertyDeclaration */);
}
function isSymbolAssigned(symbol) {
if (!symbol.valueDeclaration) {
@@ -65623,7 +65799,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function removeOptionalityFromDeclaredType(declaredType, declaration) {
if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) {
- const annotationIncludesUndefined = strictNullChecks && declaration.kind === 168 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
+ const annotationIncludesUndefined = strictNullChecks && declaration.kind === 169 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
popTypeResolution();
return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
} else {
@@ -65633,7 +65809,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isConstraintPosition(type, node) {
const parent2 = node.parent;
- return parent2.kind === 211 /* PropertyAccessExpression */ || parent2.kind === 165 /* QualifiedName */ || parent2.kind === 213 /* CallExpression */ && parent2.expression === node || parent2.kind === 212 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression)));
+ return parent2.kind === 213 /* PropertyAccessExpression */ || parent2.kind === 166 /* QualifiedName */ || parent2.kind === 215 /* CallExpression */ && parent2.expression === node || parent2.kind === 214 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression)));
}
function isGenericTypeWithUnionConstraint(type) {
return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithUnionConstraint) : !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */));
@@ -65681,14 +65857,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (declaration) {
if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
const parent2 = declaration.parent.parent;
- if (parent2.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent2.kind === 168 /* Parameter */) {
+ if (parent2.kind === 263 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent2.kind === 169 /* Parameter */) {
const links = getNodeLinks(parent2);
if (!(links.flags & 268435456 /* InCheckIdentifier */)) {
links.flags |= 268435456 /* InCheckIdentifier */;
const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
links.flags &= ~268435456 /* InCheckIdentifier */;
- if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 168 /* Parameter */ && isSymbolAssigned(symbol))) {
+ if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
const pattern = declaration.parent;
const narrowedType = getFlowTypeOfReference(pattern, parentTypeConstraint, parentTypeConstraint, void 0, location.flowNode);
if (narrowedType.flags & 131072 /* Never */) {
@@ -65731,7 +65907,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const container = getContainingFunction(node);
if (languageVersion < 2 /* ES2015 */) {
- if (container.kind === 219 /* ArrowFunction */) {
+ if (container.kind === 221 /* ArrowFunction */) {
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
} else if (hasSyntacticModifier(container, 512 /* Async */)) {
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
@@ -65752,7 +65928,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let declaration = localOrExportSymbol.valueDeclaration;
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
- if (declaration.kind === 264 /* ClassDeclaration */ && nodeIsDecorated(declaration)) {
+ if (declaration.kind === 266 /* ClassDeclaration */ && nodeIsDecorated(declaration)) {
let container = getContainingClass(node);
while (container !== void 0) {
if (container === declaration && container.name !== node) {
@@ -65762,9 +65938,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
container = getContainingClass(container);
}
- } else if (declaration.kind === 232 /* ClassExpression */) {
+ } else if (declaration.kind === 234 /* ClassExpression */) {
let container = getThisContainer(node, false);
- while (container.kind !== 314 /* SourceFile */) {
+ while (container.kind !== 317 /* SourceFile */) {
if (container.parent === declaration) {
if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */;
@@ -65812,16 +65988,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type;
}
type = getNarrowableTypeForReference(type, node, checkMode);
- const isParameter2 = getRootDeclaration(declaration).kind === 168 /* Parameter */;
+ const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */;
const declarationContainer = getControlFlowContainer(declaration);
let flowContainer = getControlFlowContainer(node);
const isOuterVariable = flowContainer !== declarationContainer;
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
- while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 220 /* FunctionExpression */ || flowContainer.kind === 221 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
flowContainer = getControlFlowContainer(flowContainer);
}
- const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || node.parent.kind === 284 /* ExportSpecifier */) || node.parent.kind === 236 /* NonNullExpression */ || declaration.kind === 261 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
+ const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || node.parent.kind === 287 /* ExportSpecifier */) || node.parent.kind === 238 /* NonNullExpression */ || declaration.kind === 263 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
@@ -65871,7 +66047,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return findAncestor(node, (n) => !n || nodeStartsNewLexicalEnvironment(n) ? "quit" : isIterationStatement(n, false));
}
function checkNestedBlockScopedBinding(node, symbol) {
- if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 301 /* CatchClause */) {
+ if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 304 /* CatchClause */) {
return;
}
const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration);
@@ -65881,7 +66057,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isCaptured) {
let capturesBlockScopeBindingInLoopBody = true;
if (isForStatement(container)) {
- const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */);
+ const varDeclList = getAncestor(symbol.valueDeclaration, 264 /* VariableDeclarationList */);
if (varDeclList && varDeclList.parent === container) {
const part = getPartOfForStatementContainingNode(node.parent, container);
if (part) {
@@ -65900,7 +66076,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
if (isForStatement(container)) {
- const varDeclList = getAncestor(symbol.valueDeclaration, 262 /* VariableDeclarationList */);
+ const varDeclList = getAncestor(symbol.valueDeclaration, 264 /* VariableDeclarationList */);
if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */;
}
@@ -65917,13 +66093,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isAssignedInBodyOfForStatement(node, container) {
let current = node;
- while (current.parent.kind === 217 /* ParenthesizedExpression */) {
+ while (current.parent.kind === 219 /* ParenthesizedExpression */) {
current = current.parent;
}
let isAssigned = false;
if (isAssignmentTarget(current)) {
isAssigned = true;
- } else if (current.parent.kind === 225 /* PrefixUnaryExpression */ || current.parent.kind === 226 /* PostfixUnaryExpression */) {
+ } else if (current.parent.kind === 227 /* PrefixUnaryExpression */ || current.parent.kind === 228 /* PostfixUnaryExpression */) {
const expr = current.parent;
isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */;
}
@@ -65934,7 +66110,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function captureLexicalThis(node, container) {
getNodeLinks(node).flags |= 2 /* LexicalThis */;
- if (container.kind === 171 /* PropertyDeclaration */ || container.kind === 176 /* Constructor */) {
+ if (container.kind === 172 /* PropertyDeclaration */ || container.kind === 178 /* Constructor */) {
const classNode = container.parent;
getNodeLinks(classNode).flags |= 4 /* CaptureThis */;
} else {
@@ -65968,27 +66144,27 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const isNodeInTypeQuery = isInTypeQuery(node);
let container = getThisContainer(node, true);
let capturedByArrowFunction = false;
- if (container.kind === 176 /* Constructor */) {
+ if (container.kind === 178 /* Constructor */) {
checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class);
}
- if (container.kind === 219 /* ArrowFunction */) {
+ if (container.kind === 221 /* ArrowFunction */) {
container = getThisContainer(container, false);
capturedByArrowFunction = true;
}
checkThisInStaticClassFieldInitializerInDecoratedClass(node, container);
switch (container.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
error(node, Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
error(node, Diagnostics.this_cannot_be_referenced_in_current_location);
break;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
if (isInConstructorArgumentInitializer(node, container)) {
error(node, Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
}
break;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
error(node, Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);
break;
}
@@ -66062,13 +66238,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getClassNameFromPrototypeMethod(container) {
- if (container.kind === 218 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) {
+ if (container.kind === 220 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) {
return container.parent.left.expression.expression;
- } else if (container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) {
+ } else if (container.kind === 176 /* MethodDeclaration */ && container.parent.kind === 212 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) {
return container.parent.parent.left.expression;
- } else if (container.kind === 218 /* FunctionExpression */ && container.parent.kind === 305 /* PropertyAssignment */ && container.parent.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) {
+ } else if (container.kind === 220 /* FunctionExpression */ && container.parent.kind === 308 /* PropertyAssignment */ && container.parent.parent.kind === 212 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) {
return container.parent.parent.parent.left.expression;
- } else if (container.kind === 218 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {
+ } else if (container.kind === 220 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {
return container.parent.parent.parent.arguments[0].expression;
} else if (isMethodDeclaration(container) && isIdentifier(container.name) && (container.name.escapedText === "value" || container.name.escapedText === "get" || container.name.escapedText === "set") && isObjectLiteralExpression(container.parent) && isCallExpression(container.parent.parent) && container.parent.parent.arguments[2] === container.parent && getAssignmentDeclarationKind(container.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {
return container.parent.parent.arguments[0].expression;
@@ -66076,7 +66252,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTypeForThisExpressionFromJSDoc(node) {
const jsdocType = getJSDocType(node);
- if (jsdocType && jsdocType.kind === 326 /* JSDocFunctionType */) {
+ if (jsdocType && jsdocType.kind === 329 /* JSDocFunctionType */) {
const jsDocFunctionType = jsdocType;
if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && jsDocFunctionType.parameters[0].name.escapedText === "this" /* This */) {
return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type);
@@ -66088,16 +66264,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isInConstructorArgumentInitializer(node, constructorDecl) {
- return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 168 /* Parameter */ && n.parent === constructorDecl);
+ return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 169 /* Parameter */ && n.parent === constructorDecl);
}
function checkSuperExpression(node) {
- const isCallExpression2 = node.parent.kind === 213 /* CallExpression */ && node.parent.expression === node;
+ const isCallExpression2 = node.parent.kind === 215 /* CallExpression */ && node.parent.expression === node;
const immediateContainer = getSuperContainer(node, true);
let container = immediateContainer;
let needToCaptureLexicalThis = false;
let inAsyncFunction = false;
if (!isCallExpression2) {
- while (container && container.kind === 219 /* ArrowFunction */) {
+ while (container && container.kind === 221 /* ArrowFunction */) {
if (hasSyntacticModifier(container, 512 /* Async */))
inAsyncFunction = true;
container = getSuperContainer(container, true);
@@ -66109,19 +66285,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const canUseSuperExpression = isLegalUsageOfSuperExpression(container);
let nodeCheckFlag = 0;
if (!canUseSuperExpression) {
- const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 166 /* ComputedPropertyName */);
- if (current && current.kind === 166 /* ComputedPropertyName */) {
+ const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 167 /* ComputedPropertyName */);
+ if (current && current.kind === 167 /* ComputedPropertyName */) {
error(node, Diagnostics.super_cannot_be_referenced_in_a_computed_property_name);
} else if (isCallExpression2) {
error(node, Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors);
- } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 210 /* ObjectLiteralExpression */)) {
+ } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 212 /* ObjectLiteralExpression */)) {
error(node, Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions);
} else {
error(node, Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class);
}
return errorType;
}
- if (!isCallExpression2 && immediateContainer.kind === 176 /* Constructor */) {
+ if (!isCallExpression2 && immediateContainer.kind === 178 /* Constructor */) {
checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class);
}
if (isStatic(container) || isCallExpression2) {
@@ -66137,7 +66313,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
nodeCheckFlag = 256 /* SuperInstance */;
}
getNodeLinks(node).flags |= nodeCheckFlag;
- if (container.kind === 174 /* MethodDeclaration */ && inAsyncFunction) {
+ if (container.kind === 176 /* MethodDeclaration */ && inAsyncFunction) {
if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) {
getNodeLinks(container).flags |= 4096 /* MethodWithSuperPropertyAssignmentInAsync */;
} else {
@@ -66147,7 +66323,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (needToCaptureLexicalThis) {
captureLexicalThis(node.parent, container);
}
- if (container.parent.kind === 210 /* ObjectLiteralExpression */) {
+ if (container.parent.kind === 212 /* ObjectLiteralExpression */) {
if (languageVersion < 2 /* ES2015 */) {
error(node, Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);
return errorType;
@@ -66165,7 +66341,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!baseClassType) {
return errorType;
}
- if (container.kind === 176 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) {
+ if (container.kind === 178 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) {
error(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
return errorType;
}
@@ -66175,13 +66351,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
if (isCallExpression2) {
- return container2.kind === 176 /* Constructor */;
+ return container2.kind === 178 /* Constructor */;
} else {
- if (isClassLike(container2.parent) || container2.parent.kind === 210 /* ObjectLiteralExpression */) {
+ if (isClassLike(container2.parent) || container2.parent.kind === 212 /* ObjectLiteralExpression */) {
if (isStatic(container2)) {
- return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 171 /* PropertyDeclaration */ || container2.kind === 175 /* ClassStaticBlockDeclaration */;
+ return container2.kind === 176 /* MethodDeclaration */ || container2.kind === 175 /* MethodSignature */ || container2.kind === 179 /* GetAccessor */ || container2.kind === 180 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 177 /* ClassStaticBlockDeclaration */;
} else {
- return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 171 /* PropertyDeclaration */ || container2.kind === 170 /* PropertySignature */ || container2.kind === 176 /* Constructor */;
+ return container2.kind === 176 /* MethodDeclaration */ || container2.kind === 175 /* MethodSignature */ || container2.kind === 179 /* GetAccessor */ || container2.kind === 180 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 171 /* PropertySignature */ || container2.kind === 178 /* Constructor */;
}
}
}
@@ -66189,7 +66365,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getContainingObjectLiteral(func) {
- return (func.kind === 174 /* MethodDeclaration */ || func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) && func.parent.kind === 210 /* ObjectLiteralExpression */ ? func.parent : func.kind === 218 /* FunctionExpression */ && func.parent.kind === 305 /* PropertyAssignment */ ? func.parent.parent : void 0;
+ return (func.kind === 176 /* MethodDeclaration */ || func.kind === 179 /* GetAccessor */ || func.kind === 180 /* SetAccessor */) && func.parent.kind === 212 /* ObjectLiteralExpression */ ? func.parent : func.kind === 220 /* FunctionExpression */ && func.parent.kind === 308 /* PropertyAssignment */ ? func.parent.parent : void 0;
}
function getThisTypeArgument(type) {
return getObjectFlags(type) & 4 /* Reference */ && type.target === globalThisType ? getTypeArguments(type)[0] : void 0;
@@ -66200,7 +66376,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
}
function getContextualThisParameterType(func) {
- if (func.kind === 219 /* ArrowFunction */) {
+ if (func.kind === 221 /* ArrowFunction */) {
return void 0;
}
if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
@@ -66224,7 +66400,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (thisType) {
return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral)));
}
- if (literal.parent.kind !== 305 /* PropertyAssignment */) {
+ if (literal.parent.kind !== 308 /* PropertyAssignment */) {
break;
}
literal = literal.parent.parent;
@@ -66233,7 +66409,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getWidenedType(contextualType ? getNonNullableType3(contextualType) : checkExpressionCached(containingLiteral));
}
const parent2 = walkUpParenthesizedExpressions(func.parent);
- if (parent2.kind === 227 /* BinaryExpression */ && parent2.operatorToken.kind === 63 /* EqualsToken */) {
+ if (parent2.kind === 229 /* BinaryExpression */ && parent2.operatorToken.kind === 63 /* EqualsToken */) {
const target = parent2.left;
if (isAccessExpression(target)) {
const { expression } = target;
@@ -66280,11 +66456,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getTypeFromTypeNode(typeNode);
}
switch (declaration.kind) {
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return getContextuallyTypedParameterType(declaration);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getContextualTypeForBindingElement(declaration, contextFlags);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (isStatic(declaration)) {
return getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags);
}
@@ -66293,10 +66469,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getContextualTypeForBindingElement(declaration, contextFlags) {
const parent2 = declaration.parent.parent;
const name = declaration.propertyName || declaration.name;
- const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 208 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */);
+ const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 210 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */);
if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name))
return void 0;
- if (parent2.name.kind === 207 /* ArrayBindingPattern */) {
+ if (parent2.name.kind === 209 /* ArrayBindingPattern */) {
const index = indexOfNode(declaration.parent.elements, declaration);
if (index < 0)
return void 0;
@@ -66429,7 +66605,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return signatureHasRestParameter(signature) && argIndex >= restIndex ? getIndexedAccessType(getTypeOfSymbol(signature.parameters[restIndex]), getNumberLiteralType(argIndex - restIndex), 256 /* Contextual */) : getTypeAtPosition(signature, argIndex);
}
function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {
- if (template.parent.kind === 215 /* TaggedTemplateExpression */) {
+ if (template.parent.kind === 217 /* TaggedTemplateExpression */) {
return getContextualTypeForArgument(template.parent, substitutionExpression);
}
return void 0;
@@ -66688,10 +66864,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
case 157 /* UndefinedKeyword */:
return true;
- case 211 /* PropertyAccessExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 219 /* ParenthesizedExpression */:
return isPossiblyDiscriminantValue(node.expression);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return !node.expression || isPossiblyDiscriminantValue(node.expression);
}
return false;
@@ -66701,7 +66877,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
contextualType,
concatenate(
map(
- filter(node.properties, (p) => !!p.symbol && p.kind === 305 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName)),
+ filter(node.properties, (p) => !!p.symbol && p.kind === 308 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName)),
(prop) => [() => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
),
map(
@@ -66721,7 +66897,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
contextualType,
concatenate(
map(
- filter(node.properties, (p) => !!p.symbol && p.kind === 294 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))),
+ filter(node.properties, (p) => !!p.symbol && p.kind === 297 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))),
(prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
),
map(
@@ -66778,63 +66954,63 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 210 /* BindingElement */:
return getContextualTypeForInitializerExpression(node, contextFlags);
- case 219 /* ArrowFunction */:
- case 254 /* ReturnStatement */:
+ case 221 /* ArrowFunction */:
+ case 256 /* ReturnStatement */:
return getContextualTypeForReturnExpression(node, contextFlags);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return getContextualTypeForYieldOperand(parent2, contextFlags);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return getContextualTypeForAwaitOperand(parent2, contextFlags);
- case 213 /* CallExpression */:
- case 220 /* EtsComponentExpression */:
+ case 215 /* CallExpression */:
+ case 222 /* EtsComponentExpression */:
if (isInEtsFile(parent2) && parent2.expression.kind === 101 /* ImportKeyword */) {
return stringType;
}
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return getContextualTypeForArgument(parent2, node);
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return isConstTypeReference(parent2.type) ? tryFindWhenConstTypeReference(parent2) : getTypeFromTypeNode(parent2.type);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return getContextualTypeForBinaryOperand(node, contextFlags);
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return getContextualTypeForObjectLiteralElement(parent2, contextFlags);
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return getContextualType2(parent2.parent, contextFlags);
- case 209 /* ArrayLiteralExpression */: {
+ case 211 /* ArrayLiteralExpression */: {
const arrayLiteral = parent2;
const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags);
return getContextualTypeForElementExpression(type, indexOfNode(arrayLiteral.elements, node));
}
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return getContextualTypeForConditionalOperand(node, contextFlags);
- case 240 /* TemplateSpan */:
- Debug.assert(parent2.parent.kind === 229 /* TemplateExpression */);
+ case 242 /* TemplateSpan */:
+ Debug.assert(parent2.parent.kind === 231 /* TemplateExpression */);
return getContextualTypeForSubstitutionExpression(parent2.parent, node);
- case 217 /* ParenthesizedExpression */: {
+ case 219 /* ParenthesizedExpression */: {
const tag = isInJSFile(parent2) ? getJSDocTypeTag(parent2) : void 0;
return !tag ? getContextualType2(parent2, contextFlags) : isJSDocTypeTag(tag) && isConstTypeReference(tag.typeExpression.type) ? tryFindWhenConstTypeReference(parent2) : getTypeFromTypeNode(tag.typeExpression.type);
}
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return getContextualType2(parent2, contextFlags);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return getTypeFromTypeNode(parent2.type);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return tryGetTypeFromEffectiveTypeNode(parent2);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return getContextualTypeForJsxExpression(parent2, contextFlags);
- case 294 /* JsxAttribute */:
- case 296 /* JsxSpreadAttribute */:
+ case 297 /* JsxAttribute */:
+ case 299 /* JsxSpreadAttribute */:
return getContextualTypeForJsxAttribute(parent2, contextFlags);
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return getContextualJsxElementAttributesType(parent2, contextFlags);
}
return void 0;
@@ -67056,7 +67232,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return isFunctionExpressionOrArrowFunction(node) || isObjectLiteralMethod(node) ? getContextualSignature(node) : void 0;
}
function getContextualSignature(node) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
const typeTagSignature = getSignatureOfTypeTag(node);
if (typeTagSignature) {
return typeTagSignature;
@@ -67097,7 +67273,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type;
}
function hasDefaultValue(node) {
- return node.kind === 208 /* BindingElement */ && !!node.initializer || node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */;
+ return node.kind === 210 /* BindingElement */ && !!node.initializer || node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */;
}
function checkArrayLiteral(node, checkMode, forceTuple) {
const elements = node.elements;
@@ -67110,7 +67286,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let hasOmittedExpression = false;
for (let i = 0; i < elementCount; i++) {
const e = elements[i];
- if (e.kind === 231 /* SpreadElement */) {
+ if (e.kind === 233 /* SpreadElement */) {
if (languageVersion < 2 /* ES2015 */) {
checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
}
@@ -67126,7 +67302,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
elementTypes.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, e.expression));
elementFlags.push(4 /* Rest */);
}
- } else if (exactOptionalPropertyTypes && e.kind === 233 /* OmittedExpression */) {
+ } else if (exactOptionalPropertyTypes && e.kind === 235 /* OmittedExpression */) {
hasOmittedExpression = true;
elementTypes.push(missingType);
elementFlags.push(2 /* Optional */);
@@ -67163,7 +67339,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isNumericName(name) {
switch (name.kind) {
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return isNumericComputedName(name);
case 79 /* Identifier */:
return isNumericLiteralName(name.escapedText);
@@ -67180,7 +67356,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkComputedPropertyName(node) {
const links = getNodeLinks(node.expression);
if (!links.resolvedType) {
- if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 102 /* InKeyword */ && node.parent.kind !== 177 /* GetAccessor */ && node.parent.kind !== 178 /* SetAccessor */) {
+ if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 102 /* InKeyword */ && node.parent.kind !== 179 /* GetAccessor */ && node.parent.kind !== 180 /* SetAccessor */) {
return links.resolvedType = errorType;
}
links.resolvedType = checkExpression(node.expression);
@@ -67239,7 +67415,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let propertiesArray = [];
let spread = emptyObjectType;
const contextualType = getApparentTypeOfContextualType(node, void 0);
- const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 206 /* ObjectBindingPattern */ || contextualType.pattern.kind === 210 /* ObjectLiteralExpression */);
+ const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 208 /* ObjectBindingPattern */ || contextualType.pattern.kind === 212 /* ObjectLiteralExpression */);
const inConstContext = isConstContext(node);
const checkFlags = inConstContext ? 8 /* Readonly */ : 0;
const isInJavascript = isInJSFile(node) && !isInJsonFile(node);
@@ -67258,9 +67434,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let offset = 0;
for (const memberDecl of node.properties) {
let member = getSymbolOfNode(memberDecl);
- const computedNameType = memberDecl.name && memberDecl.name.kind === 166 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
- if (memberDecl.kind === 305 /* PropertyAssignment */ || memberDecl.kind === 306 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
- let type = memberDecl.kind === 305 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : memberDecl.kind === 306 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode);
+ const computedNameType = memberDecl.name && memberDecl.name.kind === 167 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
+ if (memberDecl.kind === 308 /* PropertyAssignment */ || memberDecl.kind === 309 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
+ let type = memberDecl.kind === 308 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : memberDecl.kind === 309 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode);
if (isInJavascript) {
const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
if (jsDocType) {
@@ -67277,7 +67453,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
prop.nameType = nameType;
}
if (inDestructuringPattern) {
- const isOptional = memberDecl.kind === 305 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 306 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer;
+ const isOptional = memberDecl.kind === 308 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 309 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer;
if (isOptional) {
prop.flags |= 16777216 /* Optional */;
}
@@ -67303,16 +67479,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
prop.target = member;
member = prop;
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
- if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 305 /* PropertyAssignment */ || memberDecl.kind === 174 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
+ if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 308 /* PropertyAssignment */ || memberDecl.kind === 176 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
const inferenceContext = getInferenceContext(node);
Debug.assert(inferenceContext);
- const inferenceNode = memberDecl.kind === 305 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
+ const inferenceNode = memberDecl.kind === 308 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type);
}
if (type.symbol && type.symbol.flags & 268435456 /* Annotation */) {
error(memberDecl, Diagnostics.Annotation_cannot_be_used_as_a_value);
}
- } else if (memberDecl.kind === 307 /* SpreadAssignment */) {
+ } else if (memberDecl.kind === 310 /* SpreadAssignment */) {
if (languageVersion < 2 /* ES2015 */) {
checkExternalEmitHelpers(memberDecl, 2 /* Assign */);
}
@@ -67341,7 +67517,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
continue;
} else {
- Debug.assert(memberDecl.kind === 177 /* GetAccessor */ || memberDecl.kind === 178 /* SetAccessor */);
+ Debug.assert(memberDecl.kind === 179 /* GetAccessor */ || memberDecl.kind === 180 /* SetAccessor */);
checkNodeDeferred(memberDecl);
}
if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) {
@@ -67365,13 +67541,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (contextualTypeHasPattern) {
const rootPatternParent = findAncestor(
contextualType.pattern.parent,
- (n) => n.kind === 261 /* VariableDeclaration */ || n.kind === 227 /* BinaryExpression */ || n.kind === 168 /* Parameter */
+ (n) => n.kind === 263 /* VariableDeclaration */ || n.kind === 229 /* BinaryExpression */ || n.kind === 169 /* Parameter */
);
const spreadOrOutsideRootObject = findAncestor(
node,
- (n) => n === rootPatternParent || n.kind === 307 /* SpreadAssignment */
+ (n) => n === rootPatternParent || n.kind === 310 /* SpreadAssignment */
);
- if (spreadOrOutsideRootObject.kind !== 307 /* SpreadAssignment */) {
+ if (spreadOrOutsideRootObject.kind !== 310 /* SpreadAssignment */) {
for (const prop of getPropertiesOfType(contextualType)) {
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
if (!(prop.flags & 16777216 /* Optional */)) {
@@ -67500,7 +67676,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
} else {
- Debug.assert(attributeDecl.kind === 296 /* JsxSpreadAttribute */);
+ Debug.assert(attributeDecl.kind === 299 /* JsxSpreadAttribute */);
if (attributesTable.size > 0) {
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false);
attributesTable = createSymbolTable();
@@ -67525,7 +67701,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false);
}
}
- const parent2 = openingLikeElement.parent.kind === 287 /* JsxElement */ ? openingLikeElement.parent : void 0;
+ const parent2 = openingLikeElement.parent.kind === 290 /* JsxElement */ ? openingLikeElement.parent : void 0;
if (parent2 && parent2.openingElement === openingLikeElement && parent2.children.length > 0) {
const childrenTypes = checkJsxChildren(parent2, checkMode);
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
@@ -67571,7 +67747,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!child.containsOnlyTriviaWhiteSpaces) {
childrenTypes.push(stringType);
}
- } else if (child.kind === 297 /* JsxExpression */ && !child.expression) {
+ } else if (child.kind === 300 /* JsxExpression */ && !child.expression) {
continue;
} else {
childrenTypes.push(checkExpressionForMutableLocation(child, checkMode));
@@ -67888,7 +68064,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkPropertyAccessibility(node, isSuper, writing, type, prop, reportError = true) {
- const errorNode = !reportError ? void 0 : node.kind === 165 /* QualifiedName */ ? node.right : node.kind === 205 /* ImportType */ ? node : node.kind === 208 /* BindingElement */ && node.propertyName ? node.propertyName : node.name;
+ const errorNode = !reportError ? void 0 : node.kind === 166 /* QualifiedName */ ? node.right : node.kind === 207 /* ImportType */ ? node : node.kind === 210 /* BindingElement */ && node.propertyName ? node.propertyName : node.name;
return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode);
}
function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) {
@@ -68101,7 +68277,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return checkPropertyAccessExpressionOrQualifiedName(node, node.left, leftType, node.right, checkMode);
}
function isMethodAccessForCall(node) {
- while (node.parent.kind === 217 /* ParenthesizedExpression */) {
+ while (node.parent.kind === 219 /* ParenthesizedExpression */) {
node = node.parent;
}
return isCallOrNewExpression(node.parent) && node.parent.expression === node;
@@ -68256,7 +68432,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
return isErrorType(apparentType) ? errorType : apparentType;
}
- prop = getPropertyOfType(apparentType, right.escapedText, false, node.kind === 165 /* QualifiedName */);
+ prop = getPropertyOfType(apparentType, right.escapedText, false, node.kind === 166 /* QualifiedName */);
if (!prop) {
const etsComponentExpressionNode = getEtsComponentExpressionInnerCallExpressionNode(node) || getRootEtsComponentInnerCallExpressionNode(node);
const locals = getSourceFileOfNode(node).locals;
@@ -68281,7 +68457,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 308 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {
+ if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 311 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {
markAliasReferenced(parentSymbol, node);
}
let propType;
@@ -68379,7 +68555,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (declaration && isPropertyWithoutInitializer(declaration)) {
if (!isStatic(declaration)) {
const flowContainer = getControlFlowContainer(node);
- if (flowContainer.kind === 176 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 16777216 /* Ambient */)) {
+ if (flowContainer.kind === 178 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 16777216 /* Ambient */)) {
assumeUninitialized = true;
}
}
@@ -68423,7 +68599,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!needInitialization && !(hasRequireDecorator && checkStructPropertyPosition(valueDeclaration, node))) {
diagnosticMessage = error(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
}
- } else if (valueDeclaration.kind === 264 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 16777216 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
+ } else if (valueDeclaration.kind === 266 /* ClassDeclaration */ && node.parent.kind !== 185 /* TypeReference */ && !(valueDeclaration.flags & 16777216 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
diagnosticMessage = error(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
}
if (diagnosticMessage) {
@@ -68436,25 +68612,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function isInPropertyInitializerOrClassStaticBlock(node) {
return !!findAncestor(node, (node2) => {
switch (node2.kind) {
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return true;
- case 305 /* PropertyAssignment */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 307 /* SpreadAssignment */:
- case 166 /* ComputedPropertyName */:
- case 240 /* TemplateSpan */:
- case 297 /* JsxExpression */:
- case 294 /* JsxAttribute */:
- case 295 /* JsxAttributes */:
- case 296 /* JsxSpreadAttribute */:
- case 289 /* JsxOpeningElement */:
- case 234 /* ExpressionWithTypeArguments */:
- case 300 /* HeritageClause */:
+ case 308 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 310 /* SpreadAssignment */:
+ case 167 /* ComputedPropertyName */:
+ case 242 /* TemplateSpan */:
+ case 300 /* JsxExpression */:
+ case 297 /* JsxAttribute */:
+ case 298 /* JsxAttributes */:
+ case 299 /* JsxSpreadAttribute */:
+ case 292 /* JsxOpeningElement */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 303 /* HeritageClause */:
return false;
- case 219 /* ArrowFunction */:
- case 245 /* ExpressionStatement */:
+ case 221 /* ArrowFunction */:
+ case 247 /* ExpressionStatement */:
return isBlock(node2.parent) && isClassStaticBlockDeclaration(node2.parent.parent) ? true : "quit";
default:
return isExpressionNode(node2) ? false : "quit";
@@ -68689,18 +68865,18 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isValidPropertyAccess(node, propertyName) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return isValidPropertyAccessWithType(node, node.expression.kind === 107 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression)));
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return isValidPropertyAccessWithType(node, false, propertyName, getWidenedType(checkExpression(node.left)));
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return isValidPropertyAccessWithType(node, false, propertyName, getTypeFromTypeNode(node));
}
}
function isValidPropertyAccessForCompletions(node, type, property) {
return isPropertyAccessible(
node,
- node.kind === 211 /* PropertyAccessExpression */ && node.expression.kind === 107 /* SuperKeyword */,
+ node.kind === 213 /* PropertyAccessExpression */ && node.expression.kind === 107 /* SuperKeyword */,
false,
type,
property
@@ -68725,7 +68901,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getForInVariableSymbol(node) {
const initializer = node.initializer;
- if (initializer.kind === 262 /* VariableDeclarationList */) {
+ if (initializer.kind === 264 /* VariableDeclarationList */) {
const variable = initializer.declarations[0];
if (variable && !isBindingPattern(variable.name)) {
return getSymbolOfNode(variable);
@@ -68746,7 +68922,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let child = expr;
let node = expr.parent;
while (node) {
- if (node.kind === 250 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
+ if (node.kind === 252 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
return true;
}
child = node;
@@ -68790,11 +68966,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (callLikeExpressionMayHaveTypeArguments(node)) {
forEach(node.typeArguments, checkSourceElement);
}
- if (node.kind === 215 /* TaggedTemplateExpression */) {
+ if (node.kind === 217 /* TaggedTemplateExpression */) {
checkExpression(node.template);
} else if (isJsxOpeningLikeElement(node)) {
checkExpression(node.attributes);
- } else if (node.kind !== 169 /* Decorator */) {
+ } else if (node.kind !== 170 /* Decorator */) {
forEach(node.arguments, (argument) => {
checkExpression(argument);
});
@@ -68839,7 +69015,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isSpreadArgument(arg) {
- return !!arg && (arg.kind === 231 /* SpreadElement */ || arg.kind === 238 /* SyntheticExpression */ && arg.isSpread);
+ return !!arg && (arg.kind === 233 /* SpreadElement */ || arg.kind === 240 /* SyntheticExpression */ && arg.isSpread);
}
function getSpreadArgumentIndex(args) {
return findIndex(args, isSpreadArgument);
@@ -68855,9 +69031,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let callIsIncomplete = false;
let effectiveParameterCount = getParameterCount(signature);
let effectiveMinimumArguments = getMinArgumentCount(signature);
- if (node.kind === 215 /* TaggedTemplateExpression */) {
+ if (node.kind === 217 /* TaggedTemplateExpression */) {
argCount = args.length;
- if (node.template.kind === 229 /* TemplateExpression */) {
+ if (node.template.kind === 231 /* TemplateExpression */) {
const lastSpan = last(node.template.templateSpans);
callIsIncomplete = nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated;
} else {
@@ -68865,7 +69041,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
Debug.assert(templateLiteral.kind === 14 /* NoSubstitutionTemplateLiteral */);
callIsIncomplete = !!templateLiteral.isUnterminated;
}
- } else if (node.kind === 169 /* Decorator */) {
+ } else if (node.kind === 170 /* Decorator */) {
argCount = getDecoratorArgumentCount(node, signature);
} else if (isJsxOpeningLikeElement(node)) {
callIsIncomplete = node.attributes.end === node.end;
@@ -68876,7 +69052,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
effectiveParameterCount = args.length === 0 ? effectiveParameterCount : 1;
effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1);
} else if (!node.arguments) {
- Debug.assert(node.kind === 214 /* NewExpression */);
+ Debug.assert(node.kind === 216 /* NewExpression */);
return getMinArgumentCount(signature) === 0;
} else {
argCount = signatureHelpTrailingComma ? args.length + 1 : args.length;
@@ -68957,7 +69133,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isJsxOpeningLikeElement(node)) {
return inferJsxTypeArguments(node, signature, checkMode, context);
}
- if (node.kind !== 169 /* Decorator */) {
+ if (node.kind !== 170 /* Decorator */) {
const skipBindingPatterns = every(signature.typeParameters, (p) => !!getDefaultFromTypeParameter(p));
const contextualType = getContextualType2(node, skipBindingPatterns ? 8 /* SkipBindingPatterns */ : 0 /* None */);
if (contextualType) {
@@ -68994,7 +69170,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
for (let i = 0; i < argCount; i++) {
const arg = args[i];
- if (arg.kind !== 233 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
+ if (arg.kind !== 235 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
const paramType = getTypeAtPosition(signature, i);
if (couldContainTypeVariables(paramType)) {
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -69015,7 +69191,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (index >= argCount - 1) {
const arg = args[argCount - 1];
if (isSpreadArgument(arg)) {
- return getMutableArrayOrTupleType(arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode));
+ return getMutableArrayOrTupleType(arg.kind === 240 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode));
}
}
const types = [];
@@ -69024,12 +69200,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
for (let i = index; i < argCount; i++) {
const arg = args[i];
if (isSpreadArgument(arg)) {
- const spreadType = arg.kind === 238 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression);
+ const spreadType = arg.kind === 240 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression);
if (isArrayLikeType2(spreadType)) {
types.push(spreadType);
flags.push(8 /* Variadic */);
} else {
- types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 231 /* SpreadElement */ ? arg.expression : arg));
+ types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 233 /* SpreadElement */ ? arg.expression : arg));
flags.push(4 /* Rest */);
}
} else {
@@ -69039,7 +69215,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType));
flags.push(1 /* Required */);
}
- if (arg.kind === 238 /* SyntheticExpression */ && arg.tupleNameSource) {
+ if (arg.kind === 240 /* SyntheticExpression */ && arg.tupleNameSource) {
names.push(arg.tupleNameSource);
}
}
@@ -69182,7 +69358,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
const thisType = getThisTypeOfSignature(signature);
- if (thisType && thisType !== voidType && node.kind !== 214 /* NewExpression */) {
+ if (thisType && thisType !== voidType && node.kind !== 216 /* NewExpression */) {
const thisArgumentNode = getThisArgumentOfCall(node);
const thisArgumentType = getThisArgumentType(thisArgumentNode);
const errorNode = reportErrors2 ? thisArgumentNode || node : void 0;
@@ -69197,7 +69373,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length;
for (let i = 0; i < argCount; i++) {
const arg = args[i];
- if (arg.kind !== 233 /* OmittedExpression */) {
+ if (arg.kind !== 235 /* OmittedExpression */) {
const paramType = getTypeAtPosition(signature, i);
const argType = checkExpressionWithContextualType(arg, paramType, void 0, checkMode);
const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;
@@ -69232,7 +69408,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getThisArgumentOfCall(node) {
- const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : void 0;
+ const expression = node.kind === 215 /* CallExpression */ ? node.expression : node.kind === 217 /* TaggedTemplateExpression */ ? node.tag : void 0;
if (expression) {
const callee = skipOuterExpressions(expression);
if (isAccessExpression(callee)) {
@@ -69247,17 +69423,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
}
function getEffectiveCallArguments(node) {
- if (node.kind === 215 /* TaggedTemplateExpression */) {
+ if (node.kind === 217 /* TaggedTemplateExpression */) {
const template = node.template;
const args2 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())];
- if (template.kind === 229 /* TemplateExpression */) {
+ if (template.kind === 231 /* TemplateExpression */) {
forEach(template.templateSpans, (span) => {
args2.push(span.expression);
});
}
return args2;
}
- if (node.kind === 169 /* Decorator */) {
+ if (node.kind === 170 /* Decorator */) {
return getEffectiveDecoratorArguments(node);
}
if (isJsxOpeningLikeElement(node)) {
@@ -69269,7 +69445,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const effectiveArgs = args.slice(0, spreadIndex);
for (let i = spreadIndex; i < args.length; i++) {
const arg = args[i];
- const spreadType = arg.kind === 231 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
+ const spreadType = arg.kind === 233 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
if (spreadType && isTupleType(spreadType)) {
forEach(getTypeArguments(spreadType), (t, i2) => {
var _a2;
@@ -69294,30 +69470,30 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const parent2 = node.parent;
const expr = node.expression;
switch (parent2.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return [
createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent2)))
];
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
const func = parent2.parent;
return [
- createSyntheticExpression(expr, parent2.parent.kind === 176 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),
+ createSyntheticExpression(expr, parent2.parent.kind === 178 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),
createSyntheticExpression(expr, anyType),
createSyntheticExpression(expr, numberType)
];
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
const hasPropDesc = languageVersion !== 0 /* ES3 */ && (!isPropertyDeclaration(parent2) || hasAccessorModifier(parent2));
return [
createSyntheticExpression(expr, getParentTypeOfClassElement(parent2)),
createSyntheticExpression(expr, getClassElementPropertyKeyType(parent2)),
createSyntheticExpression(expr, hasPropDesc ? createTypedPropertyDescriptorType(getTypeOfNode(parent2)) : anyType)
];
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (isEtsFunctionDecorators(getNameOfDecorator(node), compilerOptions)) {
const symbol = getSymbolOfNode(expr);
return symbol ? [
@@ -69330,19 +69506,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getDecoratorArgumentCount(node, signature) {
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return 1;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return hasAccessorModifier(node.parent) ? 3 : 2;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return 3;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (isEtsFunctionDecorators(getNameOfDecorator(node), compilerOptions)) {
return isCallExpression(node.expression) ? 1 : 0;
}
@@ -69469,10 +69645,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
}
function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) {
- const isTaggedTemplate = node.kind === 215 /* TaggedTemplateExpression */;
- const isDecorator2 = node.kind === 169 /* Decorator */;
+ const isTaggedTemplate = node.kind === 217 /* TaggedTemplateExpression */;
+ const isDecorator2 = node.kind === 170 /* Decorator */;
const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
- const isEtsComponentExpression2 = node.kind === 220 /* EtsComponentExpression */;
+ const isEtsComponentExpression2 = node.kind === 222 /* EtsComponentExpression */;
const reportErrors2 = !candidatesOutArray;
let typeArguments;
let virtual;
@@ -69502,7 +69678,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let candidateForArgumentArityError;
let candidateForTypeArgumentError;
let result;
- const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 213 /* CallExpression */ && node.arguments.hasTrailingComma;
+ const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 215 /* CallExpression */ && node.arguments.hasTrailingComma;
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
}
@@ -69952,7 +70128,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const declaration = signature.declaration;
const modifiers = getSelectedEffectiveModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */);
- if (!modifiers || declaration.kind !== 176 /* Constructor */) {
+ if (!modifiers || declaration.kind !== 178 /* Constructor */) {
return true;
}
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol);
@@ -70094,19 +70270,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getDiagnosticHeadMessageForDecoratorResolution(node) {
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
const decoratorName = getNameOfDecorator(node);
if (isEtsFunctionDecorators(decoratorName, compilerOptions)) {
return Diagnostics.Unable_to_resolve_signature_of_function_decorator_when_decorators_are_not_valid;
@@ -70266,20 +70442,20 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function resolveSignature(node, candidatesOutArray, checkMode) {
switch (node.kind) {
- case 213 /* CallExpression */:
- case 220 /* EtsComponentExpression */:
+ case 215 /* CallExpression */:
+ case 222 /* EtsComponentExpression */:
return resolveCallExpression(node, candidatesOutArray, checkMode);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return resolveNewExpression(node, candidatesOutArray, checkMode);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
if (isAnnotation(node)) {
return resolveAnnotation(node);
}
return resolveDecorator(node, candidatesOutArray, checkMode);
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode);
}
}
@@ -70384,7 +70560,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
let parent2 = node.parent;
- while (parent2 && parent2.kind === 211 /* PropertyAccessExpression */) {
+ while (parent2 && parent2.kind === 213 /* PropertyAccessExpression */) {
parent2 = parent2.parent;
}
if (parent2 && isBinaryExpression(parent2) && isPrototypeAccess(parent2.left) && parent2.operatorToken.kind === 63 /* EqualsToken */) {
@@ -70403,9 +70579,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.expression.kind === 107 /* SuperKeyword */) {
return voidType;
}
- if (node.kind === 214 /* NewExpression */) {
+ if (node.kind === 216 /* NewExpression */) {
const declaration = signature.declaration;
- if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
+ if (declaration && declaration.kind !== 178 /* Constructor */ && declaration.kind !== 182 /* ConstructSignature */ && declaration.kind !== 187 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
if (noImplicitAny) {
error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);
}
@@ -70419,7 +70595,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) {
return getESSymbolLikeTypeForNode(walkUpParenthesizedExpressions(node.parent));
}
- if (node.kind === 213 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 245 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) {
+ if (node.kind === 215 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 247 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) {
if (!isDottedName(node.expression)) {
error(node.expression, Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);
} else if (!getEffectsSignature(node)) {
@@ -70439,7 +70615,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.expression, Diagnostics.UI_component_0_cannot_be_used_in_this_place, diagnosticName(node.expression));
}
const signatureDeclaration = signature.declaration;
- if (node.kind === 213 /* CallExpression */ && signatureDeclaration && !isJSDocSignature(signatureDeclaration) && (isMethodDeclaration(signatureDeclaration) || isMethodSignature(signatureDeclaration) || isFunctionDeclaration(signatureDeclaration))) {
+ if (node.kind === 215 /* CallExpression */ && signatureDeclaration && !isJSDocSignature(signatureDeclaration) && (isMethodDeclaration(signatureDeclaration) || isMethodSignature(signatureDeclaration) || isFunctionDeclaration(signatureDeclaration))) {
if (shouldCheckThrows(signatureDeclaration) && !hasAsyncErrorCallbacks(signatureDeclaration)) {
checkThrowableFunction(node);
}
@@ -70779,20 +70955,20 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getDeprecatedSuggestionNode(node) {
node = skipParentheses(node);
switch (node.kind) {
- case 213 /* CallExpression */:
- case 169 /* Decorator */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 170 /* Decorator */:
+ case 216 /* NewExpression */:
return getDeprecatedSuggestionNode(node.expression);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return getDeprecatedSuggestionNode(node.tag);
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return getDeprecatedSuggestionNode(node.tagName);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return node.argumentExpression;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return node.name;
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
const typeReference = node;
return isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference;
default:
@@ -70901,7 +71077,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (resolvedRequire.flags & 2097152 /* Alias */) {
return false;
}
- const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 263 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 261 /* VariableDeclaration */ : 0 /* Unknown */;
+ const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 265 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 263 /* VariableDeclaration */ : 0 /* Unknown */;
if (targetDeclarationKind !== 0 /* Unknown */) {
const decl = getDeclarationOfKind(resolvedRequire, targetDeclarationKind);
return !!decl && !!(decl.flags & 16777216 /* Ambient */);
@@ -70919,7 +71095,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getReturnTypeOfSignature(signature);
}
function checkAssertion(node) {
- if (node.kind === 216 /* TypeAssertionExpression */) {
+ if (node.kind === 218 /* TypeAssertionExpression */) {
const file = getSourceFileOfNode(node);
if (file && fileExtensionIsOneOf(file.fileName, [".cts" /* Cts */, ".mts" /* Mts */])) {
grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
@@ -70935,18 +71111,18 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 9 /* BigIntLiteral */:
case 111 /* TrueKeyword */:
case 96 /* FalseKeyword */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 229 /* TemplateExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 231 /* TemplateExpression */:
return true;
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isValidConstAssertionArgument(node.expression);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const op = node.operator;
const arg = node.operand;
return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = node.expression;
let symbol = getTypeOfNode(expr).symbol;
if (symbol && symbol.flags & 2097152 /* Alias */) {
@@ -70992,7 +71168,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkExpressionWithTypeArguments(node) {
checkGrammarExpressionWithTypeArguments(node);
- const exprType = node.kind === 234 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
+ const exprType = node.kind === 236 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
const typeArguments = node.typeArguments;
if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) {
return exprType;
@@ -71087,7 +71263,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!container) {
error(node, Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target");
return errorType;
- } else if (container.kind === 176 /* Constructor */) {
+ } else if (container.kind === 178 /* Constructor */) {
const symbol = getSymbolOfNode(container.parent);
return getTypeOfSymbol(symbol);
} else {
@@ -71137,7 +71313,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getParameterIdentifierNameAtPosition(signature, pos) {
var _a2;
- if (((_a2 = signature.declaration) == null ? void 0 : _a2.kind) === 326 /* JSDocFunctionType */) {
+ if (((_a2 = signature.declaration) == null ? void 0 : _a2.kind) === 329 /* JSDocFunctionType */) {
return void 0;
}
const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
@@ -71169,7 +71345,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return symbol.valueDeclaration && isParameter(symbol.valueDeclaration) && isIdentifier(symbol.valueDeclaration.name);
}
function isValidDeclarationForTupleLabel(d) {
- return d.kind === 202 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name);
+ return d.kind === 204 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name);
}
function getNameableDeclarationAtPosition(signature, pos) {
const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
@@ -71428,7 +71604,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let yieldType;
let nextType;
let fallbackReturnType = voidType;
- if (func.body.kind !== 242 /* Block */) {
+ if (func.body.kind !== 244 /* Block */) {
returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */);
if (isAsync) {
returnType = unwrapAwaitedType(checkAwaitedType(returnType, false, func, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member));
@@ -71562,7 +71738,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return links.isExhaustive;
}
function computeExhaustiveSwitchStatement(node) {
- if (node.expression.kind === 222 /* TypeOfExpression */) {
+ if (node.expression.kind === 224 /* TypeOfExpression */) {
const witnesses = getSwitchClauseTypeOfWitnesses(node);
if (!witnesses) {
return false;
@@ -71617,11 +71793,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function mayReturnNever(func) {
switch (func.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
- case 174 /* MethodDeclaration */:
- return func.parent.kind === 210 /* ObjectLiteralExpression */;
+ case 176 /* MethodDeclaration */:
+ return func.parent.kind === 212 /* ObjectLiteralExpression */;
default:
return false;
}
@@ -71663,7 +71839,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return judgeReturnTypeOfStyles();
}
}
- if (func.kind === 173 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 242 /* Block */ || !functionHasImplicitReturn(func)) {
+ if (func.kind === 175 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 244 /* Block */ || !functionHasImplicitReturn(func)) {
return;
}
const hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */;
@@ -71699,7 +71875,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
checkNodeDeferred(node);
if (isFunctionExpression(node)) {
checkCollisionsForDeclarationName(node, node.name);
@@ -71722,7 +71898,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return anyFunctionType;
}
const hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
- if (!hasGrammarError && node.kind === 218 /* FunctionExpression */) {
+ if (!hasGrammarError && node.kind === 220 /* FunctionExpression */) {
checkGrammarForGenerator(node);
}
contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -71766,7 +71942,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) {
- Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
+ Debug.assert(node.kind !== 176 /* MethodDeclaration */ || isObjectLiteralMethod(node));
const functionFlags = getFunctionFlags(node);
const returnType = getReturnTypeFromAnnotation(node);
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
@@ -71774,7 +71950,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!getEffectiveReturnTypeNode(node)) {
getReturnTypeOfSignature(getSignatureFromDeclaration(node));
}
- if (node.body.kind === 242 /* Block */) {
+ if (node.body.kind === 244 /* Block */) {
checkSourceElement(node.body);
} else {
const exprType = checkExpression(node.body);
@@ -71840,7 +72016,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isReadonlySymbol(symbol)) {
if (symbol.flags & 4 /* Property */ && isAccessExpression(expr) && expr.expression.kind === 109 /* ThisKeyword */) {
const ctor = getContainingFunction(expr);
- if (!(ctor && (ctor.kind === 176 /* Constructor */ || isJSConstructor(ctor)))) {
+ if (!(ctor && (ctor.kind === 178 /* Constructor */ || isJSConstructor(ctor)))) {
return true;
}
if (symbol.valueDeclaration) {
@@ -71861,7 +72037,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const symbol2 = getNodeLinks(node).resolvedSymbol;
if (symbol2.flags & 2097152 /* Alias */) {
const declaration = getDeclarationOfAliasSymbol(symbol2);
- return !!declaration && declaration.kind === 277 /* NamespaceImport */;
+ return !!declaration && declaration.kind === 280 /* NamespaceImport */;
}
}
}
@@ -71966,7 +72142,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!hasParseDiagnostics(sourceFile)) {
const span = getSpanOfTokenAtPosition(sourceFile, node.pos);
const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);
- if (container && container.kind !== 176 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) {
+ if (container && container.kind !== 178 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) {
const relatedInfo = createDiagnosticForNode(container, Diagnostics.Did_you_mean_to_mark_this_function_as_async);
addRelatedInfo(diagnostic, relatedInfo);
}
@@ -72159,7 +72335,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis = false) {
const properties = node.properties;
const property = properties[propertyIndex];
- if (property.kind === 305 /* PropertyAssignment */ || property.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (property.kind === 308 /* PropertyAssignment */ || property.kind === 309 /* ShorthandPropertyAssignment */) {
const name = property.name;
const exprType = getLiteralTypeFromPropertyName(name);
if (isTypeUsableAsPropertyName(exprType)) {
@@ -72172,8 +72348,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const elementType = getIndexedAccessType(objectLiteralType, exprType, 32 /* ExpressionPosition */, name);
const type = getFlowTypeOfDestructuring(property, elementType);
- return checkDestructuringAssignment(property.kind === 306 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);
- } else if (property.kind === 307 /* SpreadAssignment */) {
+ return checkDestructuringAssignment(property.kind === 309 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);
+ } else if (property.kind === 310 /* SpreadAssignment */) {
if (propertyIndex < properties.length - 1) {
error(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
} else {
@@ -72205,7 +72381,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let inBoundsType = compilerOptions.noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType;
for (let i = 0; i < elements.length; i++) {
let type = possiblyOutOfBoundsType;
- if (node.elements[i].kind === 231 /* SpreadElement */) {
+ if (node.elements[i].kind === 233 /* SpreadElement */) {
type = inBoundsType = inBoundsType != null ? inBoundsType : checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType;
}
checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode);
@@ -72215,8 +72391,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) {
const elements = node.elements;
const element = elements[elementIndex];
- if (element.kind !== 233 /* OmittedExpression */) {
- if (element.kind !== 231 /* SpreadElement */) {
+ if (element.kind !== 235 /* OmittedExpression */) {
+ if (element.kind !== 233 /* SpreadElement */) {
const indexType = getNumberLiteralType(elementIndex);
if (isArrayLikeType2(sourceType)) {
const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(element) ? 16 /* NoTupleBoundsCheck */ : 0);
@@ -72231,7 +72407,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
} else {
const restExpression = element.expression;
- if (restExpression.kind === 227 /* BinaryExpression */ && restExpression.operatorToken.kind === 63 /* EqualsToken */) {
+ if (restExpression.kind === 229 /* BinaryExpression */ && restExpression.operatorToken.kind === 63 /* EqualsToken */) {
error(restExpression.operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer);
} else {
checkGrammarForDisallowedTrailingComma(node.elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);
@@ -72244,7 +72420,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) {
let target;
- if (exprOrAssignment.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (exprOrAssignment.kind === 309 /* ShorthandPropertyAssignment */) {
const prop = exprOrAssignment;
if (prop.objectAssignmentInitializer) {
if (strictNullChecks && !(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216 /* IsUndefined */)) {
@@ -72256,25 +72432,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
target = exprOrAssignment;
}
- if (target.kind === 227 /* BinaryExpression */ && target.operatorToken.kind === 63 /* EqualsToken */) {
+ if (target.kind === 229 /* BinaryExpression */ && target.operatorToken.kind === 63 /* EqualsToken */) {
checkBinaryExpression(target, checkMode);
target = target.left;
if (strictNullChecks) {
sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);
}
}
- if (target.kind === 210 /* ObjectLiteralExpression */) {
+ if (target.kind === 212 /* ObjectLiteralExpression */) {
return checkObjectLiteralAssignment(target, sourceType, rightIsThis);
}
- if (target.kind === 209 /* ArrayLiteralExpression */) {
+ if (target.kind === 211 /* ArrayLiteralExpression */) {
return checkArrayLiteralAssignment(target, sourceType, checkMode);
}
return checkReferenceAssignment(target, sourceType, checkMode);
}
function checkReferenceAssignment(target, sourceType, checkMode) {
const targetType = checkExpression(target, checkMode);
- const error2 = target.parent.kind === 307 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;
- const optionalError = target.parent.kind === 307 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;
+ const error2 = target.parent.kind === 310 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;
+ const optionalError = target.parent.kind === 310 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;
if (checkReferenceExpression(target, error2, optionalError)) {
checkTypeAssignableToAndOptionallyElaborate(sourceType, targetType, target, target);
}
@@ -72289,8 +72465,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
case 10 /* StringLiteral */:
case 13 /* RegularExpressionLiteral */:
- case 215 /* TaggedTemplateExpression */:
- case 229 /* TemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 231 /* TemplateExpression */:
case 14 /* NoSubstitutionTemplateLiteral */:
case 8 /* NumericLiteral */:
case 9 /* BigIntLiteral */:
@@ -72298,25 +72474,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 96 /* FalseKeyword */:
case 105 /* NullKeyword */:
case 157 /* UndefinedKeyword */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
- case 219 /* ArrowFunction */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 222 /* TypeOfExpression */:
- case 236 /* NonNullExpression */:
- case 288 /* JsxSelfClosingElement */:
- case 287 /* JsxElement */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 224 /* TypeOfExpression */:
+ case 238 /* NonNullExpression */:
+ case 291 /* JsxSelfClosingElement */:
+ case 290 /* JsxElement */:
return true;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isAssignmentOperator(node.operatorToken.kind)) {
return false;
}
return isSideEffectFree(node.left) && isSideEffectFree(node.right);
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
switch (node.operator) {
case 53 /* ExclamationToken */:
case 39 /* PlusToken */:
@@ -72325,9 +72501,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
return false;
- case 223 /* VoidExpression */:
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 225 /* VoidExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
default:
return false;
}
@@ -72363,7 +72539,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
checkGrammarNullishCoalesceWithLogicalExpression(node);
const operator = node.operatorToken.kind;
- if (operator === 63 /* EqualsToken */ && (node.left.kind === 210 /* ObjectLiteralExpression */ || node.left.kind === 209 /* ArrayLiteralExpression */)) {
+ if (operator === 63 /* EqualsToken */ && (node.left.kind === 212 /* ObjectLiteralExpression */ || node.left.kind === 211 /* ArrayLiteralExpression */)) {
state.skip = true;
setLastResult(state, checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 109 /* ThisKeyword */));
return state;
@@ -72385,7 +72561,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) {
if (operator === 55 /* AmpersandAmpersandToken */) {
let parent2 = node.parent;
- while (parent2.kind === 217 /* ParenthesizedExpression */ || isBinaryExpression(parent2) && (parent2.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || parent2.operatorToken.kind === 56 /* BarBarToken */)) {
+ while (parent2.kind === 219 /* ParenthesizedExpression */ || isBinaryExpression(parent2) && (parent2.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || parent2.operatorToken.kind === 56 /* BarBarToken */)) {
parent2 = parent2.parent;
}
checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent2) ? parent2.thenStatement : void 0);
@@ -72452,7 +72628,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) {
const operator = operatorToken.kind;
- if (operator === 63 /* EqualsToken */ && (left.kind === 210 /* ObjectLiteralExpression */ || left.kind === 209 /* ArrayLiteralExpression */)) {
+ if (operator === 63 /* EqualsToken */ && (left.kind === 212 /* ObjectLiteralExpression */ || left.kind === 211 /* ArrayLiteralExpression */)) {
return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 109 /* ThisKeyword */);
}
let leftType;
@@ -72890,7 +73066,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */));
}
function getContextNode2(node) {
- if (node.kind === 295 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) {
+ if (node.kind === 298 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) {
return node.parent.parent;
}
return node;
@@ -72931,12 +73107,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isTypeAssertion3(node) {
node = skipParentheses(node, true);
- return node.kind === 216 /* TypeAssertionExpression */ || node.kind === 235 /* AsExpression */ || isJSDocTypeAssertion(node);
+ return node.kind === 218 /* TypeAssertionExpression */ || node.kind === 237 /* AsExpression */ || isJSDocTypeAssertion(node);
}
function checkDeclarationInitializer(declaration, checkMode, contextualType) {
const initializer = getEffectiveInitializer(declaration);
const type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, void 0, checkMode || 0 /* Normal */) : checkExpressionCached(initializer, checkMode));
- return isParameter(declaration) && declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type;
+ return isParameter(declaration) && declaration.name.kind === 209 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type;
}
function padTupleType(type, pattern) {
const patternElements = pattern.elements;
@@ -72944,7 +73120,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const elementFlags = type.target.elementFlags.slice();
for (let i = getTypeReferenceArity(type); i < patternElements.length; i++) {
const e = patternElements[i];
- if (i < patternElements.length - 1 || !(e.kind === 208 /* BindingElement */ && e.dotDotDotToken)) {
+ if (i < patternElements.length - 1 || !(e.kind === 210 /* BindingElement */ && e.dotDotDotToken)) {
elementTypes.push(!isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, false, false) : anyType);
elementFlags.push(2 /* Optional */);
if (!isOmittedExpression(e) && !hasDefaultValue(e)) {
@@ -72990,14 +73166,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) : isTypeAssertion3(node) ? type : getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType2(node, void 0) : contextualType, node, void 0));
}
function checkPropertyAssignment(node, checkMode) {
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
return checkExpressionForMutableLocation(node.initializer, checkMode);
}
function checkObjectLiteralMethod(node, checkMode) {
checkGrammarMethod(node);
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
const uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -73203,7 +73379,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type;
}
function checkConstEnumAccess(node, type) {
- const ok = node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 79 /* Identifier */ || node.kind === 165 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 186 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 284 /* ExportSpecifier */;
+ const ok = node.parent.kind === 213 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 214 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 79 /* Identifier */ || node.kind === 166 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 188 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 287 /* ExportSpecifier */;
if (!ok) {
error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);
}
@@ -73226,9 +73402,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
}
@@ -73259,87 +73435,87 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return trueType;
case 96 /* FalseKeyword */:
return falseType;
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return checkTemplateExpression(node);
case 13 /* RegularExpressionLiteral */:
return globalRegExpType;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return checkArrayLiteral(node, checkMode, forceTuple);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return checkObjectLiteral(node, checkMode);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return checkPropertyAccessExpression(node, checkMode);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return checkQualifiedName(node, checkMode);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return checkIndexedAccess(node, checkMode);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (node.expression.kind === 101 /* ImportKeyword */) {
return checkImportCallExpression(node);
}
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return checkCallExpression(node, checkMode);
- case 220 /* EtsComponentExpression */:
+ case 222 /* EtsComponentExpression */:
const newNode = node;
if (newNode.body && newNode.body.statements.length) {
traverseEtsComponentStatements(newNode.body.statements, checkMode);
}
return checkCallExpression(node, checkMode);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return checkTaggedTemplateExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return checkParenthesizedExpression(node, checkMode);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return checkClassExpression(node);
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return checkTypeOfExpression(node);
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return checkAssertion(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return checkNonNullAssertion(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return checkExpressionWithTypeArguments(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return checkSatisfiesExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return checkMetaProperty(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return checkDeleteExpression(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return checkVoidExpression(node);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return checkAwaitExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return checkPrefixUnaryExpression(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return checkPostfixUnaryExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return checkBinaryExpression(node, checkMode);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return checkConditionalExpression(node, checkMode);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return checkSpreadExpression(node, checkMode);
- case 233 /* OmittedExpression */:
+ case 235 /* OmittedExpression */:
return undefinedWideningType;
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return checkYieldExpression(node);
- case 238 /* SyntheticExpression */:
+ case 240 /* SyntheticExpression */:
return checkSyntheticExpression(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return checkJsxExpression(node, checkMode);
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return checkJsxElement(node, checkMode);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return checkJsxSelfClosingElement(node, checkMode);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return checkJsxFragment(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return checkJsxAttributes(node, checkMode);
- case 289 /* JsxOpeningElement */:
+ case 292 /* JsxOpeningElement */:
Debug.fail("Shouldn't ever directly check a JsxOpeningElement");
}
return errorType;
@@ -73424,10 +73600,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkVariableLikeDeclaration(node);
const func = getContainingFunction(node);
if (hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) {
- if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) {
+ if (!(func.kind === 178 /* Constructor */ && nodeIsPresent(func.body))) {
error(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
}
- if (func.kind === 176 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") {
+ if (func.kind === 178 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") {
error(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name);
}
}
@@ -73438,13 +73614,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (func.parameters.indexOf(node) !== 0) {
error(node, Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText);
}
- if (func.kind === 176 /* Constructor */ || func.kind === 180 /* ConstructSignature */ || func.kind === 185 /* ConstructorType */) {
+ if (func.kind === 178 /* Constructor */ || func.kind === 182 /* ConstructSignature */ || func.kind === 187 /* ConstructorType */) {
error(node, Diagnostics.A_constructor_cannot_have_a_this_parameter);
}
- if (func.kind === 219 /* ArrowFunction */) {
+ if (func.kind === 221 /* ArrowFunction */) {
error(node, Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
}
- if (func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) {
+ if (func.kind === 179 /* GetAccessor */ || func.kind === 180 /* SetAccessor */) {
error(node, Diagnostics.get_and_set_accessors_cannot_declare_this_parameters);
}
}
@@ -73499,13 +73675,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getTypePredicateParent(node) {
switch (node.parent.kind) {
- case 219 /* ArrowFunction */:
- case 179 /* CallSignature */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 184 /* FunctionType */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 221 /* ArrowFunction */:
+ case 181 /* CallSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 186 /* FunctionType */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
const parent2 = node.parent;
if (node === parent2.type) {
return parent2;
@@ -73525,7 +73701,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
predicateVariableName
);
return true;
- } else if (name.kind === 207 /* ArrayBindingPattern */ || name.kind === 206 /* ObjectBindingPattern */) {
+ } else if (name.kind === 209 /* ArrayBindingPattern */ || name.kind === 208 /* ObjectBindingPattern */) {
if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(
name,
predicateVariableNode,
@@ -73537,9 +73713,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkSignatureDeclaration(node) {
- if (node.kind === 181 /* IndexSignature */) {
+ if (node.kind === 183 /* IndexSignature */) {
checkGrammarIndexSignature(node);
- } else if (node.kind === 184 /* FunctionType */ || node.kind === 263 /* FunctionDeclaration */ || node.kind === 185 /* ConstructorType */ || node.kind === 179 /* CallSignature */ || node.kind === 176 /* Constructor */ || node.kind === 180 /* ConstructSignature */) {
+ } else if (node.kind === 186 /* FunctionType */ || node.kind === 265 /* FunctionDeclaration */ || node.kind === 187 /* ConstructorType */ || node.kind === 181 /* CallSignature */ || node.kind === 178 /* Constructor */ || node.kind === 182 /* ConstructSignature */) {
checkGrammarFunctionLikeDeclaration(node);
}
const functionFlags = getFunctionFlags(node);
@@ -73566,10 +73742,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const returnTypeNode = getEffectiveReturnTypeNode(node);
if (noImplicitAny && !returnTypeNode) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
error(node, Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
error(node, Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
}
@@ -73591,7 +73767,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkAsyncFunctionReturnType(node, returnTypeNode);
}
}
- if (node.kind !== 181 /* IndexSignature */ && node.kind !== 326 /* JSDocFunctionType */) {
+ if (node.kind !== 183 /* IndexSignature */ && node.kind !== 329 /* JSDocFunctionType */) {
registerForUnusedIdentifiersCheck(node);
}
}
@@ -73601,7 +73777,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const staticNames = new Map2();
const privateIdentifiers = new Map2();
for (const member of node.members) {
- if (member.kind === 176 /* Constructor */) {
+ if (member.kind === 178 /* Constructor */) {
for (const param of member.parameters) {
if (isParameterPropertyDeclaration(param, member) && !isBindingPattern(param.name)) {
addName(instanceNames, param.name, param.name.escapedText, 3 /* GetOrSetAccessor */);
@@ -73619,19 +73795,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const memberName = name && getPropertyNameForPropertyNameNode(name);
if (memberName) {
switch (member.kind) {
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
addName(names, name, memberName, 1 /* GetAccessor */ | privateStaticFlags);
break;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
addName(names, name, memberName, 2 /* SetAccessor */ | privateStaticFlags);
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags);
break;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags);
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
addName(names, name, memberName, 8 /* Method */ | privateStaticFlags);
break;
}
@@ -73684,7 +73860,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkObjectTypeForDuplicateDeclarations(node) {
const names = new Map2();
for (const member of node.members) {
- if (member.kind === 170 /* PropertySignature */) {
+ if (member.kind === 171 /* PropertySignature */) {
let memberName;
const name = member.name;
switch (name.kind) {
@@ -73708,7 +73884,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkTypeForDuplicateIndexSignatures(node) {
- if (node.kind === 267 /* InterfaceDeclaration */) {
+ if (node.kind === 270 /* InterfaceDeclaration */) {
const nodeSymbol = getSymbolOfNode(node);
if (nodeSymbol.declarations && nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {
return;
@@ -73744,7 +73920,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (type.symbol.declarations) {
for (const decl of type.symbol.declarations) {
- if (decl.kind === 269 /* EnumDeclaration */) {
+ if (decl.kind === 272 /* EnumDeclaration */) {
const members = decl.members;
for (let i = 0; i < members.length; ++i) {
if (i > 1 && typeof getConstantValue2(members[i - 1]) !== typeof getConstantValue2(members[i])) {
@@ -73816,7 +73992,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function evaluateAnnotationPropertyConstantExpression(expr) {
switch (expr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const value = evaluateAnnotationPropertyConstantExpression(expr.operand);
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean") {
switch (expr.operator) {
@@ -73835,7 +74011,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const left = evaluateAnnotationPropertyConstantExpression(expr.left);
const right = evaluateAnnotationPropertyConstantExpression(expr.right);
if (left !== void 0 && right !== void 0 && typeof left === typeof right) {
@@ -73904,7 +74080,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
const elements = expr.elements;
const result = new Array(elements.length);
for (let i = 0; i < elements.length; ++i) {
@@ -73928,7 +74104,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
checkGrammarNumericLiteral(expr);
return +expr.text;
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return evaluateAnnotationPropertyConstantExpression(expr.expression);
case 79 /* Identifier */:
if (isInfinityOrNaNString(expr.escapedText)) {
@@ -73942,7 +74118,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return evaluateAnnotationPropertyConstantExpression(symbol.valueDeclaration.initializer);
}
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isConstantMemberAccess(expr)) {
return getConstantValue2(expr);
}
@@ -73961,7 +74137,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
checkVariableLikeDeclaration(node);
setNodeLinksForPrivateIdentifierScope(node);
- if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 171 /* PropertyDeclaration */ && node.initializer) {
+ if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 172 /* PropertyDeclaration */ && node.initializer) {
error(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name));
}
if (isAnnotationPropertyDeclaration(node)) {
@@ -74052,7 +74228,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.name, Diagnostics.Class_constructor_may_not_be_a_generator);
}
checkFunctionOrMethodDeclaration(node);
- if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 174 /* MethodDeclaration */ && node.body) {
+ if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 176 /* MethodDeclaration */ && node.body) {
error(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name));
}
if (isPrivateIdentifier(node.name) && !getContainingClass(node)) {
@@ -74100,7 +74276,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isPrivateIdentifierClassElementDeclaration(n)) {
return true;
}
- return n.kind === 171 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer;
+ return n.kind === 172 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer;
}
function checkConstructorDeclarationDiagnostics() {
const containingClassDecl = node.parent;
@@ -74163,20 +74339,20 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkGrammarComputedPropertyName(node.name);
checkDecorators(node);
checkSignatureDeclaration(node);
- if (node.kind === 177 /* GetAccessor */) {
+ if (node.kind === 179 /* GetAccessor */) {
if (!(node.flags & 16777216 /* Ambient */) && nodeIsPresent(node.body) && node.flags & 256 /* HasImplicitReturn */) {
if (!(node.flags & 512 /* HasExplicitReturn */)) {
error(node.name, Diagnostics.A_get_accessor_must_return_a_value);
}
}
}
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
if (hasBindableName(node)) {
const symbol = getSymbolOfNode(node);
- const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */);
- const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */);
+ const getter = getDeclarationOfKind(symbol, 179 /* GetAccessor */);
+ const setter = getDeclarationOfKind(symbol, 180 /* SetAccessor */);
if (getter && setter && !(getNodeCheckFlags(getter) & 1 /* TypeChecked */)) {
getNodeLinks(getter).flags |= 1 /* TypeChecked */;
const getterFlags = getEffectiveModifierFlags(getter);
@@ -74197,7 +74373,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
const returnType = getTypeOfAccessors(getSymbolOfNode(node));
- if (node.kind === 177 /* GetAccessor */) {
+ if (node.kind === 179 /* GetAccessor */) {
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
}
}
@@ -74252,7 +74428,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkTypeReferenceNode(node) {
checkGrammarTypeArguments(node, node.typeArguments);
- if (node.kind === 183 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) {
+ if (node.kind === 185 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) {
grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
}
forEach(node.typeArguments, checkSourceElement);
@@ -74316,7 +74492,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let seenRestElement = false;
const hasNamedElement = some(elementTypes, isNamedTupleMember);
for (const e of elementTypes) {
- if (e.kind !== 202 /* NamedTupleMember */ && hasNamedElement) {
+ if (e.kind !== 204 /* NamedTupleMember */ && hasNamedElement) {
grammarErrorOnNode(e, Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names);
break;
}
@@ -74361,7 +74537,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const objectType = type.objectType;
const indexType = type.indexType;
if (isTypeAssignableTo(indexType, getIndexType(objectType, false))) {
- if (accessNode.kind === 212 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
+ if (accessNode.kind === 214 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
}
return type;
@@ -74422,7 +74598,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
forEachChild(node, checkSourceElement);
}
function checkInferType(node) {
- if (!findAncestor(node, (n) => n.parent && n.parent.kind === 194 /* ConditionalType */ && n.parent.extendsType === n)) {
+ if (!findAncestor(node, (n) => n.parent && n.parent.kind === 196 /* ConditionalType */ && n.parent.extendsType === n)) {
grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
}
checkSourceElement(node.typeParameter);
@@ -74432,7 +74608,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!links.typeParametersChecked) {
links.typeParametersChecked = true;
const typeParameter = getDeclaredTypeOfTypeParameter(symbol);
- const declarations = getDeclarationsOfKind(symbol, 167 /* TypeParameter */);
+ const declarations = getDeclarationsOfKind(symbol, 168 /* TypeParameter */);
if (!areTypeParametersIdentical(declarations, [typeParameter], (decl) => [decl])) {
const name = symbolToString(symbol);
for (const declaration of declarations) {
@@ -74470,10 +74646,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.dotDotDotToken && node.questionToken) {
grammarErrorOnNode(node, Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest);
}
- if (node.type.kind === 190 /* OptionalType */) {
+ if (node.type.kind === 192 /* OptionalType */) {
grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type);
}
- if (node.type.kind === 191 /* RestType */) {
+ if (node.type.kind === 193 /* RestType */) {
grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type);
}
checkSourceElement(node.type);
@@ -74484,7 +74660,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function getEffectiveDeclarationFlags(n, flagsToCheck) {
let flags = getCombinedModifierFlags(n);
- if (n.parent.kind !== 267 /* InterfaceDeclaration */ && n.parent.kind !== 264 /* ClassDeclaration */ && n.parent.kind !== 232 /* ClassExpression */ && n.flags & 16777216 /* Ambient */) {
+ if (n.parent.kind !== 270 /* InterfaceDeclaration */ && n.parent.kind !== 266 /* ClassDeclaration */ && n.parent.kind !== 234 /* ClassExpression */ && n.flags & 16777216 /* Ambient */) {
if (!(flags & 2 /* Ambient */) && !(isModuleBlock(n.parent) && isModuleDeclaration(n.parent.parent) && isGlobalScopeAugmentation(n.parent.parent))) {
flags |= 1 /* Export */;
}
@@ -74557,7 +74733,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const errorNode2 = subsequentNode.name || subsequentNode;
const subsequentName = subsequentNode.name;
if (node.name && subsequentName && (isPrivateIdentifier(node.name) && isPrivateIdentifier(subsequentName) && node.name.escapedText === subsequentName.escapedText || isComputedPropertyName(node.name) && isComputedPropertyName(subsequentName) || isPropertyNameLiteral(node.name) && isPropertyNameLiteral(subsequentName) && getEscapedTextOfIdentifierOrLiteral(node.name) === getEscapedTextOfIdentifierOrLiteral(subsequentName))) {
- const reportError = (node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode);
+ const reportError = (node.kind === 176 /* MethodDeclaration */ || node.kind === 175 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode);
if (reportError) {
const diagnostic = isStatic(node) ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static;
error(errorNode2, diagnostic);
@@ -74589,14 +74765,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
for (const current of declarations) {
const node = current;
const inAmbientContext = node.flags & 16777216 /* Ambient */;
- const inAmbientContextOrInterface = node.parent && (node.parent.kind === 267 /* InterfaceDeclaration */ || node.parent.kind === 187 /* TypeLiteral */) || inAmbientContext;
+ const inAmbientContextOrInterface = node.parent && (node.parent.kind === 270 /* InterfaceDeclaration */ || node.parent.kind === 189 /* TypeLiteral */) || inAmbientContext;
if (inAmbientContextOrInterface) {
previousDeclaration = void 0;
}
- if ((node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */) && !inAmbientContext) {
+ if ((node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */) && !inAmbientContext) {
hasNonAmbientClass = true;
}
- if (node.kind === 263 /* FunctionDeclaration */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 176 /* Constructor */) {
+ if (node.kind === 265 /* FunctionDeclaration */ || node.kind === 176 /* MethodDeclaration */ || node.kind === 175 /* MethodSignature */ || node.kind === 178 /* Constructor */) {
functionDeclarations.push(node);
const currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);
someNodeFlags |= currentNodeFlags;
@@ -74638,9 +74814,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
}
if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 /* Function */ && declarations) {
- const relatedDiagnostics = filter(declarations, (d) => d.kind === 264 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class));
+ const relatedDiagnostics = filter(declarations, (d) => d.kind === 266 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class));
forEach(declarations, (declaration) => {
- const diagnostic = declaration.kind === 264 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 263 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0;
+ const diagnostic = declaration.kind === 266 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 265 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0;
if (diagnostic) {
addRelatedInfo(
error(getNameOfDeclaration(declaration) || declaration, diagnostic, symbolName(symbol)),
@@ -74719,43 +74895,43 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getDeclarationSpaces(decl) {
let d = decl;
switch (d.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return 2 /* ExportType */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return isAmbientModule(d) || getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */;
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
return 2 /* ExportType */ | 1 /* ExportValue */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */;
- case 280 /* ExportAssignment */:
- case 227 /* BinaryExpression */:
+ case 283 /* ExportAssignment */:
+ case 229 /* BinaryExpression */:
const node2 = d;
const expression = isExportAssignment(node2) ? node2.expression : node2.right;
if (!isEntityNameExpression(expression)) {
return 1 /* ExportValue */;
}
d = expression;
- case 274 /* ImportEqualsDeclaration */:
- case 277 /* NamespaceImport */:
- case 276 /* ImportClause */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 280 /* NamespaceImport */:
+ case 279 /* ImportClause */:
let result = 0 /* None */;
const target = resolveAlias(getSymbolOfNode(d));
forEach(target.declarations, (d2) => {
result |= getDeclarationSpaces(d2);
});
return result;
- case 261 /* VariableDeclaration */:
- case 208 /* BindingElement */:
- case 263 /* FunctionDeclaration */:
- case 279 /* ImportSpecifier */:
+ case 263 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 265 /* FunctionDeclaration */:
+ case 282 /* ImportSpecifier */:
case 79 /* Identifier */:
return 1 /* ExportValue */;
default:
@@ -75006,21 +75182,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let headMessage;
let expectedReturnType;
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
const classSymbol = getSymbolOfNode(node.parent);
const classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
expectedReturnType = voidType;
break;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
const methodType = getTypeOfNode(node.parent);
const descriptorType = createTypedPropertyDescriptorType(methodType);
@@ -75066,15 +75242,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getEntityNameForDecoratorMetadata(node) {
if (node) {
switch (node.kind) {
- case 193 /* IntersectionType */:
- case 192 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 194 /* UnionType */:
return getEntityNameForDecoratorMetadataFromTypeList(node.types);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]);
- case 196 /* ParenthesizedType */:
- case 202 /* NamedTupleMember */:
+ case 198 /* ParenthesizedType */:
+ case 204 /* NamedTupleMember */:
return getEntityNameForDecoratorMetadata(node.type);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return node.typeName;
}
}
@@ -75082,13 +75258,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function getEntityNameForDecoratorMetadataFromTypeList(types) {
let commonEntityName;
for (let typeNode of types) {
- while (typeNode.kind === 196 /* ParenthesizedType */ || typeNode.kind === 202 /* NamedTupleMember */) {
+ while (typeNode.kind === 198 /* ParenthesizedType */ || typeNode.kind === 204 /* NamedTupleMember */) {
typeNode = typeNode.type;
}
if (typeNode.kind === 145 /* NeverKeyword */) {
continue;
}
- if (!strictNullChecks && (typeNode.kind === 201 /* LiteralType */ && typeNode.literal.kind === 105 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) {
+ if (!strictNullChecks && (typeNode.kind === 203 /* LiteralType */ && typeNode.literal.kind === 105 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) {
continue;
}
const individualEntityName = getEntityNameForDecoratorMetadata(typeNode);
@@ -75148,9 +75324,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
switch (annotatedDecl.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
const enclosingDecl = annotatedDecl.parent;
Debug.assert(isClassDeclaration(enclosingDecl));
if (hasSyntacticModifier(enclosingDecl, 256 /* Abstract */)) {
@@ -75181,10 +75357,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
ident = da.expression;
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
ident = da.expression;
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
ident = getIdentifierFromEntityNameExpression(da.expression.expression);
break;
default:
@@ -75239,13 +75415,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */);
- if (node.kind === 168 /* Parameter */) {
+ if (node.kind === 169 /* Parameter */) {
checkExternalEmitHelpers(firstDecorator, 32 /* Param */);
}
if (compilerOptions.emitDecoratorMetadata) {
checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */);
switch (node.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const constructor = getFirstConstructorWithBody(node);
if (constructor) {
for (const parameter of constructor.parameters) {
@@ -75253,22 +75429,22 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- const otherKind = node.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */;
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ const otherKind = node.kind === 179 /* GetAccessor */ ? 180 /* SetAccessor */ : 179 /* GetAccessor */;
const otherAccessor = getDeclarationOfKind(getSymbolOfNode(node), otherKind);
markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
for (const parameter of node.parameters) {
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
}
markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(node));
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveTypeAnnotationNode(node));
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node));
const containingSignature = node.parent;
for (const parameter of containingSignature.parameters) {
@@ -75366,7 +75542,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
return node;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return node.name;
default:
return void 0;
@@ -75377,7 +75553,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkDecorators(node);
checkSignatureDeclaration(node);
const functionFlags = getFunctionFlags(node);
- if (node.name && node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name && node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
}
if (hasBindableName(node)) {
@@ -75393,7 +75569,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkFunctionOrConstructorSymbol(symbol);
}
}
- const body = node.kind === 173 /* MethodSignature */ ? void 0 : node.body;
+ const body = node.kind === 175 /* MethodSignature */ ? void 0 : node.body;
checkSourceElement(body);
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node));
addLazyDiagnostic(checkFunctionOrMethodDeclarationDiagnostics);
@@ -75429,43 +75605,43 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) {
for (const node of potentiallyUnusedIdentifiers) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
checkUnusedClassMembers(node, addDiagnostic);
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 314 /* SourceFile */:
- case 270 /* ModuleDeclaration */:
- case 242 /* Block */:
- case 272 /* CaseBlock */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 317 /* SourceFile */:
+ case 273 /* ModuleDeclaration */:
+ case 244 /* Block */:
+ case 275 /* CaseBlock */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
checkUnusedLocalsAndParameters(node, addDiagnostic);
break;
- case 176 /* Constructor */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
if (node.body) {
checkUnusedLocalsAndParameters(node, addDiagnostic);
}
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 195 /* InferType */:
+ case 197 /* InferType */:
checkUnusedInferTypeParameter(node, addDiagnostic);
break;
default:
@@ -75484,11 +75660,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkUnusedClassMembers(node, addDiagnostic) {
for (const member of node.members) {
switch (member.kind) {
- case 174 /* MethodDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- if (member.kind === 178 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) {
+ case 176 /* MethodDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ if (member.kind === 180 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) {
break;
}
const symbol = getSymbolOfNode(member);
@@ -75496,16 +75672,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
addDiagnostic(member, 0 /* Local */, createDiagnosticForNode(member.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
}
break;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
for (const parameter of member.parameters) {
if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter, 8 /* Private */)) {
addDiagnostic(parameter, 0 /* Local */, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol)));
}
}
break;
- case 181 /* IndexSignature */:
- case 241 /* SemicolonClassElement */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 183 /* IndexSignature */:
+ case 243 /* SemicolonClassElement */:
+ case 177 /* ClassStaticBlockDeclaration */:
break;
default:
Debug.fail("Unexpected class member");
@@ -75529,7 +75705,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
const name = idText(typeParameter.name);
const { parent: parent2 } = typeParameter;
- if (parent2.kind !== 195 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) {
+ if (parent2.kind !== 197 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) {
if (tryAddToSet(seenParentsWithEveryUnused, parent2)) {
const sourceFile = getSourceFileOfNode(parent2);
const range = isJSDocTemplateTag(parent2) ? rangeOfNode(parent2) : rangeOfTypeParameters(sourceFile, parent2.typeParameters);
@@ -75609,7 +75785,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
unusedImports.forEach(([importClause, unuseds]) => {
const importDecl = importClause.parent;
- const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 277 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0);
+ const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 280 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0);
if (nDeclarations === unuseds.length) {
addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 ? createDiagnosticForNode(importDecl, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(first(unuseds).name)) : createDiagnosticForNode(importDecl, Diagnostics.All_imports_in_import_declaration_are_unused));
} else {
@@ -75620,7 +75796,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
unusedDestructures.forEach(([bindingPattern, bindingElements]) => {
const kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */;
if (bindingPattern.elements.length === bindingElements.length) {
- if (bindingElements.length === 1 && bindingPattern.parent.kind === 261 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 262 /* VariableDeclarationList */) {
+ if (bindingElements.length === 1 && bindingPattern.parent.kind === 263 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 264 /* VariableDeclarationList */) {
addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId);
} else {
addDiagnostic(bindingPattern, kind, bindingElements.length === 1 ? createDiagnosticForNode(bindingPattern, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(bindingElements).name)) : createDiagnosticForNode(bindingPattern, Diagnostics.All_destructured_elements_are_unused));
@@ -75633,7 +75809,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
});
unusedVariables.forEach(([declarationList, declarations]) => {
if (declarationList.declarations.length === declarations.length) {
- addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 244 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused));
+ addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 246 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused));
} else {
for (const decl of declarations) {
addDiagnostic(decl, 0 /* Local */, createDiagnosticForNode(decl, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(decl.name)));
@@ -75662,21 +75838,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (name.kind) {
case 79 /* Identifier */:
return idText(name);
- case 207 /* ArrayBindingPattern */:
- case 206 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
return bindingNameText(cast(first(name.elements), isBindingElement).name);
default:
return Debug.assertNever(name);
}
}
function isImportedDeclaration(node) {
- return node.kind === 276 /* ImportClause */ || node.kind === 279 /* ImportSpecifier */ || node.kind === 277 /* NamespaceImport */;
+ return node.kind === 279 /* ImportClause */ || node.kind === 282 /* ImportSpecifier */ || node.kind === 280 /* NamespaceImport */;
}
function importClauseFromImported(decl) {
- return decl.kind === 276 /* ImportClause */ ? decl : decl.kind === 277 /* NamespaceImport */ ? decl.parent : decl.parent.parent;
+ return decl.kind === 279 /* ImportClause */ ? decl : decl.kind === 280 /* NamespaceImport */ ? decl.parent : decl.parent.parent;
}
function checkBlock(node) {
- if (node.kind === 242 /* Block */) {
+ if (node.kind === 244 /* Block */) {
checkGrammarStatementInAmbientContext(node);
}
if (isFunctionOrModuleBlock(node)) {
@@ -75704,7 +75880,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if ((identifier == null ? void 0 : identifier.escapedText) !== name) {
return false;
}
- if (node.kind === 171 /* PropertyDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */ || node.kind === 305 /* PropertyAssignment */) {
+ if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 176 /* MethodDeclaration */ || node.kind === 175 /* MethodSignature */ || node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */ || node.kind === 308 /* PropertyAssignment */) {
return false;
}
if (node.flags & 16777216 /* Ambient */) {
@@ -75760,7 +75936,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const parent2 = getDeclarationContainer(node);
- if (parent2.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(parent2)) {
+ if (parent2.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(parent2)) {
errorSkippedOn(
"noEmit",
name,
@@ -75778,7 +75954,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const parent2 = getDeclarationContainer(node);
- if (parent2.kind === 314 /* SourceFile */ && isExternalOrCommonJsModule(parent2) && parent2.flags & 2048 /* HasAsyncFunctions */) {
+ if (parent2.kind === 317 /* SourceFile */ && isExternalOrCommonJsModule(parent2) && parent2.flags & 2048 /* HasAsyncFunctions */) {
errorSkippedOn(
"noEmit",
name,
@@ -75860,7 +76036,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if ((getCombinedNodeFlags(node) & 3 /* BlockScoped */) !== 0 || isParameterDeclaration(node)) {
return;
}
- if (node.kind === 261 /* VariableDeclaration */ && !node.initializer) {
+ if (node.kind === 263 /* VariableDeclaration */ && !node.initializer) {
return;
}
const symbol = getSymbolOfNode(node);
@@ -75870,9 +76046,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const localDeclarationSymbol = resolveName(node, node.name.escapedText, 3 /* Variable */, void 0, void 0, false);
if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) {
if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) {
- const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 262 /* VariableDeclarationList */);
- const container = varDeclList.parent.kind === 244 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0;
- const namesShareScope = container && (container.kind === 242 /* Block */ && isFunctionLike(container.parent) || container.kind === 271 /* ModuleBlock */ || container.kind === 270 /* ModuleDeclaration */ || container.kind === 314 /* SourceFile */);
+ const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 264 /* VariableDeclarationList */);
+ const container = varDeclList.parent.kind === 246 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0;
+ const namesShareScope = container && (container.kind === 244 /* Block */ && isFunctionLike(container.parent) || container.kind === 274 /* ModuleBlock */ || container.kind === 273 /* ModuleDeclaration */ || container.kind === 317 /* SourceFile */);
if (!namesShareScope) {
const name = symbolToString(localDeclarationSymbol);
error(node, Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name);
@@ -75893,7 +76069,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!node.name) {
return;
}
- if (node.name.kind === 166 /* ComputedPropertyName */) {
+ if (node.name.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.name);
if (hasOnlyExpressionInitializer(node) && node.initializer) {
checkExpressionCached(node.initializer);
@@ -75907,7 +76083,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ES2018 */) {
checkExternalEmitHelpers(node, 4 /* Rest */);
}
- if (node.propertyName && node.propertyName.kind === 166 /* ComputedPropertyName */) {
+ if (node.propertyName && node.propertyName.kind === 167 /* ComputedPropertyName */) {
checkComputedPropertyName(node.propertyName);
}
const parent2 = node.parent.parent;
@@ -75927,7 +76103,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
if (isBindingPattern(node.name)) {
- if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
+ if (node.name.kind === 209 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
checkExternalEmitHelpers(node, 512 /* Read */);
}
forEach(node.name.elements, checkSourceElement);
@@ -75937,7 +76113,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
if (isBindingPattern(node.name)) {
- const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 250 /* ForInStatement */;
+ const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 252 /* ForInStatement */;
const needCheckWidenedType = !some(node.name.elements, not(isOmittedExpression));
if (needCheckInitializer || needCheckWidenedType) {
const widenedType = getWidenedTypeForVariableLikeDeclaration(node);
@@ -75960,7 +76136,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const symbol = getSymbolOfNode(node);
- if (symbol.flags & 2097152 /* Alias */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 208 /* BindingElement */ ? node.parent.parent : node)) {
+ if (symbol.flags & 2097152 /* Alias */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 210 /* BindingElement */ ? node.parent.parent : node)) {
checkAliasSymbol(node);
return;
}
@@ -75969,7 +76145,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const initializer = hasOnlyExpressionInitializer(node) && getEffectiveInitializer(node);
if (initializer) {
const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((_a2 = symbol.exports) == null ? void 0 : _a2.size);
- if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 250 /* ForInStatement */) {
+ if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 252 /* ForInStatement */) {
checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, void 0);
}
}
@@ -75990,9 +76166,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name));
}
}
- if (node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 170 /* PropertySignature */ && node.kind !== 172 /* AnnotationPropertyDeclaration */) {
+ if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 173 /* AnnotationPropertyDeclaration */) {
checkExportsOnMergedDeclarations(node);
- if (node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
+ if (node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */) {
checkVarDeclaredNamesNotShadowed(node);
}
checkCollisionsForDeclarationName(node, node.name);
@@ -76000,7 +76176,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) {
const nextDeclarationName = getNameOfDeclaration(nextDeclaration);
- const message = nextDeclaration.kind === 171 /* PropertyDeclaration */ || nextDeclaration.kind === 170 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;
+ const message = nextDeclaration.kind === 172 /* PropertyDeclaration */ || nextDeclaration.kind === 171 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;
const declName = declarationNameToString(nextDeclarationName);
const err = error(
nextDeclarationName,
@@ -76017,7 +76193,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function areDeclarationFlagsIdentical(left, right) {
- if (left.kind === 168 /* Parameter */ && right.kind === 261 /* VariableDeclaration */ || left.kind === 261 /* VariableDeclaration */ && right.kind === 168 /* Parameter */) {
+ if (left.kind === 169 /* Parameter */ && right.kind === 263 /* VariableDeclaration */ || left.kind === 263 /* VariableDeclaration */ && right.kind === 169 /* Parameter */) {
return true;
}
if (hasQuestionToken(left) !== hasQuestionToken(right)) {
@@ -76053,7 +76229,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const type = checkTruthinessExpression(node.expression);
checkTestingKnownTruthyCallableOrAwaitableType(node.expression, type, node.thenStatement);
checkSourceElement(node.thenStatement);
- if (node.thenStatement.kind === 243 /* EmptyStatement */) {
+ if (node.thenStatement.kind === 245 /* EmptyStatement */) {
error(node.thenStatement, Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
}
checkSourceElement(node.elseStatement);
@@ -76169,12 +76345,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkForStatement(node) {
if (!checkGrammarStatementInAmbientContext(node)) {
- if (node.initializer && node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer && node.initializer.kind === 264 /* VariableDeclarationList */) {
checkGrammarVariableDeclarationList(node.initializer);
}
}
if (node.initializer) {
- if (node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind === 264 /* VariableDeclarationList */) {
forEach(node.initializer.declarations, checkVariableDeclaration);
} else {
checkExpression(node.initializer);
@@ -76204,12 +76380,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ES2015 */) {
checkExternalEmitHelpers(node, 256 /* ForOfIncludes */);
}
- if (node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind === 264 /* VariableDeclarationList */) {
checkForInOrForOfVariableDeclaration(node);
} else {
const varExpr = node.initializer;
const iteratedType = checkRightHandSideOfForOf(node);
- if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) {
+ if (varExpr.kind === 211 /* ArrayLiteralExpression */ || varExpr.kind === 212 /* ObjectLiteralExpression */) {
checkDestructuringAssignment(varExpr, iteratedType || errorType);
} else {
const leftType = checkExpression(varExpr);
@@ -76231,7 +76407,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkForInStatement(node) {
checkGrammarForInOrForOfStatement(node);
const rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression));
- if (node.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind === 264 /* VariableDeclarationList */) {
const variable = node.initializer.declarations[0];
if (variable && isBindingPattern(variable.name)) {
error(variable.name, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
@@ -76240,7 +76416,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
const varExpr = node.initializer;
const leftType = checkExpression(varExpr);
- if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) {
+ if (varExpr.kind === 211 /* ArrayLiteralExpression */ || varExpr.kind === 212 /* ObjectLiteralExpression */) {
error(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
} else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) {
error(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any);
@@ -76797,11 +76973,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const functionFlags = getFunctionFlags(container);
if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) {
const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
- if (container.kind === 178 /* SetAccessor */) {
+ if (container.kind === 180 /* SetAccessor */) {
if (node.expression) {
error(node, Diagnostics.Setters_cannot_return_a_value);
}
- } else if (container.kind === 176 /* Constructor */) {
+ } else if (container.kind === 178 /* Constructor */) {
if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) {
error(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
}
@@ -76812,7 +76988,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression);
}
}
- } else if (container.kind !== 176 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) {
+ } else if (container.kind !== 178 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) {
error(node, Diagnostics.Not_all_code_paths_return_a_value);
}
}
@@ -76837,7 +77013,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const expressionType = checkExpression(node.expression);
const expressionIsLiteral = isLiteralType3(expressionType);
forEach(node.caseBlock.clauses, (clause) => {
- if (clause.kind === 299 /* DefaultClause */ && !hasDuplicateDefaultClause) {
+ if (clause.kind === 302 /* DefaultClause */ && !hasDuplicateDefaultClause) {
if (firstDefaultClause === void 0) {
firstDefaultClause = clause;
} else {
@@ -76845,7 +77021,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
hasDuplicateDefaultClause = true;
}
}
- if (clause.kind === 298 /* CaseClause */) {
+ if (clause.kind === 301 /* CaseClause */) {
addLazyDiagnostic(createLazyCaseClauseDiagnostics(clause));
}
forEach(clause.statements, checkSourceElement);
@@ -76877,7 +77053,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isFunctionLike(current)) {
return "quit";
}
- if (current.kind === 257 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) {
+ if (current.kind === 259 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) {
grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNode(node.label));
return true;
}
@@ -76961,8 +77137,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const indexInfos = getApplicableIndexInfos(type, propNameType);
- const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 267 /* InterfaceDeclaration */) : void 0;
- const propDeclaration = declaration && declaration.kind === 227 /* BinaryExpression */ || name && name.kind === 166 /* ComputedPropertyName */ ? declaration : void 0;
+ const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 270 /* InterfaceDeclaration */) : void 0;
+ const propDeclaration = declaration && declaration.kind === 229 /* BinaryExpression */ || name && name.kind === 167 /* ComputedPropertyName */ ? declaration : void 0;
const localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : void 0;
for (const info of indexInfos) {
const localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : void 0;
@@ -76986,7 +77162,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkIndexConstraintForIndexSignature(type, checkInfo) {
const declaration = checkInfo.declaration;
const indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
- const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 267 /* InterfaceDeclaration */) : void 0;
+ const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 270 /* InterfaceDeclaration */) : void 0;
const localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : void 0;
for (const info of indexInfos) {
if (info === checkInfo)
@@ -77091,7 +77267,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkTypeParametersNotReferenced(root, typeParameters, index) {
visit(root);
function visit(node) {
- if (node.kind === 183 /* TypeReference */) {
+ if (node.kind === 185 /* TypeReference */) {
const type = getTypeFromTypeReference(node);
if (type.flags & 262144 /* TypeParameter */) {
for (let i = index; i < typeParameters.length; i++) {
@@ -77518,7 +77694,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getCheckFlags(s) & 1 /* Instantiated */ ? s.target : s;
}
function getClassOrInterfaceDeclarationsOfSymbol(symbol) {
- return filter(symbol.declarations, (d) => d.kind === 264 /* ClassDeclaration */ || d.kind === 267 /* InterfaceDeclaration */);
+ return filter(symbol.declarations, (d) => d.kind === 266 /* ClassDeclaration */ || d.kind === 270 /* InterfaceDeclaration */);
}
function checkKindsOfPropertyMemberOverrides(type, baseType) {
var _a2, _b, _c, _d;
@@ -77548,7 +77724,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue basePropertyCheck;
}
}
- if (derivedClassDecl.kind === 232 /* ClassExpression */) {
+ if (derivedClassDecl.kind === 234 /* ClassExpression */) {
error(
derivedClassDecl,
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
@@ -77583,7 +77759,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
} else if (useDefineForClassFields) {
- const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 171 /* PropertyDeclaration */ && !d.initializer);
+ const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer);
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_d = derived.declarations) == null ? void 0 : _d.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
const propName = uninitialized.name;
@@ -77686,7 +77862,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isPropertyWithoutInitializer(node) {
- return node.kind === 171 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer;
+ return node.kind === 172 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer;
}
function isPropertyInitializedInStaticBlocks(propName, propType, staticBlocks, startPos, endPos) {
for (const staticBlock of staticBlocks) {
@@ -77720,7 +77896,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkExportsOnMergedDeclarations(node);
const symbol = getSymbolOfNode(node);
checkTypeParameterListsIdentical(symbol);
- const firstInterfaceDecl = getDeclarationOfKind(symbol, 267 /* InterfaceDeclaration */);
+ const firstInterfaceDecl = getDeclarationOfKind(symbol, 270 /* InterfaceDeclaration */);
if (node === firstInterfaceDecl) {
const type = getDeclaredTypeOfSymbol(symbol);
const typeWithThis = getTypeWithThisArgument(type);
@@ -77819,7 +77995,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return value;
function evaluate(expr) {
switch (expr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
const value2 = evaluate(expr.operand);
if (typeof value2 === "number") {
switch (expr.operator) {
@@ -77832,7 +78008,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const left = evaluate(expr.left);
const right = evaluate(expr.right);
if (typeof left === "number" && typeof right === "number") {
@@ -77872,7 +78048,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
checkGrammarNumericLiteral(expr);
return +expr.text;
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return evaluate(expr.expression);
case 79 /* Identifier */:
const identifier = expr;
@@ -77880,13 +78056,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return +identifier.escapedText;
}
return nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isConstantMemberAccess(expr)) {
const type = getTypeOfExpression(expr.expression);
if (type.symbol && type.symbol.flags & 384 /* Enum */) {
let name;
- if (expr.kind === 211 /* PropertyAccessExpression */) {
+ if (expr.kind === 213 /* PropertyAccessExpression */) {
name = expr.name.escapedText;
} else {
name = escapeLeadingUnderscores(cast(expr.argumentExpression, isLiteralExpression).text);
@@ -77920,7 +78096,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (type === errorType) {
return false;
}
- return node.kind === 79 /* Identifier */ || node.kind === 211 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || node.kind === 212 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && isStringLiteralLike(node.argumentExpression);
+ return node.kind === 79 /* Identifier */ || node.kind === 213 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || node.kind === 214 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && isStringLiteralLike(node.argumentExpression);
}
function checkEnumDeclaration(node) {
addLazyDiagnostic(() => checkEnumDeclarationWorker(node));
@@ -77944,7 +78120,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let seenEnumMissingInitialInitializer = false;
forEach(enumSymbol.declarations, (declaration) => {
- if (declaration.kind !== 269 /* EnumDeclaration */) {
+ if (declaration.kind !== 272 /* EnumDeclaration */) {
return false;
}
const enumDeclaration = declaration;
@@ -77971,7 +78147,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const declarations = symbol.declarations;
if (declarations) {
for (const declaration of declarations) {
- if ((declaration.kind === 264 /* ClassDeclaration */ || declaration.kind === 263 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 16777216 /* Ambient */)) {
+ if ((declaration.kind === 266 /* ClassDeclaration */ || declaration.kind === 265 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 16777216 /* Ambient */)) {
return declaration;
}
}
@@ -78027,7 +78203,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged);
}
}
- const mergedClass = getDeclarationOfKind(symbol, 264 /* ClassDeclaration */);
+ const mergedClass = getDeclarationOfKind(symbol, 266 /* ClassDeclaration */);
if (mergedClass && inSameLexicalScope(node, mergedClass)) {
getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */;
}
@@ -78058,21 +78234,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkModuleAugmentationElement(node, isGlobalAugmentation) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
for (const decl of node.declarationList.declarations) {
checkModuleAugmentationElement(decl, isGlobalAugmentation);
}
break;
- case 280 /* ExportAssignment */:
- case 281 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 284 /* ExportDeclaration */:
grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
break;
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
break;
- case 208 /* BindingElement */:
- case 261 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
const name = node.name;
if (isBindingPattern(name)) {
for (const el of name.elements) {
@@ -78080,12 +78256,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
break;
}
- case 264 /* ClassDeclaration */:
- case 269 /* EnumDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
if (isGlobalAugmentation) {
return;
}
@@ -78096,12 +78272,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
return node;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
do {
node = node.left;
} while (node.kind !== 79 /* Identifier */);
return node;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
do {
if (isModuleExportsAccessExpression(node.expression) && !isPrivateIdentifier(node.name)) {
return node.name;
@@ -78120,9 +78296,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
error(moduleName, Diagnostics.String_literal_expected);
return false;
}
- const inAmbientExternalModule = node.parent.kind === 271 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
- if (node.parent.kind !== 314 /* SourceFile */ && !inAmbientExternalModule) {
- error(moduleName, node.kind === 281 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
+ const inAmbientExternalModule = node.parent.kind === 274 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
+ if (node.parent.kind !== 317 /* SourceFile */ && !inAmbientExternalModule) {
+ error(moduleName, node.kind === 284 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
return false;
}
if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) {
@@ -78151,8 +78327,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
symbol = getMergedSymbol(symbol.exportSymbol || symbol);
if (isInJSFile(node) && !(target.flags & 111551 /* Value */) && !isTypeOnlyImportOrExportDeclaration(node)) {
const errorNode = isImportOrExportSpecifier(node) ? node.propertyName || node.name : isNamedDeclaration(node) ? node.name : node;
- Debug.assert(node.kind !== 283 /* NamespaceExport */);
- if (node.kind === 284 /* ExportSpecifier */) {
+ Debug.assert(node.kind !== 286 /* NamespaceExport */);
+ if (node.kind === 287 /* ExportSpecifier */) {
const diag2 = error(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
const alreadyExportedSymbol = (_b = (_a2 = getSourceFileOfNode(node).symbol) == null ? void 0 : _a2.exports) == null ? void 0 : _b.get((node.propertyName || node.name).escapedText);
if (alreadyExportedSymbol === target) {
@@ -78166,7 +78342,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
} else {
- Debug.assert(node.kind !== 261 /* VariableDeclaration */);
+ Debug.assert(node.kind !== 263 /* VariableDeclaration */);
const importDeclaration = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration));
const moduleSpecifier = (_e = importDeclaration && ((_d = tryGetModuleSpecifierFromDeclaration(importDeclaration)) == null ? void 0 : _d.text)) != null ? _e : "...";
const importedIdentifier = unescapeLeadingUnderscores(isIdentifier(errorNode) ? errorNode.escapedText : symbol.escapedName);
@@ -78182,7 +78358,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const targetFlags = getAllSymbolFlags(target);
const excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) | (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0);
if (targetFlags & excludedMeanings) {
- const message = node.kind === 284 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
+ const message = node.kind === 287 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
error(node, message, symbolToString(symbol));
}
if (compilerOptions.isolatedModules && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216 /* Ambient */)) {
@@ -78190,25 +78366,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const isType3 = !(targetFlags & 111551 /* Value */);
if (isType3 || typeOnlyAlias) {
switch (node.kind) {
- case 276 /* ImportClause */:
- case 279 /* ImportSpecifier */:
- case 274 /* ImportEqualsDeclaration */: {
+ case 279 /* ImportClause */:
+ case 282 /* ImportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */: {
if (compilerOptions.preserveValueImports) {
Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name");
const message = isType3 ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled;
- const name = idText(node.kind === 279 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
+ const name = idText(node.kind === 282 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
addTypeOnlyDeclarationRelatedInfo(
error(node, message, name),
isType3 ? void 0 : typeOnlyAlias,
name
);
}
- if (isType3 && node.kind === 274 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) {
+ if (isType3 && node.kind === 277 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) {
error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided);
}
break;
}
- case 284 /* ExportSpecifier */: {
+ case 287 /* ExportSpecifier */: {
if (getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) {
const message = isType3 ? Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled;
const name = idText(node.propertyName || node.name);
@@ -78277,7 +78453,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkImportBinding(node) {
checkCollisionsForDeclarationName(node, node.name);
checkAliasSymbol(node);
- if (node.kind === 279 /* ImportSpecifier */ && idText(node.propertyName || node.name) === "default" && getESModuleInterop(compilerOptions) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
+ if (node.kind === 282 /* ImportSpecifier */ && idText(node.propertyName || node.name) === "default" && getESModuleInterop(compilerOptions) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
}
}
@@ -78324,7 +78500,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkImportBinding(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (importClause.namedBindings.kind === 280 /* NamespaceImport */) {
checkImportBinding(importClause.namedBindings);
if (moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && getESModuleInterop(compilerOptions)) {
checkExternalEmitHelpers(node, 65536 /* ImportStar */);
@@ -78350,7 +78526,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (hasSyntacticModifier(node, 1 /* Export */)) {
markExportAsReferenced(node);
}
- if (node.moduleReference.kind !== 286 /* ExternalModuleReference */) {
+ if (node.moduleReference.kind !== 289 /* ExternalModuleReference */) {
const target = resolveAlias(getSymbolOfNode(node));
if (target !== unknownSymbol) {
const targetFlags = getAllSymbolFlags(target);
@@ -78388,9 +78564,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
if (node.exportClause && !isNamespaceExport(node.exportClause)) {
forEach(node.exportClause.elements, checkExportSpecifier);
- const inAmbientExternalModule = node.parent.kind === 271 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
- const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 271 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 16777216 /* Ambient */;
- if (node.parent.kind !== 314 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
+ const inAmbientExternalModule = node.parent.kind === 274 /* ModuleBlock */ && isAmbientModule(node.parent.parent);
+ const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 274 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 16777216 /* Ambient */;
+ if (node.parent.kind !== 317 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
error(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
}
} else {
@@ -78416,7 +78592,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkGrammarExportDeclaration(node) {
var _a2;
if (node.isTypeOnly) {
- if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 282 /* NamedExports */) {
+ if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 285 /* NamedExports */) {
return checkGrammarNamedImportsOrExports(node.exportClause);
} else {
return grammarErrorOnNode(node, Diagnostics.Only_named_exports_may_use_export_type);
@@ -78425,7 +78601,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function checkGrammarModuleElementContext(node, errorMessage) {
- const isInAppropriateContext = node.parent.kind === 314 /* SourceFile */ || node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 270 /* ModuleDeclaration */;
+ const isInAppropriateContext = node.parent.kind === 317 /* SourceFile */ || node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 273 /* ModuleDeclaration */;
if (!isInAppropriateContext) {
grammarErrorOnFirstToken(node, errorMessage);
}
@@ -78498,7 +78674,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
ident = node.expression;
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
ident = node.expression;
break;
default:
@@ -78523,8 +78699,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
return;
}
- const container = node.parent.kind === 314 /* SourceFile */ ? node.parent : node.parent.parent;
- if (container.kind === 270 /* ModuleDeclaration */ && !isAmbientModule(container)) {
+ const container = node.parent.kind === 317 /* SourceFile */ ? node.parent : node.parent.parent;
+ if (container.kind === 273 /* ModuleDeclaration */ && !isAmbientModule(container)) {
if (node.isExportEquals) {
error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
} else {
@@ -78636,186 +78812,188 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
cancellationToken.throwIfCancellationRequested();
}
}
- if (kind >= 244 /* FirstStatement */ && kind <= 260 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) {
+ if (kind >= 246 /* FirstStatement */ && kind <= 262 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) {
errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, Diagnostics.Unreachable_code_detected);
}
switch (kind) {
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return checkTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return checkParameter(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return checkPropertyDeclaration(node);
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
return checkPropertySignature(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return checkPropertyDeclaration(node);
- case 185 /* ConstructorType */:
- case 184 /* FunctionType */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 187 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return checkSignatureDeclaration(node);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return checkMethodDeclaration(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return checkClassStaticBlockDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return checkConstructorDeclaration(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return checkAccessorDeclaration(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return checkTypeReferenceNode(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return checkTypePredicate(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return checkTypeQuery(node);
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return checkTypeLiteral(node);
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return checkArrayType(node);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
return checkTupleType(node);
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return checkUnionOrIntersectionType(node);
- case 196 /* ParenthesizedType */:
- case 190 /* OptionalType */:
- case 191 /* RestType */:
+ case 198 /* ParenthesizedType */:
+ case 192 /* OptionalType */:
+ case 193 /* RestType */:
return checkSourceElement(node.type);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return checkThisType(node);
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return checkTypeOperator(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return checkConditionalType(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return checkInferType(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return checkTemplateLiteralType(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return checkImportType(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return checkNamedTupleMember(node);
- case 337 /* JSDocAugmentsTag */:
+ case 340 /* JSDocAugmentsTag */:
return checkJSDocAugmentsTag(node);
- case 338 /* JSDocImplementsTag */:
+ case 341 /* JSDocImplementsTag */:
return checkJSDocImplementsTag(node);
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return checkJSDocTypeAliasTag(node);
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return checkJSDocTemplateTag(node);
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return checkJSDocTypeTag(node);
- case 333 /* JSDocLink */:
- case 334 /* JSDocLinkCode */:
- case 335 /* JSDocLinkPlain */:
+ case 336 /* JSDocLink */:
+ case 337 /* JSDocLinkCode */:
+ case 338 /* JSDocLinkPlain */:
return checkJSDocLinkLikeTag(node);
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
return checkJSDocParameterTag(node);
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
return checkJSDocPropertyTag(node);
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
checkJSDocFunctionType(node);
- case 324 /* JSDocNonNullableType */:
- case 323 /* JSDocNullableType */:
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
- case 331 /* JSDocTypeLiteral */:
+ case 327 /* JSDocNonNullableType */:
+ case 326 /* JSDocNullableType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
+ case 334 /* JSDocTypeLiteral */:
checkJSDocTypeIsInJsFile(node);
forEachChild(node, checkSourceElement);
return;
- case 327 /* JSDocVariadicType */:
+ case 330 /* JSDocVariadicType */:
checkJSDocVariadicType(node);
return;
- case 318 /* JSDocTypeExpression */:
+ case 321 /* JSDocTypeExpression */:
return checkSourceElement(node.type);
- case 342 /* JSDocPublicTag */:
- case 344 /* JSDocProtectedTag */:
- case 343 /* JSDocPrivateTag */:
+ case 345 /* JSDocPublicTag */:
+ case 347 /* JSDocProtectedTag */:
+ case 346 /* JSDocPrivateTag */:
return checkJSDocAccessibilityModifiers(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return checkIndexedAccessType(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return checkMappedType(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return checkFunctionDeclaration(node);
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
return checkBlock(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return checkVariableStatement(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return checkExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return checkIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return checkDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return checkWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return checkForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return checkForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return checkForOfStatement(node);
- case 252 /* ContinueStatement */:
- case 253 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
return checkBreakOrContinueStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return checkReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return checkWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return checkSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return checkLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return checkThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return checkTryStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return checkVariableDeclaration(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return checkBindingElement(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return checkClassDeclaration(node);
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return checkStructDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return checkAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return;
+ case 270 /* InterfaceDeclaration */:
return checkInterfaceDeclaration(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return checkTypeAliasDeclaration(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return checkEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return checkModuleDeclaration(node);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return checkImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return checkImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return checkExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return checkExportAssignment(node);
- case 243 /* EmptyStatement */:
- case 260 /* DebuggerStatement */:
+ case 245 /* EmptyStatement */:
+ case 262 /* DebuggerStatement */:
checkGrammarStatementInAmbientContext(node);
return;
- case 285 /* MissingDeclaration */:
+ case 288 /* MissingDeclaration */:
return checkMissingDeclaration(node);
}
}
@@ -78902,33 +79080,33 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
currentNode = node;
instantiationCount = 0;
switch (node.kind) {
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 215 /* TaggedTemplateExpression */:
- case 169 /* Decorator */:
- case 289 /* JsxOpeningElement */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 217 /* TaggedTemplateExpression */:
+ case 170 /* Decorator */:
+ case 292 /* JsxOpeningElement */:
resolveUntypedCall(node);
break;
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
checkFunctionExpressionOrObjectLiteralMethodDeferred(node);
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
checkAccessorDeclaration(node);
break;
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
checkClassExpressionDeferred(node);
break;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
checkTypeParameterDeferred(node);
break;
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
checkJsxSelfClosingElementDeferred(node);
break;
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
checkJsxElementDeferred(node);
break;
}
@@ -79092,27 +79270,27 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
copySymbols(location.locals, meaning);
}
switch (location.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (!isExternalModule(location))
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
copyLocallyVisibleExportSymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */);
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */);
break;
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
const className = location.name;
if (className) {
copySymbol(location.symbol, meaning);
}
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
if (!isStaticSymbol) {
copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */);
}
break;
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
const funcName = location.name;
if (funcName) {
copySymbol(location.symbol, meaning);
@@ -79145,7 +79323,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function copyLocallyVisibleExportSymbols(source, meaning2) {
if (meaning2) {
source.forEach((symbol) => {
- if (!getDeclarationOfKind(symbol, 284 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 283 /* NamespaceExport */)) {
+ if (!getDeclarationOfKind(symbol, 287 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 286 /* NamespaceExport */)) {
copySymbol(symbol, meaning2);
}
});
@@ -79156,16 +79334,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return name.kind === 79 /* Identifier */ && isTypeDeclaration(name.parent) && getNameOfDeclaration(name.parent) === name;
}
function isTypeReferenceIdentifier(node) {
- while (node.parent.kind === 165 /* QualifiedName */) {
+ while (node.parent.kind === 166 /* QualifiedName */) {
node = node.parent;
}
- return node.parent.kind === 183 /* TypeReference */;
+ return node.parent.kind === 185 /* TypeReference */;
}
function isHeritageClauseElementIdentifier(node) {
- while (node.parent.kind === 211 /* PropertyAccessExpression */) {
+ while (node.parent.kind === 213 /* PropertyAccessExpression */) {
node = node.parent;
}
- return node.parent.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.parent.kind === 236 /* ExpressionWithTypeArguments */;
}
function forEachEnclosingClass(node, callback) {
let result;
@@ -79192,13 +79370,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return !!forEachEnclosingClass(node, (n) => n === classDeclaration);
}
function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {
- while (nodeOnRightSide.parent.kind === 165 /* QualifiedName */) {
+ while (nodeOnRightSide.parent.kind === 166 /* QualifiedName */) {
nodeOnRightSide = nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 274 /* ImportEqualsDeclaration */) {
+ if (nodeOnRightSide.parent.kind === 277 /* ImportEqualsDeclaration */) {
return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : void 0;
}
- if (nodeOnRightSide.parent.kind === 280 /* ExportAssignment */) {
+ if (nodeOnRightSide.parent.kind === 283 /* ExportAssignment */) {
return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : void 0;
}
return void 0;
@@ -79224,7 +79402,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
node = parent2;
parent2 = parent2.parent;
}
- if (parent2 && parent2.kind === 205 /* ImportType */ && parent2.qualifier === node) {
+ if (parent2 && parent2.kind === 207 /* ImportType */ && parent2.qualifier === node) {
return parent2;
}
return void 0;
@@ -79233,7 +79411,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isDeclarationName(name)) {
return getSymbolOfNode(name.parent);
}
- if (isInJSFile(name) && name.parent.kind === 211 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) {
+ if (isInJSFile(name) && name.parent.kind === 213 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) {
if (!isPrivateIdentifier(name) && !isJSDocMemberName(name)) {
const specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name);
if (specialPropertyAssignmentSymbol) {
@@ -79241,7 +79419,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (name.parent.kind === 280 /* ExportAssignment */ && isEntityNameExpression(name)) {
+ if (name.parent.kind === 283 /* ExportAssignment */ && isEntityNameExpression(name)) {
const success = resolveEntityName(
name,
111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */,
@@ -79251,7 +79429,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return success;
}
} else if (isEntityName(name) && isInRightSideOfImportOrExportAssignment(name)) {
- const importEqualsDeclaration = getAncestor(name, 274 /* ImportEqualsDeclaration */);
+ const importEqualsDeclaration = getAncestor(name, 277 /* ImportEqualsDeclaration */);
Debug.assert(importEqualsDeclaration !== void 0);
return getSymbolOfPartOfRightHandSideOfImportEquals(name, true);
}
@@ -79268,7 +79446,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (isHeritageClauseElementIdentifier(name)) {
let meaning = 0 /* None */;
- if (name.parent.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (name.parent.kind === 236 /* ExpressionWithTypeArguments */) {
meaning = 788968 /* Type */;
if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) {
meaning |= 111551 /* Value */;
@@ -79282,10 +79460,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return entityNameSymbol;
}
}
- if (name.parent.kind === 349 /* JSDocParameterTag */) {
+ if (name.parent.kind === 352 /* JSDocParameterTag */) {
return getParameterSymbolFromJSDoc(name.parent);
}
- if (name.parent.kind === 167 /* TypeParameter */ && name.parent.parent.kind === 353 /* JSDocTemplateTag */) {
+ if (name.parent.kind === 168 /* TypeParameter */ && name.parent.parent.kind === 356 /* JSDocTemplateTag */) {
Debug.assert(!isInJSFile(name));
const typeParameter = getTypeParameterFromJsDoc(name.parent);
return typeParameter && typeParameter.symbol;
@@ -79317,12 +79495,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return result;
} else if (isPrivateIdentifier(name)) {
return getSymbolForPrivateIdentifierExpression(name);
- } else if (name.kind === 211 /* PropertyAccessExpression */ || name.kind === 165 /* QualifiedName */) {
+ } else if (name.kind === 213 /* PropertyAccessExpression */ || name.kind === 166 /* QualifiedName */) {
const links = getNodeLinks(name);
if (links.resolvedSymbol) {
return links.resolvedSymbol;
}
- if (name.kind === 211 /* PropertyAccessExpression */) {
+ if (name.kind === 213 /* PropertyAccessExpression */) {
checkPropertyAccessExpression(name, 0 /* Normal */);
if (!links.resolvedSymbol) {
const expressionType = checkExpressionCached(name.expression);
@@ -79362,11 +79540,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return resolveJSDocMemberName(name);
}
} else if (isTypeReferenceIdentifier(name)) {
- const meaning = name.parent.kind === 183 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */;
+ const meaning = name.parent.kind === 185 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */;
const symbol = resolveEntityName(name, meaning, true, true);
return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name);
}
- if (name.parent.kind === 182 /* TypePredicate */) {
+ if (name.parent.kind === 184 /* TypePredicate */) {
return resolveEntityName(name, 1 /* FunctionScopedVariable */, true);
}
return void 0;
@@ -79391,7 +79569,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getSymbolAtLocation(node, ignoreErrors) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return isExternalModule(node) ? getMergedSymbol(node.symbol) : void 0;
}
const { parent: parent2 } = node;
@@ -79408,7 +79586,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.kind === 79 /* Identifier */) {
if (isInRightSideOfImportOrExportAssignment(node)) {
return getSymbolOfNameOrPropertyAccessExpression(node);
- } else if (parent2.kind === 208 /* BindingElement */ && grandParent.kind === 206 /* ObjectBindingPattern */ && node === parent2.propertyName) {
+ } else if (parent2.kind === 210 /* BindingElement */ && grandParent.kind === 208 /* ObjectBindingPattern */ && node === parent2.propertyName) {
const typeOfPattern = getTypeOfNode(grandParent);
const propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText);
if (propertyDeclaration) {
@@ -79427,8 +79605,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
switch (node.kind) {
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
- case 211 /* PropertyAccessExpression */:
- case 165 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
if (!isThisInTypeQuery(node)) {
return getSymbolOfNameOrPropertyAccessExpression(node);
}
@@ -79443,19 +79621,19 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isInExpressionContext(node)) {
return checkExpression(node).symbol;
}
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return getTypeFromThisTypeNode(node).symbol;
case 107 /* SuperKeyword */:
return checkExpression(node).symbol;
case 136 /* ConstructorKeyword */:
const constructorDeclaration = node.parent;
- if (constructorDeclaration && constructorDeclaration.kind === 176 /* Constructor */) {
+ if (constructorDeclaration && constructorDeclaration.kind === 178 /* Constructor */) {
return constructorDeclaration.parent.symbol;
}
return void 0;
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 275 /* ImportDeclaration */ || node.parent.kind === 281 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(node.parent, false) || isImportCall(node.parent)) || isLiteralTypeNode(node.parent) && isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent) {
+ if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 278 /* ImportDeclaration */ || node.parent.kind === 284 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(node.parent, false) || isImportCall(node.parent)) || isLiteralTypeNode(node.parent) && isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent) {
return resolveExternalModuleName(node, node, ignoreErrors);
}
if (isCallExpression(parent2) && isBindableObjectDefinePropertyCall(parent2) && parent2.arguments[1] === node) {
@@ -79469,14 +79647,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 38 /* EqualsGreaterThanToken */:
case 84 /* ClassKeyword */:
return getSymbolOfNode(node.parent);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : void 0;
case 94 /* ExportKeyword */:
return isExportAssignment(node.parent) ? Debug.checkDefined(node.parent.symbol) : void 0;
case 101 /* ImportKeyword */:
case 104 /* NewKeyword */:
return isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : void 0;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return checkExpression(node).symbol;
default:
return void 0;
@@ -79492,7 +79670,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
function getShorthandAssignmentValueSymbol(location) {
- if (location && location.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (location && location.kind === 309 /* ShorthandPropertyAssignment */) {
return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */, true);
}
return void 0;
@@ -79577,16 +79755,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return getTypeOfNode(node);
}
function getTypeOfAssignmentPattern(expr) {
- Debug.assert(expr.kind === 210 /* ObjectLiteralExpression */ || expr.kind === 209 /* ArrayLiteralExpression */);
- if (expr.parent.kind === 251 /* ForOfStatement */) {
+ Debug.assert(expr.kind === 212 /* ObjectLiteralExpression */ || expr.kind === 211 /* ArrayLiteralExpression */);
+ if (expr.parent.kind === 253 /* ForOfStatement */) {
const iteratedType = checkRightHandSideOfForOf(expr.parent);
return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 227 /* BinaryExpression */) {
+ if (expr.parent.kind === 229 /* BinaryExpression */) {
const iteratedType = getTypeOfExpression(expr.parent.right);
return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 305 /* PropertyAssignment */) {
+ if (expr.parent.kind === 308 /* PropertyAssignment */) {
const node2 = cast(expr.parent.parent, isObjectLiteralExpression);
const typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node2) || errorType;
const propertyIndex = indexOfNode(node2.properties, expr.parent);
@@ -79619,7 +79797,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 8 /* NumericLiteral */:
case 10 /* StringLiteral */:
return getStringLiteralType(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
const nameType = checkComputedPropertyName(name);
return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType;
default:
@@ -79710,7 +79888,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
const parentSymbol = getParentOfSymbol(symbol);
if (parentSymbol) {
- if (parentSymbol.flags & 512 /* ValueModule */ && ((_a2 = parentSymbol.valueDeclaration) == null ? void 0 : _a2.kind) === 314 /* SourceFile */) {
+ if (parentSymbol.flags & 512 /* ValueModule */ && ((_a2 = parentSymbol.valueDeclaration) == null ? void 0 : _a2.kind) === 317 /* SourceFile */) {
const symbolFile = parentSymbol.valueDeclaration;
const referenceFile = getSourceFileOfNode(node);
const symbolIsUmdExport = symbolFile !== referenceFile;
@@ -79735,7 +79913,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return void 0;
}
function isSymbolOfDestructuredElementOfCatchBinding(symbol) {
- return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 301 /* CatchClause */;
+ return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 304 /* CatchClause */;
}
function isSymbolOfDeclarationWithCollidingName(symbol) {
if (symbol.flags & 418 /* BlockScoped */ && symbol.valueDeclaration && !isSourceFile(symbol.valueDeclaration)) {
@@ -79749,7 +79927,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else if (nodeLinks2.flags & 262144 /* CapturedBlockScopedBinding */) {
const isDeclaredInLoop = nodeLinks2.flags & 524288 /* BlockScopedBindingInLoop */;
const inLoopInitializer = isIterationStatement(container, false);
- const inLoopBodyBlock = container.kind === 242 /* Block */ && isIterationStatement(container.parent, false);
+ const inLoopBodyBlock = container.kind === 244 /* Block */ && isIterationStatement(container.parent, false);
links.isDeclarationWithCollidingName = !isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || !inLoopInitializer && !inLoopBodyBlock);
} else {
links.isDeclarationWithCollidingName = false;
@@ -79784,25 +79962,25 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function isValueAliasDeclaration(node) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return isAliasResolvedToValue(getSymbolOfNode(node));
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
const symbol = getSymbolOfNode(node);
return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportClause = node.exportClause;
return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return node.expression && node.expression.kind === 79 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true;
}
return false;
}
function isTopLevelValueImportEqualsWithEntityName(nodeIn) {
const node = getParseTreeNode(nodeIn, isImportEqualsDeclaration);
- if (node === void 0 || node.parent.kind !== 314 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) {
+ if (node === void 0 || node.parent.kind !== 317 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) {
return false;
}
const isValue = isAliasResolvedToValue(getSymbolOfNode(node));
@@ -79891,15 +80069,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function canHaveConstantValue(node) {
switch (node.kind) {
- case 308 /* EnumMember */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 311 /* EnumMember */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return true;
}
return false;
}
function getConstantValue2(node) {
- if (node.kind === 308 /* EnumMember */) {
+ if (node.kind === 311 /* EnumMember */) {
return getEnumMemberValue(node);
}
const symbol = getNodeLinks(node).resolvedSymbol;
@@ -80097,7 +80275,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 79 /* Identifier */:
ident = node.expression;
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
ident = node.expression;
break;
default:
@@ -80204,12 +80382,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
getJsxFragmentFactoryEntity,
getAllAccessorDeclarations(accessor) {
accessor = getParseTreeNode(accessor, isGetOrSetAccessorDeclaration);
- const otherKind = accessor.kind === 178 /* SetAccessor */ ? 177 /* GetAccessor */ : 178 /* SetAccessor */;
+ const otherKind = accessor.kind === 180 /* SetAccessor */ ? 179 /* GetAccessor */ : 180 /* SetAccessor */;
const otherAccessor = getDeclarationOfKind(getSymbolOfNode(accessor), otherKind);
const firstAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? otherAccessor : accessor;
const secondAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? accessor : otherAccessor;
- const setAccessor = accessor.kind === 178 /* SetAccessor */ ? accessor : otherAccessor;
- const getAccessor = accessor.kind === 177 /* GetAccessor */ ? accessor : otherAccessor;
+ const setAccessor = accessor.kind === 180 /* SetAccessor */ ? accessor : otherAccessor;
+ const getAccessor = accessor.kind === 179 /* GetAccessor */ ? accessor : otherAccessor;
return {
firstAccessor,
secondAccessor,
@@ -80225,7 +80403,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
},
getDeclarationStatementsForSourceFile: (node, flags, tracker, bundled) => {
const n = getParseTreeNode(node);
- Debug.assert(n && n.kind === 314 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
+ Debug.assert(n && n.kind === 317 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
const sym = getSymbolOfNode(node);
if (!sym) {
return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled);
@@ -80337,18 +80515,18 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function isInHeritageClause(node) {
- return node.parent && node.parent.kind === 234 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 300 /* HeritageClause */;
+ return node.parent && node.parent.kind === 236 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 303 /* HeritageClause */;
}
function getTypeReferenceDirectivesForEntityName(node) {
if (!fileToDirective) {
return void 0;
}
let meaning;
- if (node.parent.kind === 166 /* ComputedPropertyName */) {
+ if (node.parent.kind === 167 /* ComputedPropertyName */) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
} else {
meaning = 788968 /* Type */ | 1920 /* Namespace */;
- if (node.kind === 79 /* Identifier */ && isInTypeQuery(node) || node.kind === 211 /* PropertyAccessExpression */ && !isInHeritageClause(node)) {
+ if (node.kind === 79 /* Identifier */ && isInTypeQuery(node) || node.kind === 213 /* PropertyAccessExpression */ && !isInHeritageClause(node)) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
}
}
@@ -80386,7 +80564,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
}
- if (current.valueDeclaration && current.valueDeclaration.kind === 314 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
+ if (current.valueDeclaration && current.valueDeclaration.kind === 317 /* SourceFile */ && current.flags & 512 /* ValueModule */) {
return false;
}
for (const decl of symbol.declarations) {
@@ -80411,12 +80589,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function getExternalModuleFileFromDeclaration(declaration) {
- const specifier = declaration.kind === 270 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration);
+ const specifier = declaration.kind === 273 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration);
const moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, void 0);
if (!moduleSymbol) {
return void 0;
}
- return getDeclarationOfKind(moduleSymbol, 314 /* SourceFile */);
+ return getDeclarationOfKind(moduleSymbol, 317 /* SourceFile */);
}
function initializeTypeChecker() {
for (const file of host.getSourceFiles()) {
@@ -80645,7 +80823,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
if (!nodeCanBeDecorated(node, node.parent, node.parent.parent, compilerOptions)) {
- const isMethodDeclarationAndNodeIsNotPresent = node.kind === 174 /* MethodDeclaration */ && !nodeIsPresent(node.body);
+ const isMethodDeclarationAndNodeIsNotPresent = node.kind === 176 /* MethodDeclaration */ && !nodeIsPresent(node.body);
const message = isMethodDeclarationAndNodeIsNotPresent ? Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload : Diagnostics.Decorators_are_not_valid_here;
for (const decorator of decorators) {
if (!grammarErrorOnNode(decorator, message)) {
@@ -80653,7 +80831,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
return true;
- } else if (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */) {
+ } else if (node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */) {
const accessors = getAllAccessorDeclarations(node.parent.members, node);
if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) {
return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
@@ -80673,21 +80851,21 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
}
if (modifier.kind !== 147 /* ReadonlyKeyword */) {
- if (node.kind === 170 /* PropertySignature */ || node.kind === 173 /* MethodSignature */) {
+ if (node.kind === 171 /* PropertySignature */ || node.kind === 175 /* MethodSignature */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind));
}
- if (node.kind === 181 /* IndexSignature */ && (modifier.kind !== 125 /* StaticKeyword */ || !isClassLike(node.parent))) {
+ if (node.kind === 183 /* IndexSignature */ && (modifier.kind !== 125 /* StaticKeyword */ || !isClassLike(node.parent))) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind));
}
}
if (modifier.kind !== 102 /* InKeyword */ && modifier.kind !== 146 /* OutKeyword */) {
- if (node.kind === 167 /* TypeParameter */) {
+ if (node.kind === 168 /* TypeParameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind));
}
}
switch (modifier.kind) {
case 86 /* ConstKeyword */:
- if (node.kind !== 269 /* EnumDeclaration */) {
+ if (node.kind !== 272 /* EnumDeclaration */) {
return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(86 /* ConstKeyword */));
}
break;
@@ -80722,7 +80900,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly");
} else if (flags & 512 /* Async */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
- } else if (node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ } else if (node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
} else if (flags & 256 /* Abstract */) {
if (modifier.kind === 122 /* PrivateKeyword */) {
@@ -80744,9 +80922,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
} else if (flags & 128 /* Accessor */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor");
- } else if (node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ } else if (node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
} else if (flags & 256 /* Abstract */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
@@ -80763,7 +80941,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly");
} else if (flags & 2 /* Ambient */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare");
- } else if (node.kind !== 171 /* PropertyDeclaration */) {
+ } else if (node.kind !== 172 /* PropertyDeclaration */) {
return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration);
}
flags |= 128 /* Accessor */;
@@ -80771,7 +80949,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 147 /* ReadonlyKeyword */:
if (flags & 64 /* Readonly */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly");
- } else if (node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 170 /* PropertySignature */ && node.kind !== 181 /* IndexSignature */ && node.kind !== 168 /* Parameter */) {
+ } else if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 183 /* IndexSignature */ && node.kind !== 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
}
flags |= 64 /* Readonly */;
@@ -80787,14 +80965,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
} else if (isClassLike(node.parent)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export");
}
flags |= 1 /* Export */;
break;
case 89 /* DefaultKeyword */:
- const container = node.parent.kind === 314 /* SourceFile */ ? node.parent : node.parent.parent;
- if (container.kind === 270 /* ModuleDeclaration */ && !isAmbientModule(container)) {
+ const container = node.parent.kind === 317 /* SourceFile */ ? node.parent : node.parent.parent;
+ if (container.kind === 273 /* ModuleDeclaration */ && !isAmbientModule(container)) {
return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
} else if (!(flags & 1 /* Export */)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default");
@@ -80810,9 +80988,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override");
} else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
- } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 271 /* ModuleBlock */) {
+ } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 274 /* ModuleBlock */) {
return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
} else if (isPrivateIdentifierClassElementDeclaration(node)) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
@@ -80824,11 +81002,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (flags & 256 /* Abstract */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract");
}
- if (node.kind !== 264 /* ClassDeclaration */ && node.kind !== 185 /* ConstructorType */) {
- if (node.kind !== 174 /* MethodDeclaration */ && node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 177 /* GetAccessor */ && node.kind !== 178 /* SetAccessor */) {
+ if (node.kind !== 266 /* ClassDeclaration */ && node.kind !== 187 /* ConstructorType */) {
+ if (node.kind !== 176 /* MethodDeclaration */ && node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 179 /* GetAccessor */ && node.kind !== 180 /* SetAccessor */) {
return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
}
- if (!(node.parent.kind === 264 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) {
+ if (!(node.parent.kind === 266 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) {
return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);
}
if (flags & 32 /* Static */) {
@@ -80857,7 +81035,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async");
} else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
- } else if (node.kind === 168 /* Parameter */) {
+ } else if (node.kind === 169 /* Parameter */) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
}
if (flags & 256 /* Abstract */) {
@@ -80870,7 +81048,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 146 /* OutKeyword */:
const inOutFlag = modifier.kind === 102 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */;
const inOutText = modifier.kind === 102 /* InKeyword */ ? "in" : "out";
- if (node.kind !== 167 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
+ if (node.kind !== 168 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
}
if (flags & inOutFlag) {
@@ -80883,7 +81061,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
}
- if (node.kind === 176 /* Constructor */) {
+ if (node.kind === 178 /* Constructor */) {
if (flags & 32 /* Static */) {
return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
}
@@ -80894,11 +81072,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async");
}
return false;
- } else if ((node.kind === 275 /* ImportDeclaration */ || node.kind === 274 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) {
+ } else if ((node.kind === 278 /* ImportDeclaration */ || node.kind === 277 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) {
return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
- } else if (node.kind === 168 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) {
+ } else if (node.kind === 169 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) {
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
- } else if (node.kind === 168 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && node.dotDotDotToken) {
+ } else if (node.kind === 169 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && node.dotDotDotToken) {
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
}
if (flags & 512 /* Async */) {
@@ -80911,49 +81089,51 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function shouldReportBadModifier(node) {
switch (node.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 270 /* ModuleDeclaration */:
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 168 /* Parameter */:
- case 167 /* TypeParameter */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 273 /* ModuleDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 169 /* Parameter */:
+ case 168 /* TypeParameter */:
return false;
- case 175 /* ClassStaticBlockDeclaration */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 273 /* NamespaceExportDeclaration */:
- case 184 /* FunctionType */:
- case 285 /* MissingDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 276 /* NamespaceExportDeclaration */:
+ case 186 /* FunctionType */:
+ case 288 /* MissingDeclaration */:
return true;
default:
- if (node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ if (node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
return false;
}
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return nodeHasAnyModifiersExcept(node, 133 /* AsyncKeyword */);
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 185 /* ConstructorType */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 187 /* ConstructorType */:
return nodeHasAnyModifiersExcept(node, 127 /* AbstractKeyword */);
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 244 /* VariableStatement */:
- case 268 /* TypeAliasDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 246 /* VariableStatement */:
+ case 271 /* TypeAliasDeclaration */:
return true;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return nodeHasAnyModifiersExcept(node, 86 /* ConstKeyword */);
default:
Debug.assertNever(node);
@@ -80971,10 +81151,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function checkGrammarAsyncModifier(node, asyncModifier) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return false;
}
return grammarErrorOnNode(asyncModifier, Diagnostics._0_modifier_cannot_be_used_here, "async");
@@ -81187,11 +81367,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function checkGrammarComputedPropertyName(node) {
- if (node.kind !== 166 /* ComputedPropertyName */) {
+ if (node.kind !== 167 /* ComputedPropertyName */) {
return false;
}
const computedPropertyName = node;
- if (computedPropertyName.expression.kind === 227 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) {
+ if (computedPropertyName.expression.kind === 229 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) {
return grammarErrorOnNode(computedPropertyName.expression, Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name);
}
return false;
@@ -81199,7 +81379,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkGrammarForGenerator(node) {
if (node.asteriskToken) {
Debug.assert(
- node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */ || node.kind === 174 /* MethodDeclaration */
+ node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */ || node.kind === 176 /* MethodDeclaration */
);
if (node.flags & 16777216 /* Ambient */) {
return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
@@ -81218,7 +81398,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
function checkGrammarObjectLiteralExpression(node, inDestructuring) {
const seen = new Map2();
for (const prop of node.properties) {
- if (prop.kind === 307 /* SpreadAssignment */) {
+ if (prop.kind === 310 /* SpreadAssignment */) {
if (inDestructuring) {
const expression = skipParentheses(prop.expression);
if (isArrayLiteralExpression(expression) || isObjectLiteralExpression(expression)) {
@@ -81228,10 +81408,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
continue;
}
const name = prop.name;
- if (name.kind === 166 /* ComputedPropertyName */) {
+ if (name.kind === 167 /* ComputedPropertyName */) {
checkGrammarComputedPropertyName(name);
}
- if (prop.kind === 306 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
+ if (prop.kind === 309 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
grammarErrorOnNode(prop.equalsToken, Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);
}
if (name.kind === 80 /* PrivateIdentifier */) {
@@ -81239,7 +81419,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (canHaveModifiers(prop) && prop.modifiers) {
for (const mod of prop.modifiers) {
- if (isModifier(mod) && (mod.kind !== 133 /* AsyncKeyword */ || prop.kind !== 174 /* MethodDeclaration */)) {
+ if (isModifier(mod) && (mod.kind !== 133 /* AsyncKeyword */ || prop.kind !== 176 /* MethodDeclaration */)) {
grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod));
}
}
@@ -81250,8 +81430,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
let currentKind;
switch (prop.kind) {
- case 306 /* ShorthandPropertyAssignment */:
- case 305 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
checkGrammarForInvalidExclamationToken(prop.exclamationToken, Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);
checkGrammarForInvalidQuestionMark(prop.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional);
if (name.kind === 8 /* NumericLiteral */) {
@@ -81259,13 +81439,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
currentKind = 4 /* PropertyAssignment */;
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
currentKind = 8 /* Method */;
break;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
currentKind = 1 /* GetAccessor */;
break;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
currentKind = 2 /* SetAccessor */;
break;
default:
@@ -81302,7 +81482,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
checkGrammarTypeArguments(node, node.typeArguments);
const seen = new Map2();
for (const attr of node.attributes.properties) {
- if (attr.kind === 296 /* JsxSpreadAttribute */) {
+ if (attr.kind === 299 /* JsxSpreadAttribute */) {
continue;
}
const { name, initializer } = attr;
@@ -81311,7 +81491,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
} else {
return grammarErrorOnNode(name, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
}
- if (initializer && initializer.kind === 297 /* JsxExpression */ && !initializer.expression) {
+ if (initializer && initializer.kind === 300 /* JsxExpression */ && !initializer.expression) {
return grammarErrorOnNode(initializer, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression);
}
}
@@ -81346,7 +81526,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) {
return true;
}
- if (forInOrOfStatement.kind === 251 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) {
+ if (forInOrOfStatement.kind === 253 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) {
if (!(forInOrOfStatement.flags & 32768 /* AwaitContext */)) {
const sourceFile = getSourceFileOfNode(forInOrOfStatement);
if (isInTopLevelContext(forInOrOfStatement)) {
@@ -81386,7 +81566,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!hasParseDiagnostics(sourceFile)) {
const diagnostic = createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);
const func = getContainingFunction(forInOrOfStatement);
- if (func && func.kind !== 176 /* Constructor */) {
+ if (func && func.kind !== 178 /* Constructor */) {
Debug.assert((getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function.");
const relatedInfo = createDiagnosticForNode(func, Diagnostics.Did_you_mean_to_mark_this_function_as_async);
addRelatedInfo(diagnostic, relatedInfo);
@@ -81402,7 +81582,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
grammarErrorOnNode(forInOrOfStatement.initializer, Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async);
return false;
}
- if (forInOrOfStatement.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (forInOrOfStatement.initializer.kind === 264 /* VariableDeclarationList */) {
const variableList = forInOrOfStatement.initializer;
if (!checkGrammarVariableDeclarationList(variableList)) {
const declarations = variableList.declarations;
@@ -81410,16 +81590,16 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
if (declarations.length > 1) {
- const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
+ const diagnostic = forInOrOfStatement.kind === 252 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic);
}
const firstDeclaration = declarations[0];
if (firstDeclaration.initializer) {
- const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
+ const diagnostic = forInOrOfStatement.kind === 252 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
return grammarErrorOnNode(firstDeclaration.name, diagnostic);
}
if (firstDeclaration.type) {
- const diagnostic = forInOrOfStatement.kind === 250 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
+ const diagnostic = forInOrOfStatement.kind === 252 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
return grammarErrorOnNode(firstDeclaration, diagnostic);
}
}
@@ -81427,7 +81607,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function checkGrammarAccessor(accessor) {
- if (!(accessor.flags & 16777216 /* Ambient */) && accessor.parent.kind !== 187 /* TypeLiteral */ && accessor.parent.kind !== 267 /* InterfaceDeclaration */) {
+ if (!(accessor.flags & 16777216 /* Ambient */) && accessor.parent.kind !== 189 /* TypeLiteral */ && accessor.parent.kind !== 270 /* InterfaceDeclaration */) {
if (languageVersion < 1 /* ES5 */) {
return grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);
}
@@ -81442,7 +81622,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (hasSyntacticModifier(accessor, 256 /* Abstract */)) {
return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation);
}
- if (accessor.parent.kind === 187 /* TypeLiteral */ || accessor.parent.kind === 267 /* InterfaceDeclaration */) {
+ if (accessor.parent.kind === 189 /* TypeLiteral */ || accessor.parent.kind === 270 /* InterfaceDeclaration */) {
return grammarErrorOnNode(accessor.body, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
}
@@ -81452,10 +81632,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!doesAccessorHaveCorrectParameterCount(accessor)) {
return grammarErrorOnNode(
accessor.name,
- accessor.kind === 177 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter
+ accessor.kind === 179 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter
);
}
- if (accessor.kind === 178 /* SetAccessor */) {
+ if (accessor.kind === 180 /* SetAccessor */) {
if (accessor.type) {
return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);
}
@@ -81473,10 +81653,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return false;
}
function doesAccessorHaveCorrectParameterCount(accessor) {
- return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 0 : 1);
+ return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 179 /* GetAccessor */ ? 0 : 1);
}
function getAccessorThisParameter(accessor) {
- if (accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 1 : 2)) {
+ if (accessor.parameters.length === (accessor.kind === 179 /* GetAccessor */ ? 1 : 2)) {
return getThisParameter(accessor);
}
}
@@ -81493,7 +81673,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
switch (parent2.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
const decl = parent2;
if (decl.name.kind !== 79 /* Identifier */) {
return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);
@@ -81505,12 +81685,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(parent2.name, Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (!isStatic(parent2) || !hasEffectiveReadonlyModifier(parent2)) {
return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);
}
break;
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
if (!hasSyntacticModifier(parent2, 64 /* Readonly */)) {
return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);
}
@@ -81519,7 +81699,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_here);
}
} else if (node.operator === 147 /* ReadonlyKeyword */) {
- if (node.type.kind !== 188 /* ArrayType */ && node.type.kind !== 189 /* TupleType */) {
+ if (node.type.kind !== 190 /* ArrayType */ && node.type.kind !== 191 /* TupleType */) {
return grammarErrorOnFirstToken(node, Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, tokenToString(154 /* SymbolKeyword */));
}
}
@@ -81533,8 +81713,8 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (checkGrammarFunctionLikeDeclaration(node)) {
return true;
}
- if (node.kind === 174 /* MethodDeclaration */) {
- if (node.parent.kind === 210 /* ObjectLiteralExpression */) {
+ if (node.kind === 176 /* MethodDeclaration */) {
+ if (node.parent.kind === 212 /* ObjectLiteralExpression */) {
if (node.modifiers && !(node.modifiers.length === 1 && first(node.modifiers).kind === 133 /* AsyncKeyword */)) {
return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here);
} else if (checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional)) {
@@ -81555,12 +81735,12 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (node.flags & 16777216 /* Ambient */) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
- } else if (node.kind === 174 /* MethodDeclaration */ && !node.body) {
+ } else if (node.kind === 176 /* MethodDeclaration */ && !node.body) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
}
- } else if (node.parent.kind === 267 /* InterfaceDeclaration */) {
+ } else if (node.parent.kind === 270 /* InterfaceDeclaration */) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
- } else if (node.parent.kind === 187 /* TypeLiteral */) {
+ } else if (node.parent.kind === 189 /* TypeLiteral */) {
return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
}
}
@@ -81571,17 +81751,17 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary);
}
switch (current.kind) {
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
if (node.label && current.label.escapedText === node.label.escapedText) {
- const isMisplacedContinueLabel = node.kind === 252 /* ContinueStatement */ && !isIterationStatement(current.statement, true);
+ const isMisplacedContinueLabel = node.kind === 254 /* ContinueStatement */ && !isIterationStatement(current.statement, true);
if (isMisplacedContinueLabel) {
return grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);
}
return false;
}
break;
- case 256 /* SwitchStatement */:
- if (node.kind === 253 /* BreakStatement */ && !node.label) {
+ case 258 /* SwitchStatement */:
+ if (node.kind === 255 /* BreakStatement */ && !node.label) {
return false;
}
break;
@@ -81594,10 +81774,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
current = current.parent;
}
if (node.label) {
- const message = node.kind === 253 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
+ const message = node.kind === 255 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
} else {
- const message = node.kind === 253 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
+ const message = node.kind === 255 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
}
}
@@ -81617,10 +81797,10 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function isStringOrNumberLiteralExpression(expr) {
- return isStringOrNumericLiteralLike(expr) || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */;
+ return isStringOrNumericLiteralLike(expr) || expr.kind === 227 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */;
}
function isBigIntLiteralExpression(expr) {
- return expr.kind === 9 /* BigIntLiteral */ || expr.kind === 225 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */;
+ return expr.kind === 9 /* BigIntLiteral */ || expr.kind === 227 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */;
}
function isSimpleLiteralEnumReference(expr) {
if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) {
@@ -81642,7 +81822,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkGrammarVariableDeclaration(node) {
- if (node.parent.parent.kind !== 250 /* ForInStatement */ && node.parent.parent.kind !== 251 /* ForOfStatement */) {
+ if (node.parent.parent.kind !== 252 /* ForInStatement */ && node.parent.parent.kind !== 253 /* ForOfStatement */) {
if (node.flags & 16777216 /* Ambient */) {
checkAmbientInitializer(node);
} else if (!node.initializer) {
@@ -81654,7 +81834,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
}
- if (node.exclamationToken && (node.parent.parent.kind !== 244 /* VariableStatement */ || !node.type || node.initializer || node.flags & 16777216 /* Ambient */)) {
+ if (node.exclamationToken && (node.parent.parent.kind !== 246 /* VariableStatement */ || !node.type || node.initializer || node.flags & 16777216 /* Ambient */)) {
const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context;
return grammarErrorOnNode(node.exclamationToken, message);
}
@@ -81706,15 +81886,15 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
function allowLetAndConstDeclarations(parent2) {
switch (parent2.kind) {
- case 246 /* IfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 255 /* WithStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 248 /* IfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 257 /* WithStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
return false;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return allowLetAndConstDeclarations(parent2.parent);
}
return true;
@@ -81816,7 +81996,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (isAutoAccessorPropertyDeclaration(node) && checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_accessor_property_cannot_be_declared_optional)) {
return true;
}
- } else if (node.parent.kind === 267 /* InterfaceDeclaration */) {
+ } else if (node.parent.kind === 270 /* InterfaceDeclaration */) {
if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) {
return true;
}
@@ -81842,14 +82022,14 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
- if (node.kind === 267 /* InterfaceDeclaration */ || node.kind === 268 /* TypeAliasDeclaration */ || node.kind === 275 /* ImportDeclaration */ || node.kind === 274 /* ImportEqualsDeclaration */ || node.kind === 281 /* ExportDeclaration */ || node.kind === 280 /* ExportAssignment */ || node.kind === 273 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 1024 /* Default */)) {
+ if (node.kind === 270 /* InterfaceDeclaration */ || node.kind === 271 /* TypeAliasDeclaration */ || node.kind === 278 /* ImportDeclaration */ || node.kind === 277 /* ImportEqualsDeclaration */ || node.kind === 284 /* ExportDeclaration */ || node.kind === 283 /* ExportAssignment */ || node.kind === 276 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 1024 /* Default */)) {
return false;
}
return grammarErrorOnFirstToken(node, Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier);
}
function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) {
for (const decl of file.statements) {
- if (isDeclaration(decl) || decl.kind === 244 /* VariableStatement */) {
+ if (isDeclaration(decl) || decl.kind === 246 /* VariableStatement */) {
if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) {
return true;
}
@@ -81866,7 +82046,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (!links.hasReportedStatementInAmbientContext && (isFunctionLike(node.parent) || isAccessor(node.parent))) {
return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
- if (node.parent.kind === 242 /* Block */ || node.parent.kind === 271 /* ModuleBlock */ || node.parent.kind === 314 /* SourceFile */) {
+ if (node.parent.kind === 244 /* Block */ || node.parent.kind === 274 /* ModuleBlock */ || node.parent.kind === 317 /* SourceFile */) {
const links2 = getNodeLinks(node.parent);
if (!links2.hasReportedStatementInAmbientContext) {
return links2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts);
@@ -81881,9 +82061,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
let diagnosticMessage;
if (languageVersion >= 1 /* ES5 */) {
diagnosticMessage = Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0;
- } else if (isChildOfNodeWithKind(node, 201 /* LiteralType */)) {
+ } else if (isChildOfNodeWithKind(node, 203 /* LiteralType */)) {
diagnosticMessage = Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;
- } else if (isChildOfNodeWithKind(node, 308 /* EnumMember */)) {
+ } else if (isChildOfNodeWithKind(node, 311 /* EnumMember */)) {
diagnosticMessage = Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0;
}
if (diagnosticMessage) {
@@ -81943,7 +82123,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (node.isTypeOnly && node.name && node.namedBindings) {
return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);
}
- if (node.isTypeOnly && ((_a2 = node.namedBindings) == null ? void 0 : _a2.kind) === 278 /* NamedImports */) {
+ if (node.isTypeOnly && ((_a2 = node.namedBindings) == null ? void 0 : _a2.kind) === 281 /* NamedImports */) {
return checkGrammarNamedImportsOrExports(node.namedBindings);
}
return false;
@@ -81953,7 +82133,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
if (specifier.isTypeOnly) {
return grammarErrorOnFirstToken(
specifier,
- specifier.kind === 279 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement
+ specifier.kind === 282 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement
);
}
});
@@ -82062,12 +82242,12 @@ function isNotAccessor(declaration) {
return !isAccessor(declaration);
}
function isNotOverload(declaration) {
- return declaration.kind !== 263 /* FunctionDeclaration */ && declaration.kind !== 174 /* MethodDeclaration */ || !!declaration.body;
+ return declaration.kind !== 265 /* FunctionDeclaration */ && declaration.kind !== 176 /* MethodDeclaration */ || !!declaration.body;
}
function isDeclarationNameOrImportPropertyName(name) {
switch (name.parent.kind) {
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return isIdentifier(name);
default:
return isDeclarationName(name);
@@ -82345,20 +82525,20 @@ var visitEachChildTable = {
nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)
);
},
- [165 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [166 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateQualifiedName(
node,
nodeVisitor(node.left, visitor, isEntityName),
nodeVisitor(node.right, visitor, isIdentifier)
);
},
- [166 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [167 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateComputedPropertyName(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [167 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [168 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeParameterDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82367,7 +82547,7 @@ var visitEachChildTable = {
nodeVisitor(node.default, visitor, isTypeNode)
);
},
- [168 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [169 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateParameterDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -82378,14 +82558,14 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [169 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [170 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDecorator(
node,
nodeVisitor(node.expression, visitor, isExpression),
node.annotationDeclaration
);
},
- [170 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [171 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updatePropertySignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82394,7 +82574,16 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [171 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [174 /* OverloadPropertyDeclaration */]: function visitEachChildOfOverloadPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ return context.factory.updateOverloadPropertyDeclaration(
+ node,
+ nodesVisitor(node.modifiers, visitor, isModifier),
+ nodeVisitor(node.name, visitor, isPropertyName),
+ nodeVisitor(node.questionToken, tokenVisitor, isToken),
+ nodeVisitor(node.type, visitor, isTypeNode)
+ );
+ },
+ [172 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
var _a2;
return context.factory.updatePropertyDeclaration(
node,
@@ -82405,7 +82594,7 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [172 /* AnnotationPropertyDeclaration */]: function visitEachChildOfAnnotationPropertyDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [173 /* AnnotationPropertyDeclaration */]: function visitEachChildOfAnnotationPropertyDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAnnotationPropertyDeclaration(
node,
nodeVisitor(node.name, visitor, isPropertyName),
@@ -82413,7 +82602,7 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [173 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [175 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMethodSignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82424,7 +82613,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [174 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [176 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMethodDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -82437,7 +82626,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [176 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [178 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructorDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82445,7 +82634,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [177 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [179 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
if (context.isLexicalEnvironmentSuspended && context.isLexicalEnvironmentSuspended()) {
return context.factory.updateGetAccessorDeclaration(
node,
@@ -82466,7 +82655,7 @@ var visitEachChildTable = {
);
}
},
- [178 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [180 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
if (context.isLexicalEnvironmentSuspended && context.isLexicalEnvironmentSuspended()) {
return context.factory.updateSetAccessorDeclaration(
node,
@@ -82485,7 +82674,7 @@ var visitEachChildTable = {
);
}
},
- [175 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [177 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
context.startLexicalEnvironment();
context.suspendLexicalEnvironment();
return context.factory.updateClassStaticBlockDeclaration(
@@ -82493,7 +82682,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [179 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [181 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCallSignature(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -82501,7 +82690,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [180 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [182 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructSignature(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -82509,7 +82698,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [181 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [183 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIndexSignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82517,7 +82706,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [182 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [184 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypePredicateNode(
node,
nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword),
@@ -82525,14 +82714,14 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [183 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [185 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeReferenceNode(
node,
nodeVisitor(node.typeName, visitor, isEntityName),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [184 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [186 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateFunctionTypeNode(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -82540,7 +82729,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [185 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [187 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructorTypeNode(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82549,56 +82738,56 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [186 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [188 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeQueryNode(
node,
nodeVisitor(node.exprName, visitor, isEntityName),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [187 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [189 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeLiteralNode(
node,
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [188 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [190 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayTypeNode(
node,
nodeVisitor(node.elementType, visitor, isTypeNode)
);
},
- [189 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [191 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateTupleTypeNode(
node,
nodesVisitor(node.elements, visitor, isTypeNode)
);
},
- [190 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [192 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateOptionalTypeNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [191 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [193 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateRestTypeNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [192 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [194 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateUnionTypeNode(
node,
nodesVisitor(node.types, visitor, isTypeNode)
);
},
- [193 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [195 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateIntersectionTypeNode(
node,
nodesVisitor(node.types, visitor, isTypeNode)
);
},
- [194 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [196 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConditionalTypeNode(
node,
nodeVisitor(node.checkType, visitor, isTypeNode),
@@ -82607,13 +82796,13 @@ var visitEachChildTable = {
nodeVisitor(node.falseType, visitor, isTypeNode)
);
},
- [195 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [197 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateInferTypeNode(
node,
nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)
);
},
- [205 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [207 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportTypeNode(
node,
nodeVisitor(node.argument, visitor, isTypeNode),
@@ -82623,14 +82812,14 @@ var visitEachChildTable = {
node.isTypeOf
);
},
- [304 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [307 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportTypeAssertionContainer(
node,
nodeVisitor(node.assertClause, visitor, isAssertClause),
node.multiLine
);
},
- [202 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [204 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateNamedTupleMember(
node,
nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken),
@@ -82639,26 +82828,26 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [196 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [198 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateParenthesizedType(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [198 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [200 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeOperatorNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [199 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [201 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIndexedAccessTypeNode(
node,
nodeVisitor(node.objectType, visitor, isTypeNode),
nodeVisitor(node.indexType, visitor, isTypeNode)
);
},
- [200 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [202 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMappedTypeNode(
node,
nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken),
@@ -82669,39 +82858,39 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [201 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [203 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateLiteralTypeNode(
node,
nodeVisitor(node.literal, visitor, isExpression)
);
},
- [203 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [205 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateLiteralType(
node,
nodeVisitor(node.head, visitor, isTemplateHead),
nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan)
);
},
- [204 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [206 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateLiteralTypeSpan(
node,
nodeVisitor(node.type, visitor, isTypeNode),
nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)
);
},
- [206 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [208 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateObjectBindingPattern(
node,
nodesVisitor(node.elements, visitor, isBindingElement)
);
},
- [207 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [209 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayBindingPattern(
node,
nodesVisitor(node.elements, visitor, isArrayBindingElement)
);
},
- [208 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [210 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateBindingElement(
node,
nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken),
@@ -82710,19 +82899,19 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [209 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [211 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayLiteralExpression(
node,
nodesVisitor(node.elements, visitor, isExpression)
);
},
- [210 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [212 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateObjectLiteralExpression(
node,
nodesVisitor(node.properties, visitor, isObjectLiteralElementLike)
);
},
- [211 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [213 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82734,7 +82923,7 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isMemberName)
);
},
- [212 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [214 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return isElementAccessChain(node) ? context.factory.updateElementAccessChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82746,7 +82935,7 @@ var visitEachChildTable = {
nodeVisitor(node.argumentExpression, visitor, isExpression)
);
},
- [213 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [215 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return isCallChain(node) ? context.factory.updateCallChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82760,7 +82949,7 @@ var visitEachChildTable = {
nodesVisitor(node.arguments, visitor, isExpression)
);
},
- [220 /* EtsComponentExpression */]: function visitEachChildOfEtsComponentExpression(node, visitor, context, nodesVisitor, nodeVisitor) {
+ [222 /* EtsComponentExpression */]: function visitEachChildOfEtsComponentExpression(node, visitor, context, nodesVisitor, nodeVisitor) {
return context.factory.updateEtsComponentExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82768,7 +82957,7 @@ var visitEachChildTable = {
nodeVisitor(node.body, visitor, isBlock)
);
},
- [214 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [216 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNewExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82776,7 +82965,7 @@ var visitEachChildTable = {
nodesVisitor(node.arguments, visitor, isExpression)
);
},
- [215 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [217 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTaggedTemplateExpression(
node,
nodeVisitor(node.tag, visitor, isExpression),
@@ -82784,20 +82973,20 @@ var visitEachChildTable = {
nodeVisitor(node.template, visitor, isTemplateLiteral)
);
},
- [216 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [218 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeAssertion(
node,
nodeVisitor(node.type, visitor, isTypeNode),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [217 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [219 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateParenthesizedExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [218 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [220 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateFunctionExpression(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82809,7 +82998,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [219 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [221 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateArrowFunction(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -82820,43 +83009,43 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [221 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [223 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDeleteExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [222 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [224 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeOfExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [223 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [225 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateVoidExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [224 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [226 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAwaitExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [225 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [227 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePrefixUnaryExpression(
node,
nodeVisitor(node.operand, visitor, isExpression)
);
},
- [226 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [228 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePostfixUnaryExpression(
node,
nodeVisitor(node.operand, visitor, isExpression)
);
},
- [227 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [229 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateBinaryExpression(
node,
nodeVisitor(node.left, visitor, isExpression),
@@ -82864,7 +83053,7 @@ var visitEachChildTable = {
nodeVisitor(node.right, visitor, isExpression)
);
},
- [228 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [230 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateConditionalExpression(
node,
nodeVisitor(node.condition, visitor, isExpression),
@@ -82874,27 +83063,27 @@ var visitEachChildTable = {
nodeVisitor(node.whenFalse, visitor, isExpression)
);
},
- [229 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [231 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateExpression(
node,
nodeVisitor(node.head, visitor, isTemplateHead),
nodesVisitor(node.templateSpans, visitor, isTemplateSpan)
);
},
- [230 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [232 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateYieldExpression(
node,
nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [231 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [233 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSpreadElement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [232 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [234 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateClassExpression(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -82904,28 +83093,28 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [234 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [236 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExpressionWithTypeArguments(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [235 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [237 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAsExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [239 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [241 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSatisfiesExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [236 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [238 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return isOptionalChain(node) ? context.factory.updateNonNullChain(
node,
nodeVisitor(node.expression, visitor, isExpression)
@@ -82934,39 +83123,39 @@ var visitEachChildTable = {
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [237 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [239 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateMetaProperty(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [240 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [242 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateSpan(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)
);
},
- [242 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [244 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateBlock(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [244 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [246 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateVariableStatement(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)
);
},
- [245 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [247 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExpressionStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [246 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [248 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIfStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -82974,21 +83163,21 @@ var visitEachChildTable = {
nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [247 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [249 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDoStatement(
node,
visitIterationBody(node.statement, visitor, context, nodeVisitor),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [248 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [250 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateWhileStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [249 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [251 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateForStatement(
node,
nodeVisitor(node.initializer, visitor, isForInitializer),
@@ -82997,7 +83186,7 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [250 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [252 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateForInStatement(
node,
nodeVisitor(node.initializer, visitor, isForInitializer),
@@ -83005,7 +83194,7 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [251 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [253 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateForOfStatement(
node,
nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword),
@@ -83014,52 +83203,52 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [252 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [254 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateContinueStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier)
);
},
- [253 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [255 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateBreakStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier)
);
},
- [254 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [256 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateReturnStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [255 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [257 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateWithStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [256 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [258 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSwitchStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.caseBlock, visitor, isCaseBlock)
);
},
- [257 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [259 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateLabeledStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier),
nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [258 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [260 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateThrowStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [259 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [261 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTryStatement(
node,
nodeVisitor(node.tryBlock, visitor, isBlock),
@@ -83067,7 +83256,7 @@ var visitEachChildTable = {
nodeVisitor(node.finallyBlock, visitor, isBlock)
);
},
- [261 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [263 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateVariableDeclaration(
node,
nodeVisitor(node.name, visitor, isBindingName),
@@ -83076,13 +83265,13 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [262 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [264 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateVariableDeclarationList(
node,
nodesVisitor(node.declarations, visitor, isVariableDeclaration)
);
},
- [263 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [265 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateFunctionDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83094,7 +83283,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [264 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [266 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateClassDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -83104,7 +83293,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [265 /* StructDeclaration */]: function visitEachChildOfStructDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [267 /* StructDeclaration */]: function visitEachChildOfStructDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateStructDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83114,7 +83303,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [266 /* AnnotationDeclaration */]: function visitEachChildOfAnnotationDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [268 /* AnnotationDeclaration */]: function visitEachChildOfAnnotationDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAnnotationDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83122,7 +83311,15 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isAnnotationElement)
);
},
- [267 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [269 /* OverloadDeclaration */]: function visitEachChildOfOverloadDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ return context.factory.updateOverloadDeclaration(
+ node,
+ nodesVisitor(node.modifiers, visitor, isModifier),
+ nodeVisitor(node.name, visitor, isIdentifier),
+ nodesVisitor(node.members, visitor, isOverloadElement)
+ );
+ },
+ [270 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateInterfaceDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83132,7 +83329,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [268 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [271 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeAliasDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83141,7 +83338,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [269 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [272 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateEnumDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83149,7 +83346,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isEnumMember)
);
},
- [270 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [273 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateModuleDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83157,25 +83354,25 @@ var visitEachChildTable = {
nodeVisitor(node.body, visitor, isModuleBody)
);
},
- [271 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [274 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateModuleBlock(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [272 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [275 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateCaseBlock(
node,
nodesVisitor(node.clauses, visitor, isCaseOrDefaultClause)
);
},
- [273 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [276 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceExportDeclaration(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [274 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [277 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportEqualsDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83184,7 +83381,7 @@ var visitEachChildTable = {
nodeVisitor(node.moduleReference, visitor, isModuleReference)
);
},
- [275 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [278 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83193,21 +83390,21 @@ var visitEachChildTable = {
nodeVisitor(node.assertClause, visitor, isAssertClause)
);
},
- [302 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [305 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateAssertClause(
node,
nodesVisitor(node.elements, visitor, isAssertEntry),
node.multiLine
);
},
- [303 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [306 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAssertEntry(
node,
nodeVisitor(node.name, visitor, isAssertionKey),
nodeVisitor(node.value, visitor, isExpression)
);
},
- [276 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [279 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportClause(
node,
node.isTypeOnly,
@@ -83215,25 +83412,25 @@ var visitEachChildTable = {
nodeVisitor(node.namedBindings, visitor, isNamedImportBindings)
);
},
- [277 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [280 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceImport(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [283 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [286 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceExport(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [278 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [281 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateNamedImports(
node,
nodesVisitor(node.elements, visitor, isImportSpecifier)
);
},
- [279 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [282 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportSpecifier(
node,
node.isTypeOnly,
@@ -83241,14 +83438,14 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [280 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [283 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportAssignment(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [281 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [284 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -83258,13 +83455,13 @@ var visitEachChildTable = {
nodeVisitor(node.assertClause, visitor, isAssertClause)
);
},
- [282 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [285 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateNamedExports(
node,
nodesVisitor(node.elements, visitor, isExportSpecifier)
);
},
- [284 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [287 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportSpecifier(
node,
node.isTypeOnly,
@@ -83272,13 +83469,13 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [286 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [289 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExternalModuleReference(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [287 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [290 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxElement(
node,
nodeVisitor(node.openingElement, visitor, isJsxOpeningElement),
@@ -83286,7 +83483,7 @@ var visitEachChildTable = {
nodeVisitor(node.closingElement, visitor, isJsxClosingElement)
);
},
- [288 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [291 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxSelfClosingElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression),
@@ -83294,7 +83491,7 @@ var visitEachChildTable = {
nodeVisitor(node.attributes, visitor, isJsxAttributes)
);
},
- [289 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [292 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxOpeningElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression),
@@ -83302,13 +83499,13 @@ var visitEachChildTable = {
nodeVisitor(node.attributes, visitor, isJsxAttributes)
);
},
- [290 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [293 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxClosingElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)
);
},
- [291 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [294 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxFragment(
node,
nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment),
@@ -83316,97 +83513,97 @@ var visitEachChildTable = {
nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)
);
},
- [294 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [297 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxAttribute(
node,
nodeVisitor(node.name, visitor, isIdentifier),
nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression)
);
},
- [295 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [298 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxAttributes(
node,
nodesVisitor(node.properties, visitor, isJsxAttributeLike)
);
},
- [296 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [299 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxSpreadAttribute(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [297 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [300 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [298 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [301 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCaseClause(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [299 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [302 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateDefaultClause(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [300 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [303 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateHeritageClause(
node,
nodesVisitor(node.types, visitor, isExpressionWithTypeArguments)
);
},
- [301 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [304 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCatchClause(
node,
nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration),
nodeVisitor(node.block, visitor, isBlock)
);
},
- [305 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [308 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePropertyAssignment(
node,
nodeVisitor(node.name, visitor, isPropertyName),
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [306 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [309 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateShorthandPropertyAssignment(
node,
nodeVisitor(node.name, visitor, isIdentifier),
nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression)
);
},
- [307 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [310 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSpreadAssignment(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [308 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [311 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateEnumMember(
node,
nodeVisitor(node.name, visitor, isPropertyName),
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [314 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [317 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateSourceFile(
node,
visitLexicalEnvironment(node.statements, visitor, context)
);
},
- [359 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [362 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePartiallyEmittedExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [360 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [363 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateCommaListExpression(
node,
nodesVisitor(node.elements, visitor, isExpression)
@@ -83980,7 +84177,7 @@ function isNamedDefaultReference(e) {
function chainBundle(context, transformSourceFile) {
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- return node.kind === 314 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
+ return node.kind === 317 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
}
function transformBundle(node) {
return context.factory.createBundle(map(node.sourceFiles, transformSourceFile), node.prepends);
@@ -84023,7 +84220,7 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
let hasImportDefault = false;
for (const node of sourceFile.statements) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
externalImports.push(node);
if (!hasImportStar && getImportNeedsImportStarHelper(node)) {
hasImportStar = true;
@@ -84032,12 +84229,12 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
hasImportDefault = true;
}
break;
- case 274 /* ImportEqualsDeclaration */:
- if (node.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ case 277 /* ImportEqualsDeclaration */:
+ if (node.moduleReference.kind === 289 /* ExternalModuleReference */) {
externalImports.push(node);
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
if (node.moduleSpecifier) {
if (!node.exportClause) {
externalImports.push(node);
@@ -84060,19 +84257,19 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
addExportedNamesForExportDeclaration(node);
}
break;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
if (node.isExportEquals && !exportEquals) {
exportEquals = node;
}
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (hasSyntacticModifier(node, 1 /* Export */)) {
for (const decl of node.declarationList.declarations) {
exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames);
}
}
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (hasSyntacticModifier(node, 1 /* Export */)) {
if (hasSyntacticModifier(node, 1024 /* Default */)) {
if (!hasExportDefault) {
@@ -84089,7 +84286,7 @@ function collectExternalModuleInfo(context, sourceFile, resolver, compilerOption
}
}
break;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
if (hasSyntacticModifier(node, 1 /* Export */)) {
if (hasSyntacticModifier(node, 1024 /* Default */)) {
if (!hasExportDefault) {
@@ -84233,7 +84430,7 @@ function isStaticPropertyDeclaration(member) {
return isPropertyDeclaration(member) && hasStaticModifier(member);
}
function isInitializedProperty(member) {
- return member.kind === 171 /* PropertyDeclaration */ && member.initializer !== void 0;
+ return member.kind === 172 /* PropertyDeclaration */ && member.initializer !== void 0;
}
function isNonStaticMethodOrAccessorWithPrivateName(member) {
return !isStatic(member) && (isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member)) && isPrivateIdentifier(member.name);
@@ -84270,12 +84467,12 @@ function getAllDecoratorsOfClass(node) {
}
function getAllDecoratorsOfClassElement(member, parent2) {
switch (member.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return getAllDecoratorsOfAccessors(member, parent2);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return getAllDecoratorsOfMethod(member);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return getAllDecoratorsOfProperty(member);
default:
return void 0;
@@ -84768,8 +84965,8 @@ function transformTypeScript(context) {
const previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(212 /* ElementAccessExpression */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(214 /* ElementAccessExpression */);
let currentSourceFile;
let currentNamespace;
let currentNamespaceContainerName;
@@ -84780,14 +84977,14 @@ function transformTypeScript(context) {
let applicableSubstitutions;
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- if (node.kind === 315 /* Bundle */) {
+ if (node.kind === 318 /* Bundle */) {
return transformBundle(node);
}
return transformSourceFile(node);
}
function transformBundle(node) {
return factory2.createBundle(node.sourceFiles.map(transformSourceFile), mapDefined(node.prepends, (prepend) => {
- if (prepend.kind === 317 /* InputFiles */) {
+ if (prepend.kind === 320 /* InputFiles */) {
return createUnparsedSourceFile(prepend, "js");
}
return prepend;
@@ -84818,22 +85015,22 @@ function transformTypeScript(context) {
}
function onBeforeVisitNode(node) {
switch (node.kind) {
- case 314 /* SourceFile */:
- case 272 /* CaseBlock */:
- case 271 /* ModuleBlock */:
- case 242 /* Block */:
+ case 317 /* SourceFile */:
+ case 275 /* CaseBlock */:
+ case 274 /* ModuleBlock */:
+ case 244 /* Block */:
currentLexicalScope = node;
currentScopeFirstDeclarationsOfName = void 0;
break;
- case 264 /* ClassDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (hasSyntacticModifier(node, 2 /* Ambient */)) {
break;
}
if (node.name) {
recordEmittedDeclarationInScope(node);
} else {
- Debug.assert(node.kind === 264 /* ClassDeclaration */ || hasSyntacticModifier(node, 1024 /* Default */));
+ Debug.assert(node.kind === 266 /* ClassDeclaration */ || hasSyntacticModifier(node, 1024 /* Default */));
}
break;
}
@@ -84852,10 +85049,10 @@ function transformTypeScript(context) {
}
function sourceElementVisitorWorker(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 280 /* ExportAssignment */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 284 /* ExportDeclaration */:
return visitElidableStatement(node);
default:
return visitorWorker(node);
@@ -84873,13 +85070,13 @@ function transformTypeScript(context) {
return node;
}
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
default:
Debug.fail("Unhandled ellided statement");
@@ -84889,7 +85086,7 @@ function transformTypeScript(context) {
return saveStateAndInvoke(node, namespaceElementVisitorWorker);
}
function namespaceElementVisitorWorker(node) {
- if (node.kind === 281 /* ExportDeclaration */ || node.kind === 275 /* ImportDeclaration */ || node.kind === 276 /* ImportClause */ || node.kind === 274 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ if (node.kind === 284 /* ExportDeclaration */ || node.kind === 278 /* ImportDeclaration */ || node.kind === 279 /* ImportClause */ || node.kind === 277 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 289 /* ExternalModuleReference */) {
return void 0;
} else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 1 /* Export */)) {
return visitTypeScript(node);
@@ -84901,21 +85098,21 @@ function transformTypeScript(context) {
}
function classElementVisitorWorker(node, parent2) {
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return visitConstructor(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return visitPropertyDeclaration(node, parent2);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return visitGetAccessor(node, parent2);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return visitSetAccessor(node, parent2);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node, parent2);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return visitEachChild(node, visitor, context);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return node;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return;
default:
return Debug.failBadSyntaxKind(node);
@@ -84926,15 +85123,15 @@ function transformTypeScript(context) {
}
function objectLiteralElementVisitorWorker(node, parent2) {
switch (node.kind) {
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return visitor(node);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return visitGetAccessor(node, parent2);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return visitSetAccessor(node, parent2);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node, parent2);
default:
return Debug.failBadSyntaxKind(node);
@@ -84969,13 +85166,13 @@ function transformTypeScript(context) {
case 147 /* ReadonlyKeyword */:
case 102 /* InKeyword */:
case 146 /* OutKeyword */:
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
- case 190 /* OptionalType */:
- case 191 /* RestType */:
- case 187 /* TypeLiteral */:
- case 182 /* TypePredicate */:
- case 167 /* TypeParameter */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
+ case 192 /* OptionalType */:
+ case 193 /* RestType */:
+ case 189 /* TypeLiteral */:
+ case 184 /* TypePredicate */:
+ case 168 /* TypeParameter */:
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
case 135 /* BooleanKeyword */:
@@ -84984,83 +85181,86 @@ function transformTypeScript(context) {
case 145 /* NeverKeyword */:
case 115 /* VoidKeyword */:
case 154 /* SymbolKeyword */:
- case 185 /* ConstructorType */:
- case 184 /* FunctionType */:
- case 186 /* TypeQuery */:
- case 183 /* TypeReference */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 194 /* ConditionalType */:
- case 196 /* ParenthesizedType */:
- case 197 /* ThisType */:
- case 198 /* TypeOperator */:
- case 199 /* IndexedAccessType */:
- case 200 /* MappedType */:
- case 201 /* LiteralType */:
- case 181 /* IndexSignature */:
+ case 187 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 188 /* TypeQuery */:
+ case 185 /* TypeReference */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 196 /* ConditionalType */:
+ case 198 /* ParenthesizedType */:
+ case 199 /* ThisType */:
+ case 200 /* TypeOperator */:
+ case 201 /* IndexedAccessType */:
+ case 202 /* MappedType */:
+ case 203 /* LiteralType */:
+ case 183 /* IndexSignature */:
return void 0;
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return factory2.createNotEmittedStatement(node);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return void 0;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return factory2.createNotEmittedStatement(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ return factory2.createNotEmittedStatement(node);
+ case 269 /* OverloadDeclaration */:
return factory2.createNotEmittedStatement(node);
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return visitHeritageClause(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return visitExpressionWithTypeArguments(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
return Debug.fail("Class and object literal elements must be visited with their respective visitors");
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return visitArrowFunction(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameter(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node);
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
return visitAssertionExpression(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return visitSatisfiesExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return visitNewExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return visitNonNullExpression(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return visitEnumDeclaration(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return visitVariableDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return visitModuleDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return visitJsxSelfClosingElement(node);
- case 289 /* JsxOpeningElement */:
+ case 292 /* JsxOpeningElement */:
return visitJsxJsxOpeningElement(node);
default:
return visitEachChild(node, visitor, context);
@@ -85292,19 +85492,19 @@ function transformTypeScript(context) {
}
function shouldAddTypeMetadata(node) {
const kind = node.kind;
- return kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 171 /* PropertyDeclaration */;
+ return kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 172 /* PropertyDeclaration */;
}
function shouldAddReturnTypeMetadata(node) {
- return node.kind === 174 /* MethodDeclaration */;
+ return node.kind === 176 /* MethodDeclaration */;
}
function shouldAddParamTypesMetadata(node) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return getFirstConstructorWithBody(node) !== void 0;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
}
return false;
@@ -85837,12 +86037,12 @@ function transformTypeScript(context) {
factory2.createVariableDeclaration(
factory2.getLocalName(node, false, true)
)
- ], currentLexicalScope.kind === 314 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)
+ ], currentLexicalScope.kind === 317 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)
);
setOriginalNode(statement, node);
recordEmittedDeclarationInScope(node);
if (isFirstEmittedDeclarationInScope(node)) {
- if (node.kind === 269 /* EnumDeclaration */) {
+ if (node.kind === 272 /* EnumDeclaration */) {
setSourceMapRange(statement.declarationList, node);
} else {
setSourceMapRange(statement, node);
@@ -85924,7 +86124,7 @@ function transformTypeScript(context) {
let statementsLocation;
let blockLocation;
if (node.body) {
- if (node.body.kind === 271 /* ModuleBlock */) {
+ if (node.body.kind === 274 /* ModuleBlock */) {
saveStateAndInvoke(node.body, (body) => addRange(statements, visitNodes2(body.statements, namespaceElementVisitor, isStatement)));
statementsLocation = node.body.statements;
blockLocation = node.body;
@@ -85953,13 +86153,13 @@ function transformTypeScript(context) {
true
);
setTextRange(block, blockLocation);
- if (!node.body || node.body.kind !== 271 /* ModuleBlock */) {
+ if (!node.body || node.body.kind !== 274 /* ModuleBlock */) {
setEmitFlags(block, getEmitFlags(block) | 1536 /* NoComments */);
}
return block;
}
function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) {
- if (moduleDeclaration.body.kind === 270 /* ModuleDeclaration */) {
+ if (moduleDeclaration.body.kind === 273 /* ModuleDeclaration */) {
const recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body);
return recursiveInnerModule || moduleDeclaration.body;
}
@@ -85987,7 +86187,7 @@ function transformTypeScript(context) {
return name || namedBindings ? factory2.updateImportClause(node, false, name, namedBindings) : void 0;
}
function visitNamedImportBindings(node) {
- if (node.kind === 277 /* NamespaceImport */) {
+ if (node.kind === 280 /* NamespaceImport */) {
return shouldEmitAliasDeclaration(node) ? node : void 0;
} else {
const allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */);
@@ -86157,15 +86357,15 @@ function transformTypeScript(context) {
if ((enabledSubstitutions & 2 /* NamespaceExports */) === 0) {
enabledSubstitutions |= 2 /* NamespaceExports */;
context.enableSubstitution(79 /* Identifier */);
- context.enableSubstitution(306 /* ShorthandPropertyAssignment */);
- context.enableEmitNotification(270 /* ModuleDeclaration */);
+ context.enableSubstitution(309 /* ShorthandPropertyAssignment */);
+ context.enableEmitNotification(273 /* ModuleDeclaration */);
}
}
function isTransformedModuleDeclaration(node) {
- return getOriginalNode(node).kind === 270 /* ModuleDeclaration */;
+ return getOriginalNode(node).kind === 273 /* ModuleDeclaration */;
}
function isTransformedEnumDeclaration(node) {
- return getOriginalNode(node).kind === 269 /* EnumDeclaration */;
+ return getOriginalNode(node).kind === 272 /* EnumDeclaration */;
}
function onEmitNode(hint, node, emitCallback) {
const savedApplicableSubstitutions = applicableSubstitutions;
@@ -86210,9 +86410,9 @@ function transformTypeScript(context) {
switch (node.kind) {
case 79 /* Identifier */:
return substituteExpressionIdentifier(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return substitutePropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return substituteElementAccessExpression(node);
}
return node;
@@ -86223,8 +86423,8 @@ function transformTypeScript(context) {
function trySubstituteNamespaceExportedName(node) {
if (enabledSubstitutions & applicableSubstitutions && !isGeneratedIdentifier(node) && !isLocalName(node)) {
const container = resolver.getReferencedExportContainer(node, false);
- if (container && container.kind !== 314 /* SourceFile */) {
- const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 270 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 269 /* EnumDeclaration */;
+ if (container && container.kind !== 317 /* SourceFile */) {
+ const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 273 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 272 /* EnumDeclaration */;
if (substitute) {
return setTextRange(
factory2.createPropertyAccessExpression(factory2.getGeneratedNameForNode(container), node),
@@ -86339,45 +86539,49 @@ function transformClassFields(context) {
switch (node.kind) {
case 128 /* AccessorKeyword */:
return shouldTransformAutoAccessors ? void 0 : node;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return void 0;
- case 232 /* ClassExpression */:
+ case 269 /* OverloadDeclaration */:
+ return void 0;
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return visitClassStaticBlockDeclaration(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return visitPropertyDeclaration(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ return void 0;
+ case 174 /* OverloadPropertyDeclaration */:
return void 0;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
case 80 /* PrivateIdentifier */:
return visitPrivateIdentifier(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return visitPropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitElementAccessExpression(node);
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPreOrPostfixUnaryExpression(node, false);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, false);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */: {
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */: {
return setCurrentStaticPropertyDeclarationOrStaticBlockAnd(
void 0,
fallbackVisitor,
@@ -86393,10 +86597,10 @@ function transformClassFields(context) {
}
function discardedValueVisitor(node) {
switch (node.kind) {
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPreOrPostfixUnaryExpression(node, true);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, true);
default:
return visitor(node);
@@ -86404,9 +86608,9 @@ function transformClassFields(context) {
}
function heritageClauseVisitor(node) {
switch (node.kind) {
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return visitEachChild(node, heritageClauseVisitor, context);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return visitExpressionWithTypeArgumentsInHeritageClause(node);
default:
return visitor(node);
@@ -86414,8 +86618,8 @@ function transformClassFields(context) {
}
function assignmentTargetVisitor(node) {
switch (node.kind) {
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return visitAssignmentPattern(node);
default:
return visitor(node);
@@ -86423,25 +86627,25 @@ function transformClassFields(context) {
}
function classElementVisitor(node) {
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return visitConstructorDeclaration(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
return setCurrentStaticPropertyDeclarationOrStaticBlockAnd(
void 0,
visitMethodOrAccessorDeclaration,
node
);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return setCurrentStaticPropertyDeclarationOrStaticBlockAnd(
void 0,
visitPropertyDeclaration,
node
);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return visitComputedPropertyName(node);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return node;
default:
return visitor(node);
@@ -86449,10 +86653,10 @@ function transformClassFields(context) {
}
function accessorFieldResultVisitor(node) {
switch (node.kind) {
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return transformFieldInitializer(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return classElementVisitor(node);
default:
Debug.assertMissingNode(node, "Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration");
@@ -87536,14 +87740,14 @@ function transformClassFields(context) {
if ((enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */) === 0) {
enabledSubstitutions |= 2 /* ClassStaticThisOrSuperReference */;
context.enableSubstitution(109 /* ThisKeyword */);
- context.enableEmitNotification(263 /* FunctionDeclaration */);
- context.enableEmitNotification(218 /* FunctionExpression */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(171 /* PropertyDeclaration */);
- context.enableEmitNotification(166 /* ComputedPropertyName */);
+ context.enableEmitNotification(265 /* FunctionDeclaration */);
+ context.enableEmitNotification(220 /* FunctionExpression */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(172 /* PropertyDeclaration */);
+ context.enableEmitNotification(167 /* ComputedPropertyName */);
}
}
function addMethodStatements(statements, methods, receiver) {
@@ -87585,12 +87789,12 @@ function transformClassFields(context) {
}
}
switch (node.kind) {
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
if (isArrowFunction(original) || getEmitFlags(node) & 262144 /* AsyncFunctionBody */) {
break;
}
- case 263 /* FunctionDeclaration */:
- case 176 /* Constructor */: {
+ case 265 /* FunctionDeclaration */:
+ case 178 /* Constructor */: {
const savedClassLexicalEnvironment = currentClassLexicalEnvironment;
const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
currentClassLexicalEnvironment = void 0;
@@ -87600,10 +87804,10 @@ function transformClassFields(context) {
currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment;
return;
}
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- case 171 /* PropertyDeclaration */: {
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 172 /* PropertyDeclaration */: {
const savedClassLexicalEnvironment = currentClassLexicalEnvironment;
const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
currentComputedPropertyNameClassLexicalEnvironment = currentClassLexicalEnvironment;
@@ -87613,7 +87817,7 @@ function transformClassFields(context) {
currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment;
return;
}
- case 166 /* ComputedPropertyName */: {
+ case 167 /* ComputedPropertyName */: {
const savedClassLexicalEnvironment = currentClassLexicalEnvironment;
const savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
currentClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment;
@@ -88087,15 +88291,15 @@ function createRuntimeTypeSerializer(context) {
}
function serializeTypeOfNode(node) {
switch (node.kind) {
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
return serializeTypeNode(node.type);
- case 178 /* SetAccessor */:
- case 177 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 179 /* GetAccessor */:
return serializeTypeNode(getAccessorTypeNode(node));
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 174 /* MethodDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 176 /* MethodDeclaration */:
return factory.createIdentifier("Function");
default:
return factory.createVoidZero();
@@ -88122,7 +88326,7 @@ function createRuntimeTypeSerializer(context) {
return factory.createArrayLiteralExpression(expressions);
}
function getParametersOfDecoratedDeclaration(node, container) {
- if (container && node.kind === 177 /* GetAccessor */) {
+ if (container && node.kind === 179 /* GetAccessor */) {
const { setAccessor } = getAllAccessorDeclarations(container.members, node);
if (setAccessor) {
return setAccessor.parameters;
@@ -88148,22 +88352,22 @@ function createRuntimeTypeSerializer(context) {
case 157 /* UndefinedKeyword */:
case 145 /* NeverKeyword */:
return factory.createVoidZero();
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return factory.createIdentifier("Function");
- case 188 /* ArrayType */:
- case 189 /* TupleType */:
+ case 190 /* ArrayType */:
+ case 191 /* TupleType */:
return factory.createIdentifier("Array");
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return node.assertsModifier ? factory.createVoidZero() : factory.createIdentifier("Boolean");
case 135 /* BooleanKeyword */:
return factory.createIdentifier("Boolean");
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
case 153 /* StringKeyword */:
return factory.createIdentifier("String");
case 150 /* ObjectKeyword */:
return factory.createIdentifier("Object");
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return serializeLiteralOfLiteralTypeNode(node.literal);
case 149 /* NumberKeyword */:
return factory.createIdentifier("Number");
@@ -88171,37 +88375,37 @@ function createRuntimeTypeSerializer(context) {
return getGlobalConstructor("BigInt", 7 /* ES2020 */);
case 154 /* SymbolKeyword */:
return getGlobalConstructor("Symbol", 2 /* ES2015 */);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return serializeTypeReferenceNode(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return serializeUnionOrIntersectionConstituents(node.types, true);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return serializeUnionOrIntersectionConstituents(node.types, false);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return serializeUnionOrIntersectionConstituents([node.trueType, node.falseType], false);
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
if (node.operator === 147 /* ReadonlyKeyword */) {
return serializeTypeNode(node.type);
}
break;
- case 186 /* TypeQuery */:
- case 199 /* IndexedAccessType */:
- case 200 /* MappedType */:
- case 187 /* TypeLiteral */:
+ case 188 /* TypeQuery */:
+ case 201 /* IndexedAccessType */:
+ case 202 /* MappedType */:
+ case 189 /* TypeLiteral */:
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
- case 197 /* ThisType */:
- case 205 /* ImportType */:
+ case 199 /* ThisType */:
+ case 207 /* ImportType */:
break;
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
- case 326 /* JSDocFunctionType */:
- case 327 /* JSDocVariadicType */:
- case 328 /* JSDocNamepathType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
+ case 329 /* JSDocFunctionType */:
+ case 330 /* JSDocVariadicType */:
+ case 331 /* JSDocNamepathType */:
break;
- case 323 /* JSDocNullableType */:
- case 324 /* JSDocNonNullableType */:
- case 325 /* JSDocOptionalType */:
+ case 326 /* JSDocNullableType */:
+ case 327 /* JSDocNonNullableType */:
+ case 328 /* JSDocOptionalType */:
return serializeTypeNode(node.type);
default:
return Debug.failBadSyntaxKind(node);
@@ -88213,7 +88417,7 @@ function createRuntimeTypeSerializer(context) {
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return factory.createIdentifier("String");
- case 225 /* PrefixUnaryExpression */: {
+ case 227 /* PrefixUnaryExpression */: {
const operand = node.operand;
switch (operand.kind) {
case 8 /* NumericLiteral */:
@@ -88346,7 +88550,7 @@ function createRuntimeTypeSerializer(context) {
name.original = void 0;
setParent(name, getParseTreeNode(currentLexicalScope));
return name;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return serializeQualifiedNameAsExpression(node);
}
}
@@ -88394,23 +88598,23 @@ function transformLegacyDecorators(context) {
return node;
}
switch (node.kind) {
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return void 0;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return visitConstructorDeclaration(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return visitSetAccessorDeclaration(node);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return visitGetAccessorDeclaration(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return visitPropertyDeclaration(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameterDeclaration(node);
default:
return visitEachChild(node, visitor, context);
@@ -88828,34 +89032,34 @@ function transformES2017(context) {
switch (node.kind) {
case 133 /* AsyncKeyword */:
return void 0;
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return visitAwaitExpression(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 107 /* SuperKeyword */) {
capturedSuperProperties.add(node.name.escapedText);
}
return visitEachChild(node, visitor, context);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (capturedSuperProperties && node.expression.kind === 107 /* SuperKeyword */) {
hasSuperElementAccess = true;
}
return visitEachChild(node, visitor, context);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitGetAccessorDeclaration, node);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitSetAccessorDeclaration, node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitConstructorDeclaration, node);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node);
default:
return visitEachChild(node, visitor, context);
@@ -88864,27 +89068,27 @@ function transformES2017(context) {
function asyncBodyVisitor(node) {
if (isNodeWithPossibleHoistedDeclaration(node)) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatementInAsyncBody(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatementInAsyncBody(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatementInAsyncBody(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatementInAsyncBody(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClauseInAsyncBody(node);
- case 242 /* Block */:
- case 256 /* SwitchStatement */:
- case 272 /* CaseBlock */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 259 /* TryStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 246 /* IfStatement */:
- case 255 /* WithStatement */:
- case 257 /* LabeledStatement */:
+ case 244 /* Block */:
+ case 258 /* SwitchStatement */:
+ case 275 /* CaseBlock */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 261 /* TryStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 248 /* IfStatement */:
+ case 257 /* WithStatement */:
+ case 259 /* LabeledStatement */:
return visitEachChild(node, asyncBodyVisitor, context);
default:
return Debug.assertNever(node, "Unhandled node.");
@@ -89134,7 +89338,7 @@ function transformES2017(context) {
const original = getOriginalNode(node, isFunctionLike);
const nodeType = original.type;
const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
- const isArrowFunction2 = node.kind === 219 /* ArrowFunction */;
+ const isArrowFunction2 = node.kind === 221 /* ArrowFunction */;
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0;
const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
enclosingFunctionParameterNames = new Set2();
@@ -89223,15 +89427,15 @@ function transformES2017(context) {
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) {
enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */;
- context.enableSubstitution(213 /* CallExpression */);
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(212 /* ElementAccessExpression */);
- context.enableEmitNotification(264 /* ClassDeclaration */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(244 /* VariableStatement */);
+ context.enableSubstitution(215 /* CallExpression */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(214 /* ElementAccessExpression */);
+ context.enableEmitNotification(266 /* ClassDeclaration */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(246 /* VariableStatement */);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -89262,11 +89466,11 @@ function transformES2017(context) {
}
function substituteExpression(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return substitutePropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return substituteElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return substituteCallExpression(node);
}
return node;
@@ -89309,7 +89513,7 @@ function transformES2017(context) {
}
function isSuperContainer(node) {
const kind = node.kind;
- return kind === 264 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 266 /* ClassDeclaration */ || kind === 178 /* Constructor */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
if (enclosingSuperContainerFlags & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
@@ -89536,115 +89740,115 @@ function transformES2018(context) {
return node;
}
switch (node.kind) {
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return visitAwaitExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return visitYieldExpression(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitReturnStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, expressionResultIsUnused2);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return visitCommaListExpression(node, expressionResultIsUnused2);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return visitVariableDeclaration(node);
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 250 /* ForInStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 252 /* ForInStatement */:
return doWithHierarchyFacts(
visitDefault,
node,
0 /* IterationStatementExcludes */,
2 /* IterationStatementIncludes */
);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node, void 0);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return doWithHierarchyFacts(
visitForStatement,
node,
0 /* IterationStatementExcludes */,
2 /* IterationStatementIncludes */
);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return visitVoidExpression(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return doWithHierarchyFacts(
visitConstructorDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return doWithHierarchyFacts(
visitMethodDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return doWithHierarchyFacts(
visitGetAccessorDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return doWithHierarchyFacts(
visitSetAccessorDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return doWithHierarchyFacts(
visitFunctionDeclaration,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return doWithHierarchyFacts(
visitFunctionExpression,
node,
2 /* ClassOrFunctionExcludes */,
1 /* ClassOrFunctionIncludes */
);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return doWithHierarchyFacts(
visitArrowFunction,
node,
2 /* ArrowFunctionExcludes */,
0 /* ArrowFunctionIncludes */
);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameter(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, expressionResultIsUnused2);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 107 /* SuperKeyword */) {
capturedSuperProperties.add(node.name.escapedText);
}
return visitEachChild(node, visitor, context);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (capturedSuperProperties && node.expression.kind === 107 /* SuperKeyword */) {
hasSuperElementAccess = true;
}
return visitEachChild(node, visitor, context);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return doWithHierarchyFacts(
visitDefault,
node,
@@ -89722,7 +89926,7 @@ function transformES2018(context) {
function visitLabeledStatement(node) {
if (enclosingFunctionFlags & 2 /* Async */) {
const statement = unwrapInnermostStatementOfLabel(node);
- if (statement.kind === 251 /* ForOfStatement */ && statement.awaitModifier) {
+ if (statement.kind === 253 /* ForOfStatement */ && statement.awaitModifier) {
return visitForOfStatement(statement, node);
}
return factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node);
@@ -89733,7 +89937,7 @@ function transformES2018(context) {
let chunkObject;
const objects = [];
for (const e of elements) {
- if (e.kind === 307 /* SpreadAssignment */) {
+ if (e.kind === 310 /* SpreadAssignment */) {
if (chunkObject) {
objects.push(factory2.createObjectLiteralExpression(chunkObject));
chunkObject = void 0;
@@ -89741,7 +89945,7 @@ function transformES2018(context) {
const target = e.expression;
objects.push(visitNode(target, visitor, isExpression));
} else {
- chunkObject = append(chunkObject, e.kind === 305 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike));
+ chunkObject = append(chunkObject, e.kind === 308 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike));
}
}
if (chunkObject) {
@@ -89752,7 +89956,7 @@ function transformES2018(context) {
function visitObjectLiteralExpression(node) {
if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) {
const objects = chunkObjectLiteralElements(node.properties);
- if (objects.length && objects[0].kind !== 210 /* ObjectLiteralExpression */) {
+ if (objects.length && objects[0].kind !== 212 /* ObjectLiteralExpression */) {
objects.unshift(factory2.createObjectLiteralExpression());
}
let expression = objects[0];
@@ -90405,15 +90609,15 @@ function transformES2018(context) {
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) {
enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */;
- context.enableSubstitution(213 /* CallExpression */);
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(212 /* ElementAccessExpression */);
- context.enableEmitNotification(264 /* ClassDeclaration */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(244 /* VariableStatement */);
+ context.enableSubstitution(215 /* CallExpression */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(214 /* ElementAccessExpression */);
+ context.enableEmitNotification(266 /* ClassDeclaration */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(246 /* VariableStatement */);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -90444,11 +90648,11 @@ function transformES2018(context) {
}
function substituteExpression(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return substitutePropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return substituteElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return substituteCallExpression(node);
}
return node;
@@ -90491,7 +90695,7 @@ function transformES2018(context) {
}
function isSuperContainer(node) {
const kind = node.kind;
- return kind === 264 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 266 /* ClassDeclaration */ || kind === 178 /* Constructor */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
if (enclosingSuperContainerFlags & 4096 /* MethodWithSuperPropertyAssignmentInAsync */) {
@@ -90534,7 +90738,7 @@ function transformES2019(context) {
return node;
}
switch (node.kind) {
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
default:
return visitEachChild(node, visitor, context);
@@ -90570,25 +90774,25 @@ function transformES2020(context) {
return node;
}
switch (node.kind) {
- case 213 /* CallExpression */: {
+ case 215 /* CallExpression */: {
const updated = visitNonOptionalCallExpression(node, false);
Debug.assertNotNode(updated, isSyntheticReference);
return updated;
}
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (isOptionalChain(node)) {
const updated = visitOptionalExpression(node, false, false);
Debug.assertNotNode(updated, isSyntheticReference);
return updated;
}
return visitEachChild(node, visitor, context);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) {
return transformNullishCoalescingExpression(node);
}
return visitEachChild(node, visitor, context);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return visitDeleteExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -90626,7 +90830,7 @@ function transformES2020(context) {
thisArg = expression;
}
}
- expression = node.kind === 211 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression));
+ expression = node.kind === 213 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression));
return thisArg ? factory2.createSyntheticReferenceExpression(expression, thisArg) : expression;
}
function visitNonOptionalCallExpression(node, captureThisArg) {
@@ -90645,12 +90849,12 @@ function transformES2020(context) {
}
function visitNonOptionalExpression(node, captureThisArg, isDelete) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitNonOptionalCallExpression(node, captureThisArg);
default:
return visitNode(node, visitor, isExpression);
@@ -90671,8 +90875,8 @@ function transformES2020(context) {
for (let i = 0; i < chain.length; i++) {
const segment = chain[i];
switch (segment.kind) {
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
if (i === chain.length - 1 && captureThisArg) {
if (!isSimpleCopiableExpression(rightExpression)) {
thisArg = factory2.createTempVariable(hoistVariableDeclaration);
@@ -90681,9 +90885,9 @@ function transformES2020(context) {
thisArg = rightExpression;
}
}
- rightExpression = segment.kind === 211 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression));
+ rightExpression = segment.kind === 213 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression));
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (i === 0 && leftThisArg) {
if (!isGeneratedIdentifier(leftThisArg)) {
leftThisArg = factory2.cloneNode(leftThisArg);
@@ -90762,7 +90966,7 @@ function transformES2021(context) {
return node;
}
switch (node.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const binaryExpression = node;
if (isLogicalOrCoalescingAssignmentExpression(binaryExpression)) {
return transformLogicalAssignment(binaryExpression);
@@ -90940,13 +91144,13 @@ function transformJsx(context) {
}
function visitorWorker(node) {
switch (node.kind) {
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return visitJsxElement(node, false);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return visitJsxSelfClosingElement(node, false);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return visitJsxFragment(node, false);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return visitJsxExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -90956,13 +91160,13 @@ function transformJsx(context) {
switch (node.kind) {
case 11 /* JsxText */:
return visitJsxText(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return visitJsxExpression(node);
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return visitJsxElement(node, true);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return visitJsxSelfClosingElement(node, true);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return visitJsxFragment(node, true);
default:
return Debug.failBadSyntaxKind(node);
@@ -91157,7 +91361,7 @@ function transformJsx(context) {
const literal = factory2.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote);
return setTextRange(literal, node);
}
- if (node.kind === 297 /* JsxExpression */) {
+ if (node.kind === 300 /* JsxExpression */) {
if (node.expression === void 0) {
return factory2.createTrue();
}
@@ -91219,7 +91423,7 @@ function transformJsx(context) {
return decoded === text ? void 0 : decoded;
}
function getTagName(node) {
- if (node.kind === 287 /* JsxElement */) {
+ if (node.kind === 290 /* JsxElement */) {
return getTagName(node.openingElement);
} else {
const name = node.tagName;
@@ -91518,7 +91722,7 @@ function transformES2016(context) {
return node;
}
switch (node.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -91722,7 +91926,7 @@ function transformES2015(context) {
hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -32768 /* SubtreeFactsMask */ | ancestorFacts;
}
function isReturnVoidStatementInConstructorWithCapturedSuper(node) {
- return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 && node.kind === 254 /* ReturnStatement */ && !node.expression;
+ return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 && node.kind === 256 /* ReturnStatement */ && !node.expression;
}
function isOrMayContainReturnCompletion(node) {
return node.transformFlags & 4194304 /* ContainsHoistedDeclarationOrCompletion */ && (isReturnStatement(node) || isIfStatement(node) || isWithStatement(node) || isSwitchStatement(node) || isCaseBlock(node) || isCaseClause(node) || isDefaultClause(node) || isTryStatement(node) || isCatchClause(node) || isLabeledStatement(node) || isIterationStatement(node, false) || isBlock(node));
@@ -91762,65 +91966,65 @@ function transformES2015(context) {
switch (node.kind) {
case 125 /* StaticKeyword */:
return void 0;
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return visitClassExpression(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return visitParameter(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return visitArrowFunction(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return visitVariableDeclaration(node);
case 79 /* Identifier */:
return visitIdentifier(node);
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return visitVariableDeclarationList(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return visitSwitchStatement(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return visitCaseBlock(node);
- case 242 /* Block */:
+ case 244 /* Block */:
return visitBlock(node, false);
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
return visitBreakOrContinueStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return visitDoOrWhileStatement(node, void 0);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, void 0);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node, void 0);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node, void 0);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return visitShorthandPropertyAssignment(node);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return visitComputedPropertyName(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return visitArrayLiteralExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return visitNewExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, expressionResultIsUnused2);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node, expressionResultIsUnused2);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return visitCommaListExpression(node, expressionResultIsUnused2);
case 14 /* NoSubstitutionTemplateLiteral */:
case 15 /* TemplateHead */:
@@ -91831,30 +92035,30 @@ function transformES2015(context) {
return visitStringLiteral(node);
case 8 /* NumericLiteral */:
return visitNumericLiteral(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return visitTaggedTemplateExpression(node);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return visitTemplateExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return visitYieldExpression(node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return visitSpreadElement(node);
case 107 /* SuperKeyword */:
return visitSuperKeyword(false);
case 109 /* ThisKeyword */:
return visitThisKeyword(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return visitMetaProperty(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return visitMethodDeclaration(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return visitAccessorDeclaration(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitReturnStatement(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return visitVoidExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -91955,13 +92159,13 @@ function transformES2015(context) {
}
function visitBreakOrContinueStatement(node) {
if (convertedLoopState) {
- const jump = node.kind === 253 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */;
+ const jump = node.kind === 255 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */;
const canUseBreakOrContinue = node.label && convertedLoopState.labels && convertedLoopState.labels.get(idText(node.label)) || !node.label && convertedLoopState.allowedNonLabeledJumps & jump;
if (!canUseBreakOrContinue) {
let labelMarker;
const label = node.label;
if (!label) {
- if (node.kind === 253 /* BreakStatement */) {
+ if (node.kind === 255 /* BreakStatement */) {
convertedLoopState.nonLocalJumps |= 2 /* Break */;
labelMarker = "break";
} else {
@@ -91969,7 +92173,7 @@ function transformES2015(context) {
labelMarker = "continue";
}
} else {
- if (node.kind === 253 /* BreakStatement */) {
+ if (node.kind === 255 /* BreakStatement */) {
labelMarker = `break-${label.escapedText}`;
setLabeledJump(convertedLoopState, true, idText(label), labelMarker);
} else {
@@ -92213,14 +92417,14 @@ function transformES2015(context) {
};
}
function isSufficientlyCoveredByReturnStatements(statement) {
- if (statement.kind === 254 /* ReturnStatement */) {
+ if (statement.kind === 256 /* ReturnStatement */) {
return true;
- } else if (statement.kind === 246 /* IfStatement */) {
+ } else if (statement.kind === 248 /* IfStatement */) {
const ifStatement = statement;
if (ifStatement.elseStatement) {
return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement);
}
- } else if (statement.kind === 242 /* Block */) {
+ } else if (statement.kind === 244 /* Block */) {
const lastStatement = lastOrUndefined(statement.statements);
if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {
return true;
@@ -92462,7 +92666,7 @@ function transformES2015(context) {
return true;
}
function insertCaptureThisForNodeIfNeeded(statements, node) {
- if (hierarchyFacts & 65536 /* CapturedLexicalThis */ && node.kind !== 219 /* ArrowFunction */) {
+ if (hierarchyFacts & 65536 /* CapturedLexicalThis */ && node.kind !== 221 /* ArrowFunction */) {
insertCaptureThisForNode(statements, node, factory2.createThis());
return true;
}
@@ -92501,21 +92705,21 @@ function transformES2015(context) {
if (hierarchyFacts & 32768 /* NewTarget */) {
let newTarget;
switch (node.kind) {
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return statements;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
newTarget = factory2.createVoidZero();
break;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
newTarget = factory2.createPropertyAccessExpression(
setEmitFlags(factory2.createThis(), 4 /* NoSubstitution */),
"constructor"
);
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
newTarget = factory2.createConditionalExpression(
factory2.createLogicalAnd(
setEmitFlags(factory2.createThis(), 4 /* NoSubstitution */),
@@ -92559,21 +92763,21 @@ function transformES2015(context) {
function addClassMembers(statements, node) {
for (const member of node.members) {
switch (member.kind) {
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
statements.push(transformSemicolonClassElementToStatement(member));
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node));
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
const accessors = getAllAccessorDeclarations(node.members, member);
if (member === accessors.firstAccessor) {
statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node));
}
break;
- case 176 /* Constructor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 177 /* ClassStaticBlockDeclaration */:
break;
default:
Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName);
@@ -92726,7 +92930,7 @@ function transformES2015(context) {
const ancestorFacts = container && isClassLike(container) && !isStatic(node) ? enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */) : enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */);
const parameters = visitParameterList(node.parameters, visitor, context);
const body = transformFunctionBody2(node);
- if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) {
+ if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */)) {
name = factory2.getGeneratedNameForNode(node);
}
exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */);
@@ -92772,7 +92976,7 @@ function transformES2015(context) {
multiLine = true;
}
} else {
- Debug.assert(node.kind === 219 /* ArrowFunction */);
+ Debug.assert(node.kind === 221 /* ArrowFunction */);
statementsLocation = moveRangeEnd(body, -1);
const equalsGreaterThanToken = node.equalsGreaterThanToken;
if (!nodeIsSynthesized(equalsGreaterThanToken) && !nodeIsSynthesized(body)) {
@@ -92975,14 +93179,14 @@ function transformES2015(context) {
}
function visitIterationStatement(node, outermostLabeledStatement) {
switch (node.kind) {
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return visitDoOrWhileStatement(node, outermostLabeledStatement);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, outermostLabeledStatement);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node, outermostLabeledStatement);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node, outermostLabeledStatement);
}
}
@@ -93259,7 +93463,7 @@ function transformES2015(context) {
let numInitialProperties = -1, hasComputed = false;
for (let i = 0; i < properties.length; i++) {
const property = properties[i];
- if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 166 /* ComputedPropertyName */)) {
+ if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 167 /* ComputedPropertyName */)) {
numInitialProperties = i;
break;
}
@@ -93371,15 +93575,15 @@ function transformES2015(context) {
}
function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) {
switch (node.kind) {
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return convertForStatement(node, initializerFunction, convertedLoopBody);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return convertForInStatement(node, convertedLoopBody);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return convertForOfStatement(node, convertedLoopBody);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return convertDoStatement(node, convertedLoopBody);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return convertWhileStatement(node, convertedLoopBody);
default:
return Debug.failBadSyntaxKind(node, "IterationStatement expected");
@@ -93430,11 +93634,11 @@ function transformES2015(context) {
function createConvertedLoopState(node) {
let loopInitializer;
switch (node.kind) {
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
const initializer = node.initializer;
- if (initializer && initializer.kind === 262 /* VariableDeclarationList */) {
+ if (initializer && initializer.kind === 264 /* VariableDeclarationList */) {
loopInitializer = initializer;
}
break;
@@ -93788,20 +93992,20 @@ function transformES2015(context) {
for (let i = start; i < numProperties; i++) {
const property = properties[i];
switch (property.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
const accessors = getAllAccessorDeclarations(node.properties, property);
if (property === accessors.firstAccessor) {
expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine));
}
break;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine));
break;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
default:
@@ -93904,7 +94108,7 @@ function transformES2015(context) {
let updated;
const parameters = visitParameterList(node.parameters, visitor, context);
const body = transformFunctionBody2(node);
- if (node.kind === 177 /* GetAccessor */) {
+ if (node.kind === 179 /* GetAccessor */) {
updated = factory2.updateGetAccessorDeclaration(node, node.modifiers, node.name, parameters, node.type, body);
} else {
updated = factory2.updateSetAccessorDeclaration(node, node.modifiers, node.name, parameters, body);
@@ -94206,13 +94410,13 @@ function transformES2015(context) {
if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) {
enabledSubstitutions |= 1 /* CapturedThis */;
context.enableSubstitution(109 /* ThisKeyword */);
- context.enableEmitNotification(176 /* Constructor */);
- context.enableEmitNotification(174 /* MethodDeclaration */);
- context.enableEmitNotification(177 /* GetAccessor */);
- context.enableEmitNotification(178 /* SetAccessor */);
- context.enableEmitNotification(219 /* ArrowFunction */);
- context.enableEmitNotification(218 /* FunctionExpression */);
- context.enableEmitNotification(263 /* FunctionDeclaration */);
+ context.enableEmitNotification(178 /* Constructor */);
+ context.enableEmitNotification(176 /* MethodDeclaration */);
+ context.enableEmitNotification(179 /* GetAccessor */);
+ context.enableEmitNotification(180 /* SetAccessor */);
+ context.enableEmitNotification(221 /* ArrowFunction */);
+ context.enableEmitNotification(220 /* FunctionExpression */);
+ context.enableEmitNotification(265 /* FunctionDeclaration */);
}
}
function onSubstituteNode(hint, node) {
@@ -94236,10 +94440,10 @@ function transformES2015(context) {
}
function isNameOfDeclarationWithCollidingName(node) {
switch (node.parent.kind) {
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
- case 269 /* EnumDeclaration */:
- case 261 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 263 /* VariableDeclaration */:
return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent);
}
return false;
@@ -94296,11 +94500,11 @@ function transformES2015(context) {
return false;
}
const statement = firstOrUndefined(constructor.body.statements);
- if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 245 /* ExpressionStatement */) {
+ if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 247 /* ExpressionStatement */) {
return false;
}
const statementExpression = statement.expression;
- if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 213 /* CallExpression */) {
+ if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 215 /* CallExpression */) {
return false;
}
const callTarget = statementExpression.expression;
@@ -94308,7 +94512,7 @@ function transformES2015(context) {
return false;
}
const callArgument = singleOrUndefined(statementExpression.arguments);
- if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 231 /* SpreadElement */) {
+ if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 233 /* SpreadElement */) {
return false;
}
const expression = callArgument.expression;
@@ -94325,24 +94529,24 @@ function transformES5(context) {
if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) {
previousOnEmitNode = context.onEmitNode;
context.onEmitNode = onEmitNode;
- context.enableEmitNotification(289 /* JsxOpeningElement */);
- context.enableEmitNotification(290 /* JsxClosingElement */);
- context.enableEmitNotification(288 /* JsxSelfClosingElement */);
+ context.enableEmitNotification(292 /* JsxOpeningElement */);
+ context.enableEmitNotification(293 /* JsxClosingElement */);
+ context.enableEmitNotification(291 /* JsxSelfClosingElement */);
noSubstitution = [];
}
const previousOnSubstituteNode = context.onSubstituteNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(211 /* PropertyAccessExpression */);
- context.enableSubstitution(305 /* PropertyAssignment */);
+ context.enableSubstitution(213 /* PropertyAccessExpression */);
+ context.enableSubstitution(308 /* PropertyAssignment */);
return chainBundle(context, transformSourceFile);
function transformSourceFile(node) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
switch (node.kind) {
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
const tagName = node.tagName;
noSubstitution[getOriginalNodeId(tagName)] = true;
break;
@@ -94513,13 +94717,13 @@ function transformGenerators(context) {
}
function visitJavaScriptInStatementContainingYield(node) {
switch (node.kind) {
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return visitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return visitWhileStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return visitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
default:
return visitJavaScriptInGeneratorFunctionBody(node);
@@ -94527,24 +94731,24 @@ function transformGenerators(context) {
}
function visitJavaScriptInGeneratorFunctionBody(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return visitAccessorDeclaration(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return visitBreakStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return visitContinueStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return visitReturnStatement(node);
default:
if (node.transformFlags & 1048576 /* ContainsYield */) {
@@ -94558,23 +94762,23 @@ function transformGenerators(context) {
}
function visitJavaScriptContainingYield(node) {
switch (node.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return visitBinaryExpression(node);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return visitCommaListExpression(node);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return visitConditionalExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return visitYieldExpression(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return visitArrayLiteralExpression(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return visitObjectLiteralExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return visitElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return visitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return visitNewExpression(node);
default:
return visitEachChild(node, visitor, context);
@@ -94582,9 +94786,9 @@ function transformGenerators(context) {
}
function visitGenerator(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return visitFunctionExpression(node);
default:
return Debug.failBadSyntaxKind(node);
@@ -94751,14 +94955,14 @@ function transformGenerators(context) {
if (containsYield(right)) {
let target;
switch (left.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
target = factory2.updatePropertyAccessExpression(
left,
cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)),
left.name
);
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
target = factory2.updateElementAccessExpression(
left,
cacheExpression(visitNode(left.expression, visitor, isLeftHandSideExpression)),
@@ -95030,35 +95234,35 @@ function transformGenerators(context) {
}
function transformAndEmitStatementWorker(node) {
switch (node.kind) {
- case 242 /* Block */:
+ case 244 /* Block */:
return transformAndEmitBlock(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return transformAndEmitExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return transformAndEmitIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return transformAndEmitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return transformAndEmitWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return transformAndEmitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return transformAndEmitForInStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return transformAndEmitContinueStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return transformAndEmitBreakStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return transformAndEmitReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return transformAndEmitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return transformAndEmitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return transformAndEmitLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return transformAndEmitThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return transformAndEmitTryStatement(node);
default:
return emitStatement(visitNode(node, visitor, isStatement));
@@ -95383,7 +95587,7 @@ function transformGenerators(context) {
for (let i = 0; i < numClauses; i++) {
const clause = caseBlock.clauses[i];
clauseLabels.push(defineLabel());
- if (clause.kind === 299 /* DefaultClause */ && defaultClauseIndex === -1) {
+ if (clause.kind === 302 /* DefaultClause */ && defaultClauseIndex === -1) {
defaultClauseIndex = i;
}
}
@@ -95393,7 +95597,7 @@ function transformGenerators(context) {
let defaultClausesSkipped = 0;
for (let i = clausesWritten; i < numClauses; i++) {
const clause = caseBlock.clauses[i];
- if (clause.kind === 298 /* CaseClause */) {
+ if (clause.kind === 301 /* CaseClause */) {
if (containsYield(clause.expression) && pendingClauses.length > 0) {
break;
}
@@ -96318,12 +96522,12 @@ function transformModule(context) {
const previousOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(213 /* CallExpression */);
- context.enableSubstitution(215 /* TaggedTemplateExpression */);
+ context.enableSubstitution(215 /* CallExpression */);
+ context.enableSubstitution(217 /* TaggedTemplateExpression */);
context.enableSubstitution(79 /* Identifier */);
- context.enableSubstitution(227 /* BinaryExpression */);
- context.enableSubstitution(306 /* ShorthandPropertyAssignment */);
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableSubstitution(229 /* BinaryExpression */);
+ context.enableSubstitution(309 /* ShorthandPropertyAssignment */);
+ context.enableEmitNotification(317 /* SourceFile */);
const moduleInfoMap = [];
const deferredExports = [];
let currentSourceFile;
@@ -96631,23 +96835,23 @@ function transformModule(context) {
}
function topLevelVisitor(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 361 /* MergeDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return visitMergeDeclarationMarker(node);
- case 362 /* EndOfDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return visitEndOfDeclarationMarker(node);
default:
return visitor(node);
@@ -96658,26 +96862,26 @@ function transformModule(context) {
return node;
}
switch (node.kind) {
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, valueIsDiscarded);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
return visitImportCallExpression(node);
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
return visitDestructuringAssignment(node, valueIsDiscarded);
}
break;
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPreOrPostfixUnaryExpression(node, valueIsDiscarded);
}
return visitEachChild(node, visitor, context);
@@ -96692,24 +96896,24 @@ function transformModule(context) {
if (isObjectLiteralExpression(node)) {
for (const elem of node.properties) {
switch (elem.kind) {
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (destructuringNeedsFlattening(elem.initializer)) {
return true;
}
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
if (destructuringNeedsFlattening(elem.name)) {
return true;
}
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
if (destructuringNeedsFlattening(elem.expression)) {
return true;
}
break;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return false;
default:
Debug.assertNever(elem, "Unhandled object member kind");
@@ -97366,7 +97570,7 @@ function transformModule(context) {
}
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 244 /* VariableStatement */) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 246 /* VariableStatement */) {
const id = getOriginalNodeId(node);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original);
}
@@ -97398,10 +97602,10 @@ function transformModule(context) {
const namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
for (const importBinding of namedBindings.elements) {
statements = appendExportsOfDeclaration(statements, importBinding, true);
}
@@ -97545,7 +97749,7 @@ function transformModule(context) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
currentSourceFile = node;
currentModuleInfo = moduleInfoMap[getOriginalNodeId(currentSourceFile)];
previousOnEmitNode(hint, node, emitCallback);
@@ -97583,11 +97787,11 @@ function transformModule(context) {
switch (node.kind) {
case 79 /* Identifier */:
return substituteExpressionIdentifier(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return substituteCallExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return substituteTaggedTemplateExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return substituteBinaryExpression(node);
}
return node;
@@ -97638,7 +97842,7 @@ function transformModule(context) {
return node;
} else if (!(isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node));
- if (exportContainer && exportContainer.kind === 314 /* SourceFile */) {
+ if (exportContainer && exportContainer.kind === 317 /* SourceFile */) {
return setTextRange(
factory2.createPropertyAccessExpression(
factory2.createIdentifier("exports"),
@@ -97717,10 +97921,10 @@ function transformSystemModule(context) {
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
context.enableSubstitution(79 /* Identifier */);
- context.enableSubstitution(306 /* ShorthandPropertyAssignment */);
- context.enableSubstitution(227 /* BinaryExpression */);
- context.enableSubstitution(237 /* MetaProperty */);
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableSubstitution(309 /* ShorthandPropertyAssignment */);
+ context.enableSubstitution(229 /* BinaryExpression */);
+ context.enableSubstitution(239 /* MetaProperty */);
+ context.enableEmitNotification(317 /* SourceFile */);
const moduleInfoMap = [];
const deferredExports = [];
const exportFunctionsMap = [];
@@ -97870,7 +98074,7 @@ function transformSystemModule(context) {
if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) {
let hasExportDeclarationWithExportClause = false;
for (const externalImport of moduleInfo.externalImports) {
- if (externalImport.kind === 281 /* ExportDeclaration */ && externalImport.exportClause) {
+ if (externalImport.kind === 284 /* ExportDeclaration */ && externalImport.exportClause) {
hasExportDeclarationWithExportClause = true;
break;
}
@@ -97989,11 +98193,11 @@ function transformSystemModule(context) {
for (const entry of group2.externalImports) {
const importVariableName = getLocalNameForExternalImport(factory2, entry, currentSourceFile);
switch (entry.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
if (!entry.importClause) {
break;
}
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
Debug.assert(importVariableName !== void 0);
statements.push(
factory2.createExpressionStatement(
@@ -98015,7 +98219,7 @@ function transformSystemModule(context) {
);
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
Debug.assert(importVariableName !== void 0);
if (entry.exportClause) {
if (isNamedExports(entry.exportClause)) {
@@ -98084,13 +98288,13 @@ function transformSystemModule(context) {
}
function topLevelVisitor(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return visitImportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return visitImportEqualsDeclaration(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return visitExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
default:
return topLevelNestedVisitor(node);
@@ -98235,7 +98439,7 @@ function transformSystemModule(context) {
}
}
function shouldHoistVariableDeclarationList(node) {
- return (getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 314 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);
+ return (getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 317 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);
}
function transformInitializedVariable(node, isExportedDeclaration) {
const createAssignment3 = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment;
@@ -98259,7 +98463,7 @@ function transformSystemModule(context) {
return isExportedDeclaration ? createExportExpression(name, preventSubstitution(setTextRange(factory2.createAssignment(name, value), location))) : preventSubstitution(setTextRange(factory2.createAssignment(name, value), location));
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 244 /* VariableStatement */) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 246 /* VariableStatement */) {
const id = getOriginalNodeId(node);
const isExportedDeclaration = hasSyntacticModifier(node.original, 1 /* Export */);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration);
@@ -98297,10 +98501,10 @@ function transformSystemModule(context) {
const namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
for (const importBinding of namedBindings.elements) {
statements = appendExportsOfDeclaration(statements, importBinding);
}
@@ -98395,43 +98599,43 @@ function transformSystemModule(context) {
}
function topLevelNestedVisitor(node) {
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return visitVariableStatement(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return visitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return visitClassDeclaration(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, true);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return visitForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return visitForOfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return visitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return visitWhileStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return visitLabeledStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return visitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return visitSwitchStatement(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return visitCaseBlock(node);
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
return visitCaseClause(node);
- case 299 /* DefaultClause */:
+ case 302 /* DefaultClause */:
return visitDefaultClause(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return visitTryStatement(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return visitCatchClause(node);
- case 242 /* Block */:
+ case 244 /* Block */:
return visitBlock(node);
- case 361 /* MergeDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return visitMergeDeclarationMarker(node);
- case 362 /* EndOfDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return visitEndOfDeclarationMarker(node);
default:
return visitor(node);
@@ -98573,26 +98777,26 @@ function transformSystemModule(context) {
return node;
}
switch (node.kind) {
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return visitForStatement(node, false);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return visitExpressionStatement(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return visitParenthesizedExpression(node, valueIsDiscarded);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
return visitDestructuringAssignment(node, valueIsDiscarded);
}
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isImportCall(node)) {
return visitImportCallExpression(node);
}
break;
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded);
}
return visitEachChild(node, visitor, context);
@@ -98652,7 +98856,7 @@ function transformSystemModule(context) {
return hasExportedReferenceInDestructuringTarget(node.initializer);
} else if (isIdentifier(node)) {
const container = resolver.getReferencedExportContainer(node);
- return container !== void 0 && container.kind === 314 /* SourceFile */;
+ return container !== void 0 && container.kind === 317 /* SourceFile */;
} else {
return false;
}
@@ -98696,7 +98900,7 @@ function transformSystemModule(context) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
const id = getOriginalNodeId(node);
currentSourceFile = node;
moduleInfo = moduleInfoMap[id];
@@ -98730,7 +98934,7 @@ function transformSystemModule(context) {
}
function substituteUnspecified(node) {
switch (node.kind) {
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return substituteShorthandPropertyAssignment(node);
}
return node;
@@ -98772,9 +98976,9 @@ function transformSystemModule(context) {
switch (node.kind) {
case 79 /* Identifier */:
return substituteExpressionIdentifier(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return substituteBinaryExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return substituteMetaProperty(node);
}
return node;
@@ -98837,7 +99041,7 @@ function transformSystemModule(context) {
const valueDeclaration = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name);
if (valueDeclaration) {
const exportContainer = resolver.getReferencedExportContainer(name, false);
- if (exportContainer && exportContainer.kind === 314 /* SourceFile */) {
+ if (exportContainer && exportContainer.kind === 317 /* SourceFile */) {
exportedNames = append(exportedNames, factory2.getDeclarationName(valueDeclaration));
}
exportedNames = addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[getOriginalNodeId(valueDeclaration)]);
@@ -98870,7 +99074,7 @@ function transformECMAScriptModule(context) {
const previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableEmitNotification(317 /* SourceFile */);
context.enableSubstitution(79 /* Identifier */);
let helperNameSubstitutions;
let currentSourceFile;
@@ -98921,11 +99125,11 @@ function transformECMAScriptModule(context) {
}
function visitor(node) {
switch (node.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return getEmitModuleKind(compilerOptions) >= 100 /* Node16 */ ? visitImportEqualsDeclaration(node) : void 0;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return visitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportDecl = node;
return visitExportDeclaration(exportDecl);
}
@@ -99087,8 +99291,8 @@ function transformNodeModule(context) {
const cjsOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(314 /* SourceFile */);
- context.enableEmitNotification(314 /* SourceFile */);
+ context.enableSubstitution(317 /* SourceFile */);
+ context.enableEmitNotification(317 /* SourceFile */);
let currentSourceFile;
return transformSourceFileOrBundle;
function onSubstituteNode(hint, node) {
@@ -99131,7 +99335,7 @@ function transformNodeModule(context) {
return result;
}
function transformSourceFileOrBundle(node) {
- return node.kind === 314 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
+ return node.kind === 317 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);
}
function transformBundle(node) {
return context.factory.createBundle(map(node.sourceFiles, transformSourceFile), node.prepends);
@@ -99161,7 +99365,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
function getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (isStatic(node)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1;
@@ -99178,7 +99382,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
function getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (isStatic(node)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1;
@@ -99186,7 +99390,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
}
}
function createGetSymbolAccessibilityDiagnosticForNode(node) {
- if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isAnnotationPropertyDeclaration(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
+ if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isAnnotationPropertyDeclaration(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node) || isOverloadPropertyDeclaration(node)) {
return getVariableDeclarationTypeVisibilityError;
} else if (isSetAccessor(node) || isGetAccessor(node)) {
return getAccessorDeclarationTypeVisibilityError;
@@ -99209,12 +99413,12 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
return Debug.assertNever(node, `Attempted to set a declaration diagnostic context for unhandled node kind: ${Debug.formatSyntaxKind(node.kind)}`);
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
- if (node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
+ if (node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
- } else if (node.kind === 171 /* PropertyDeclaration */ || node.kind === 211 /* PropertyAccessExpression */ || node.kind === 170 /* PropertySignature */ || node.kind === 168 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
+ } else if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 213 /* PropertyAccessExpression */ || node.kind === 171 /* PropertySignature */ || node.kind === 169 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
if (isStatic(node)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.kind === 264 /* ClassDeclaration */ || node.kind === 168 /* Parameter */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */ || node.kind === 169 /* Parameter */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1;
@@ -99231,7 +99435,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
}
function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) {
let diagnosticMessage;
- if (node.kind === 178 /* SetAccessor */) {
+ if (node.kind === 180 /* SetAccessor */) {
if (isStatic(node)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1;
} else {
@@ -99253,26 +99457,26 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
function getReturnTypeVisibilityError(symbolAccessibilityResult) {
let diagnosticMessage;
switch (node.kind) {
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isStatic(node)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0;
- } else if (node.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.kind === 266 /* ClassDeclaration */) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0;
} else {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;
}
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;
break;
default:
@@ -99293,29 +99497,29 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
}
function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
switch (node.parent.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;
- case 180 /* ConstructSignature */:
- case 185 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isStatic(node.parent)) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.parent.kind === 266 /* ClassDeclaration */) {
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
} else {
return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
- case 263 /* FunctionDeclaration */:
- case 184 /* FunctionType */:
+ case 265 /* FunctionDeclaration */:
+ case 186 /* FunctionType */:
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1;
- case 178 /* SetAccessor */:
- case 177 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 179 /* GetAccessor */:
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
default:
return Debug.fail(`Unknown parent for parameter: ${Debug.formatSyntaxKind(node.parent.kind)}`);
@@ -99324,37 +99528,37 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
function getTypeParameterConstraintVisibilityError() {
let diagnosticMessage;
switch (node.parent.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;
break;
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;
break;
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isStatic(node.parent)) {
diagnosticMessage = Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
- } else if (node.parent.parent.kind === 264 /* ClassDeclaration */) {
+ } else if (node.parent.parent.kind === 266 /* ClassDeclaration */) {
diagnosticMessage = Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
} else {
diagnosticMessage = Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
break;
- case 184 /* FunctionType */:
- case 263 /* FunctionDeclaration */:
+ case 186 /* FunctionType */:
+ case 265 /* FunctionDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
break;
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
break;
default:
@@ -99407,7 +99611,7 @@ function hasInternalAnnotation(range, currentSourceFile) {
}
function isInternalDeclaration(node, currentSourceFile) {
const parseTreeNode = getParseTreeNode(node);
- if (parseTreeNode && parseTreeNode.kind === 168 /* Parameter */) {
+ if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
const text = currentSourceFile.text;
@@ -99616,10 +99820,10 @@ function transformDeclarations(context) {
return result;
}
function transformRoot(node) {
- if (node.kind === 314 /* SourceFile */ && node.isDeclarationFile) {
+ if (node.kind === 317 /* SourceFile */ && node.isDeclarationFile) {
return node;
}
- if (node.kind === 315 /* Bundle */) {
+ if (node.kind === 318 /* Bundle */) {
isBundledEmit = true;
refs = new Map2();
libs2 = new Map2();
@@ -99656,7 +99860,7 @@ function transformDeclarations(context) {
return factory2.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated2), true, [], [], false, []);
}
), mapDefined(node.prepends, (prepend) => {
- if (prepend.kind === 317 /* InputFiles */) {
+ if (prepend.kind === 320 /* InputFiles */) {
const sourceFile = createUnparsedSourceFile(prepend, "dts", stripInternal);
hasNoDefaultLib = hasNoDefaultLib || !!sourceFile.hasNoDefaultLib;
collectReferences(sourceFile, refs);
@@ -99798,14 +100002,14 @@ function transformDeclarations(context) {
if (name.kind === 79 /* Identifier */) {
return name;
} else {
- if (name.kind === 207 /* ArrayBindingPattern */) {
+ if (name.kind === 209 /* ArrayBindingPattern */) {
return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement));
} else {
return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement));
}
}
function visitBindingElement(elem) {
- if (elem.kind === 233 /* OmittedExpression */) {
+ if (elem.kind === 235 /* OmittedExpression */) {
return elem;
}
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced) {
@@ -99865,14 +100069,14 @@ function transformDeclarations(context) {
if (type !== void 0 && isTypeReferenceNode(type) && type.typeName.virtual) {
return;
}
- const shouldUseResolverType = node.kind === 168 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node));
+ const shouldUseResolverType = node.kind === 169 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node));
if (type && !shouldUseResolverType) {
return visitNode(type, visitDeclarationSubtree);
}
if (!getParseTreeNode(node)) {
return type ? visitNode(type, visitDeclarationSubtree) : factory2.createKeywordTypeNode(132 /* AnyKeyword */);
}
- if (node.kind === 178 /* SetAccessor */) {
+ if (node.kind === 180 /* SetAccessor */) {
return factory2.createKeywordTypeNode(132 /* AnyKeyword */);
}
errorNameNode = node.name;
@@ -99881,10 +100085,10 @@ function transformDeclarations(context) {
oldDiag = getSymbolAccessibilityDiagnostic;
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(node);
}
- if (node.kind === 261 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
+ if (node.kind === 263 /* VariableDeclaration */ || node.kind === 210 /* BindingElement */) {
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
}
- if (node.kind === 168 /* Parameter */ || node.kind === 171 /* PropertyDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 172 /* AnnotationPropertyDeclaration */) {
+ if (node.kind === 169 /* Parameter */ || node.kind === 172 /* PropertyDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 173 /* AnnotationPropertyDeclaration */ || node.kind === 174 /* OverloadPropertyDeclaration */) {
if (isPropertySignature(node) || !node.initializer)
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType));
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
@@ -99901,23 +100105,23 @@ function transformDeclarations(context) {
function isDeclarationAndNotVisible(node) {
node = getParseTreeNode(node);
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return !resolver.isDeclarationVisible(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return !getBindingNameVisible(node);
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
return false;
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return true;
}
return false;
@@ -99982,7 +100186,7 @@ function transformDeclarations(context) {
return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree);
}
function isEnclosingDeclaration(node) {
- return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isStructDeclaration(node) || isAnnotationDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node);
+ return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isStructDeclaration(node) || isAnnotationDeclaration(node) || isOverloadDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node);
}
function checkEntityNameVisibility(entityName, enclosingDeclaration2) {
const visibilityResult = resolver.isEntityNameVisible(entityName, enclosingDeclaration2);
@@ -99998,7 +100202,7 @@ function transformDeclarations(context) {
function rewriteModuleSpecifier(parent2, input) {
if (!input)
return void 0;
- resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 270 /* ModuleDeclaration */ && parent2.kind !== 205 /* ImportType */;
+ resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 273 /* ModuleDeclaration */ && parent2.kind !== 207 /* ImportType */;
if (isStringLiteralLike(input)) {
if (isBundledEmit) {
const newName = getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent2);
@@ -100017,7 +100221,7 @@ function transformDeclarations(context) {
function transformImportEqualsDeclaration(decl) {
if (!resolver.isDeclarationVisible(decl))
return;
- if (decl.moduleReference.kind === 286 /* ExternalModuleReference */) {
+ if (decl.moduleReference.kind === 289 /* ExternalModuleReference */) {
const specifier = getExternalModuleImportEqualsDeclarationExpression(decl);
return factory2.updateImportEqualsDeclaration(
decl,
@@ -100053,7 +100257,7 @@ function transformDeclarations(context) {
void 0
), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
}
- if (decl.importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (decl.importClause.namedBindings.kind === 280 /* NamespaceImport */) {
const namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : void 0;
return visibleDefaultBinding || namedBindings ? factory2.updateImportDeclaration(decl, decl.modifiers, factory2.updateImportClause(
decl.importClause,
@@ -100164,7 +100368,7 @@ function transformDeclarations(context) {
const oldDiag = getSymbolAccessibilityDiagnostic;
const canProduceDiagnostic = canProduceDiagnostics(input);
const oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
- let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 187 /* TypeLiteral */ || input.kind === 200 /* MappedType */) && input.parent.kind !== 268 /* TypeAliasDeclaration */;
+ let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 189 /* TypeLiteral */ || input.kind === 202 /* MappedType */) && input.parent.kind !== 271 /* TypeAliasDeclaration */;
if (isMethodDeclaration(input) || isMethodSignature(input)) {
if (hasEffectiveModifier(input, 8 /* Private */)) {
if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input)
@@ -100183,26 +100387,26 @@ function transformDeclarations(context) {
}
if (isProcessedComponent(input)) {
switch (input.kind) {
- case 234 /* ExpressionWithTypeArguments */: {
+ case 236 /* ExpressionWithTypeArguments */: {
if (isEntityName(input.expression) || isEntityNameExpression(input.expression)) {
checkEntityNameVisibility(input.expression, enclosingDeclaration);
}
const node = visitEachChild(input, visitDeclarationSubtree, context);
return cleanup(factory2.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments));
}
- case 183 /* TypeReference */: {
+ case 185 /* TypeReference */: {
checkEntityNameVisibility(input.typeName, enclosingDeclaration);
const node = visitEachChild(input, visitDeclarationSubtree, context);
return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments));
}
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return cleanup(factory2.updateConstructSignature(
input,
ensureTypeParams(input, input.typeParameters),
updateParamsList(input, input.parameters),
ensureType(input, input.type)
));
- case 176 /* Constructor */: {
+ case 178 /* Constructor */: {
const ctor = factory2.createConstructorDeclaration(
ensureModifiers(input),
updateParamsList(input, input.parameters, 0 /* None */),
@@ -100210,7 +100414,7 @@ function transformDeclarations(context) {
);
return cleanup(ctor);
}
- case 174 /* MethodDeclaration */: {
+ case 176 /* MethodDeclaration */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -100228,7 +100432,7 @@ function transformDeclarations(context) {
);
return cleanup(sig);
}
- case 177 /* GetAccessor */: {
+ case 179 /* GetAccessor */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -100242,7 +100446,7 @@ function transformDeclarations(context) {
void 0
));
}
- case 178 /* SetAccessor */: {
+ case 180 /* SetAccessor */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -100254,7 +100458,7 @@ function transformDeclarations(context) {
void 0
));
}
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -100267,14 +100471,14 @@ function transformDeclarations(context) {
ensureType(input, input.type),
ensureNoInitializer(input)
));
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return cleanup(factory2.updateAnnotationPropertyDeclaration(
input,
input.name,
ensureType(input, input.type),
input.initializer
));
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -100285,7 +100489,18 @@ function transformDeclarations(context) {
input.questionToken,
ensureType(input, input.type)
));
- case 173 /* MethodSignature */: {
+ case 174 /* OverloadPropertyDeclaration */:
+ if (isPrivateIdentifier(input.name)) {
+ return cleanup(void 0);
+ }
+ return cleanup(factory2.updateOverloadPropertyDeclaration(
+ input,
+ ensureModifiers(input),
+ input.name,
+ input.questionToken,
+ ensureType(input, input.type)
+ ));
+ case 175 /* MethodSignature */: {
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
}
@@ -100299,7 +100514,7 @@ function transformDeclarations(context) {
ensureType(input, input.type)
));
}
- case 179 /* CallSignature */: {
+ case 181 /* CallSignature */: {
return cleanup(factory2.updateCallSignature(
input,
ensureTypeParams(input, input.typeParameters),
@@ -100307,7 +100522,7 @@ function transformDeclarations(context) {
ensureType(input, input.type)
));
}
- case 181 /* IndexSignature */: {
+ case 183 /* IndexSignature */: {
return cleanup(factory2.updateIndexSignature(
input,
ensureModifiers(input),
@@ -100315,7 +100530,7 @@ function transformDeclarations(context) {
visitNode(input.type, visitDeclarationSubtree) || factory2.createKeywordTypeNode(132 /* AnyKeyword */)
));
}
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
if (isBindingPattern(input.name)) {
return recreateBindingPattern(input.name);
}
@@ -100323,13 +100538,13 @@ function transformDeclarations(context) {
suppressNewDiagnosticContexts = true;
return cleanup(factory2.updateVariableDeclaration(input, input.name, void 0, ensureType(input, input.type), ensureNoInitializer(input)));
}
- case 167 /* TypeParameter */: {
+ case 168 /* TypeParameter */: {
if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) {
return cleanup(factory2.updateTypeParameterDeclaration(input, input.modifiers, input.name, void 0, void 0));
}
return cleanup(visitEachChild(input, visitDeclarationSubtree, context));
}
- case 194 /* ConditionalType */: {
+ case 196 /* ConditionalType */: {
const checkType = visitNode(input.checkType, visitDeclarationSubtree);
const extendsType = visitNode(input.extendsType, visitDeclarationSubtree);
const oldEnclosingDecl = enclosingDeclaration;
@@ -100339,13 +100554,13 @@ function transformDeclarations(context) {
const falseType = visitNode(input.falseType, visitDeclarationSubtree);
return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
}
- case 184 /* FunctionType */: {
+ case 186 /* FunctionType */: {
return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
- case 185 /* ConstructorType */: {
+ case 187 /* ConstructorType */: {
return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
- case 205 /* ImportType */: {
+ case 207 /* ImportType */: {
if (!isLiteralImportTypeNode(input))
return cleanup(input);
return cleanup(factory2.updateImportTypeNode(
@@ -100385,7 +100600,7 @@ function transformDeclarations(context) {
}
}
function isPrivateMethodTypeParameter(node) {
- return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 8 /* Private */);
+ return node.parent.kind === 176 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 8 /* Private */);
}
function visitDeclarationStatements(input) {
if (!isPreservedDeclarationStatement(input)) {
@@ -100394,7 +100609,7 @@ function transformDeclarations(context) {
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 281 /* ExportDeclaration */: {
+ case 284 /* ExportDeclaration */: {
if (isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
}
@@ -100408,7 +100623,7 @@ function transformDeclarations(context) {
getResolutionModeOverrideForClause(input.assertClause) ? input.assertClause : void 0
);
}
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
if (isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
}
@@ -100450,10 +100665,10 @@ function transformDeclarations(context) {
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 274 /* ImportEqualsDeclaration */: {
+ case 277 /* ImportEqualsDeclaration */: {
return transformImportEqualsDeclaration(input);
}
- case 275 /* ImportDeclaration */: {
+ case 278 /* ImportDeclaration */: {
return transformImportDeclaration(input);
}
}
@@ -100473,7 +100688,7 @@ function transformDeclarations(context) {
}
const previousNeedsDeclare = needsDeclare;
switch (input.kind) {
- case 268 /* TypeAliasDeclaration */: {
+ case 271 /* TypeAliasDeclaration */: {
needsDeclare = false;
const clean2 = cleanup(factory2.updateTypeAliasDeclaration(
input,
@@ -100488,7 +100703,7 @@ function transformDeclarations(context) {
needsDeclare = previousNeedsDeclare;
return clean2;
}
- case 267 /* InterfaceDeclaration */: {
+ case 270 /* InterfaceDeclaration */: {
return cleanup(factory2.updateInterfaceDeclaration(
input,
ensureModifiers(input),
@@ -100498,7 +100713,7 @@ function transformDeclarations(context) {
visitNodes2(input.members, visitDeclarationSubtree)
));
}
- case 263 /* FunctionDeclaration */: {
+ case 265 /* FunctionDeclaration */: {
const clean2 = cleanup(factory2.updateFunctionDeclaration(
input,
ensureModifiers(input),
@@ -100588,10 +100803,10 @@ function transformDeclarations(context) {
return clean2;
}
}
- case 270 /* ModuleDeclaration */: {
+ case 273 /* ModuleDeclaration */: {
needsDeclare = false;
const inner = input.body;
- if (inner && inner.kind === 271 /* ModuleBlock */) {
+ if (inner && inner.kind === 274 /* ModuleBlock */) {
const oldNeedsScopeFix = needsScopeFixMarker;
const oldHasScopeFix = resultHasScopeMarker;
resultHasScopeMarker = false;
@@ -100635,7 +100850,7 @@ function transformDeclarations(context) {
));
}
}
- case 265 /* StructDeclaration */: {
+ case 267 /* StructDeclaration */: {
errorNameNode = input.name;
errorFallbackNode = input;
const decorators = ensureEtsDecorators(input, host);
@@ -100652,7 +100867,7 @@ function transformDeclarations(context) {
members
));
}
- case 266 /* AnnotationDeclaration */: {
+ case 268 /* AnnotationDeclaration */: {
errorNameNode = input.name;
errorFallbackNode = input;
const modifiers = factory2.createNodeArray(ensureModifiers(input));
@@ -100665,7 +100880,20 @@ function transformDeclarations(context) {
members
));
}
- case 264 /* ClassDeclaration */: {
+ case 269 /* OverloadDeclaration */: {
+ errorNameNode = input.name;
+ errorFallbackNode = input;
+ const modifiers = factory2.createNodeArray(ensureModifiers(input));
+ const memberNodes = visitNodes2(input.members, visitDeclarationSubtree);
+ const members = factory2.createNodeArray(memberNodes);
+ return cleanup(factory2.updateOverloadDeclaration(
+ input,
+ modifiers,
+ input.name,
+ members
+ ));
+ }
+ case 266 /* ClassDeclaration */: {
errorNameNode = input.name;
errorFallbackNode = input;
const modifiers = factory2.createNodeArray(ensureModifiers(input));
@@ -100768,10 +100996,10 @@ function transformDeclarations(context) {
));
}
}
- case 244 /* VariableStatement */: {
+ case 246 /* VariableStatement */: {
return cleanup(transformVariableStatement(input));
}
- case 269 /* EnumDeclaration */: {
+ case 272 /* EnumDeclaration */: {
return cleanup(factory2.updateEnumDeclaration(input, factory2.createNodeArray(ensureModifiers(input)), input.name, factory2.createNodeArray(mapDefined(input.members, (m) => {
if (shouldStripInternal(m))
return;
@@ -100787,7 +101015,7 @@ function transformDeclarations(context) {
if (canProdiceDiagnostic) {
getSymbolAccessibilityDiagnostic = oldDiag;
}
- if (input.kind === 270 /* ModuleDeclaration */) {
+ if (input.kind === 273 /* ModuleDeclaration */) {
needsDeclare = previousNeedsDeclare;
}
if (node === input) {
@@ -100810,7 +101038,7 @@ function transformDeclarations(context) {
return flatten(mapDefined(d.elements, (e) => recreateBindingElement(e)));
}
function recreateBindingElement(e) {
- if (e.kind === 233 /* OmittedExpression */) {
+ if (e.kind === 235 /* OmittedExpression */) {
return;
}
if (e.name) {
@@ -100859,7 +101087,7 @@ function transformDeclarations(context) {
function ensureModifierFlags(node) {
let mask2 = 258047 /* All */ ^ (4 /* Public */ | 512 /* Async */ | 16384 /* Override */);
let additions = needsDeclare && !isAlwaysType(node) ? 2 /* Ambient */ : 0 /* None */;
- const parentIsFile = node.parent.kind === 314 /* SourceFile */;
+ const parentIsFile = node.parent.kind === 317 /* SourceFile */;
if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) {
mask2 ^= 2 /* Ambient */;
additions = 0 /* None */;
@@ -100885,7 +101113,7 @@ function transformDeclarations(context) {
}
}
function isAlwaysType(node) {
- if (node.kind === 267 /* InterfaceDeclaration */) {
+ if (node.kind === 270 /* InterfaceDeclaration */) {
return true;
}
return false;
@@ -100905,60 +101133,62 @@ function maskModifierFlags(node, modifierMask = 258047 /* All */ ^ 4 /* Public *
}
function getTypeAnnotationFromAccessor(accessor) {
if (accessor) {
- return accessor.kind === 177 /* GetAccessor */ ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : void 0;
+ return accessor.kind === 179 /* GetAccessor */ ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : void 0;
}
}
function canHaveLiteralInitializer(node) {
switch (node.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return !hasEffectiveModifier(node, 8 /* Private */);
- case 168 /* Parameter */:
- case 261 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 263 /* VariableDeclaration */:
return true;
}
return false;
}
function isPreservedDeclarationStatement(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 244 /* VariableStatement */:
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
+ case 265 /* FunctionDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 246 /* VariableStatement */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
return true;
}
return false;
}
function isProcessedComponent(node) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 181 /* IndexSignature */:
- case 261 /* VariableDeclaration */:
- case 167 /* TypeParameter */:
- case 234 /* ExpressionWithTypeArguments */:
- case 183 /* TypeReference */:
- case 194 /* ConditionalType */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 205 /* ImportType */:
+ case 182 /* ConstructSignature */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 183 /* IndexSignature */:
+ case 263 /* VariableDeclaration */:
+ case 168 /* TypeParameter */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 185 /* TypeReference */:
+ case 196 /* ConditionalType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 207 /* ImportType */:
return true;
}
return false;
@@ -101074,7 +101304,7 @@ function noEmitNotification(hint, node, callback) {
}
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
var _a2, _b;
- const enabledSyntaxKindFeatures = new Array(364 /* Count */);
+ const enabledSyntaxKindFeatures = new Array(367 /* Count */);
let lexicalEnvironmentVariableDeclarations;
let lexicalEnvironmentFunctionDeclarations;
let lexicalEnvironmentStatements;
@@ -101153,7 +101383,7 @@ function transformNodes(resolver, host, factory2, options, nodes, transformers,
state = 1 /* Initialized */;
const transformed = [];
for (const node of nodes) {
- (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Emit, "transformNodes", node.kind === 314 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
+ (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Emit, "transformNodes", node.kind === 317 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
PerformanceDotting.start("transformRoot");
transformed.push((allowDtsFiles ? transformation : transformRoot)(node));
PerformanceDotting.stop("transformRoot");
@@ -101470,7 +101700,7 @@ function getOutputPathsForBundle(options, forceDtsPaths) {
}
function getOutputPathsFor(sourceFile, host, forceDtsPaths) {
const options = host.getCompilerOptions();
- if (sourceFile.kind === 315 /* Bundle */) {
+ if (sourceFile.kind === 318 /* Bundle */) {
return getOutputPathsForBundle(options, forceDtsPaths);
} else {
const ownOutputFilePath = getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile.fileName, options));
@@ -101843,8 +102073,8 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
}
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform2, printer3, mapOptions) {
const sourceFileOrBundle = transform2.transformed[0];
- const bundle = sourceFileOrBundle.kind === 315 /* Bundle */ ? sourceFileOrBundle : void 0;
- const sourceFile = sourceFileOrBundle.kind === 314 /* SourceFile */ ? sourceFileOrBundle : void 0;
+ const bundle = sourceFileOrBundle.kind === 318 /* Bundle */ ? sourceFileOrBundle : void 0;
+ const sourceFile = sourceFileOrBundle.kind === 317 /* SourceFile */ ? sourceFileOrBundle : void 0;
const sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];
let sourceMapGenerator;
if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) {
@@ -101898,7 +102128,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
writer.clear();
}
function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
- return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 314 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
+ return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 317 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
}
function getSourceRoot(mapOptions) {
const sourceRoot = normalizeSlashes(mapOptions.sourceRoot || "");
@@ -102257,11 +102487,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
break;
}
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return printFile(node);
- case 315 /* Bundle */:
+ case 318 /* Bundle */:
return printBundle(node);
- case 316 /* UnparsedSource */:
+ case 319 /* UnparsedSource */:
return printUnparsedSource(node);
}
writeNode(hint, node, sourceFile, beginPrint());
@@ -102575,300 +102805,304 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return emitIdentifier(node);
case 80 /* PrivateIdentifier */:
return emitPrivateIdentifier(node);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return emitQualifiedName(node);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return emitComputedPropertyName(node);
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return emitTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return emitParameter(node);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return emitDecorator(node);
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
return emitPropertySignature(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return emitPropertyDeclaration(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return emitAnnotationPropertyDeclaration(node);
- case 173 /* MethodSignature */:
+ case 174 /* OverloadPropertyDeclaration */:
+ return emitOverloadPropertyDeclaration(node);
+ case 175 /* MethodSignature */:
return emitMethodSignature(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return emitMethodDeclaration(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return emitClassStaticBlockDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return emitConstructor(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return emitAccessorDeclaration(node);
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return emitCallSignature(node);
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return emitConstructSignature(node);
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return emitIndexSignature(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return emitTypePredicate(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return emitTypeReference(node);
- case 184 /* FunctionType */:
+ case 186 /* FunctionType */:
return emitFunctionType(node);
- case 185 /* ConstructorType */:
+ case 187 /* ConstructorType */:
return emitConstructorType(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return emitTypeQuery(node);
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return emitTypeLiteral(node);
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return emitArrayType(node);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
return emitTupleType(node);
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return emitOptionalType(node);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return emitUnionType(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return emitIntersectionType(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return emitConditionalType(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return emitInferType(node);
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return emitParenthesizedType(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return emitExpressionWithTypeArguments(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return emitThisType();
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return emitTypeOperator(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return emitIndexedAccessType(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return emitMappedType(node);
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return emitLiteralType(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return emitNamedTupleMember(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return emitTemplateType(node);
- case 204 /* TemplateLiteralTypeSpan */:
+ case 206 /* TemplateLiteralTypeSpan */:
return emitTemplateTypeSpan(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return emitImportTypeNode(node);
- case 206 /* ObjectBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
return emitObjectBindingPattern(node);
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return emitArrayBindingPattern(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return emitBindingElement(node);
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return emitTemplateSpan(node);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return emitSemicolonClassElement();
- case 242 /* Block */:
+ case 244 /* Block */:
return emitBlock(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return emitVariableStatement(node);
- case 243 /* EmptyStatement */:
+ case 245 /* EmptyStatement */:
return emitEmptyStatement(false);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return emitExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return emitIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return emitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return emitWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return emitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return emitForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return emitForOfStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return emitContinueStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return emitBreakStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return emitReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return emitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return emitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return emitLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return emitThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return emitTryStatement(node);
- case 260 /* DebuggerStatement */:
+ case 262 /* DebuggerStatement */:
return emitDebuggerStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return emitVariableDeclaration(node);
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return emitVariableDeclarationList(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return emitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return emitClassOrStructDeclaration(node);
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return emitClassOrStructDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return emitAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return emitOverloadDeclaration(node);
+ case 270 /* InterfaceDeclaration */:
return emitInterfaceDeclaration(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return emitTypeAliasDeclaration(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return emitEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return emitModuleDeclaration(node);
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return emitModuleBlock(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return emitCaseBlock(node);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return emitNamespaceExportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return emitImportEqualsDeclaration(node);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return emitImportDeclaration(node);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return emitImportClause(node);
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return emitNamespaceImport(node);
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
return emitNamespaceExport(node);
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
return emitNamedImports(node);
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return emitImportSpecifier(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return emitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return emitExportDeclaration(node);
- case 282 /* NamedExports */:
+ case 285 /* NamedExports */:
return emitNamedExports(node);
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return emitExportSpecifier(node);
- case 302 /* AssertClause */:
+ case 305 /* AssertClause */:
return emitAssertClause(node);
- case 303 /* AssertEntry */:
+ case 306 /* AssertEntry */:
return emitAssertEntry(node);
- case 285 /* MissingDeclaration */:
+ case 288 /* MissingDeclaration */:
return;
- case 286 /* ExternalModuleReference */:
+ case 289 /* ExternalModuleReference */:
return emitExternalModuleReference(node);
case 11 /* JsxText */:
return emitJsxText(node);
- case 289 /* JsxOpeningElement */:
- case 292 /* JsxOpeningFragment */:
+ case 292 /* JsxOpeningElement */:
+ case 295 /* JsxOpeningFragment */:
return emitJsxOpeningElementOrFragment(node);
- case 290 /* JsxClosingElement */:
- case 293 /* JsxClosingFragment */:
+ case 293 /* JsxClosingElement */:
+ case 296 /* JsxClosingFragment */:
return emitJsxClosingElementOrFragment(node);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return emitJsxAttribute(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return emitJsxAttributes(node);
- case 296 /* JsxSpreadAttribute */:
+ case 299 /* JsxSpreadAttribute */:
return emitJsxSpreadAttribute(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return emitJsxExpression(node);
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
return emitCaseClause(node);
- case 299 /* DefaultClause */:
+ case 302 /* DefaultClause */:
return emitDefaultClause(node);
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return emitHeritageClause(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return emitCatchClause(node);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return emitPropertyAssignment(node);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return emitShorthandPropertyAssignment(node);
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return emitSpreadAssignment(node);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return emitEnumMember(node);
- case 309 /* UnparsedPrologue */:
+ case 312 /* UnparsedPrologue */:
return writeUnparsedNode(node);
- case 316 /* UnparsedSource */:
- case 310 /* UnparsedPrepend */:
+ case 319 /* UnparsedSource */:
+ case 313 /* UnparsedPrepend */:
return emitUnparsedSourceOrPrepend(node);
- case 311 /* UnparsedText */:
- case 312 /* UnparsedInternalText */:
+ case 314 /* UnparsedText */:
+ case 315 /* UnparsedInternalText */:
return emitUnparsedTextLike(node);
- case 313 /* UnparsedSyntheticReference */:
+ case 316 /* UnparsedSyntheticReference */:
return emitUnparsedSyntheticReference(node);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return emitSourceFile(node);
- case 315 /* Bundle */:
+ case 318 /* Bundle */:
return Debug.fail("Bundles should be printed using printBundle");
- case 317 /* InputFiles */:
+ case 320 /* InputFiles */:
return Debug.fail("InputFiles should not be printed");
- case 318 /* JSDocTypeExpression */:
+ case 321 /* JSDocTypeExpression */:
return emitJSDocTypeExpression(node);
- case 319 /* JSDocNameReference */:
+ case 322 /* JSDocNameReference */:
return emitJSDocNameReference(node);
- case 321 /* JSDocAllType */:
+ case 324 /* JSDocAllType */:
return writePunctuation("*");
- case 322 /* JSDocUnknownType */:
+ case 325 /* JSDocUnknownType */:
return writePunctuation("?");
- case 323 /* JSDocNullableType */:
+ case 326 /* JSDocNullableType */:
return emitJSDocNullableType(node);
- case 324 /* JSDocNonNullableType */:
+ case 327 /* JSDocNonNullableType */:
return emitJSDocNonNullableType(node);
- case 325 /* JSDocOptionalType */:
+ case 328 /* JSDocOptionalType */:
return emitJSDocOptionalType(node);
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return emitJSDocFunctionType(node);
- case 191 /* RestType */:
- case 327 /* JSDocVariadicType */:
+ case 193 /* RestType */:
+ case 330 /* JSDocVariadicType */:
return emitRestOrJSDocVariadicType(node);
- case 328 /* JSDocNamepathType */:
+ case 331 /* JSDocNamepathType */:
return;
- case 329 /* JSDoc */:
+ case 332 /* JSDoc */:
return emitJSDoc(node);
- case 331 /* JSDocTypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
return emitJSDocTypeLiteral(node);
- case 332 /* JSDocSignature */:
+ case 335 /* JSDocSignature */:
return emitJSDocSignature(node);
- case 336 /* JSDocTag */:
- case 341 /* JSDocClassTag */:
- case 346 /* JSDocOverrideTag */:
+ case 339 /* JSDocTag */:
+ case 344 /* JSDocClassTag */:
+ case 349 /* JSDocOverrideTag */:
return emitJSDocSimpleTag(node);
- case 337 /* JSDocAugmentsTag */:
- case 338 /* JSDocImplementsTag */:
+ case 340 /* JSDocAugmentsTag */:
+ case 341 /* JSDocImplementsTag */:
return emitJSDocHeritageTag(node);
- case 339 /* JSDocAuthorTag */:
- case 340 /* JSDocDeprecatedTag */:
+ case 342 /* JSDocAuthorTag */:
+ case 343 /* JSDocDeprecatedTag */:
return;
- case 342 /* JSDocPublicTag */:
- case 343 /* JSDocPrivateTag */:
- case 344 /* JSDocProtectedTag */:
- case 345 /* JSDocReadonlyTag */:
+ case 345 /* JSDocPublicTag */:
+ case 346 /* JSDocPrivateTag */:
+ case 347 /* JSDocProtectedTag */:
+ case 348 /* JSDocReadonlyTag */:
return;
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
return emitJSDocCallbackTag(node);
- case 349 /* JSDocParameterTag */:
- case 356 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
+ case 359 /* JSDocPropertyTag */:
return emitJSDocPropertyLikeTag(node);
- case 348 /* JSDocEnumTag */:
- case 350 /* JSDocReturnTag */:
- case 351 /* JSDocThisTag */:
- case 352 /* JSDocTypeTag */:
+ case 351 /* JSDocEnumTag */:
+ case 353 /* JSDocReturnTag */:
+ case 354 /* JSDocThisTag */:
+ case 355 /* JSDocTypeTag */:
return emitJSDocSimpleTypedTag(node);
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return emitJSDocTemplateTag(node);
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return emitJSDocTypedefTag(node);
- case 355 /* JSDocSeeTag */:
+ case 358 /* JSDocSeeTag */:
return emitJSDocSeeTag(node);
- case 358 /* NotEmittedStatement */:
- case 362 /* EndOfDeclarationMarker */:
- case 361 /* MergeDeclarationMarker */:
+ case 361 /* NotEmittedStatement */:
+ case 365 /* EndOfDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return;
}
if (isExpression(node)) {
@@ -102897,84 +103131,84 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return emitIdentifier(node);
case 80 /* PrivateIdentifier */:
return emitPrivateIdentifier(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return emitArrayLiteralExpression(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return emitObjectLiteralExpression(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return emitPropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return emitElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return emitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return emitNewExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return emitTaggedTemplateExpression(node);
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return emitTypeAssertionExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return emitParenthesizedExpression(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return emitFunctionExpression(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return emitArrowFunction(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return emitDeleteExpression(node);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return emitTypeOfExpression(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return emitVoidExpression(node);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return emitAwaitExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return emitPrefixUnaryExpression(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return emitPostfixUnaryExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return emitBinaryExpression(node);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return emitConditionalExpression(node);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return emitTemplateExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return emitYieldExpression(node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return emitSpreadElement(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return emitClassExpression(node);
- case 233 /* OmittedExpression */:
+ case 235 /* OmittedExpression */:
return;
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return emitAsExpression(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return emitNonNullExpression(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return emitExpressionWithTypeArguments(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return emitSatisfiesExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return emitMetaProperty(node);
- case 238 /* SyntheticExpression */:
+ case 240 /* SyntheticExpression */:
return Debug.fail("SyntheticExpression should never be printed.");
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return emitJsxElement(node);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return emitJsxSelfClosingElement(node);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return emitJsxFragment(node);
- case 357 /* SyntaxList */:
+ case 360 /* SyntaxList */:
return Debug.fail("SyntaxList should not be printed");
- case 358 /* NotEmittedStatement */:
+ case 361 /* NotEmittedStatement */:
return;
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return emitPartiallyEmittedExpression(node);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return emitCommaList(node);
- case 361 /* MergeDeclarationMarker */:
- case 362 /* EndOfDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return;
- case 363 /* SyntheticReferenceExpression */:
+ case 366 /* SyntheticReferenceExpression */:
return Debug.fail("SyntheticReferenceExpression should not be printed");
}
}
@@ -103025,7 +103259,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitHelpers(node) {
let helpersEmitted = false;
- const bundle = node.kind === 315 /* Bundle */ ? node : void 0;
+ const bundle = node.kind === 318 /* Bundle */ ? node : void 0;
if (bundle && moduleKind === 0 /* None */) {
return;
}
@@ -103096,7 +103330,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
updateOrPushBundleFileTextLike(
pos,
writer.getTextPos(),
- unparsed.kind === 311 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */
+ unparsed.kind === 314 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */
);
}
}
@@ -103127,7 +103361,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitTabStop(hint, node, snippet) {
Debug.assert(
- node.kind === 243 /* EmptyStatement */,
+ node.kind === 245 /* EmptyStatement */,
`A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`
);
Debug.assert(
@@ -103183,7 +103417,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(node.dotDotDotToken);
emitNodeWithWriter(node.name, writeParameter);
emit(node.questionToken);
- if (node.parent && node.parent.kind === 326 /* JSDocFunctionType */ && !node.name) {
+ if (node.parent && node.parent.kind === 329 /* JSDocFunctionType */ && !node.name) {
emit(node.type);
} else {
emitTypeAnnotation(node.type);
@@ -103201,6 +103435,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitTypeAnnotation(node.type);
writeTrailingSemicolon();
}
+ function emitOverloadPropertyDeclaration(node) {
+ emitModifiers(node, node.modifiers);
+ emitNodeWithWriter(node.name, writeProperty);
+ emit(node.questionToken);
+ }
function emitPropertyDeclaration(node) {
emitDecoratorsAndModifiers(node, node.modifiers);
emit(node.name);
@@ -103245,7 +103484,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitAccessorDeclaration(node) {
emitDecoratorsAndModifiers(node, node.modifiers);
- writeKeyword(node.kind === 177 /* GetAccessor */ ? "get" : "set");
+ writeKeyword(node.kind === 179 /* GetAccessor */ ? "get" : "set");
writeSpace();
emit(node.name);
emitSignatureAndBody(node, emitSignatureHead);
@@ -103674,7 +103913,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function shouldEmitWhitespaceBeforeOperand(node) {
const operand = node.operand;
- return operand.kind === 225 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */));
+ return operand.kind === 227 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */));
}
function emitPostfixUnaryExpression(node) {
emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary);
@@ -103870,7 +104109,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (node.elseStatement) {
writeLineOrSpace(node, node.thenStatement, node.elseStatement);
emitTokenWithComment(92 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node);
- if (node.elseStatement.kind === 246 /* IfStatement */) {
+ if (node.elseStatement.kind === 248 /* IfStatement */) {
writeSpace();
emit(node.elseStatement);
} else {
@@ -103931,7 +104170,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);
emitForBinding(node.initializer);
writeSpace();
- emitTokenWithComment(164 /* OfKeyword */, node.initializer.end, writeKeyword, node);
+ emitTokenWithComment(165 /* OfKeyword */, node.initializer.end, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);
@@ -103939,7 +104178,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitForBinding(node) {
if (node !== void 0) {
- if (node.kind === 262 /* VariableDeclarationList */) {
+ if (node.kind === 264 /* VariableDeclarationList */) {
emit(node);
} else {
emitExpression(node);
@@ -103975,7 +104214,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
pos = writeTokenText(token, writer2, pos);
if (isSimilarNode && contextNode.end !== pos) {
- const isJsxExprContext = contextNode.kind === 297 /* JsxExpression */;
+ const isJsxExprContext = contextNode.kind === 300 /* JsxExpression */;
emitTrailingCommentsOfPosition(pos, !isJsxExprContext, isJsxExprContext);
}
return pos;
@@ -104234,6 +104473,25 @@ function createPrinter(printerOptions = {}, handlers = {}) {
decreaseIndent();
}
}
+ function emitOverloadDeclaration(node) {
+ emitDecoratorsAndModifiers(node, node.modifiers);
+ writeKeyword("overload");
+ if (node.name) {
+ writeSpace();
+ emitIdentifierName(node.name);
+ }
+ const indentedFlag = getEmitFlags(node) & 65536 /* Indented */;
+ if (indentedFlag) {
+ increaseIndent();
+ }
+ writeSpace();
+ writePunctuation("{");
+ emitList(node, node.members, 145 /* EnumMembers */);
+ writePunctuation("}");
+ if (indentedFlag) {
+ decreaseIndent();
+ }
+ }
function emitTypeAliasDeclaration(node) {
if (isSendableFunctionOrType(node, true)) {
emitDecorators(node, node.illegalDecorators);
@@ -104631,7 +104889,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
}
if (node.tags) {
- if (node.tags.length === 1 && node.tags[0].kind === 352 /* JSDocTypeTag */ && !node.comment) {
+ if (node.tags.length === 1 && node.tags[0].kind === 355 /* JSDocTypeTag */ && !node.comment) {
writeSpace();
emit(node.tags[0]);
} else {
@@ -104675,7 +104933,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitJSDocTypedefTag(tag) {
emitJSDocTagName(tag.tagName);
if (tag.typeExpression) {
- if (tag.typeExpression.kind === 318 /* JSDocTypeExpression */) {
+ if (tag.typeExpression.kind === 321 /* JSDocTypeExpression */) {
emitJSDocTypeExpression(tag.typeExpression);
} else {
writeSpace();
@@ -104693,7 +104951,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(tag.fullName);
}
emitJSDocComment(tag.comment);
- if (tag.typeExpression && tag.typeExpression.kind === 331 /* JSDocTypeLiteral */) {
+ if (tag.typeExpression && tag.typeExpression.kind === 334 /* JSDocTypeLiteral */) {
emitJSDocTypeLiteral(tag.typeExpression);
}
}
@@ -105509,7 +105767,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile));
}
function skipSynthesizedParentheses(node) {
- while (node.kind === 217 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) {
+ while (node.kind === 219 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) {
node = node.expression;
}
return node;
@@ -105579,84 +105837,84 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (!node)
return;
switch (node.kind) {
- case 242 /* Block */:
+ case 244 /* Block */:
forEach(node.statements, generateNames);
break;
- case 257 /* LabeledStatement */:
- case 255 /* WithStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 259 /* LabeledStatement */:
+ case 257 /* WithStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
generateNames(node.statement);
break;
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
generateNames(node.thenStatement);
generateNames(node.elseStatement);
break;
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
generateNames(node.initializer);
generateNames(node.statement);
break;
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
generateNames(node.caseBlock);
break;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
forEach(node.clauses, generateNames);
break;
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
forEach(node.statements, generateNames);
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
generateNames(node.tryBlock);
generateNames(node.catchClause);
generateNames(node.finallyBlock);
break;
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
generateNames(node.variableDeclaration);
generateNames(node.block);
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
generateNames(node.declarationList);
break;
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
forEach(node.declarations, generateNames);
break;
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
generateNameIfNeeded(node.name);
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
generateNameIfNeeded(node.name);
if (getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) {
forEach(node.parameters, generateNames);
generateNames(node.body);
}
break;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
forEach(node.elements, generateNames);
break;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
generateNames(node.importClause);
break;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
generateNameIfNeeded(node.name);
generateNames(node.namedBindings);
break;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
generateNameIfNeeded(node.name);
break;
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
generateNameIfNeeded(node.name);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
forEach(node.elements, generateNames);
break;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
generateNameIfNeeded(node.propertyName || node.name);
break;
}
@@ -105665,13 +105923,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (!node)
return;
switch (node.kind) {
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
generateNameIfNeeded(node.name);
break;
}
@@ -105845,27 +106103,27 @@ function createPrinter(printerOptions = {}, handlers = {}) {
prefix,
suffix
);
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForModuleOrEnum(node);
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForImportOrExportDeclaration(node);
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 280 /* ExportAssignment */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 283 /* ExportAssignment */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForExportDefault();
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForClassExpression();
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return generateNameForMethodOrAccessor(node, privateName, prefix, suffix);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return makeTempVariableName(TempFlags.Auto, true, privateName, prefix, suffix);
default:
return makeTempVariableName(TempFlags.Auto, false, privateName, prefix, suffix);
@@ -105956,14 +106214,14 @@ function createPrinter(printerOptions = {}, handlers = {}) {
const skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;
if ((pos > 0 || end > 0) && pos !== end) {
if (!skipLeadingComments) {
- emitLeadingComments(pos, node.kind !== 358 /* NotEmittedStatement */);
+ emitLeadingComments(pos, node.kind !== 361 /* NotEmittedStatement */);
}
if (!skipLeadingComments || pos >= 0 && (emitFlags & 512 /* NoLeadingComments */) !== 0) {
containerPos = pos;
}
if (!skipTrailingComments || end >= 0 && (emitFlags & 1024 /* NoTrailingComments */) !== 0) {
containerEnd = end;
- if (node.kind === 262 /* VariableDeclarationList */) {
+ if (node.kind === 264 /* VariableDeclarationList */) {
declarationListContainerEnd = end;
}
}
@@ -105979,7 +106237,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
containerPos = savedContainerPos;
containerEnd = savedContainerEnd;
declarationListContainerEnd = savedDeclarationListContainerEnd;
- if (!skipTrailingComments && node.kind !== 358 /* NotEmittedStatement */) {
+ if (!skipTrailingComments && node.kind !== 361 /* NotEmittedStatement */) {
emitTrailingComments(end);
}
}
@@ -106231,7 +106489,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
} else {
const source = sourceMapRange.source || sourceMapSource;
- if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
+ if (node.kind !== 361 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
}
if (emitFlags & 64 /* NoNestedSourceMaps */) {
@@ -106246,7 +106504,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (emitFlags & 64 /* NoNestedSourceMaps */) {
sourceMapsDisabled = false;
}
- if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
+ if (node.kind !== 361 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
}
}
@@ -108649,89 +108907,89 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
return diagnostics;
function walk(node, parent2) {
switch (parent2.kind) {
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
if (parent2.questionToken === node) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?"));
return "skip";
}
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
- case 261 /* VariableDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 263 /* VariableDeclaration */:
if (parent2.type === node) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files));
return "skip";
}
}
switch (node.kind) {
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
if (node.isTypeOnly) {
diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type"));
return "skip";
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
if (node.isTypeOnly) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type"));
return "skip";
}
break;
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
if (node.isTypeOnly) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, isImportSpecifier(node) ? "import...type" : "export...type"));
return "skip";
}
break;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.import_can_only_be_used_in_TypeScript_files));
return "skip";
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
if (node.isExportEquals) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.export_can_only_be_used_in_TypeScript_files));
return "skip";
}
break;
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
const heritageClause = node;
if (heritageClause.token === 118 /* ImplementsKeyword */) {
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files));
return "skip";
}
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
const interfaceKeyword = tokenToString(119 /* InterfaceKeyword */);
Debug.assertIsDefined(interfaceKeyword);
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword));
return "skip";
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const moduleKeyword = node.flags & 16 /* Namespace */ ? tokenToString(144 /* NamespaceKeyword */) : tokenToString(143 /* ModuleKeyword */);
Debug.assertIsDefined(moduleKeyword);
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword));
return "skip";
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files));
return "skip";
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
const enumKeyword = Debug.checkDefined(tokenToString(93 /* EnumKeyword */));
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword));
return "skip";
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files));
return "skip";
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files));
return "skip";
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files));
return "skip";
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
Debug.fail();
}
}
@@ -108740,27 +108998,27 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning));
}
switch (parent2.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
if (nodes === parent2.typeParameters) {
diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files));
return "skip";
}
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (nodes === parent2.modifiers) {
- checkModifiers(parent2.modifiers, parent2.kind === 244 /* VariableStatement */);
+ checkModifiers(parent2.modifiers, parent2.kind === 246 /* VariableStatement */);
return "skip";
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (nodes === parent2.modifiers) {
for (const modifier of nodes) {
if (isModifier(modifier) && modifier.kind !== 125 /* StaticKeyword */ && modifier.kind !== 128 /* AccessorKeyword */) {
@@ -108770,18 +109028,18 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
return "skip";
}
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (nodes === parent2.modifiers && some(nodes, isModifier)) {
diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files));
return "skip";
}
break;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 234 /* ExpressionWithTypeArguments */:
- case 288 /* JsxSelfClosingElement */:
- case 289 /* JsxOpeningElement */:
- case 215 /* TaggedTemplateExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 291 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 217 /* TaggedTemplateExpression */:
if (nodes === parent2.typeArguments) {
diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files));
return "skip";
@@ -116616,39 +116874,39 @@ var SemanticMeaning = /* @__PURE__ */ ((SemanticMeaning3) => {
})(SemanticMeaning || {});
function getMeaningFromDeclaration(node) {
switch (node.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return isInJSFile(node) && getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */;
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 301 /* CatchClause */:
- case 294 /* JsxAttribute */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 304 /* CatchClause */:
+ case 297 /* JsxAttribute */:
return 1 /* Value */;
- case 167 /* TypeParameter */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 187 /* TypeLiteral */:
+ case 168 /* TypeParameter */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 189 /* TypeLiteral */:
return 2 /* Type */;
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return node.name === void 0 ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */;
- case 308 /* EnumMember */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 311 /* EnumMember */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
return 1 /* Value */ | 2 /* Type */;
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return 2 /* Type */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (isAmbientModule(node)) {
return 4 /* Namespace */ | 1 /* Value */;
} else if (getModuleInstanceState(node) === 1 /* Instantiated */) {
@@ -116656,15 +116914,15 @@ function getMeaningFromDeclaration(node) {
} else {
return 4 /* Namespace */;
}
- case 269 /* EnumDeclaration */:
- case 278 /* NamedImports */:
- case 279 /* ImportSpecifier */:
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
- case 280 /* ExportAssignment */:
- case 281 /* ExportDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 281 /* NamedImports */:
+ case 282 /* ImportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 284 /* ExportDeclaration */:
return 7 /* All */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return 4 /* Namespace */ | 1 /* Value */;
}
return 7 /* All */;
@@ -116672,7 +116930,7 @@ function getMeaningFromDeclaration(node) {
function getMeaningFromLocation(node) {
node = getAdjustedReferenceLocation(node);
const parent2 = node.parent;
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return 1 /* Value */;
} else if (isExportAssignment(parent2) || isExportSpecifier(parent2) || isExternalModuleReference(parent2) || isImportSpecifier(parent2) || isImportClause(parent2) || isImportEqualsDeclaration(parent2) && node === parent2.name) {
return 7 /* All */;
@@ -116696,11 +116954,11 @@ function getMeaningFromLocation(node) {
}
}
function getMeaningFromRightHandSideOfImportEquals(node) {
- const name = node.kind === 165 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0;
- return name && name.parent.kind === 274 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */;
+ const name = node.kind === 166 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0;
+ return name && name.parent.kind === 277 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */;
}
function isInRightSideOfInternalImportEqualsDeclaration(node) {
- while (node.parent.kind === 165 /* QualifiedName */) {
+ while (node.parent.kind === 166 /* QualifiedName */) {
node = node.parent;
}
return isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node;
@@ -116711,26 +116969,26 @@ function isNamespaceReference(node) {
function isQualifiedNameNamespaceReference(node) {
let root = node;
let isLastClause = true;
- if (root.parent.kind === 165 /* QualifiedName */) {
- while (root.parent && root.parent.kind === 165 /* QualifiedName */) {
+ if (root.parent.kind === 166 /* QualifiedName */) {
+ while (root.parent && root.parent.kind === 166 /* QualifiedName */) {
root = root.parent;
}
isLastClause = root.right === node;
}
- return root.parent.kind === 183 /* TypeReference */ && !isLastClause;
+ return root.parent.kind === 185 /* TypeReference */ && !isLastClause;
}
function isPropertyAccessNamespaceReference(node) {
let root = node;
let isLastClause = true;
- if (root.parent.kind === 211 /* PropertyAccessExpression */) {
- while (root.parent && root.parent.kind === 211 /* PropertyAccessExpression */) {
+ if (root.parent.kind === 213 /* PropertyAccessExpression */) {
+ while (root.parent && root.parent.kind === 213 /* PropertyAccessExpression */) {
root = root.parent;
}
isLastClause = root.name === node;
}
- if (!isLastClause && root.parent.kind === 234 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 300 /* HeritageClause */) {
+ if (!isLastClause && root.parent.kind === 236 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 303 /* HeritageClause */) {
const decl = root.parent.parent.parent;
- return (decl.kind === 264 /* ClassDeclaration */ || decl.kind === 265 /* StructDeclaration */) && root.parent.parent.token === 118 /* ImplementsKeyword */ || decl.kind === 267 /* InterfaceDeclaration */ && root.parent.parent.token === 95 /* ExtendsKeyword */;
+ return (decl.kind === 266 /* ClassDeclaration */ || decl.kind === 267 /* StructDeclaration */) && root.parent.parent.token === 118 /* ImplementsKeyword */ || decl.kind === 270 /* InterfaceDeclaration */ && root.parent.parent.token === 95 /* ExtendsKeyword */;
}
return false;
}
@@ -116741,15 +116999,15 @@ function isTypeReference(node) {
switch (node.kind) {
case 109 /* ThisKeyword */:
return !isExpressionNode(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return true;
}
switch (node.parent.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return true;
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return !node.parent.isTypeOf;
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return isPartOfTypeNode(node.parent);
}
return false;
@@ -116796,7 +117054,7 @@ function climbPastPropertyOrElementAccess(node) {
}
function getTargetLabel(referenceNode, labelName) {
while (referenceNode) {
- if (referenceNode.kind === 257 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) {
+ if (referenceNode.kind === 259 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) {
return referenceNode.label;
}
referenceNode = referenceNode.parent;
@@ -116846,22 +117104,22 @@ function isNameOfFunctionDeclaration(node) {
}
function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) {
switch (node.parent.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 305 /* PropertyAssignment */:
- case 308 /* EnumMember */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 270 /* ModuleDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 308 /* PropertyAssignment */:
+ case 311 /* EnumMember */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 273 /* ModuleDeclaration */:
return getNameOfDeclaration(node.parent) === node;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return node.parent.argumentExpression === node;
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return true;
- case 201 /* LiteralType */:
- return node.parent.parent.kind === 199 /* IndexedAccessType */;
+ case 203 /* LiteralType */:
+ return node.parent.parent.kind === 201 /* IndexedAccessType */;
default:
return false;
}
@@ -116879,86 +117137,86 @@ function getContainerNode(node) {
return void 0;
}
switch (node.kind) {
- case 314 /* SourceFile */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 317 /* SourceFile */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
return node;
}
}
}
function getNodeKind(node) {
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return "module" /* moduleElement */;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return "class" /* classElement */;
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return "struct" /* structElement */;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return "interface" /* interfaceElement */;
- case 268 /* TypeAliasDeclaration */:
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
+ case 271 /* TypeAliasDeclaration */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
return "type" /* typeElement */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return "enum" /* enumElement */;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return getKindOfVariableDeclaration(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getKindOfVariableDeclaration(getRootDeclaration(node));
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return "function" /* functionElement */;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return "getter" /* memberGetAccessorElement */;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return "setter" /* memberSetAccessorElement */;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return "method" /* memberFunctionElement */;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
const { initializer } = node;
return isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */;
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return "property" /* memberVariableElement */;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return "index" /* indexSignatureElement */;
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return "construct" /* constructSignatureElement */;
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return "call" /* callSignatureElement */;
- case 176 /* Constructor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 177 /* ClassStaticBlockDeclaration */:
return "constructor" /* constructorImplementationElement */;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return "type parameter" /* typeParameterElement */;
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return "enum member" /* enumMemberElement */;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */;
- case 274 /* ImportEqualsDeclaration */:
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
- case 277 /* NamespaceImport */:
- case 283 /* NamespaceExport */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
+ case 280 /* NamespaceImport */:
+ case 286 /* NamespaceExport */:
return "alias" /* alias */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const kind = getAssignmentDeclarationKind(node);
const { right } = node;
switch (kind) {
@@ -116986,7 +117244,7 @@ function getNodeKind(node) {
}
case 79 /* Identifier */:
return isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
const scriptKind = getNodeKind(node.expression);
return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind;
default:
@@ -117001,7 +117259,7 @@ function isThis(node) {
case 109 /* ThisKeyword */:
return true;
case 79 /* Identifier */:
- return identifierIsThisKeyword(node) && node.parent.kind === 168 /* Parameter */;
+ return identifierIsThisKeyword(node) && node.parent.kind === 169 /* Parameter */;
default:
return false;
}
@@ -117050,42 +117308,42 @@ function isCompletedNode(n, sourceFile) {
return false;
}
switch (n.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 210 /* ObjectLiteralExpression */:
- case 206 /* ObjectBindingPattern */:
- case 187 /* TypeLiteral */:
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
- case 272 /* CaseBlock */:
- case 278 /* NamedImports */:
- case 282 /* NamedExports */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 212 /* ObjectLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 189 /* TypeLiteral */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
+ case 275 /* CaseBlock */:
+ case 281 /* NamedImports */:
+ case 285 /* NamedExports */:
return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return isCompletedNode(n.block, sourceFile);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
if (!n.arguments) {
return true;
}
- case 213 /* CallExpression */:
- case 217 /* ParenthesizedExpression */:
- case 196 /* ParenthesizedType */:
+ case 215 /* CallExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 198 /* ParenthesizedType */:
return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return isCompletedNode(n.type, sourceFile);
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 180 /* ConstructSignature */:
- case 179 /* CallSignature */:
- case 219 /* ArrowFunction */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 182 /* ConstructSignature */:
+ case 181 /* CallSignature */:
+ case 221 /* ArrowFunction */:
if (n.body) {
return isCompletedNode(n.body, sourceFile);
}
@@ -117093,60 +117351,60 @@ function isCompletedNode(n, sourceFile) {
return isCompletedNode(n.type, sourceFile);
}
return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return !!n.body && isCompletedNode(n.body, sourceFile);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
if (n.elseStatement) {
return isCompletedNode(n.elseStatement, sourceFile);
}
return isCompletedNode(n.thenStatement, sourceFile);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile);
- case 209 /* ArrayLiteralExpression */:
- case 207 /* ArrayBindingPattern */:
- case 212 /* ElementAccessExpression */:
- case 166 /* ComputedPropertyName */:
- case 189 /* TupleType */:
+ case 211 /* ArrayLiteralExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 214 /* ElementAccessExpression */:
+ case 167 /* ComputedPropertyName */:
+ case 191 /* TupleType */:
return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile);
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
if (n.type) {
return isCompletedNode(n.type, sourceFile);
}
return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return false;
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 248 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 250 /* WhileStatement */:
return isCompletedNode(n.statement, sourceFile);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return hasChildOfKind(n, 116 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return isCompletedNode(n.exprName, sourceFile);
- case 222 /* TypeOfExpression */:
- case 221 /* DeleteExpression */:
- case 223 /* VoidExpression */:
- case 230 /* YieldExpression */:
- case 231 /* SpreadElement */:
+ case 224 /* TypeOfExpression */:
+ case 223 /* DeleteExpression */:
+ case 225 /* VoidExpression */:
+ case 232 /* YieldExpression */:
+ case 233 /* SpreadElement */:
const unaryWordExpression = n;
return isCompletedNode(unaryWordExpression.expression, sourceFile);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return isCompletedNode(n.template, sourceFile);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
const lastSpan = lastOrUndefined(n.templateSpans);
return isCompletedNode(lastSpan, sourceFile);
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return nodeIsPresent(n.literal);
- case 281 /* ExportDeclaration */:
- case 275 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
return nodeIsPresent(n.moduleSpecifier);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return isCompletedNode(n.operand, sourceFile);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isCompletedNode(n.right, sourceFile);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isCompletedNode(n.whenFalse, sourceFile);
default:
return true;
@@ -117248,14 +117506,14 @@ function getContextualTypeFromParentOrAncestorTypeNode(node, checker) {
function getAdjustedLocationForDeclaration(node, forRename) {
if (!forRename) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
return getAdjustedLocationForClass(node);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return getAdjustedLocationForFunction(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return node;
}
}
@@ -117405,7 +117663,7 @@ function getAdjustedLocation(node, forRename) {
if (node.kind === 129 /* AsKeyword */ && isAsExpression(parent2) && isTypeReferenceNode(parent2.type)) {
return parent2.type.typeName;
}
- if (node.kind === 102 /* InKeyword */ && isForInStatement(parent2) || node.kind === 164 /* OfKeyword */ && isForOfStatement(parent2)) {
+ if (node.kind === 102 /* InKeyword */ && isForInStatement(parent2) || node.kind === 165 /* OfKeyword */ && isForOfStatement(parent2)) {
return skipOuterExpressions(parent2.expression);
}
}
@@ -117544,7 +117802,7 @@ function findPrecedingToken(position, sourceFile, startNode2, excludeJsdoc) {
}
}
}
- Debug.assert(startNode2 !== void 0 || n.kind === 314 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n));
+ Debug.assert(startNode2 !== void 0 || n.kind === 317 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n));
const candidate = findRightmostChildNodeWithTokens(children, children.length, sourceFile, n.kind);
return candidate && findRightmostToken(candidate, sourceFile);
}
@@ -117567,7 +117825,7 @@ function findRightmostChildNodeWithTokens(children, exclusiveStartPosition, sour
for (let i = exclusiveStartPosition - 1; i >= 0; i--) {
const child = children[i];
if (isWhiteSpaceOnlyJsxText(child)) {
- if (i === 0 && (parentKind === 11 /* JsxText */ || parentKind === 288 /* JsxSelfClosingElement */)) {
+ if (i === 0 && (parentKind === 11 /* JsxText */ || parentKind === 291 /* JsxSelfClosingElement */)) {
Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");
}
} else if (nodeHasTokens(children[i], sourceFile)) {
@@ -117599,13 +117857,13 @@ function isInsideJsxElementOrAttribute(sourceFile, position) {
if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 11 /* JsxText */) {
return true;
}
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 297 /* JsxExpression */) {
+ if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 300 /* JsxExpression */) {
return true;
}
- if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 297 /* JsxExpression */) {
+ if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 300 /* JsxExpression */) {
return true;
}
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 290 /* JsxClosingElement */) {
+ if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 293 /* JsxClosingElement */) {
return true;
}
return false;
@@ -117633,9 +117891,9 @@ function isInJSXText(sourceFile, position) {
function isInsideJsxElement(sourceFile, position) {
function isInsideJsxElementTraversal(node) {
while (node) {
- if (node.kind >= 288 /* JsxSelfClosingElement */ && node.kind <= 297 /* JsxExpression */ || node.kind === 11 /* JsxText */ || node.kind === 29 /* LessThanToken */ || node.kind === 31 /* GreaterThanToken */ || node.kind === 79 /* Identifier */ || node.kind === 19 /* CloseBraceToken */ || node.kind === 18 /* OpenBraceToken */ || node.kind === 43 /* SlashToken */) {
+ if (node.kind >= 291 /* JsxSelfClosingElement */ && node.kind <= 300 /* JsxExpression */ || node.kind === 11 /* JsxText */ || node.kind === 29 /* LessThanToken */ || node.kind === 31 /* GreaterThanToken */ || node.kind === 79 /* Identifier */ || node.kind === 19 /* CloseBraceToken */ || node.kind === 18 /* OpenBraceToken */ || node.kind === 43 /* SlashToken */) {
node = node.parent;
- } else if (node.kind === 287 /* JsxElement */) {
+ } else if (node.kind === 290 /* JsxElement */) {
if (position > node.getStart(sourceFile))
return true;
node = node.parent;
@@ -117796,15 +118054,15 @@ function getNodeModifiers(node, excludeFlags = 0 /* None */) {
result.push("deprecated" /* deprecatedModifier */);
if (node.flags & 16777216 /* Ambient */)
result.push("declare" /* ambientModifier */);
- if (node.kind === 280 /* ExportAssignment */)
+ if (node.kind === 283 /* ExportAssignment */)
result.push("export" /* exportedModifier */);
return result.length > 0 ? result.join(",") : "" /* none */;
}
function getTypeArgumentOrTypeParameterList(node) {
- if (node.kind === 183 /* TypeReference */ || node.kind === 213 /* CallExpression */) {
+ if (node.kind === 185 /* TypeReference */ || node.kind === 215 /* CallExpression */) {
return node.typeArguments;
}
- if (isFunctionLike(node) || node.kind === 264 /* ClassDeclaration */ || node.kind === 267 /* InterfaceDeclaration */) {
+ if (isFunctionLike(node) || node.kind === 266 /* ClassDeclaration */ || node.kind === 270 /* InterfaceDeclaration */) {
return node.typeParameters;
}
return void 0;
@@ -117839,14 +118097,14 @@ function cloneCompilerOptions(options) {
return result;
}
function isArrayLiteralOrObjectLiteralDestructuringPattern(node) {
- if (node.kind === 209 /* ArrayLiteralExpression */ || node.kind === 210 /* ObjectLiteralExpression */) {
- if (node.parent.kind === 227 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */) {
+ if (node.kind === 211 /* ArrayLiteralExpression */ || node.kind === 212 /* ObjectLiteralExpression */) {
+ if (node.parent.kind === 229 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 63 /* EqualsToken */) {
return true;
}
- if (node.parent.kind === 251 /* ForOfStatement */ && node.parent.initializer === node) {
+ if (node.parent.kind === 253 /* ForOfStatement */ && node.parent.initializer === node) {
return true;
}
- if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 305 /* PropertyAssignment */ ? node.parent.parent : node.parent)) {
+ if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 308 /* PropertyAssignment */ ? node.parent.parent : node.parent)) {
return true;
}
}
@@ -117950,7 +118208,7 @@ function skipConstraint(type) {
return type.isTypeParameter() ? type.getConstraint() || type : type;
}
function getNameFromPropertyName(name) {
- return name.kind === 166 /* ComputedPropertyName */ ? isStringOrNumericLiteralLike(name.expression) ? name.expression.text : void 0 : isPrivateIdentifier(name) ? idText(name) : getTextOfIdentifierOrLiteral(name);
+ return name.kind === 167 /* ComputedPropertyName */ ? isStringOrNumericLiteralLike(name.expression) ? name.expression.text : void 0 : isPrivateIdentifier(name) ? idText(name) : getTextOfIdentifierOrLiteral(name);
}
function programContainsModules(program) {
return program.getSourceFiles().some((s) => !s.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s) && !!(s.externalModuleIndicator || s.commonJsModuleIndicator));
@@ -118074,7 +118332,7 @@ function findModifier(node, kind) {
}
function insertImports(changes, sourceFile, imports, blankLineBetween) {
const decl = isArray(imports) ? imports[0] : imports;
- const importKindPredicate = decl.kind === 244 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax;
+ const importKindPredicate = decl.kind === 246 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax;
const existingImportStatements = filter(sourceFile.statements, importKindPredicate);
const sortedNewImports = isArray(imports) ? stableSort(imports, ts_OrganizeImports_exports.compareImportsOrRequireStatements) : [imports];
if (!existingImportStatements.length) {
@@ -118615,13 +118873,13 @@ function needsParentheses(expression) {
function getContextualTypeFromParent(node, checker) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return checker.getContextualType(parent2);
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const { left, operatorToken, right } = parent2;
return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node);
}
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
return parent2.expression === node ? getSwitchedType(parent2, checker) : void 0;
default:
return checker.getContextualType(node);
@@ -118647,8 +118905,8 @@ function isStringLiteralOrTemplate(node) {
switch (node.kind) {
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
- case 215 /* TaggedTemplateExpression */:
+ case 231 /* TemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return true;
default:
return false;
@@ -118678,16 +118936,16 @@ function getTypeNodeIfAccessible(type, enclosingScope, program, host) {
return typeIsAccessible ? res : void 0;
}
function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) {
- return kind === 179 /* CallSignature */ || kind === 180 /* ConstructSignature */ || kind === 181 /* IndexSignature */ || kind === 170 /* PropertySignature */ || kind === 173 /* MethodSignature */;
+ return kind === 181 /* CallSignature */ || kind === 182 /* ConstructSignature */ || kind === 183 /* IndexSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */;
}
function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) {
- return kind === 263 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 265 /* FunctionDeclaration */ || kind === 178 /* Constructor */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) {
- return kind === 270 /* ModuleDeclaration */;
+ return kind === 273 /* ModuleDeclaration */;
}
function syntaxRequiresTrailingSemicolonOrASI(kind) {
- return kind === 244 /* VariableStatement */ || kind === 245 /* ExpressionStatement */ || kind === 247 /* DoStatement */ || kind === 252 /* ContinueStatement */ || kind === 253 /* BreakStatement */ || kind === 254 /* ReturnStatement */ || kind === 258 /* ThrowStatement */ || kind === 260 /* DebuggerStatement */ || kind === 171 /* PropertyDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 280 /* ExportAssignment */;
+ return kind === 246 /* VariableStatement */ || kind === 247 /* ExpressionStatement */ || kind === 249 /* DoStatement */ || kind === 254 /* ContinueStatement */ || kind === 255 /* BreakStatement */ || kind === 256 /* ReturnStatement */ || kind === 260 /* ThrowStatement */ || kind === 262 /* DebuggerStatement */ || kind === 172 /* PropertyDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 283 /* ExportAssignment */;
}
var syntaxMayBeASICandidate = or(
syntaxRequiresTrailingCommaOrSemicolonOrASI,
@@ -118717,7 +118975,7 @@ function nodeIsASICandidate(node, sourceFile) {
} else if (!syntaxRequiresTrailingSemicolonOrASI(node.kind)) {
return false;
}
- if (node.kind === 247 /* DoStatement */) {
+ if (node.kind === 249 /* DoStatement */) {
return true;
}
const topNode = findAncestor(node, (ancestor) => !ancestor.parent);
@@ -119879,13 +120137,13 @@ function getSemanticClassifications(typeChecker3, cancellationToken, sourceFile,
}
function checkForClassificationCancellation(cancellationToken, kind) {
switch (kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
}
@@ -120089,46 +120347,46 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
pos = tag.tagName.end;
let commentStart = tag.tagName.end;
switch (tag.kind) {
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
const param = tag;
processJSDocParameterTag(param);
commentStart = param.isNameFirst && ((_a2 = param.typeExpression) == null ? void 0 : _a2.end) || param.name.end;
break;
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
const prop = tag;
commentStart = prop.isNameFirst && ((_b = prop.typeExpression) == null ? void 0 : _b.end) || prop.name.end;
break;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
processJSDocTemplateTag(tag);
pos = tag.end;
commentStart = tag.typeParameters.end;
break;
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
const type = tag;
- commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 318 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart;
+ commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 321 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart;
break;
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
commentStart = tag.typeExpression.end;
break;
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
processElement(tag.typeExpression);
pos = tag.end;
commentStart = tag.typeExpression.end;
break;
- case 351 /* JSDocThisTag */:
- case 348 /* JSDocEnumTag */:
+ case 354 /* JSDocThisTag */:
+ case 351 /* JSDocEnumTag */:
commentStart = tag.typeExpression.end;
break;
- case 350 /* JSDocReturnTag */:
+ case 353 /* JSDocReturnTag */:
processElement(tag.typeExpression);
pos = tag.end;
commentStart = ((_f = tag.typeExpression) == null ? void 0 : _f.end) || commentStart;
break;
- case 355 /* JSDocSeeTag */:
+ case 358 /* JSDocSeeTag */:
commentStart = ((_g = tag.name) == null ? void 0 : _g.end) || commentStart;
break;
- case 337 /* JSDocAugmentsTag */:
- case 338 /* JSDocImplementsTag */:
+ case 340 /* JSDocAugmentsTag */:
+ case 341 /* JSDocImplementsTag */:
commentStart = tag.class.end;
break;
}
@@ -120271,22 +120529,22 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
}
function tryClassifyJsxElementName(token) {
switch (token.parent && token.parent.kind) {
- case 289 /* JsxOpeningElement */:
+ case 292 /* JsxOpeningElement */:
if (token.parent.tagName === token) {
return 19 /* jsxOpenTagName */;
}
break;
- case 290 /* JsxClosingElement */:
+ case 293 /* JsxClosingElement */:
if (token.parent.tagName === token) {
return 20 /* jsxCloseTagName */;
}
break;
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
if (token.parent.tagName === token) {
return 21 /* jsxSelfClosingTagName */;
}
break;
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
if (token.parent.name === token) {
return 22 /* jsxAttribute */;
}
@@ -120307,11 +120565,11 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
if (token) {
const parent2 = token.parent;
if (tokenKind === 63 /* EqualsToken */) {
- if (parent2.kind === 261 /* VariableDeclaration */ || parent2.kind === 171 /* PropertyDeclaration */ || parent2.kind === 168 /* Parameter */ || parent2.kind === 294 /* JsxAttribute */) {
+ if (parent2.kind === 263 /* VariableDeclaration */ || parent2.kind === 172 /* PropertyDeclaration */ || parent2.kind === 169 /* Parameter */ || parent2.kind === 297 /* JsxAttribute */) {
return 5 /* operator */;
}
}
- if (parent2.kind === 227 /* BinaryExpression */ || parent2.kind === 225 /* PrefixUnaryExpression */ || parent2.kind === 226 /* PostfixUnaryExpression */ || parent2.kind === 228 /* ConditionalExpression */) {
+ if (parent2.kind === 229 /* BinaryExpression */ || parent2.kind === 227 /* PrefixUnaryExpression */ || parent2.kind === 228 /* PostfixUnaryExpression */ || parent2.kind === 230 /* ConditionalExpression */) {
return 5 /* operator */;
}
}
@@ -120321,7 +120579,7 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
} else if (tokenKind === 9 /* BigIntLiteral */) {
return 25 /* bigintLiteral */;
} else if (tokenKind === 10 /* StringLiteral */) {
- return token && token.parent.kind === 294 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */;
+ return token && token.parent.kind === 297 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */;
} else if (tokenKind === 13 /* RegularExpressionLiteral */) {
return 6 /* stringLiteral */;
} else if (isTemplateLiteralKind(tokenKind)) {
@@ -120331,32 +120589,32 @@ function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)
} else if (tokenKind === 79 /* Identifier */) {
if (token) {
switch (token.parent.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
if (token.parent.name === token) {
return 11 /* className */;
}
return;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
if (token.parent.name === token) {
return 15 /* typeParameterName */;
}
return;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
if (token.parent.name === token) {
return 13 /* interfaceName */;
}
return;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (token.parent.name === token) {
return 12 /* enumName */;
}
return;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (token.parent.name === token) {
return 14 /* moduleName */;
}
return;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (token.parent.name === token) {
return isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */;
}
@@ -120499,7 +120757,7 @@ var DocumentHighlights2;
let child = throwStatement;
while (child.parent) {
const parent2 = child.parent;
- if (isFunctionBlock(parent2) || parent2.kind === 314 /* SourceFile */) {
+ if (isFunctionBlock(parent2) || parent2.kind === 317 /* SourceFile */) {
return parent2;
}
if (isTryStatement(parent2) && parent2.tryBlock === child && parent2.catchClause) {
@@ -120529,15 +120787,15 @@ var DocumentHighlights2;
function getBreakOrContinueOwner(statement) {
return findAncestor(statement, (node) => {
switch (node.kind) {
- case 256 /* SwitchStatement */:
- if (statement.kind === 252 /* ContinueStatement */) {
+ case 258 /* SwitchStatement */:
+ if (statement.kind === 254 /* ContinueStatement */) {
return false;
}
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 248 /* WhileStatement */:
- case 247 /* DoStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 250 /* WhileStatement */:
+ case 249 /* DoStatement */:
return !statement.label || isLabeledBy(node, statement.label.escapedText);
default:
return isFunctionLike(node) && "quit";
@@ -120550,25 +120808,25 @@ var DocumentHighlights2;
function getNodesToSearchForModifier(declaration, modifierFlag) {
const container = declaration.parent;
switch (container.kind) {
- case 271 /* ModuleBlock */:
- case 314 /* SourceFile */:
- case 242 /* Block */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 274 /* ModuleBlock */:
+ case 317 /* SourceFile */:
+ case 244 /* Block */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
if (modifierFlag & 256 /* Abstract */ && isClassDeclaration(declaration)) {
return [...declaration.members, declaration];
} else {
return container.statements;
}
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
return [...container.parameters, ...isClassLike(container.parent) ? container.parent.members : []];
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 187 /* TypeLiteral */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 189 /* TypeLiteral */:
const nodes = container.members;
if (modifierFlag & (28 /* AccessibilityModifier */ | 64 /* Readonly */)) {
const constructor = find(container.members, isConstructorDeclaration);
@@ -120579,7 +120837,7 @@ var DocumentHighlights2;
return [...nodes, container];
}
return nodes;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return void 0;
default:
Debug.assertNever(container, "Invalid container kind.");
@@ -120595,7 +120853,7 @@ var DocumentHighlights2;
function getLoopBreakContinueOccurrences(loopNode) {
const keywords = [];
if (pushKeywordIf(keywords, loopNode.getFirstToken(), 98 /* ForKeyword */, 116 /* WhileKeyword */, 91 /* DoKeyword */)) {
- if (loopNode.kind === 247 /* DoStatement */) {
+ if (loopNode.kind === 249 /* DoStatement */) {
const loopTokens = loopNode.getChildren();
for (let i = loopTokens.length - 1; i >= 0; i--) {
if (pushKeywordIf(keywords, loopTokens[i], 116 /* WhileKeyword */)) {
@@ -120615,13 +120873,13 @@ var DocumentHighlights2;
const owner = getBreakOrContinueOwner(breakOrContinueStatement);
if (owner) {
switch (owner.kind) {
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return getLoopBreakContinueOccurrences(owner);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return getSwitchCaseDefaultOccurrences(owner);
}
}
@@ -121997,9 +122255,9 @@ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {
function containsTopLevelCommonjs(sourceFile) {
return sourceFile.statements.some((statement) => {
switch (statement.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return statement.declarationList.declarations.some((decl) => !!decl.initializer && isRequireCall(propertyAccessLeftHandSide(decl.initializer), true));
- case 245 /* ExpressionStatement */: {
+ case 247 /* ExpressionStatement */: {
const { expression } = statement;
if (!isBinaryExpression(expression))
return isRequireCall(expression, true);
@@ -122016,10 +122274,10 @@ function propertyAccessLeftHandSide(node) {
}
function importNameForConvertToDefaultImport(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
const { importClause, moduleSpecifier } = node;
- return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 277 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0;
- case 274 /* ImportEqualsDeclaration */:
+ return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 280 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0;
+ case 277 /* ImportEqualsDeclaration */:
return node.name;
default:
return void 0;
@@ -122083,18 +122341,18 @@ function hasSupportedNumberOfArguments(node) {
}
function isFixablePromiseArgument(arg, checker) {
switch (arg.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
const functionFlags = getFunctionFlags(arg);
if (functionFlags & 1 /* Generator */) {
return false;
}
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true);
case 105 /* NullKeyword */:
return true;
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const symbol = checker.getSymbolAtLocation(arg);
if (!symbol) {
return false;
@@ -122110,24 +122368,24 @@ function getKeyFromNode(exp) {
}
function canBeConvertedToClass(node, checker) {
var _a2, _b, _c, _d;
- if (node.kind === 218 /* FunctionExpression */) {
+ if (node.kind === 220 /* FunctionExpression */) {
if (isVariableDeclaration(node.parent) && ((_a2 = node.symbol.members) == null ? void 0 : _a2.size)) {
return true;
}
const symbol = checker.getSymbolOfExpando(node, false);
return !!(symbol && (((_b = symbol.exports) == null ? void 0 : _b.size) || ((_c = symbol.members) == null ? void 0 : _c.size)));
}
- if (node.kind === 263 /* FunctionDeclaration */) {
+ if (node.kind === 265 /* FunctionDeclaration */) {
return !!((_d = node.symbol.members) == null ? void 0 : _d.size);
}
return false;
}
function canBeConvertedToAsync(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
default:
return false;
@@ -122272,9 +122530,9 @@ function getItemsFromNamedDeclaration(patternMatcher, name, declarations, checke
}
function shouldKeepItem(declaration, checker) {
switch (declaration.kind) {
- case 276 /* ImportClause */:
- case 279 /* ImportSpecifier */:
- case 274 /* ImportEqualsDeclaration */:
+ case 279 /* ImportClause */:
+ case 282 /* ImportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
const importer = checker.getSymbolAtLocation(declaration.name);
const imported = checker.getAliasedSymbol(importer);
return importer.escapedName !== imported.escapedName;
@@ -122284,7 +122542,7 @@ function shouldKeepItem(declaration, checker) {
}
function tryAddSingleDeclarationName(declaration, containers) {
const name = getNameOfDeclaration(declaration);
- return !!name && (pushLiteral(name, containers) || name.kind === 166 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers));
+ return !!name && (pushLiteral(name, containers) || name.kind === 167 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers));
}
function tryAddComputedPropertyName(expression, containers) {
return pushLiteral(expression, containers) || isPropertyAccessExpression(expression) && (containers.push(expression.name.text), true) && tryAddComputedPropertyName(expression.expression, containers);
@@ -122295,7 +122553,7 @@ function pushLiteral(node, containers) {
function getContainers(declaration) {
const containers = [];
const name = getNameOfDeclaration(declaration);
- if (name && name.kind === 166 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) {
+ if (name && name.kind === 167 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) {
return emptyArray;
}
containers.shift();
@@ -122465,7 +122723,7 @@ function addNodeWithRecursiveInitializer(node) {
}
}
function hasNavigationBarName(node) {
- return !hasDynamicName(node) || node.kind !== 227 /* BinaryExpression */ && isPropertyAccessExpression(node.name.expression) && isIdentifier(node.name.expression.expression) && idText(node.name.expression.expression) === "Symbol";
+ return !hasDynamicName(node) || node.kind !== 229 /* BinaryExpression */ && isPropertyAccessExpression(node.name.expression) && isIdentifier(node.name.expression.expression) && idText(node.name.expression.expression) === "Symbol";
}
function addChildrenRecursively(node) {
curCancellationToken.throwIfCancellationRequested();
@@ -122473,7 +122731,7 @@ function addChildrenRecursively(node) {
return;
}
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
const ctr = node;
addNodeWithRecursiveChild(ctr, ctr.body);
for (const param of ctr.parameters) {
@@ -122482,32 +122740,32 @@ function addChildrenRecursively(node) {
}
}
break;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 175 /* MethodSignature */:
if (hasNavigationBarName(node)) {
addNodeWithRecursiveChild(node, node.body);
}
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
if (hasNavigationBarName(node)) {
addNodeWithRecursiveInitializer(node);
}
break;
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
if (hasNavigationBarName(node)) {
addLeafNode(node);
}
break;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
const importClause = node;
if (importClause.name) {
addLeafNode(importClause.name);
}
const { namedBindings } = importClause;
if (namedBindings) {
- if (namedBindings.kind === 277 /* NamespaceImport */) {
+ if (namedBindings.kind === 280 /* NamespaceImport */) {
addLeafNode(namedBindings);
} else {
for (const element of namedBindings.elements) {
@@ -122516,16 +122774,16 @@ function addChildrenRecursively(node) {
}
}
break;
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
addNodeWithRecursiveChild(node, node.name);
break;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
const { expression } = node;
isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node);
break;
- case 208 /* BindingElement */:
- case 305 /* PropertyAssignment */:
- case 261 /* VariableDeclaration */: {
+ case 210 /* BindingElement */:
+ case 308 /* PropertyAssignment */:
+ case 263 /* VariableDeclaration */: {
const child = node;
if (isBindingPattern(child.name)) {
addChildrenRecursively(child.name);
@@ -122534,18 +122792,18 @@ function addChildrenRecursively(node) {
}
break;
}
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
const nameNode = node.name;
if (nameNode && isIdentifier(nameNode)) {
addTrackedEs5Class(nameNode.text);
}
addNodeWithRecursiveChild(node, node.body);
break;
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
addNodeWithRecursiveChild(node, node.body);
break;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
startNode(node);
for (const member of node.members) {
if (!isComputedProperty(member)) {
@@ -122554,20 +122812,20 @@ function addChildrenRecursively(node) {
}
endNode();
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
startNode(node);
for (const member of node.members) {
addChildrenRecursively(member);
}
endNode();
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
addNodeWithRecursiveChild(node, getInteriorModule(node).body);
break;
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
const expression2 = node.expression;
const child = isObjectLiteralExpression(expression2) || isCallExpression(expression2) ? expression2 : isArrowFunction(expression2) || isFunctionExpression(expression2) ? expression2.body : void 0;
if (child) {
@@ -122579,16 +122837,16 @@ function addChildrenRecursively(node) {
}
break;
}
- case 284 /* ExportSpecifier */:
- case 274 /* ImportEqualsDeclaration */:
- case 181 /* IndexSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 268 /* TypeAliasDeclaration */:
+ case 287 /* ExportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 183 /* IndexSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 271 /* TypeAliasDeclaration */:
addLeafNode(node);
break;
- case 213 /* CallExpression */:
- case 227 /* BinaryExpression */: {
+ case 215 /* CallExpression */:
+ case 229 /* BinaryExpression */: {
const special = getAssignmentDeclarationKind(node);
switch (special) {
case 1 /* ExportsProperty */:
@@ -122798,12 +123056,12 @@ function shouldReallyMerge(a, b, parent2) {
return false;
}
switch (a.kind) {
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return isStatic(a) === isStatic(b);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return areSameModule(a, b) && getFullyQualifiedModuleName(a) === getFullyQualifiedModuleName(b);
default:
return true;
@@ -122820,7 +123078,7 @@ function areSameModule(a, b) {
if (!a.body || !b.body) {
return a.body === b.body;
}
- return a.body.kind === b.body.kind && (a.body.kind !== 270 /* ModuleDeclaration */ || areSameModule(a.body, b.body));
+ return a.body.kind === b.body.kind && (a.body.kind !== 273 /* ModuleDeclaration */ || areSameModule(a.body, b.body));
}
function merge(target, source) {
target.additionalNodes = target.additionalNodes || [];
@@ -122841,7 +123099,7 @@ function compareChildren(child1, child2) {
return compareStringsCaseSensitiveUI(tryGetName(child1.node), tryGetName(child2.node)) || compareValues(navigationBarNodeKind(child1), navigationBarNodeKind(child2));
}
function tryGetName(node) {
- if (node.kind === 270 /* ModuleDeclaration */) {
+ if (node.kind === 273 /* ModuleDeclaration */) {
return getModuleName(node);
}
const declName = getNameOfDeclaration(node);
@@ -122850,16 +123108,16 @@ function tryGetName(node) {
return propertyName && unescapeLeadingUnderscores(propertyName);
}
switch (node.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 232 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 234 /* ClassExpression */:
return getFunctionOrClassName(node);
default:
return void 0;
}
}
function getItemName(node, name) {
- if (node.kind === 270 /* ModuleDeclaration */) {
+ if (node.kind === 273 /* ModuleDeclaration */) {
return cleanText(getModuleName(node));
}
if (name) {
@@ -122869,28 +123127,28 @@ function getItemName(node, name) {
}
}
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
const sourceFile = node;
return isExternalModule(sourceFile) ? `"${escapeString(getBaseFileName(removeFileExtension(normalizePath(sourceFile.fileName))))}"` : "";
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
if (getSyntacticModifierFlags(node) & 1024 /* Default */) {
return "default";
}
return getFunctionOrClassName(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return "constructor";
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return "new()";
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return "()";
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return "[]";
default:
return "";
@@ -122915,20 +123173,20 @@ function primaryNavBarMenuItems(root) {
return true;
}
switch (navigationBarNodeKind(item)) {
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 269 /* EnumDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 314 /* SourceFile */:
- case 268 /* TypeAliasDeclaration */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 317 /* SourceFile */:
+ case 271 /* TypeAliasDeclaration */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
return true;
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
return isTopLevelFunctionDeclaration(item);
default:
return false;
@@ -122938,10 +123196,10 @@ function primaryNavBarMenuItems(root) {
return false;
}
switch (navigationBarNodeKind(item2.parent)) {
- case 271 /* ModuleBlock */:
- case 314 /* SourceFile */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
+ case 274 /* ModuleBlock */:
+ case 317 /* SourceFile */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
return true;
default:
return false;
@@ -123000,7 +123258,7 @@ function getModuleName(moduleDeclaration) {
}
function getFullyQualifiedModuleName(moduleDeclaration) {
const result = [getTextOfIdentifierOrLiteral(moduleDeclaration.name)];
- while (moduleDeclaration.body && moduleDeclaration.body.kind === 270 /* ModuleDeclaration */) {
+ while (moduleDeclaration.body && moduleDeclaration.body.kind === 273 /* ModuleDeclaration */) {
moduleDeclaration = moduleDeclaration.body;
result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name));
}
@@ -123010,13 +123268,13 @@ function getInteriorModule(decl) {
return decl.body && isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl;
}
function isComputedProperty(member) {
- return !member.name || member.name.kind === 166 /* ComputedPropertyName */;
+ return !member.name || member.name.kind === 167 /* ComputedPropertyName */;
}
function getNodeSpan(node) {
- return node.kind === 314 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile);
+ return node.kind === 317 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile);
}
function getModifiers2(node) {
- if (node.parent && node.parent.kind === 261 /* VariableDeclaration */) {
+ if (node.parent && node.parent.kind === 263 /* VariableDeclaration */) {
node = node.parent;
}
return getNodeModifiers(node);
@@ -123061,9 +123319,9 @@ function getCalledExpressionName(expr) {
}
function isFunctionOrClassExpression(node) {
switch (node.kind) {
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
- case 232 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
return true;
default:
return false;
@@ -123149,8 +123407,8 @@ var NodeObject = class {
if (!children.length) {
return void 0;
}
- const child = find(children, (kid) => kid.kind < 318 /* FirstJSDocNode */ || kid.kind > 356 /* LastJSDocNode */);
- return child.kind < 165 /* FirstNode */ ? child : child.getFirstToken(sourceFile);
+ const child = find(children, (kid) => kid.kind < 321 /* FirstJSDocNode */ || kid.kind > 359 /* LastJSDocNode */);
+ return child.kind < 166 /* FirstNode */ ? child : child.getFirstToken(sourceFile);
}
getLastToken(sourceFile) {
this.assertHasRealPosition();
@@ -123159,7 +123417,7 @@ var NodeObject = class {
if (!child) {
return void 0;
}
- return child.kind < 165 /* FirstNode */ ? child : child.getLastToken(sourceFile);
+ return child.kind < 166 /* FirstNode */ ? child : child.getLastToken(sourceFile);
}
forEachChild(cbNode, cbNodeArray) {
return forEachChild(this, cbNode, cbNodeArray);
@@ -123222,7 +123480,7 @@ function addSyntheticNodes(nodes, pos, end, parent2) {
}
}
function createSyntaxList(nodes, parent2) {
- const list = createNode(357 /* SyntaxList */, nodes.pos, nodes.end, parent2);
+ const list = createNode(360 /* SyntaxList */, nodes.pos, nodes.end, parent2);
list._children = [];
let pos = nodes.pos;
for (const node of nodes) {
@@ -123536,7 +123794,7 @@ function getJsDocTagsOfDeclarations(declarations, checker) {
var _a2;
if (!seenSymbols.has(symbol)) {
seenSymbols.add(symbol);
- if (declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) {
+ if (declaration.kind === 179 /* GetAccessor */ || declaration.kind === 180 /* SetAccessor */) {
return symbol.getContextualJsDocTags(declaration, checker);
}
return ((_a2 = symbol.declarations) == null ? void 0 : _a2.length) === 1 ? symbol.getJsDocTags() : void 0;
@@ -123559,7 +123817,7 @@ function getDocumentationComment(declarations, checker) {
const inheritedDocs = findBaseOfDeclaration(checker, declaration, (symbol) => {
if (!seenSymbols.has(symbol)) {
seenSymbols.add(symbol);
- if (declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) {
+ if (declaration.kind === 179 /* GetAccessor */ || declaration.kind === 180 /* SetAccessor */) {
return symbol.getContextualDocumentationComment(declaration, checker);
}
return symbol.getDocumentationComment(checker);
@@ -123573,7 +123831,7 @@ function getDocumentationComment(declarations, checker) {
}
function findBaseOfDeclaration(checker, declaration, cb) {
var _a2;
- const classOrInterfaceDeclaration = ((_a2 = declaration.parent) == null ? void 0 : _a2.kind) === 176 /* Constructor */ ? declaration.parent.parent : declaration.parent;
+ const classOrInterfaceDeclaration = ((_a2 = declaration.parent) == null ? void 0 : _a2.kind) === 178 /* Constructor */ ? declaration.parent.parent : declaration.parent;
if (!classOrInterfaceDeclaration)
return;
const isStaticMember = hasStaticModifier(declaration);
@@ -123587,7 +123845,7 @@ function findBaseOfDeclaration(checker, declaration, cb) {
var SourceFileObject = class extends NodeObject {
constructor(kind, pos, end) {
super(kind, pos, end);
- this.kind = 314 /* SourceFile */;
+ this.kind = 317 /* SourceFile */;
}
update(newText, textChangeRange) {
return updateSourceFile(this, newText, textChangeRange);
@@ -123643,10 +123901,10 @@ var SourceFileObject = class extends NodeObject {
}
function visit(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
const functionDeclaration = node;
const declarationName = getDeclarationName(functionDeclaration);
if (declarationName) {
@@ -123662,30 +123920,30 @@ var SourceFileObject = class extends NodeObject {
}
forEachChild(node, visit);
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 284 /* ExportSpecifier */:
- case 279 /* ImportSpecifier */:
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 187 /* TypeLiteral */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 287 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 189 /* TypeLiteral */:
addDeclaration(node);
forEachChild(node, visit);
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
if (!hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) {
break;
}
- case 261 /* VariableDeclaration */:
- case 208 /* BindingElement */: {
+ case 263 /* VariableDeclaration */:
+ case 210 /* BindingElement */: {
const decl = node;
if (isBindingPattern(decl.name)) {
forEachChild(decl.name, visit);
@@ -123695,12 +123953,12 @@ var SourceFileObject = class extends NodeObject {
visit(decl.initializer);
}
}
- case 308 /* EnumMember */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 311 /* EnumMember */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
addDeclaration(node);
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportDeclaration = node;
if (exportDeclaration.exportClause) {
if (isNamedExports(exportDeclaration.exportClause)) {
@@ -123710,14 +123968,14 @@ var SourceFileObject = class extends NodeObject {
}
}
break;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
const importClause = node.importClause;
if (importClause) {
if (importClause.name) {
addDeclaration(importClause.name);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (importClause.namedBindings.kind === 280 /* NamespaceImport */) {
addDeclaration(importClause.namedBindings);
} else {
forEach(importClause.namedBindings.elements, visit);
@@ -123725,7 +123983,7 @@ var SourceFileObject = class extends NodeObject {
}
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (getAssignmentDeclarationKind(node) !== 0 /* None */) {
addDeclaration(node);
}
@@ -124367,15 +124625,15 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
switch (node.kind) {
case 79 /* Identifier */:
return !isLabelName(node) && !isTagName(node) && !isConstTypeReference(node.parent);
- case 211 /* PropertyAccessExpression */:
- case 165 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
return !isInComment(sourceFile, position);
case 109 /* ThisKeyword */:
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 107 /* SuperKeyword */:
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return true;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return isImportMeta(node);
default:
return false;
@@ -124485,15 +124743,15 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
return void 0;
}
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
- case 165 /* QualifiedName */:
+ case 213 /* PropertyAccessExpression */:
+ case 166 /* QualifiedName */:
case 10 /* StringLiteral */:
case 96 /* FalseKeyword */:
case 111 /* TrueKeyword */:
case 105 /* NullKeyword */:
case 107 /* SuperKeyword */:
case 109 /* ThisKeyword */:
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 79 /* Identifier */:
break;
default:
@@ -124504,7 +124762,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) {
nodeForStartPos = nodeForStartPos.parent;
} else if (isNameOfModuleDeclaration(nodeForStartPos)) {
- if (nodeForStartPos.parent.parent.kind === 270 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) {
+ if (nodeForStartPos.parent.parent.kind === 273 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) {
nodeForStartPos = nodeForStartPos.parent.parent.name;
} else {
break;
@@ -125121,7 +125379,7 @@ function initializeNameTable(sourceFile) {
});
}
function literalIsName(node) {
- return isDeclarationName(node) || node.parent.kind === 286 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node);
+ return isDeclarationName(node) || node.parent.kind === 289 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node);
}
function getContainingObjectLiteralElement(node) {
const element = getContainingObjectLiteralElementWorker(node);
@@ -125132,11 +125390,11 @@ function getContainingObjectLiteralElementWorker(node) {
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
case 8 /* NumericLiteral */:
- if (node.parent.kind === 166 /* ComputedPropertyName */) {
+ if (node.parent.kind === 167 /* ComputedPropertyName */) {
return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : void 0;
}
case 79 /* Identifier */:
- return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.parent.kind === 295 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0;
+ return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 212 /* ObjectLiteralExpression */ || node.parent.parent.kind === 298 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0;
}
return void 0;
}
@@ -125171,7 +125429,7 @@ function getPropertySymbolsFromContextualType(node, checker, contextualType, uni
return discriminatedPropertySymbols;
}
function isArgumentOfElementAccessExpression(node) {
- return node && node.parent && node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.argumentExpression === node;
+ return node && node.parent && node.parent.kind === 214 /* ElementAccessExpression */ && node.parent.argumentExpression === node;
}
function getDefaultLibFilePath(options) {
if (sys) {
@@ -126093,89 +126351,89 @@ function spanInSourceFileAtLocation(sourceFile, position) {
if (node) {
const { parent: parent2 } = node;
switch (node.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return spanInVariableDeclaration(node.declarationList.declarations[0]);
- case 261 /* VariableDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 263 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return spanInVariableDeclaration(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return spanInParameterDeclaration(node);
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return spanInFunctionDeclaration(node);
- case 242 /* Block */:
+ case 244 /* Block */:
if (isFunctionBlock(node)) {
return spanInFunctionBlock(node);
}
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return spanInBlock(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return spanInBlock(node.block);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return textSpan(node.expression);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return textSpan(node.getChildAt(0), node.expression);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return textSpanEndingAtNextToken(node, node.expression);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return spanInNode(node.statement);
- case 260 /* DebuggerStatement */:
+ case 262 /* DebuggerStatement */:
return textSpan(node.getChildAt(0));
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return textSpanEndingAtNextToken(node, node.expression);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return spanInNode(node.statement);
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
return textSpan(node.getChildAt(0), node.label);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return spanInForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return textSpanEndingAtNextToken(node, node.expression);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return spanInInitializerOfForLike(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return textSpanEndingAtNextToken(node, node.expression);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return spanInNode(node.statements[0]);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return spanInBlock(node.tryBlock);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return textSpan(node, node.expression);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return textSpan(node, node.expression);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return textSpan(node, node.moduleReference);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return textSpan(node, node.moduleSpecifier);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return textSpan(node, node.moduleSpecifier);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (getModuleInstanceState(node) !== 1 /* Instantiated */) {
return void 0;
}
- case 264 /* ClassDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 208 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 210 /* BindingElement */:
return textSpan(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return spanInNode(node.statement);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return spanInNodeArray(parent2.modifiers, node, isDecorator);
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return spanInBindingPattern(node);
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return void 0;
case 26 /* SemicolonToken */:
case 1 /* EndOfFileToken */:
@@ -126203,16 +126461,16 @@ function spanInSourceFileAtLocation(sourceFile, position) {
case 83 /* CatchKeyword */:
case 97 /* FinallyKeyword */:
return spanInNextNode(node);
- case 164 /* OfKeyword */:
+ case 165 /* OfKeyword */:
return spanInOfKeyword(node);
default:
if (isArrayLiteralOrObjectLiteralDestructuringPattern(node)) {
return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node);
}
- if ((node.kind === 79 /* Identifier */ || node.kind === 231 /* SpreadElement */ || node.kind === 305 /* PropertyAssignment */ || node.kind === 306 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) {
+ if ((node.kind === 79 /* Identifier */ || node.kind === 233 /* SpreadElement */ || node.kind === 308 /* PropertyAssignment */ || node.kind === 309 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) {
return textSpan(node);
}
- if (node.kind === 227 /* BinaryExpression */) {
+ if (node.kind === 229 /* BinaryExpression */) {
const { left, operatorToken } = node;
if (isArrayLiteralOrObjectLiteralDestructuringPattern(left)) {
return spanInArrayLiteralOrObjectLiteralDestructuringPattern(
@@ -126228,19 +126486,19 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
if (isExpressionNode(node)) {
switch (parent2.kind) {
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return spanInPreviousNode(node);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return spanInNode(node.parent);
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
return textSpan(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (node.parent.operatorToken.kind === 27 /* CommaToken */) {
return textSpan(node);
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
if (node.parent.body === node) {
return textSpan(node);
}
@@ -126248,25 +126506,25 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
}
switch (node.parent.kind) {
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (node.parent.name === node && !isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) {
return spanInNode(node.parent.initializer);
}
break;
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
if (node.parent.type === node) {
return spanInNextNode(node.parent.type);
}
break;
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */: {
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */: {
const { initializer, type } = node.parent;
if (initializer === node || type === node || isAssignmentOperator(node.kind)) {
return spanInPreviousNode(node);
}
break;
}
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const { left } = node.parent;
if (isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) {
return spanInPreviousNode(node);
@@ -126289,14 +126547,14 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
}
function spanInVariableDeclaration(variableDeclaration) {
- if (variableDeclaration.parent.parent.kind === 250 /* ForInStatement */) {
+ if (variableDeclaration.parent.parent.kind === 252 /* ForInStatement */) {
return spanInNode(variableDeclaration.parent.parent);
}
const parent2 = variableDeclaration.parent;
if (isBindingPattern(variableDeclaration.name)) {
return spanInBindingPattern(variableDeclaration.name);
}
- if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 1 /* Export */) || parent2.parent.kind === 251 /* ForOfStatement */) {
+ if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 1 /* Export */) || parent2.parent.kind === 253 /* ForOfStatement */) {
return textSpanFromVariableDeclaration(variableDeclaration);
}
if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) {
@@ -126323,7 +126581,7 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
}
function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) {
- return hasSyntacticModifier(functionDeclaration, 1 /* Export */) || functionDeclaration.parent.kind === 264 /* ClassDeclaration */ && functionDeclaration.kind !== 176 /* Constructor */;
+ return hasSyntacticModifier(functionDeclaration, 1 /* Export */) || functionDeclaration.parent.kind === 266 /* ClassDeclaration */ && functionDeclaration.kind !== 178 /* Constructor */;
}
function spanInFunctionDeclaration(functionDeclaration) {
if (!functionDeclaration.body) {
@@ -126343,22 +126601,22 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
function spanInBlock(block) {
switch (block.parent.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (getModuleInstanceState(block.parent) !== 1 /* Instantiated */) {
return void 0;
}
- case 248 /* WhileStatement */:
- case 246 /* IfStatement */:
- case 250 /* ForInStatement */:
+ case 250 /* WhileStatement */:
+ case 248 /* IfStatement */:
+ case 252 /* ForInStatement */:
return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]);
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
return spanInNodeIfStartsOnSameLine(findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]);
}
return spanInNode(block.statements[0]);
}
function spanInInitializerOfForLike(forLikeStatement) {
- if (forLikeStatement.initializer.kind === 262 /* VariableDeclarationList */) {
+ if (forLikeStatement.initializer.kind === 264 /* VariableDeclarationList */) {
const variableDeclarationList = forLikeStatement.initializer;
if (variableDeclarationList.declarations.length > 0) {
return spanInNode(variableDeclarationList.declarations[0]);
@@ -126381,64 +126639,64 @@ function spanInSourceFileAtLocation(sourceFile, position) {
function spanInBindingPattern(bindingPattern) {
const firstBindingElement = forEach(
bindingPattern.elements,
- (element) => element.kind !== 233 /* OmittedExpression */ ? element : void 0
+ (element) => element.kind !== 235 /* OmittedExpression */ ? element : void 0
);
if (firstBindingElement) {
return spanInNode(firstBindingElement);
}
- if (bindingPattern.parent.kind === 208 /* BindingElement */) {
+ if (bindingPattern.parent.kind === 210 /* BindingElement */) {
return textSpan(bindingPattern.parent);
}
return textSpanFromVariableDeclaration(bindingPattern.parent);
}
function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node2) {
- Debug.assert(node2.kind !== 207 /* ArrayBindingPattern */ && node2.kind !== 206 /* ObjectBindingPattern */);
- const elements = node2.kind === 209 /* ArrayLiteralExpression */ ? node2.elements : node2.properties;
+ Debug.assert(node2.kind !== 209 /* ArrayBindingPattern */ && node2.kind !== 208 /* ObjectBindingPattern */);
+ const elements = node2.kind === 211 /* ArrayLiteralExpression */ ? node2.elements : node2.properties;
const firstBindingElement = forEach(
elements,
- (element) => element.kind !== 233 /* OmittedExpression */ ? element : void 0
+ (element) => element.kind !== 235 /* OmittedExpression */ ? element : void 0
);
if (firstBindingElement) {
return spanInNode(firstBindingElement);
}
- return textSpan(node2.parent.kind === 227 /* BinaryExpression */ ? node2.parent : node2);
+ return textSpan(node2.parent.kind === 229 /* BinaryExpression */ ? node2.parent : node2);
}
function spanInOpenBraceToken(node2) {
switch (node2.parent.kind) {
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
const enumDeclaration = node2.parent;
return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile));
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const classDeclaration = node2.parent;
return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile));
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return spanInNodeIfStartsOnSameLine(node2.parent.parent, node2.parent.clauses[0]);
}
return spanInNode(node2.parent);
}
function spanInCloseBraceToken(node2) {
switch (node2.parent.kind) {
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
if (getModuleInstanceState(node2.parent.parent) !== 1 /* Instantiated */) {
return void 0;
}
- case 269 /* EnumDeclaration */:
- case 264 /* ClassDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 266 /* ClassDeclaration */:
return textSpan(node2);
- case 242 /* Block */:
+ case 244 /* Block */:
if (isFunctionBlock(node2.parent)) {
return textSpan(node2);
}
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return spanInNode(lastOrUndefined(node2.parent.statements));
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
const caseBlock = node2.parent;
const lastClause = lastOrUndefined(caseBlock.clauses);
if (lastClause) {
return spanInNode(lastOrUndefined(lastClause.statements));
}
return void 0;
- case 206 /* ObjectBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
const bindingPattern = node2.parent;
return spanInNode(lastOrUndefined(bindingPattern.elements) || bindingPattern);
default:
@@ -126451,7 +126709,7 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
function spanInCloseBracketToken(node2) {
switch (node2.parent.kind) {
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
const bindingPattern = node2.parent;
return textSpan(lastOrUndefined(bindingPattern.elements) || bindingPattern);
default:
@@ -126463,56 +126721,56 @@ function spanInSourceFileAtLocation(sourceFile, position) {
}
}
function spanInOpenParenToken(node2) {
- if (node2.parent.kind === 247 /* DoStatement */ || node2.parent.kind === 213 /* CallExpression */ || node2.parent.kind === 214 /* NewExpression */) {
+ if (node2.parent.kind === 249 /* DoStatement */ || node2.parent.kind === 215 /* CallExpression */ || node2.parent.kind === 216 /* NewExpression */) {
return spanInPreviousNode(node2);
}
- if (node2.parent.kind === 217 /* ParenthesizedExpression */) {
+ if (node2.parent.kind === 219 /* ParenthesizedExpression */) {
return spanInNextNode(node2);
}
return spanInNode(node2.parent);
}
function spanInCloseParenToken(node2) {
switch (node2.parent.kind) {
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 176 /* Constructor */:
- case 248 /* WhileStatement */:
- case 247 /* DoStatement */:
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 250 /* WhileStatement */:
+ case 249 /* DoStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 219 /* ParenthesizedExpression */:
return spanInPreviousNode(node2);
default:
return spanInNode(node2.parent);
}
}
function spanInColonToken(node2) {
- if (isFunctionLike(node2.parent) || node2.parent.kind === 305 /* PropertyAssignment */ || node2.parent.kind === 168 /* Parameter */) {
+ if (isFunctionLike(node2.parent) || node2.parent.kind === 308 /* PropertyAssignment */ || node2.parent.kind === 169 /* Parameter */) {
return spanInPreviousNode(node2);
}
return spanInNode(node2.parent);
}
function spanInGreaterThanOrLessThanToken(node2) {
- if (node2.parent.kind === 216 /* TypeAssertionExpression */) {
+ if (node2.parent.kind === 218 /* TypeAssertionExpression */) {
return spanInNextNode(node2);
}
return spanInNode(node2.parent);
}
function spanInWhileKeyword(node2) {
- if (node2.parent.kind === 247 /* DoStatement */) {
+ if (node2.parent.kind === 249 /* DoStatement */) {
return textSpanEndingAtNextToken(node2, node2.parent.expression);
}
return spanInNode(node2.parent);
}
function spanInOfKeyword(node2) {
- if (node2.parent.kind === 251 /* ForOfStatement */) {
+ if (node2.parent.kind === 253 /* ForOfStatement */) {
return spanInNextNode(node2);
}
return spanInNode(node2.parent);
@@ -126601,17 +126859,17 @@ function getCallHierarchItemContainerName(node) {
return;
}
switch (node.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
- if (node.parent.kind === 210 /* ObjectLiteralExpression */) {
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ if (node.parent.kind === 212 /* ObjectLiteralExpression */) {
return (_a2 = getAssignedName(node.parent)) == null ? void 0 : _a2.getText();
}
return (_b = getNameOfDeclaration(node.parent)) == null ? void 0 : _b.getText();
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (isModuleBlock(node.parent) && isIdentifier(node.parent.parent.name)) {
return node.parent.parent.name.getText();
}
@@ -126789,55 +127047,55 @@ function createCallSiteCollector(program, callSites) {
}
switch (node.kind) {
case 79 /* Identifier */:
- case 274 /* ImportEqualsDeclaration */:
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return;
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
recordCallSite(node);
return;
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
collect(node.expression);
return;
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
collect(node.name);
collect(node.initializer);
return;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
recordCallSite(node);
collect(node.expression);
forEach(node.arguments, collect);
return;
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
recordCallSite(node);
collect(node.expression);
forEach(node.arguments, collect);
return;
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
recordCallSite(node);
collect(node.tag);
collect(node.template);
return;
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
recordCallSite(node);
collect(node.tagName);
collect(node.attributes);
return;
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
recordCallSite(node);
collect(node.expression);
return;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
recordCallSite(node);
forEachChild(node, collect);
break;
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
collect(node.expression);
return;
}
@@ -126890,26 +127148,26 @@ function collectCallSites(program, node) {
const callSites = [];
const collect = createCallSiteCollector(program, callSites);
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
collectCallSitesOfSourceFile(node, collect);
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
collectCallSitesOfModuleDeclaration(node, collect);
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect);
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
collectCallSitesOfClassLikeDeclaration(node, collect);
break;
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
collectCallSitesOfClassStaticBlockDeclaration(node, collect);
break;
default:
@@ -127010,13 +127268,13 @@ function collectTokens(program, sourceFile, span, collector, cancellationToken)
let inJSXElement = false;
function visit(node) {
switch (node.kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
if (!node || !textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) {
@@ -127156,25 +127414,25 @@ function isRightSideOfQualifiedNameOrPropertyAccess2(node) {
return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node;
}
var tokenFromDeclarationMapping = new Map2([
- [261 /* VariableDeclaration */, 7 /* variable */],
- [168 /* Parameter */, 6 /* parameter */],
- [171 /* PropertyDeclaration */, 9 /* property */],
- [270 /* ModuleDeclaration */, 3 /* namespace */],
- [269 /* EnumDeclaration */, 1 /* enum */],
- [308 /* EnumMember */, 8 /* enumMember */],
- [264 /* ClassDeclaration */, 0 /* class */],
- [174 /* MethodDeclaration */, 11 /* member */],
- [263 /* FunctionDeclaration */, 10 /* function */],
- [218 /* FunctionExpression */, 10 /* function */],
- [173 /* MethodSignature */, 11 /* member */],
- [177 /* GetAccessor */, 9 /* property */],
- [178 /* SetAccessor */, 9 /* property */],
- [170 /* PropertySignature */, 9 /* property */],
- [267 /* InterfaceDeclaration */, 2 /* interface */],
- [268 /* TypeAliasDeclaration */, 5 /* type */],
- [167 /* TypeParameter */, 4 /* typeParameter */],
- [305 /* PropertyAssignment */, 9 /* property */],
- [306 /* ShorthandPropertyAssignment */, 9 /* property */]
+ [263 /* VariableDeclaration */, 7 /* variable */],
+ [169 /* Parameter */, 6 /* parameter */],
+ [172 /* PropertyDeclaration */, 9 /* property */],
+ [273 /* ModuleDeclaration */, 3 /* namespace */],
+ [272 /* EnumDeclaration */, 1 /* enum */],
+ [311 /* EnumMember */, 8 /* enumMember */],
+ [266 /* ClassDeclaration */, 0 /* class */],
+ [176 /* MethodDeclaration */, 11 /* member */],
+ [265 /* FunctionDeclaration */, 10 /* function */],
+ [220 /* FunctionExpression */, 10 /* function */],
+ [175 /* MethodSignature */, 11 /* member */],
+ [179 /* GetAccessor */, 9 /* property */],
+ [180 /* SetAccessor */, 9 /* property */],
+ [171 /* PropertySignature */, 9 /* property */],
+ [270 /* InterfaceDeclaration */, 2 /* interface */],
+ [271 /* TypeAliasDeclaration */, 5 /* type */],
+ [168 /* TypeParameter */, 4 /* typeParameter */],
+ [308 /* PropertyAssignment */, 9 /* property */],
+ [309 /* ShorthandPropertyAssignment */, 9 /* property */]
]);
// src/services/_namespaces/ts.codefix.ts
@@ -127521,7 +127779,7 @@ function findAwaitableInitializers(expression, sourceFile, cancellationToken, pr
}
const declaration = tryCast(symbol.valueDeclaration, isVariableDeclaration);
const variableName = declaration && tryCast(declaration.name, isIdentifier);
- const variableStatement = getAncestor(declaration, 244 /* VariableStatement */);
+ const variableStatement = getAncestor(declaration, 246 /* VariableStatement */);
if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement, 1 /* Export */) || !variableName || !isInsideAwaitableBody(declaration.initializer)) {
isCompleteFix = false;
continue;
@@ -127573,7 +127831,7 @@ function symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, c
return diagnostic && contains(errorCodes3, diagnostic.code) || checker.getTypeAtLocation(errorNode).flags & 1 /* Any */;
}
function isInsideAwaitableBody(node) {
- return node.kind & 32768 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 263 /* FunctionDeclaration */ || ancestor.parent.kind === 218 /* FunctionExpression */ || ancestor.parent.kind === 219 /* ArrowFunction */ || ancestor.parent.kind === 174 /* MethodDeclaration */));
+ return node.kind & 32768 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 265 /* FunctionDeclaration */ || ancestor.parent.kind === 220 /* FunctionExpression */ || ancestor.parent.kind === 221 /* ArrowFunction */ || ancestor.parent.kind === 176 /* MethodDeclaration */));
}
function makeChange3(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) {
if (isForOfStatement(insertionSite.parent) && !insertionSite.parent.awaitModifier) {
@@ -127695,10 +127953,10 @@ function applyChange(changeTracker, initializer, sourceFile, fixedNodes) {
function isPossiblyPartOfDestructuring(node) {
switch (node.kind) {
case 79 /* Identifier */:
- case 209 /* ArrayLiteralExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 211 /* ArrayLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return true;
default:
return false;
@@ -127711,7 +127969,7 @@ function arrayElementCouldBeVariableDeclaration(expression, checker) {
function isPossiblyPartOfCommaSeperatedInitializer(node) {
switch (node.kind) {
case 79 /* Identifier */:
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
case 27 /* CommaToken */:
return true;
default:
@@ -127753,7 +128011,7 @@ function makeChange5(changeTracker, sourceFile, pos, fixedNodes) {
return;
}
const declaration = token.parent;
- if (declaration.kind === 171 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) {
+ if (declaration.kind === 172 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) {
changeTracker.insertModifierBefore(sourceFile, 137 /* DeclareKeyword */, declaration);
}
}
@@ -127887,7 +128145,7 @@ function addUndefinedToOptionalProperty(changes, toAdd) {
const d = add.valueDeclaration;
if (d && (isPropertySignature(d) || isPropertyDeclaration(d)) && d.type) {
const t = factory.createUnionTypeNode([
- ...d.type.kind === 192 /* UnionType */ ? d.type.types : [d.type],
+ ...d.type.kind === 194 /* UnionType */ ? d.type.types : [d.type],
factory.createTypeReferenceNode("undefined")
]);
changes.replaceNode(d.getSourceFile(), d.type, t);
@@ -127955,24 +128213,24 @@ function doChange(changes, sourceFile, decl) {
}
}
function isDeclarationWithType(node) {
- return isFunctionLikeDeclaration(node) || node.kind === 261 /* VariableDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 171 /* PropertyDeclaration */;
+ return isFunctionLikeDeclaration(node) || node.kind === 263 /* VariableDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 172 /* PropertyDeclaration */;
}
function transformJSDocType(node) {
switch (node.kind) {
- case 321 /* JSDocAllType */:
- case 322 /* JSDocUnknownType */:
+ case 324 /* JSDocAllType */:
+ case 325 /* JSDocUnknownType */:
return factory.createTypeReferenceNode("any", emptyArray);
- case 325 /* JSDocOptionalType */:
+ case 328 /* JSDocOptionalType */:
return transformJSDocOptionalType(node);
- case 324 /* JSDocNonNullableType */:
+ case 327 /* JSDocNonNullableType */:
return transformJSDocType(node.type);
- case 323 /* JSDocNullableType */:
+ case 326 /* JSDocNullableType */:
return transformJSDocNullableType(node);
- case 327 /* JSDocVariadicType */:
+ case 330 /* JSDocVariadicType */:
return transformJSDocVariadicType(node);
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return transformJSDocFunctionType(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return transformJSDocTypeReference(node);
default:
const visited = visitEachChild(node, transformJSDocType, nullTransformationContext);
@@ -127995,7 +128253,7 @@ function transformJSDocFunctionType(node) {
}
function transformJSDocParameter(node) {
const index = node.parent.parameters.indexOf(node);
- const isRest = node.type.kind === 327 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1;
+ const isRest = node.type.kind === 330 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1;
const name = node.name || (isRest ? "rest" : "arg" + index);
const dotdotdot = isRest ? factory.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken;
return factory.createParameterDeclaration(node.modifiers, dotdotdot, name, node.questionToken, visitNode(node.type, transformJSDocType), node.initializer);
@@ -128143,7 +128401,7 @@ function doChange2(changes, sourceFile, position, checker, preferences, compiler
})) {
return;
}
- const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 245 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression;
+ const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 247 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression;
changes.delete(sourceFile, nodeToDelete);
if (!assignmentExpr) {
members.push(factory.createPropertyDeclaration(
@@ -128213,7 +128471,7 @@ function doChange2(changes, sourceFile, position, checker, preferences, compiler
function createArrowFunctionExpressionMember(members2, arrowFunction, name) {
const arrowFunctionBody = arrowFunction.body;
let bodyBlock;
- if (arrowFunctionBody.kind === 242 /* Block */) {
+ if (arrowFunctionBody.kind === 244 /* Block */) {
bodyBlock = arrowFunctionBody;
} else {
bodyBlock = factory.createBlock([factory.createReturnStatement(arrowFunctionBody)]);
@@ -128665,7 +128923,7 @@ function transformCallbackArgument(func, hasContinuation, continuationArgName, i
switch (func.kind) {
case 105 /* NullKeyword */:
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
case 79 /* Identifier */:
if (!inputArgName) {
break;
@@ -128685,8 +128943,8 @@ function transformCallbackArgument(func, hasContinuation, continuationArgName, i
continuationArgName.types.push(transformer.checker.getAwaitedType(returnType) || returnType);
}
return varDeclOrAssignment;
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */: {
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */: {
const funcBody = func.body;
const returnType2 = (_a2 = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) == null ? void 0 : _a2.getReturnType();
if (isBlock(funcBody)) {
@@ -128900,10 +129158,10 @@ function fixImportOfModuleExports(importingFile, exportingFile, changes, quotePr
}
const importNode = importFromModuleSpecifier(moduleSpecifier);
switch (importNode.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
changes.replaceNode(importingFile, importNode, makeImport(importNode.name, void 0, moduleSpecifier, quotePreference));
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isRequireCall(importNode, false)) {
changes.replaceNode(importingFile, importNode, factory.createPropertyAccessExpression(getSynthesizedDeepClone(importNode), "default"));
}
@@ -128962,19 +129220,19 @@ function forEachExportReference(sourceFile, cb) {
}
function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference) {
switch (statement.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference);
return false;
- case 245 /* ExpressionStatement */: {
+ case 247 /* ExpressionStatement */: {
const { expression } = statement;
switch (expression.kind) {
- case 213 /* CallExpression */: {
+ case 215 /* CallExpression */: {
if (isRequireCall(expression, true)) {
changes.replaceNode(sourceFile, statement, makeImport(void 0, void 0, expression.arguments[0], quotePreference));
}
return false;
}
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const { operatorToken } = expression;
return operatorToken.kind === 63 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports, useSitesToUnqualify);
}
@@ -129016,8 +129274,8 @@ function convertVariableStatement(sourceFile, statement, changes, checker, ident
}
function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) {
switch (name.kind) {
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */: {
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */: {
const tmp = makeUniqueName(propertyName, identifiers);
return convertedImports([
makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference),
@@ -129056,14 +129314,14 @@ function convertAssignment(sourceFile, checker, assignment, changes, exports, us
function tryChangeModuleExportsObject(object, useSitesToUnqualify) {
const statements = mapAllOrFail(object.properties, (prop) => {
switch (prop.kind) {
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 306 /* ShorthandPropertyAssignment */:
- case 307 /* SpreadAssignment */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 310 /* SpreadAssignment */:
return void 0;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return !isIdentifier(prop.name) ? void 0 : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return !isIdentifier(prop.name) ? void 0 : functionExpressionToDeclaration(prop.name.text, [factory.createToken(94 /* ExportKeyword */)], prop, useSitesToUnqualify);
default:
Debug.assertNever(prop, `Convert to ES6 got invalid prop kind ${prop.kind}`);
@@ -129118,15 +129376,15 @@ function convertExportsPropertyAssignment({ left, right, parent: parent2 }, sour
function convertExportsDotXEquals_replaceNode(name, exported, useSitesToUnqualify) {
const modifiers = [factory.createToken(94 /* ExportKeyword */)];
switch (exported.kind) {
- case 218 /* FunctionExpression */: {
+ case 220 /* FunctionExpression */: {
const { name: expressionName } = exported;
if (expressionName && expressionName.text !== name) {
return exportConst();
}
}
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return functionExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return classExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify);
default:
return exportConst();
@@ -129141,7 +129399,7 @@ function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) {
}
return isArray(nodeOrNodes) ? getSynthesizedDeepClonesWithReplacements(nodeOrNodes, true, replaceNode) : getSynthesizedDeepCloneWithReplacements(nodeOrNodes, true, replaceNode);
function replaceNode(original) {
- if (original.kind === 211 /* PropertyAccessExpression */) {
+ if (original.kind === 213 /* PropertyAccessExpression */) {
const replacement = useSitesToUnqualify.get(original);
useSitesToUnqualify.delete(original);
return replacement;
@@ -129150,13 +129408,13 @@ function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) {
}
function convertSingleImport(name, moduleSpecifier, checker, identifiers, target, quotePreference) {
switch (name.kind) {
- case 206 /* ObjectBindingPattern */: {
+ case 208 /* ObjectBindingPattern */: {
const importSpecifiers = mapAllOrFail(name.elements, (e) => e.dotDotDotToken || e.initializer || e.propertyName && !isIdentifier(e.propertyName) || !isIdentifier(e.name) ? void 0 : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text));
if (importSpecifiers) {
return convertedImports([makeImport(void 0, importSpecifiers, moduleSpecifier, quotePreference)]);
}
}
- case 207 /* ArrayBindingPattern */: {
+ case 209 /* ArrayBindingPattern */: {
const tmp = makeUniqueName(moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers);
return convertedImports([
makeImport(factory.createIdentifier(tmp), void 0, moduleSpecifier, quotePreference),
@@ -129227,11 +129485,11 @@ function forEachFreeIdentifier(node, cb) {
function isFreeIdentifier(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return parent2.name !== node;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return parent2.propertyName !== node;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return parent2.propertyName !== node;
default:
return true;
@@ -129901,11 +130159,11 @@ function tryUseExistingNamespaceImport(existingImports, symbolName2, position, c
function getTargetModuleFromNamespaceLikeImport(declaration, checker) {
var _a2;
switch (declaration.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return checker.resolveExternalModuleName(declaration.initializer.arguments[0]);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return checker.getAliasedSymbol(declaration.symbol);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
const namespaceImport = tryCast((_a2 = declaration.importClause) == null ? void 0 : _a2.namedBindings, isNamespaceImport);
return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol);
default:
@@ -129915,11 +130173,11 @@ function getTargetModuleFromNamespaceLikeImport(declaration, checker) {
function getNamespaceLikeImportText(declaration) {
var _a2, _b, _c;
switch (declaration.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return (_a2 = tryCast(declaration.name, isIdentifier)) == null ? void 0 : _a2.text;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return declaration.name.text;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return (_c = tryCast((_b = declaration.importClause) == null ? void 0 : _b.namedBindings, isNamespaceImport)) == null ? void 0 : _c.name.text;
default:
return Debug.assertNever(declaration);
@@ -129939,11 +130197,11 @@ function getAddAsTypeOnly(isValidTypeOnlyUseSite, isForNewImportDeclaration, sym
}
function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, compilerOptions) {
return firstDefined(existingImports, ({ declaration, importKind, symbol, targetFlags }) => {
- if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 274 /* ImportEqualsDeclaration */) {
+ if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 277 /* ImportEqualsDeclaration */) {
return void 0;
}
- if (declaration.kind === 261 /* VariableDeclaration */) {
- return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 206 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0;
+ if (declaration.kind === 263 /* VariableDeclaration */) {
+ return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 208 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0;
}
const { importClause } = declaration;
if (!importClause || !isStringLiteralLike(declaration.moduleSpecifier))
@@ -129954,7 +130212,7 @@ function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker
const addAsTypeOnly = getAddAsTypeOnly(isValidTypeOnlyUseSite, false, symbol, targetFlags, checker, compilerOptions);
if (importKind === 1 /* Default */ && (name || addAsTypeOnly === 2 /* Required */ && namedBindings))
return void 0;
- if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 277 /* NamespaceImport */)
+ if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 280 /* NamespaceImport */)
return void 0;
return {
kind: 2 /* AddToExisting */,
@@ -129974,7 +130232,7 @@ function createExistingImportMap(checker, importingFile, compilerOptions) {
if (moduleSymbol) {
(importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i.parent);
}
- } else if (i.kind === 275 /* ImportDeclaration */ || i.kind === 274 /* ImportEqualsDeclaration */) {
+ } else if (i.kind === 278 /* ImportDeclaration */ || i.kind === 277 /* ImportEqualsDeclaration */) {
const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier);
if (moduleSymbol) {
(importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i);
@@ -130315,7 +130573,7 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy
case 4 /* PromoteTypeOnly */: {
const { typeOnlyAliasDeclaration } = fix;
const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, compilerOptions, sourceFile);
- return promotedDeclaration.kind === 279 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
+ return promotedDeclaration.kind === 282 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
}
default:
return Debug.assertNever(fix, `Unexpected fix kind ${fix.kind}`);
@@ -130323,12 +130581,12 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy
}
function getModuleSpecifierText(promotedDeclaration) {
var _a2, _b;
- return promotedDeclaration.kind === 274 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text;
+ return promotedDeclaration.kind === 277 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text;
}
function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile) {
const convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules;
switch (aliasDeclaration.kind) {
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
if (aliasDeclaration.isTypeOnly) {
if (aliasDeclaration.parent.elements.length > 1 && ts_OrganizeImports_exports.importSpecifiersAreSorted(aliasDeclaration.parent.elements)) {
changes.delete(sourceFile, aliasDeclaration);
@@ -130344,13 +130602,13 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF
promoteImportClause(aliasDeclaration.parent.parent);
return aliasDeclaration.parent.parent;
}
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
promoteImportClause(aliasDeclaration);
return aliasDeclaration;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
promoteImportClause(aliasDeclaration.parent);
return aliasDeclaration.parent;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
changes.deleteRange(sourceFile, aliasDeclaration.getChildAt(1));
return aliasDeclaration;
default:
@@ -130361,7 +130619,7 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF
if (convertExistingToTypeOnly) {
const namedImports = tryCast(importClause.namedBindings, isNamedImports);
if (namedImports && namedImports.elements.length > 1) {
- if (ts_OrganizeImports_exports.importSpecifiersAreSorted(namedImports.elements) && aliasDeclaration.kind === 279 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) {
+ if (ts_OrganizeImports_exports.importSpecifiersAreSorted(namedImports.elements) && aliasDeclaration.kind === 282 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) {
changes.delete(sourceFile, aliasDeclaration);
changes.insertImportSpecifierAtIndex(sourceFile, aliasDeclaration, namedImports, 0);
}
@@ -130376,7 +130634,7 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF
}
function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, compilerOptions) {
var _a2;
- if (clause.kind === 206 /* ObjectBindingPattern */) {
+ if (clause.kind === 208 /* ObjectBindingPattern */) {
if (defaultImport) {
addElementToBindingPattern(clause, defaultImport.name, "default");
}
@@ -130774,13 +131032,13 @@ function doRemoveOverrideModifierChange(changeTracker, sourceFile, pos) {
}
function isClassElementLikeHasJSDoc(node) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return isParameterPropertyDeclaration(node, node.parent);
default:
return false;
@@ -131038,7 +131296,7 @@ registerCodeFix({
});
function getNamedTupleMember(sourceFile, pos) {
const token = getTokenAtPosition(sourceFile, pos);
- return findAncestor(token, (t) => t.kind === 202 /* NamedTupleMember */);
+ return findAncestor(token, (t) => t.kind === 204 /* NamedTupleMember */);
}
function doChange8(changes, sourceFile, namedTupleMember) {
if (!namedTupleMember) {
@@ -131047,10 +131305,10 @@ function doChange8(changes, sourceFile, namedTupleMember) {
let unwrappedType = namedTupleMember.type;
let sawOptional = false;
let sawRest = false;
- while (unwrappedType.kind === 190 /* OptionalType */ || unwrappedType.kind === 191 /* RestType */ || unwrappedType.kind === 196 /* ParenthesizedType */) {
- if (unwrappedType.kind === 190 /* OptionalType */) {
+ while (unwrappedType.kind === 192 /* OptionalType */ || unwrappedType.kind === 193 /* RestType */ || unwrappedType.kind === 198 /* ParenthesizedType */) {
+ if (unwrappedType.kind === 192 /* OptionalType */) {
sawOptional = true;
- } else if (unwrappedType.kind === 191 /* RestType */) {
+ } else if (unwrappedType.kind === 193 /* RestType */) {
sawRest = true;
}
unwrappedType = unwrappedType.type;
@@ -131357,19 +131615,19 @@ function getInfo6(checker, sourceFile, position, errorCode) {
}
function getVariableLikeInitializer(declaration) {
switch (declaration.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 171 /* PropertyDeclaration */:
- case 305 /* PropertyAssignment */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 172 /* PropertyDeclaration */:
+ case 308 /* PropertyAssignment */:
return declaration.initializer;
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return declaration.initializer && (isJsxExpression(declaration.initializer) ? declaration.initializer.expression : void 0);
- case 306 /* ShorthandPropertyAssignment */:
- case 170 /* PropertySignature */:
- case 308 /* EnumMember */:
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 171 /* PropertySignature */:
+ case 311 /* EnumMember */:
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
return void 0;
}
}
@@ -131611,7 +131869,7 @@ function createActionForAddMissingMemberInJavascriptFile(context, { parentDeclar
function addMissingMemberInJs(changeTracker, sourceFile, classDeclaration, token, makeStatic) {
const tokenName = token.text;
if (makeStatic) {
- if (classDeclaration.kind === 232 /* ClassExpression */) {
+ if (classDeclaration.kind === 234 /* ClassExpression */) {
return;
}
const className = classDeclaration.name.getText();
@@ -131660,7 +131918,7 @@ function createActionsForAddMissingMemberInTypeScriptFile(context, { parentDecla
}
function getTypeNode2(checker, node, token) {
let typeNode;
- if (token.parent.parent.kind === 227 /* BinaryExpression */) {
+ if (token.parent.parent.kind === 229 /* BinaryExpression */) {
const binaryExpression = token.parent.parent;
const otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left;
const widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression)));
@@ -131726,7 +131984,7 @@ function getActionsForMissingMethodDeclaration(context, info) {
}
function addMethodDeclaration(context, changes, callExpression, name, modifierFlags, parentDeclaration, sourceFile) {
const importAdder = createImportAdder(sourceFile, context.program, context.preferences, context.host);
- const kind = isClassLike(parentDeclaration) ? 174 /* MethodDeclaration */ : 173 /* MethodSignature */;
+ const kind = isClassLike(parentDeclaration) ? 176 /* MethodDeclaration */ : 175 /* MethodSignature */;
const signatureDeclaration = createSignatureDeclarationFromCallExpression(kind, context, importAdder, callExpression, name, modifierFlags, parentDeclaration);
const containingMethodDeclaration = tryGetContainingMethodDeclaration(parentDeclaration, callExpression);
if (containingMethodDeclaration) {
@@ -131755,7 +132013,7 @@ function addEnumMemberDeclaration(changes, checker, { token, parentDeclaration }
function addFunctionDeclaration(changes, context, info) {
const quotePreference = getQuotePreference(context.sourceFile, context.preferences);
const importAdder = createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
- const functionDeclaration = info.kind === 2 /* Function */ ? createSignatureDeclarationFromCallExpression(263 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature(263 /* FunctionDeclaration */, context, quotePreference, info.signature, createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference), info.token, void 0, void 0, void 0, importAdder);
+ const functionDeclaration = info.kind === 2 /* Function */ ? createSignatureDeclarationFromCallExpression(265 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature(265 /* FunctionDeclaration */, context, quotePreference, info.signature, createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference), info.token, void 0, void 0, void 0, importAdder);
if (functionDeclaration === void 0) {
Debug.fail("fixMissingFunctionDeclaration codefix got unexpected error.");
}
@@ -131855,7 +132113,7 @@ function tryGetValueFromType(context, checker, importAdder, quotePreference, typ
if (signature === void 0)
return createUndefined();
const func = createSignatureDeclarationFromSignature(
- 218 /* FunctionExpression */,
+ 220 /* FunctionExpression */,
context,
quotePreference,
signature[0],
@@ -132516,7 +132774,7 @@ registerCodeFix({
const importDeclaration = getImportDeclaration(context.sourceFile, context.program, context.span.start);
if (!importDeclaration)
return;
- const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => importDeclaration.kind === 279 /* ImportSpecifier */ && doNamespaceImportChange(t, context.sourceFile, importDeclaration, context.program));
+ const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => importDeclaration.kind === 282 /* ImportSpecifier */ && doNamespaceImportChange(t, context.sourceFile, importDeclaration, context.program));
const typeOnlyChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => doTypeOnlyImportChange(t, context.sourceFile, importDeclaration, context.program));
let actions2;
if (namespaceChanges.length) {
@@ -132531,18 +132789,18 @@ registerCodeFix({
});
function getImportDeclaration(sourceFile, program, start) {
const identifier = tryCast(getTokenAtPosition(sourceFile, start), isIdentifier);
- if (!identifier || identifier.parent.kind !== 183 /* TypeReference */)
+ if (!identifier || identifier.parent.kind !== 185 /* TypeReference */)
return;
const checker = program.getTypeChecker();
const symbol = checker.getSymbolAtLocation(identifier);
return find((symbol == null ? void 0 : symbol.declarations) || emptyArray, or(isImportClause, isImportSpecifier, isImportEqualsDeclaration));
}
function doTypeOnlyImportChange(changes, sourceFile, importDeclaration, program) {
- if (importDeclaration.kind === 274 /* ImportEqualsDeclaration */) {
+ if (importDeclaration.kind === 277 /* ImportEqualsDeclaration */) {
changes.insertModifierBefore(sourceFile, 155 /* TypeKeyword */, importDeclaration.name);
return;
}
- const importClause = importDeclaration.kind === 276 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent;
+ const importClause = importDeclaration.kind === 279 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent;
if (importClause.name && importClause.namedBindings) {
return;
}
@@ -132700,7 +132958,7 @@ function deleteTypeParameters(changes, sourceFile, token) {
changes.delete(sourceFile, Debug.checkDefined(cast(token.parent, isDeclarationWithTypeParameterChildren).typeParameters, "The type parameter to delete should exist"));
}
function isImport(token) {
- return token.kind === 101 /* ImportKeyword */ || token.kind === 79 /* Identifier */ && (token.parent.kind === 279 /* ImportSpecifier */ || token.parent.kind === 276 /* ImportClause */);
+ return token.kind === 101 /* ImportKeyword */ || token.kind === 79 /* Identifier */ && (token.parent.kind === 282 /* ImportSpecifier */ || token.parent.kind === 279 /* ImportClause */);
}
function tryGetFullImport(token) {
return token.kind === 101 /* ImportKeyword */ ? tryCast(token.parent, isImportDeclaration) : void 0;
@@ -132709,7 +132967,7 @@ function canDeleteEntireVariableStatement(sourceFile, token) {
return isVariableDeclarationList(token.parent) && first(token.parent.getChildren(sourceFile)) === token;
}
function deleteEntireVariableStatement(changes, sourceFile, node) {
- changes.delete(sourceFile, node.parent.kind === 244 /* VariableStatement */ ? node.parent : node);
+ changes.delete(sourceFile, node.parent.kind === 246 /* VariableStatement */ ? node.parent : node);
}
function deleteDestructuringElements(changes, sourceFile, node) {
forEach(node.elements, (n) => changes.delete(sourceFile, n));
@@ -132733,14 +132991,14 @@ function tryPrefixDeclaration(changes, errorCode, sourceFile, token) {
}
function canPrefix(token) {
switch (token.parent.kind) {
- case 168 /* Parameter */:
- case 167 /* TypeParameter */:
+ case 169 /* Parameter */:
+ case 168 /* TypeParameter */:
return true;
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
const varDecl = token.parent;
switch (varDecl.parent.parent.kind) {
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
return true;
}
}
@@ -132789,8 +133047,8 @@ function isNotProvidedArguments(parameter, checker, sourceFiles) {
function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll) {
const { parent: parent2 } = parameter;
switch (parent2.kind) {
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
const index = parent2.parameters.indexOf(parameter);
const referent = isMethodDeclaration(parent2) ? parent2.name : parent2;
const entries = ts_FindAllReferences_exports.Core.getReferencedSymbolsForNode(parent2.pos, referent, program, sourceFiles, cancellationToken);
@@ -132808,18 +133066,18 @@ function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program
}
}
return true;
- case 263 /* FunctionDeclaration */: {
+ case 265 /* FunctionDeclaration */: {
if (parent2.name && isCallbackLike(checker, sourceFile, parent2.name)) {
return isLastParameter(parent2, parameter, isFixAll);
}
return true;
}
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return isLastParameter(parent2, parameter, isFixAll);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return false;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return true;
default:
return Debug.failBadSyntaxKind(parent2);
@@ -132869,7 +133127,7 @@ function doChange18(changes, sourceFile, start, length2, errorCode) {
const container = (isBlock(statement.parent) ? statement.parent : statement).parent;
if (!isBlock(statement.parent) || statement === first(statement.parent.statements)) {
switch (container.kind) {
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
if (container.elseStatement) {
if (isBlock(statement.parent)) {
break;
@@ -132878,8 +133136,8 @@ function doChange18(changes, sourceFile, start, length2, errorCode) {
}
return;
}
- case 248 /* WhileStatement */:
- case 249 /* ForStatement */:
+ case 250 /* WhileStatement */:
+ case 251 /* ForStatement */:
changes.delete(sourceFile, container);
return;
}
@@ -132938,7 +133196,7 @@ registerCodeFix({
const { typeNode, type } = info;
const original = typeNode.getText(sourceFile);
const actions2 = [fix(type, fixIdPlain, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)];
- if (typeNode.kind === 323 /* JSDocNullableType */) {
+ if (typeNode.kind === 326 /* JSDocNullableType */) {
actions2.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types));
}
return actions2;
@@ -132956,7 +133214,7 @@ registerCodeFix({
if (!info)
return;
const { typeNode, type } = info;
- const fixedType = typeNode.kind === 323 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
+ const fixedType = typeNode.kind === 326 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
doChange20(changes, sourceFile, typeNode, fixedType, checker);
});
}
@@ -132971,22 +133229,22 @@ function getInfo11(sourceFile, pos, checker) {
}
function isTypeContainer(node) {
switch (node.kind) {
- case 235 /* AsExpression */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 263 /* FunctionDeclaration */:
- case 177 /* GetAccessor */:
- case 181 /* IndexSignature */:
- case 200 /* MappedType */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 168 /* Parameter */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 178 /* SetAccessor */:
- case 268 /* TypeAliasDeclaration */:
- case 216 /* TypeAssertionExpression */:
- case 261 /* VariableDeclaration */:
+ case 237 /* AsExpression */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 179 /* GetAccessor */:
+ case 183 /* IndexSignature */:
+ case 202 /* MappedType */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 169 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 180 /* SetAccessor */:
+ case 271 /* TypeAliasDeclaration */:
+ case 218 /* TypeAssertionExpression */:
+ case 263 /* VariableDeclaration */:
return true;
default:
return false;
@@ -133077,14 +133335,14 @@ function getNodes3(sourceFile, start) {
}
let insertBefore;
switch (containingFunction.kind) {
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
insertBefore = containingFunction.name;
break;
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
insertBefore = findChildOfKind(containingFunction, 99 /* FunctionKeyword */, sourceFile);
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
const kind = containingFunction.typeParameters ? 29 /* LessThanToken */ : 20 /* OpenParenToken */;
insertBefore = findChildOfKind(containingFunction, kind, sourceFile) || first(containingFunction.parameters);
break;
@@ -133379,7 +133637,7 @@ function annotateSetAccessor(changes, importAdder, sourceFile, setAccessorDeclar
function annotate(changes, importAdder, sourceFile, declaration, type, program, host) {
const typeNode = getTypeNodeIfAccessible(type, declaration, program, host);
if (typeNode) {
- if (isInJSFile(sourceFile) && declaration.kind !== 170 /* PropertySignature */) {
+ if (isInJSFile(sourceFile) && declaration.kind !== 171 /* PropertySignature */) {
const parent2 = isVariableDeclaration(declaration) ? tryCast(declaration.parent.parent, isVariableStatement) : declaration;
if (!parent2) {
return;
@@ -133455,17 +133713,17 @@ function inferTypeForParametersFromUsage(func, sourceFile, program, cancellation
function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) {
let searchToken;
switch (containingFunction.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
searchToken = findChildOfKind(containingFunction, 136 /* ConstructorKeyword */, sourceFile);
break;
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
const parent2 = containingFunction.parent;
searchToken = (isVariableDeclaration(parent2) || isPropertyDeclaration(parent2)) && isIdentifier(parent2.name) ? parent2.name : containingFunction.name;
break;
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
searchToken = containingFunction.name;
break;
}
@@ -133600,44 +133858,44 @@ function inferTypeFromReferences(program, references, cancellationToken) {
node = node.parent;
}
switch (node.parent.kind) {
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
inferTypeFromExpressionStatement(node, usage);
break;
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
usage.isNumber = true;
break;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
inferTypeFromPrefixUnaryExpression(node.parent, usage);
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
inferTypeFromBinaryExpression(node, node.parent, usage);
break;
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
inferTypeFromSwitchStatementLabel(node.parent, usage);
break;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
if (node.parent.expression === node) {
inferTypeFromCallExpression(node.parent, usage);
} else {
inferTypeFromContextualType(node, usage);
}
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
inferTypeFromPropertyAccessExpression(node.parent, usage);
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
inferTypeFromPropertyElementExpression(node.parent, node, usage);
break;
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
inferTypeFromPropertyAssignment(node.parent, usage);
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
inferTypeFromPropertyDeclaration(node.parent, usage);
break;
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
const { name, initializer } = node.parent;
if (node === name) {
if (initializer) {
@@ -133734,7 +133992,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
break;
case 56 /* BarBarToken */:
case 60 /* QuestionQuestionToken */:
- if (node === parent2.left && (node.parent.parent.kind === 261 /* VariableDeclaration */ || isAssignmentExpression(node.parent.parent, true))) {
+ if (node === parent2.left && (node.parent.parent.kind === 263 /* VariableDeclaration */ || isAssignmentExpression(node.parent.parent, true))) {
addCandidateType(usage, checker.getTypeAtLocation(parent2.right));
}
break;
@@ -133758,7 +134016,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
}
}
calculateUsageOfNode(parent2, call.return_);
- if (parent2.kind === 213 /* CallExpression */) {
+ if (parent2.kind === 215 /* CallExpression */) {
(usage.calls || (usage.calls = [])).push(call);
} else {
(usage.constructs || (usage.constructs = [])).push(call);
@@ -134177,7 +134435,7 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
const declaration = declarations == null ? void 0 : declarations[0];
const checker = context.program.getTypeChecker();
const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions());
- const kind = (_a2 = declaration == null ? void 0 : declaration.kind) != null ? _a2 : 170 /* PropertySignature */;
+ const kind = (_a2 = declaration == null ? void 0 : declaration.kind) != null ? _a2 : 171 /* PropertySignature */;
const declarationName = getSynthesizedDeepClone(getNameOfDeclaration(declaration), false);
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
let modifierFlags = effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
@@ -134190,8 +134448,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
const ambient = !!(enclosingDeclaration.flags & 16777216 /* Ambient */) || isAmbient;
const quotePreference = getQuotePreference(sourceFile, preferences);
switch (kind) {
- case 170 /* PropertySignature */:
- case 171 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
const flags = quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : void 0;
let typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context));
if (importAdder) {
@@ -134209,8 +134467,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
void 0
));
break;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */: {
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */: {
Debug.assertIsDefined(declarations);
let typeNode2 = checker.typeToTypeNode(type, enclosingDeclaration, void 0, getNoopSymbolTrackerWithResolver(context));
const allAccessors = getAllAccessorDeclarations(declarations, declaration);
@@ -134245,8 +134503,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
}
break;
}
- case 173 /* MethodSignature */:
- case 174 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
Debug.assertIsDefined(declarations);
const signatures = type.isUnion() ? flatMap(type.types, (t) => t.getCallSignatures()) : type.getCallSignatures();
if (!some(signatures)) {
@@ -134273,7 +134531,7 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
break;
}
function outputMethod(quotePreference2, signature, modifiers2, name, body2) {
- const method = createSignatureDeclarationFromSignature(174 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder);
+ const method = createSignatureDeclarationFromSignature(176 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder);
if (method)
addClassElement(method);
}
@@ -134399,7 +134657,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder
const parameters = createDummyParameters(args.length, names, argumentTypeNodes, void 0, isJs);
const type = isJs || contextualType === void 0 ? void 0 : checker.typeToTypeNode(contextualType, contextNode, void 0, tracker);
switch (kind) {
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return factory.createMethodDeclaration(
modifiers,
asteriskToken,
@@ -134410,7 +134668,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder
type,
createStubbedMethodBody(quotePreference)
);
- case 173 /* MethodSignature */:
+ case 175 /* MethodSignature */:
return factory.createMethodSignature(
modifiers,
name,
@@ -134419,7 +134677,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder
parameters,
type === void 0 ? factory.createKeywordTypeNode(159 /* UnknownKeyword */) : type
);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return factory.createFunctionDeclaration(
modifiers,
asteriskToken,
@@ -134773,7 +135031,7 @@ function getAccessorConvertiblePropertyAtPosition(file, program, start, end, con
isStatic: hasStaticModifier(declaration),
isReadonly: hasEffectiveReadonlyModifier(declaration),
type: getDeclarationType(declaration, program),
- container: declaration.kind === 168 /* Parameter */ ? declaration.parent.parent : declaration.parent,
+ container: declaration.kind === 169 /* Parameter */ ? declaration.parent.parent : declaration.parent,
originalName: declaration.name.text,
declaration,
fieldName,
@@ -134921,7 +135179,7 @@ registerCodeFix({
});
function getActionsForUsageOfInvalidImport(context) {
const sourceFile = context.sourceFile;
- const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 213 /* CallExpression */ : 214 /* NewExpression */;
+ const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 215 /* CallExpression */ : 216 /* NewExpression */;
const node = findAncestor(getTokenAtPosition(sourceFile, context.span.start), (a) => a.kind === targetKind);
if (!node) {
return [];
@@ -135244,7 +135502,7 @@ registerCodeFix({
function getImportTypeNode(sourceFile, pos) {
const token = getTokenAtPosition(sourceFile, pos);
Debug.assert(token.kind === 101 /* ImportKeyword */, "This token should be an ImportKeyword");
- Debug.assert(token.parent.kind === 205 /* ImportType */, "Token parent should be an ImportType");
+ Debug.assert(token.parent.kind === 207 /* ImportType */, "Token parent should be an ImportType");
return token.parent;
}
function doChange28(changes, sourceFile, importType) {
@@ -136040,12 +136298,12 @@ function isMemberCompletionKind(kind) {
function getJsxClosingTagCompletion(location, sourceFile) {
const jsxClosingElement = findAncestor(location, (node) => {
switch (node.kind) {
- case 290 /* JsxClosingElement */:
+ case 293 /* JsxClosingElement */:
return true;
case 43 /* SlashToken */:
case 31 /* GreaterThanToken */:
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return false;
default:
return "quit";
@@ -136364,10 +136622,10 @@ function createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, pro
const quotePreference = getQuotePreference(sourceFile, preferences);
const builderFlags = 33554432 /* OmitThisParameter */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0 /* None */);
switch (declaration.kind) {
- case 170 /* PropertySignature */:
- case 171 /* PropertyDeclaration */:
- case 173 /* MethodSignature */:
- case 174 /* MethodDeclaration */: {
+ case 171 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 175 /* MethodSignature */:
+ case 176 /* MethodDeclaration */: {
let effectiveType = type.flags & 1048576 /* Union */ && type.types.length < 10 ? checker.getUnionType(type.types, 2 /* Subtype */) : type;
if (effectiveType.flags & 1048576 /* Union */) {
const functionTypes = filter(effectiveType.types, (type2) => checker.getSignaturesOfType(type2, 0 /* Call */).length > 0);
@@ -136887,11 +137145,11 @@ function getContextualType(previousToken, position, sourceFile, checker) {
return getContextualTypeFromParent(previousToken, checker);
case 63 /* EqualsToken */:
switch (parent2.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return checker.getContextualType(parent2.initializer);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return checker.getTypeAtLocation(parent2.left);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return checker.getContextualTypeForJsxAttribute(parent2);
default:
return void 0;
@@ -136916,7 +137174,7 @@ function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) {
}
function isModuleSymbol(symbol) {
var _a2;
- return !!((_a2 = symbol.declarations) == null ? void 0 : _a2.some((d) => d.kind === 314 /* SourceFile */));
+ return !!((_a2 = symbol.declarations) == null ? void 0 : _a2.some((d) => d.kind === 317 /* SourceFile */));
}
function getCompletionData(program, log, sourceFile, compilerOptions, position, preferences, detailsEntryId, host, formatContext, cancellationToken) {
var _a2;
@@ -136950,7 +137208,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const typeExpression = tryGetTypeExpressionFromTag(tag);
if (typeExpression) {
currentToken = getTokenAtPosition(sourceFile, position);
- if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 356 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) {
+ if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 359 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) {
insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression);
}
}
@@ -137008,7 +137266,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
isRightOfDot = contextToken.kind === 24 /* DotToken */;
isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
propertyAccessToConvert = parent2;
node = propertyAccessToConvert.expression;
const leftmostAccessExpression = getLeftmostAccessExpression(propertyAccessToConvert);
@@ -137019,16 +137277,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return void 0;
}
break;
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
node = parent2.left;
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
node = parent2.name;
break;
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
node = parent2;
break;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
node = parent2.getFirstToken(sourceFile);
Debug.assert(node.kind === 101 /* ImportKeyword */ || node.kind === 104 /* NewKeyword */);
break;
@@ -137036,51 +137294,51 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return void 0;
}
} else if (!importStatementCompletion) {
- if (parent2 && parent2.kind === 211 /* PropertyAccessExpression */) {
+ if (parent2 && parent2.kind === 213 /* PropertyAccessExpression */) {
contextToken = parent2;
parent2 = parent2.parent;
}
if (currentToken.parent === location) {
switch (currentToken.kind) {
case 31 /* GreaterThanToken */:
- if (currentToken.parent.kind === 287 /* JsxElement */ || currentToken.parent.kind === 289 /* JsxOpeningElement */) {
+ if (currentToken.parent.kind === 290 /* JsxElement */ || currentToken.parent.kind === 292 /* JsxOpeningElement */) {
location = currentToken;
}
break;
case 43 /* SlashToken */:
- if (currentToken.parent.kind === 288 /* JsxSelfClosingElement */) {
+ if (currentToken.parent.kind === 291 /* JsxSelfClosingElement */) {
location = currentToken;
}
break;
}
}
switch (parent2.kind) {
- case 290 /* JsxClosingElement */:
+ case 293 /* JsxClosingElement */:
if (contextToken.kind === 43 /* SlashToken */) {
isStartingCloseTag = true;
location = contextToken;
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (!binaryExpressionMayBeOpenTag(parent2)) {
break;
}
- case 288 /* JsxSelfClosingElement */:
- case 287 /* JsxElement */:
- case 289 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 290 /* JsxElement */:
+ case 292 /* JsxOpeningElement */:
isJsxIdentifierExpected = true;
if (contextToken.kind === 29 /* LessThanToken */) {
isRightOfOpenTag = true;
location = contextToken;
}
break;
- case 297 /* JsxExpression */:
- case 296 /* JsxSpreadAttribute */:
+ case 300 /* JsxExpression */:
+ case 299 /* JsxSpreadAttribute */:
if (previousToken.kind === 19 /* CloseBraceToken */ && currentToken.kind === 31 /* GreaterThanToken */) {
isJsxIdentifierExpected = true;
}
break;
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
if (parent2.initializer === previousToken && previousToken.end < position) {
isJsxIdentifierExpected = true;
break;
@@ -137184,13 +137442,13 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
};
function isTagWithTypeExpression(tag) {
switch (tag.kind) {
- case 349 /* JSDocParameterTag */:
- case 356 /* JSDocPropertyTag */:
- case 350 /* JSDocReturnTag */:
- case 352 /* JSDocTypeTag */:
- case 354 /* JSDocTypedefTag */:
+ case 352 /* JSDocParameterTag */:
+ case 359 /* JSDocPropertyTag */:
+ case 353 /* JSDocReturnTag */:
+ case 355 /* JSDocTypeTag */:
+ case 357 /* JSDocTypedefTag */:
return true;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return !!tag.constraint;
default:
return false;
@@ -137199,7 +137457,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
function tryGetTypeExpressionFromTag(tag) {
if (isTagWithTypeExpression(tag)) {
const typeExpression = isJSDocTemplateTag(tag) ? tag.constraint : tag.typeExpression;
- return typeExpression && typeExpression.kind === 318 /* JSDocTypeExpression */ ? typeExpression : void 0;
+ return typeExpression && typeExpression.kind === 321 /* JSDocTypeExpression */ ? typeExpression : void 0;
}
return void 0;
}
@@ -137229,7 +137487,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
symbols.push(exportedSymbol);
}
}
- if (!isTypeLocation && symbol.declarations && symbol.declarations.some((d) => d.kind !== 314 /* SourceFile */ && d.kind !== 270 /* ModuleDeclaration */ && d.kind !== 269 /* EnumDeclaration */)) {
+ if (!isTypeLocation && symbol.declarations && symbol.declarations.some((d) => d.kind !== 317 /* SourceFile */ && d.kind !== 273 /* ModuleDeclaration */ && d.kind !== 272 /* EnumDeclaration */)) {
let type = typeChecker3.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType();
let insertQuestionDot = false;
if (type.isNullableType()) {
@@ -137268,7 +137526,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
if (isRightOfQuestionDot && some(type.getCallSignatures())) {
isNewIdentifierLocation = true;
}
- const propertyAccess = node.kind === 205 /* ImportType */ ? node : node.parent;
+ const propertyAccess = node.kind === 207 /* ImportType */ ? node : node.parent;
if (inCheckedFile) {
const typeSymbols = type.getApparentProperties();
for (const symbol of typeSymbols) {
@@ -137504,7 +137762,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
}
}
}
- if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 314 /* SourceFile */) {
+ if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 317 /* SourceFile */) {
const thisType = typeChecker3.tryGetThisTypeAt(scopeNode, false, isClassLike(scopeNode.parent) ? scopeNode : void 0);
if (thisType && !isProbablyGlobalType(thisType, sourceFile, typeChecker3)) {
for (const symbol of getPropertiesForCompletion(thisType, typeChecker3)) {
@@ -137534,10 +137792,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
}
function isSnippetScope(scopeNode) {
switch (scopeNode.kind) {
- case 314 /* SourceFile */:
- case 229 /* TemplateExpression */:
- case 297 /* JsxExpression */:
- case 242 /* Block */:
+ case 317 /* SourceFile */:
+ case 231 /* TemplateExpression */:
+ case 300 /* JsxExpression */:
+ case 244 /* Block */:
return true;
default:
return isStatement(scopeNode);
@@ -137547,24 +137805,24 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return insideJsDocTagTypeExpression || !!importStatementCompletion && isTypeOnlyImportOrExportDeclaration(location.parent) || !isContextTokenValueLocation(contextToken) && (isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker3) || isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
}
function isContextTokenValueLocation(contextToken2) {
- return contextToken2 && (contextToken2.kind === 113 /* TypeOfKeyword */ && (contextToken2.parent.kind === 186 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 130 /* AssertsKeyword */ && contextToken2.parent.kind === 182 /* TypePredicate */);
+ return contextToken2 && (contextToken2.kind === 113 /* TypeOfKeyword */ && (contextToken2.parent.kind === 188 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 130 /* AssertsKeyword */ && contextToken2.parent.kind === 184 /* TypePredicate */);
}
function isContextTokenTypeLocation(contextToken2) {
if (contextToken2) {
const parentKind = contextToken2.parent.kind;
switch (contextToken2.kind) {
case 58 /* ColonToken */:
- return parentKind === 171 /* PropertyDeclaration */ || parentKind === 170 /* PropertySignature */ || parentKind === 168 /* Parameter */ || parentKind === 261 /* VariableDeclaration */ || isFunctionLikeKind(parentKind);
+ return parentKind === 172 /* PropertyDeclaration */ || parentKind === 171 /* PropertySignature */ || parentKind === 169 /* Parameter */ || parentKind === 263 /* VariableDeclaration */ || isFunctionLikeKind(parentKind);
case 63 /* EqualsToken */:
- return parentKind === 268 /* TypeAliasDeclaration */;
+ return parentKind === 271 /* TypeAliasDeclaration */;
case 129 /* AsKeyword */:
- return parentKind === 235 /* AsExpression */;
+ return parentKind === 237 /* AsExpression */;
case 29 /* LessThanToken */:
- return parentKind === 183 /* TypeReference */ || parentKind === 216 /* TypeAssertionExpression */;
+ return parentKind === 185 /* TypeReference */ || parentKind === 218 /* TypeAssertionExpression */;
case 95 /* ExtendsKeyword */:
- return parentKind === 167 /* TypeParameter */;
+ return parentKind === 168 /* TypeParameter */;
case 151 /* SatisfiesKeyword */:
- return parentKind === 239 /* SatisfiesExpression */;
+ return parentKind === 241 /* SatisfiesExpression */;
}
}
return false;
@@ -137739,14 +137997,14 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return true;
}
if (contextToken2.kind === 31 /* GreaterThanToken */ && contextToken2.parent) {
- if (location === contextToken2.parent && (location.kind === 289 /* JsxOpeningElement */ || location.kind === 288 /* JsxSelfClosingElement */)) {
+ if (location === contextToken2.parent && (location.kind === 292 /* JsxOpeningElement */ || location.kind === 291 /* JsxSelfClosingElement */)) {
return false;
}
- if (contextToken2.parent.kind === 289 /* JsxOpeningElement */) {
- return location.parent.kind !== 289 /* JsxOpeningElement */;
+ if (contextToken2.parent.kind === 292 /* JsxOpeningElement */) {
+ return location.parent.kind !== 292 /* JsxOpeningElement */;
}
- if (contextToken2.parent.kind === 290 /* JsxClosingElement */ || contextToken2.parent.kind === 288 /* JsxSelfClosingElement */) {
- return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 287 /* JsxElement */;
+ if (contextToken2.parent.kind === 293 /* JsxClosingElement */ || contextToken2.parent.kind === 291 /* JsxSelfClosingElement */) {
+ return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 290 /* JsxElement */;
}
}
return false;
@@ -137757,29 +138015,29 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const tokenKind = keywordForNode(contextToken);
switch (tokenKind) {
case 27 /* CommaToken */:
- return containingNodeKind === 213 /* CallExpression */ || containingNodeKind === 176 /* Constructor */ || containingNodeKind === 214 /* NewExpression */ || containingNodeKind === 209 /* ArrayLiteralExpression */ || containingNodeKind === 227 /* BinaryExpression */ || containingNodeKind === 184 /* FunctionType */ || containingNodeKind === 210 /* ObjectLiteralExpression */;
+ return containingNodeKind === 215 /* CallExpression */ || containingNodeKind === 178 /* Constructor */ || containingNodeKind === 216 /* NewExpression */ || containingNodeKind === 211 /* ArrayLiteralExpression */ || containingNodeKind === 229 /* BinaryExpression */ || containingNodeKind === 186 /* FunctionType */ || containingNodeKind === 212 /* ObjectLiteralExpression */;
case 20 /* OpenParenToken */:
- return containingNodeKind === 213 /* CallExpression */ || containingNodeKind === 176 /* Constructor */ || containingNodeKind === 214 /* NewExpression */ || containingNodeKind === 217 /* ParenthesizedExpression */ || containingNodeKind === 196 /* ParenthesizedType */;
+ return containingNodeKind === 215 /* CallExpression */ || containingNodeKind === 178 /* Constructor */ || containingNodeKind === 216 /* NewExpression */ || containingNodeKind === 219 /* ParenthesizedExpression */ || containingNodeKind === 198 /* ParenthesizedType */;
case 22 /* OpenBracketToken */:
- return containingNodeKind === 209 /* ArrayLiteralExpression */ || containingNodeKind === 181 /* IndexSignature */ || containingNodeKind === 166 /* ComputedPropertyName */;
+ return containingNodeKind === 211 /* ArrayLiteralExpression */ || containingNodeKind === 183 /* IndexSignature */ || containingNodeKind === 167 /* ComputedPropertyName */;
case 143 /* ModuleKeyword */:
case 144 /* NamespaceKeyword */:
case 101 /* ImportKeyword */:
return true;
case 24 /* DotToken */:
- return containingNodeKind === 270 /* ModuleDeclaration */;
+ return containingNodeKind === 273 /* ModuleDeclaration */;
case 18 /* OpenBraceToken */:
- return containingNodeKind === 264 /* ClassDeclaration */ || containingNodeKind === 265 /* StructDeclaration */ || containingNodeKind === 210 /* ObjectLiteralExpression */;
+ return containingNodeKind === 266 /* ClassDeclaration */ || containingNodeKind === 267 /* StructDeclaration */ || containingNodeKind === 212 /* ObjectLiteralExpression */;
case 63 /* EqualsToken */:
- return containingNodeKind === 261 /* VariableDeclaration */ || containingNodeKind === 227 /* BinaryExpression */;
+ return containingNodeKind === 263 /* VariableDeclaration */ || containingNodeKind === 229 /* BinaryExpression */;
case 15 /* TemplateHead */:
- return containingNodeKind === 229 /* TemplateExpression */;
+ return containingNodeKind === 231 /* TemplateExpression */;
case 16 /* TemplateMiddle */:
- return containingNodeKind === 240 /* TemplateSpan */;
+ return containingNodeKind === 242 /* TemplateSpan */;
case 133 /* AsyncKeyword */:
- return containingNodeKind === 174 /* MethodDeclaration */ || containingNodeKind === 306 /* ShorthandPropertyAssignment */;
+ return containingNodeKind === 176 /* MethodDeclaration */ || containingNodeKind === 309 /* ShorthandPropertyAssignment */;
case 41 /* AsteriskToken */:
- return containingNodeKind === 174 /* MethodDeclaration */;
+ return containingNodeKind === 176 /* MethodDeclaration */;
}
if (isClassMemberCompletionKeyword(tokenKind)) {
return true;
@@ -137817,7 +138075,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
completionKind = 0 /* ObjectPropertyDeclaration */;
let typeMembers;
let existingMembers;
- if (objectLikeContainer.kind === 210 /* ObjectLiteralExpression */) {
+ if (objectLikeContainer.kind === 212 /* ObjectLiteralExpression */) {
const instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker3);
if (instantiatedType === void 0) {
if (objectLikeContainer.flags & 33554432 /* InWithStatement */) {
@@ -137839,16 +138097,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
}
}
} else {
- Debug.assert(objectLikeContainer.kind === 206 /* ObjectBindingPattern */);
+ Debug.assert(objectLikeContainer.kind === 208 /* ObjectBindingPattern */);
isNewIdentifierLocation = false;
const rootDeclaration = getRootDeclaration(objectLikeContainer.parent);
if (!isVariableLike(rootDeclaration))
return Debug.fail("Root declaration is not variable-like.");
- let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 251 /* ForOfStatement */;
- if (!canGetType && rootDeclaration.kind === 168 /* Parameter */) {
+ let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 253 /* ForOfStatement */;
+ if (!canGetType && rootDeclaration.kind === 169 /* Parameter */) {
if (isExpression(rootDeclaration.parent)) {
canGetType = !!typeChecker3.getContextualType(rootDeclaration.parent);
- } else if (rootDeclaration.parent.kind === 174 /* MethodDeclaration */ || rootDeclaration.parent.kind === 178 /* SetAccessor */) {
+ } else if (rootDeclaration.parent.kind === 176 /* MethodDeclaration */ || rootDeclaration.parent.kind === 180 /* SetAccessor */) {
canGetType = isExpression(rootDeclaration.parent.parent) && !!typeChecker3.getContextualType(rootDeclaration.parent.parent);
}
}
@@ -137866,7 +138124,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const filteredMembers = filterObjectMembersList(typeMembers, Debug.checkDefined(existingMembers));
symbols = concatenate(symbols, filteredMembers);
setSortTextToOptionalMember();
- if (objectLikeContainer.kind === 210 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) {
+ if (objectLikeContainer.kind === 212 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) {
transformObjectLiteralMembersSortText(symbolsStartIndex);
collectObjectLiteralMethodSymbols(filteredMembers, objectLikeContainer);
}
@@ -137882,10 +138140,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
if (!isTypeKeywordTokenOrIdentifier(contextToken)) {
keywordFilters = 8 /* TypeKeyword */;
}
- const { moduleSpecifier } = namedImportsOrExports.kind === 278 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent;
+ const { moduleSpecifier } = namedImportsOrExports.kind === 281 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent;
if (!moduleSpecifier) {
isNewIdentifierLocation = true;
- return namedImportsOrExports.kind === 278 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */;
+ return namedImportsOrExports.kind === 281 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */;
}
const moduleSpecifierSymbol = typeChecker3.getSymbolAtLocation(moduleSpecifier);
if (!moduleSpecifierSymbol) {
@@ -138000,31 +138258,31 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
case 30 /* LessThanSlashToken */:
case 43 /* SlashToken */:
case 79 /* Identifier */:
- case 211 /* PropertyAccessExpression */:
- case 295 /* JsxAttributes */:
- case 294 /* JsxAttribute */:
- case 296 /* JsxSpreadAttribute */:
- if (parent2 && (parent2.kind === 288 /* JsxSelfClosingElement */ || parent2.kind === 289 /* JsxOpeningElement */)) {
+ case 213 /* PropertyAccessExpression */:
+ case 298 /* JsxAttributes */:
+ case 297 /* JsxAttribute */:
+ case 299 /* JsxSpreadAttribute */:
+ if (parent2 && (parent2.kind === 291 /* JsxSelfClosingElement */ || parent2.kind === 292 /* JsxOpeningElement */)) {
if (contextToken2.kind === 31 /* GreaterThanToken */) {
const precedingToken = findPrecedingToken(contextToken2.pos, sourceFile, void 0);
if (!parent2.typeArguments || precedingToken && precedingToken.kind === 43 /* SlashToken */)
break;
}
return parent2;
- } else if (parent2.kind === 294 /* JsxAttribute */) {
+ } else if (parent2.kind === 297 /* JsxAttribute */) {
return parent2.parent.parent;
}
break;
case 10 /* StringLiteral */:
- if (parent2 && (parent2.kind === 294 /* JsxAttribute */ || parent2.kind === 296 /* JsxSpreadAttribute */)) {
+ if (parent2 && (parent2.kind === 297 /* JsxAttribute */ || parent2.kind === 299 /* JsxSpreadAttribute */)) {
return parent2.parent.parent;
}
break;
case 19 /* CloseBraceToken */:
- if (parent2 && parent2.kind === 297 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 294 /* JsxAttribute */) {
+ if (parent2 && parent2.kind === 300 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 297 /* JsxAttribute */) {
return parent2.parent.parent.parent;
}
- if (parent2 && parent2.kind === 296 /* JsxSpreadAttribute */) {
+ if (parent2 && parent2.kind === 299 /* JsxSpreadAttribute */) {
return parent2.parent.parent;
}
break;
@@ -138037,34 +138295,34 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const containingNodeKind = parent2.kind;
switch (contextToken2.kind) {
case 27 /* CommaToken */:
- return containingNodeKind === 261 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 244 /* VariableStatement */ || containingNodeKind === 269 /* EnumDeclaration */ || isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 267 /* InterfaceDeclaration */ || containingNodeKind === 207 /* ArrayBindingPattern */ || containingNodeKind === 268 /* TypeAliasDeclaration */ || isClassLike(parent2) && !!parent2.typeParameters && parent2.typeParameters.end >= contextToken2.pos;
+ return containingNodeKind === 263 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 246 /* VariableStatement */ || containingNodeKind === 272 /* EnumDeclaration */ || isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 270 /* InterfaceDeclaration */ || containingNodeKind === 209 /* ArrayBindingPattern */ || containingNodeKind === 271 /* TypeAliasDeclaration */ || isClassLike(parent2) && !!parent2.typeParameters && parent2.typeParameters.end >= contextToken2.pos;
case 24 /* DotToken */:
- return containingNodeKind === 207 /* ArrayBindingPattern */;
+ return containingNodeKind === 209 /* ArrayBindingPattern */;
case 58 /* ColonToken */:
- return containingNodeKind === 208 /* BindingElement */;
+ return containingNodeKind === 210 /* BindingElement */;
case 22 /* OpenBracketToken */:
- return containingNodeKind === 207 /* ArrayBindingPattern */;
+ return containingNodeKind === 209 /* ArrayBindingPattern */;
case 20 /* OpenParenToken */:
- return containingNodeKind === 301 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind);
+ return containingNodeKind === 304 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind);
case 18 /* OpenBraceToken */:
- return containingNodeKind === 269 /* EnumDeclaration */;
+ return containingNodeKind === 272 /* EnumDeclaration */;
case 29 /* LessThanToken */:
- return containingNodeKind === 264 /* ClassDeclaration */ || containingNodeKind === 232 /* ClassExpression */ || containingNodeKind === 267 /* InterfaceDeclaration */ || containingNodeKind === 268 /* TypeAliasDeclaration */ || isFunctionLikeKind(containingNodeKind);
+ return containingNodeKind === 266 /* ClassDeclaration */ || containingNodeKind === 234 /* ClassExpression */ || containingNodeKind === 270 /* InterfaceDeclaration */ || containingNodeKind === 271 /* TypeAliasDeclaration */ || isFunctionLikeKind(containingNodeKind);
case 125 /* StaticKeyword */:
- return containingNodeKind === 171 /* PropertyDeclaration */ && !isClassLike(parent2.parent);
+ return containingNodeKind === 172 /* PropertyDeclaration */ && !isClassLike(parent2.parent);
case 25 /* DotDotDotToken */:
- return containingNodeKind === 168 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 207 /* ArrayBindingPattern */;
+ return containingNodeKind === 169 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 209 /* ArrayBindingPattern */;
case 124 /* PublicKeyword */:
case 122 /* PrivateKeyword */:
case 123 /* ProtectedKeyword */:
- return containingNodeKind === 168 /* Parameter */ && !isConstructorDeclaration(parent2.parent);
+ return containingNodeKind === 169 /* Parameter */ && !isConstructorDeclaration(parent2.parent);
case 129 /* AsKeyword */:
- return containingNodeKind === 279 /* ImportSpecifier */ || containingNodeKind === 284 /* ExportSpecifier */ || containingNodeKind === 277 /* NamespaceImport */;
+ return containingNodeKind === 282 /* ImportSpecifier */ || containingNodeKind === 287 /* ExportSpecifier */ || containingNodeKind === 280 /* NamespaceImport */;
case 138 /* GetKeyword */:
case 152 /* SetKeyword */:
return !isFromObjectTypeDeclaration(contextToken2);
case 79 /* Identifier */:
- if (containingNodeKind === 279 /* ImportSpecifier */ && contextToken2 === parent2.name && contextToken2.text === "type") {
+ if (containingNodeKind === 282 /* ImportSpecifier */ && contextToken2 === parent2.name && contextToken2.text === "type") {
return false;
}
break;
@@ -138080,7 +138338,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
case 139 /* InferKeyword */:
return true;
case 155 /* TypeKeyword */:
- return containingNodeKind !== 279 /* ImportSpecifier */;
+ return containingNodeKind !== 282 /* ImportSpecifier */;
case 41 /* AsteriskToken */:
return isFunctionLike(contextToken2.parent) && !isMethodDeclaration(contextToken2.parent);
}
@@ -138115,7 +138373,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
if (ancestorClassLike && contextToken2 === previousToken && isPreviousPropertyDeclarationTerminated(contextToken2, position)) {
return false;
}
- const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 171 /* PropertyDeclaration */);
+ const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 172 /* PropertyDeclaration */);
if (ancestorPropertyDeclaraion && contextToken2 !== previousToken && isClassLike(previousToken.parent.parent) && position <= previousToken.end) {
if (isPreviousPropertyDeclarationTerminated(contextToken2, previousToken.end)) {
return false;
@@ -138129,7 +138387,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return contextToken2.kind !== 63 /* EqualsToken */ && (contextToken2.kind === 26 /* SemicolonToken */ || !positionsAreOnSameLine(contextToken2.end, position2, sourceFile));
}
function isFunctionLikeButNotConstructor(kind) {
- return isFunctionLikeKind(kind) && kind !== 176 /* Constructor */;
+ return isFunctionLikeKind(kind) && kind !== 178 /* Constructor */;
}
function isDotOfNumericLiteral(contextToken2) {
if (contextToken2.kind === 8 /* NumericLiteral */) {
@@ -138139,7 +138397,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
return false;
}
function isVariableDeclarationListButNotTypeArgument(node2) {
- return node2.parent.kind === 262 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker3);
+ return node2.parent.kind === 264 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker3);
}
function filterObjectMembersList(contextualMemberSymbols, existingMembers) {
if (existingMembers.length === 0) {
@@ -138148,7 +138406,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
const membersDeclaredBySpreadAssignment = new Set2();
const existingMemberNames = new Set2();
for (const m of existingMembers) {
- if (m.kind !== 305 /* PropertyAssignment */ && m.kind !== 306 /* ShorthandPropertyAssignment */ && m.kind !== 208 /* BindingElement */ && m.kind !== 174 /* MethodDeclaration */ && m.kind !== 177 /* GetAccessor */ && m.kind !== 178 /* SetAccessor */ && m.kind !== 307 /* SpreadAssignment */) {
+ if (m.kind !== 308 /* PropertyAssignment */ && m.kind !== 309 /* ShorthandPropertyAssignment */ && m.kind !== 210 /* BindingElement */ && m.kind !== 176 /* MethodDeclaration */ && m.kind !== 179 /* GetAccessor */ && m.kind !== 180 /* SetAccessor */ && m.kind !== 310 /* SpreadAssignment */) {
continue;
}
if (isCurrentlyEditingNode(m)) {
@@ -138227,7 +138485,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
function filterClassMembersList(baseSymbols, existingMembers, currentClassElementModifierFlags) {
const existingMemberNames = new Set2();
for (const m of existingMembers) {
- if (m.kind !== 171 /* PropertyDeclaration */ && m.kind !== 174 /* MethodDeclaration */ && m.kind !== 177 /* GetAccessor */ && m.kind !== 178 /* SetAccessor */) {
+ if (m.kind !== 172 /* PropertyDeclaration */ && m.kind !== 176 /* MethodDeclaration */ && m.kind !== 179 /* GetAccessor */ && m.kind !== 180 /* SetAccessor */) {
continue;
}
if (isCurrentlyEditingNode(m)) {
@@ -138253,7 +138511,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
if (isCurrentlyEditingNode(attr)) {
continue;
}
- if (attr.kind === 294 /* JsxAttribute */) {
+ if (attr.kind === 297 /* JsxAttribute */) {
seenNames.add(attr.name.escapedText);
} else if (isJsxSpreadAttribute(attr)) {
setMembersDeclaredBySpreadAssignment(attr, membersDeclaredBySpreadAssignment);
@@ -138333,7 +138591,7 @@ function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, js
var _keywordCompletions = [];
var allKeywordsCompletions = memoize(() => {
const res = [];
- for (let i = 81 /* FirstKeyword */; i <= 164 /* LastKeyword */; i++) {
+ for (let i = 81 /* FirstKeyword */; i <= 165 /* LastKeyword */; i++) {
res.push({
name: tokenToString(i),
kind: "keyword" /* keyword */,
@@ -138479,7 +138737,7 @@ function getPropertiesForCompletion(type, checker) {
}
function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) {
switch (location.kind) {
- case 357 /* SyntaxList */:
+ case 360 /* SyntaxList */:
return tryCast(location.parent, isObjectTypeDeclaration);
case 1 /* EndOfFileToken */:
const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration);
@@ -138538,7 +138796,7 @@ function tryGetTypeLiteralNode(node) {
case 26 /* SemicolonToken */:
case 27 /* CommaToken */:
case 79 /* Identifier */:
- if (parent2.kind === 170 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) {
+ if (parent2.kind === 171 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) {
return parent2.parent;
}
break;
@@ -138555,11 +138813,11 @@ function getConstraintOfTypeArgumentProperty(node, checker) {
if (!t)
return void 0;
switch (node.kind) {
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
return checker.getTypeOfPropertyOfContextualType(t, node.symbol.escapedName);
- case 193 /* IntersectionType */:
- case 187 /* TypeLiteral */:
- case 192 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 189 /* TypeLiteral */:
+ case 194 /* UnionType */:
return t;
}
}
@@ -138582,7 +138840,7 @@ function isValidTrigger(sourceFile, triggerCharacter, contextToken, position) {
case "/":
return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 43 /* SlashToken */ && isJsxClosingElement(contextToken.parent));
case " ":
- return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 314 /* SourceFile */;
+ return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 317 /* SourceFile */;
default:
return Debug.assertNever(triggerCharacter);
}
@@ -138678,8 +138936,8 @@ function getSingleLineReplacementSpanForImportCompletionNode(node) {
if (rangeIsOnSingleLine(top, sourceFile)) {
return createTextSpanFromNode(top, sourceFile);
}
- Debug.assert(top.kind !== 101 /* ImportKeyword */ && top.kind !== 279 /* ImportSpecifier */);
- const potentialSplitPoint = top.kind === 275 /* ImportDeclaration */ ? (_c = getPotentiallyInvalidImportSpecifier((_b = top.importClause) == null ? void 0 : _b.namedBindings)) != null ? _c : top.moduleSpecifier : top.moduleReference;
+ Debug.assert(top.kind !== 101 /* ImportKeyword */ && top.kind !== 282 /* ImportSpecifier */);
+ const potentialSplitPoint = top.kind === 278 /* ImportDeclaration */ ? (_c = getPotentiallyInvalidImportSpecifier((_b = top.importClause) == null ? void 0 : _b.namedBindings)) != null ? _c : top.moduleSpecifier : top.moduleReference;
const withoutModuleSpecifier = {
pos: top.getFirstToken().getStart(),
end: potentialSplitPoint.pos
@@ -138922,26 +139180,26 @@ var StringLiteralCompletionKind = /* @__PURE__ */ ((StringLiteralCompletionKind2
function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker3, compilerOptions, host, preferences) {
const parent2 = walkUpParentheses(node.parent);
switch (parent2.kind) {
- case 201 /* LiteralType */: {
+ case 203 /* LiteralType */: {
const grandParent = walkUpParentheses(parent2.parent);
switch (grandParent.kind) {
- case 234 /* ExpressionWithTypeArguments */:
- case 183 /* TypeReference */: {
+ case 236 /* ExpressionWithTypeArguments */:
+ case 185 /* TypeReference */: {
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
if (typeArgument) {
return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker3.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };
}
return void 0;
}
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
const { indexType, objectType } = grandParent;
if (!rangeContainsPosition(indexType, position)) {
return void 0;
}
return stringLiteralCompletionsFromProperties(typeChecker3.getTypeFromTypeNode(objectType));
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker3, preferences) };
- case 192 /* UnionType */: {
+ case 194 /* UnionType */: {
if (!isTypeReferenceNode(grandParent.parent)) {
return void 0;
}
@@ -138953,28 +139211,28 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
return void 0;
}
}
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) {
return stringLiteralCompletionsForObjectLiteral(typeChecker3, parent2.parent);
}
return fromContextualType();
- case 212 /* ElementAccessExpression */: {
+ case 214 /* ElementAccessExpression */: {
const { expression, argumentExpression } = parent2;
if (node === skipParentheses(argumentExpression)) {
return stringLiteralCompletionsFromProperties(typeChecker3.getTypeAtLocation(expression));
}
return void 0;
}
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 294 /* JsxAttribute */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 297 /* JsxAttribute */:
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
- const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 294 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
+ const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 297 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker3) || fromContextualType();
}
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
- case 286 /* ExternalModuleReference */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 289 /* ExternalModuleReference */:
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker3, preferences) };
default:
return fromContextualType();
@@ -138985,9 +139243,9 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
}
function walkUpParentheses(node) {
switch (node.kind) {
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return walkUpParenthesizedTypes(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return walkUpParenthesizedExpressions(node);
default:
return node;
@@ -139565,14 +139823,14 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
if (cancellationToken)
cancellationToken.throwIfCancellationRequested();
switch (direct.kind) {
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (isImportCall(direct)) {
handleImportCall(direct);
break;
}
if (!isAvailableThroughGlobal) {
const parent2 = direct.parent;
- if (exportKind === 2 /* ExportEquals */ && parent2.kind === 261 /* VariableDeclaration */) {
+ if (exportKind === 2 /* ExportEquals */ && parent2.kind === 263 /* VariableDeclaration */) {
const { name } = parent2;
if (name.kind === 79 /* Identifier */) {
directImports.push(name);
@@ -139583,28 +139841,28 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
break;
case 79 /* Identifier */:
break;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
handleNamespaceImport(direct, direct.name, hasSyntacticModifier(direct, 1 /* Export */), false);
break;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
directImports.push(direct);
const namedBindings = direct.importClause && direct.importClause.namedBindings;
- if (namedBindings && namedBindings.kind === 277 /* NamespaceImport */) {
+ if (namedBindings && namedBindings.kind === 280 /* NamespaceImport */) {
handleNamespaceImport(direct, namedBindings.name, false, true);
} else if (!isAvailableThroughGlobal && isDefaultImport(direct)) {
addIndirectUser(getSourceFileLikeForImportDeclaration(direct));
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
if (!direct.exportClause) {
handleDirectImports(getContainingModuleSymbol(direct, checker));
- } else if (direct.exportClause.kind === 283 /* NamespaceExport */) {
+ } else if (direct.exportClause.kind === 286 /* NamespaceExport */) {
addIndirectUser(getSourceFileLikeForImportDeclaration(direct), true);
} else {
directImports.push(direct);
}
break;
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported2(direct)) {
addIndirectUser(direct.getSourceFile(), true);
}
@@ -139633,7 +139891,7 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
directImports.push(importDeclaration);
} else if (!isAvailableThroughGlobal) {
const sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration);
- Debug.assert(sourceFileLike.kind === 314 /* SourceFile */ || sourceFileLike.kind === 270 /* ModuleDeclaration */);
+ Debug.assert(sourceFileLike.kind === 317 /* SourceFile */ || sourceFileLike.kind === 273 /* ModuleDeclaration */);
if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) {
addIndirectUser(sourceFileLike, true);
} else {
@@ -139679,7 +139937,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
}
return { importSearches, singleReferences };
function handleImport(decl) {
- if (decl.kind === 274 /* ImportEqualsDeclaration */) {
+ if (decl.kind === 277 /* ImportEqualsDeclaration */) {
if (isExternalModuleImportEquals(decl)) {
handleNamespaceImportLike(decl.name);
}
@@ -139689,7 +139947,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
handleNamespaceImportLike(decl);
return;
}
- if (decl.kind === 205 /* ImportType */) {
+ if (decl.kind === 207 /* ImportType */) {
if (decl.qualifier) {
const firstIdentifier = getFirstIdentifier(decl.qualifier);
if (firstIdentifier.escapedText === symbolName(exportSymbol)) {
@@ -139703,7 +139961,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) {
return;
}
- if (decl.kind === 281 /* ExportDeclaration */) {
+ if (decl.kind === 284 /* ExportDeclaration */) {
if (decl.exportClause && isNamedExports(decl.exportClause)) {
searchForNamedImport(decl.exportClause);
}
@@ -139712,10 +139970,10 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
const { name, namedBindings } = decl.importClause || { name: void 0, namedBindings: void 0 };
if (namedBindings) {
switch (namedBindings.kind) {
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
handleNamespaceImportLike(namedBindings.name);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) {
searchForNamedImport(namedBindings);
}
@@ -139749,7 +140007,7 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
addSearch(name, checker.getSymbolAtLocation(name));
}
} else {
- const localSymbol = element.kind === 284 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name);
+ const localSymbol = element.kind === 287 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name);
addSearch(name, localSymbol);
}
}
@@ -139772,7 +140030,7 @@ function findModuleReferences(program, sourceFiles, searchModuleSymbol) {
const checker = program.getTypeChecker();
for (const referencingFile of sourceFiles) {
const searchSourceFile = searchModuleSymbol.valueDeclaration;
- if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 314 /* SourceFile */) {
+ if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 317 /* SourceFile */) {
for (const ref of referencingFile.referencedFiles) {
if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) {
refs.push({ kind: "reference", referencingFile, ref });
@@ -139814,7 +140072,7 @@ function getDirectImportsMap(sourceFiles, checker, cancellationToken) {
return map2;
}
function forEachPossibleImportOrExportStatement(sourceFileLike, action) {
- return forEach(sourceFileLike.kind === 314 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action));
+ return forEach(sourceFileLike.kind === 317 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action));
}
function forEachImport(sourceFile, action) {
if (sourceFile.externalModuleIndicator || sourceFile.imports !== void 0) {
@@ -139824,15 +140082,15 @@ function forEachImport(sourceFile, action) {
} else {
forEachPossibleImportOrExportStatement(sourceFile, (statement) => {
switch (statement.kind) {
- case 281 /* ExportDeclaration */:
- case 275 /* ImportDeclaration */: {
+ case 284 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */: {
const decl = statement;
if (decl.moduleSpecifier && isStringLiteral(decl.moduleSpecifier)) {
action(decl, decl.moduleSpecifier);
}
break;
}
- case 274 /* ImportEqualsDeclaration */: {
+ case 277 /* ImportEqualsDeclaration */: {
const decl = statement;
if (isExternalModuleImportEquals(decl)) {
action(decl, decl.moduleReference.expression);
@@ -139850,7 +140108,7 @@ function getImportOrExportSymbol(node, symbol, checker, comingFromExport) {
const { parent: parent2 } = node;
const grandparent = parent2.parent;
if (symbol.exportSymbol) {
- if (parent2.kind === 211 /* PropertyAccessExpression */) {
+ if (parent2.kind === 213 /* PropertyAccessExpression */) {
return ((_a2 = symbol.declarations) == null ? void 0 : _a2.some((d) => d === parent2)) && isBinaryExpression(grandparent) ? getSpecialPropertyExport(grandparent, false) : void 0;
} else {
return exportInfo(symbol.exportSymbol, getExportKindForDeclaration(parent2));
@@ -139954,15 +140212,15 @@ function getExportNode(parent2, node) {
function isNodeImport(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return parent2.name === node && isExternalModuleImportEquals(parent2);
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return !parent2.propertyName;
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
Debug.assert(parent2.name === node);
return true;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(parent2.parent.parent);
default:
return false;
@@ -139993,21 +140251,21 @@ function getContainingModuleSymbol(importer, checker) {
return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol);
}
function getSourceFileLikeForImportDeclaration(node) {
- if (node.kind === 213 /* CallExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
return node.getSourceFile();
}
const { parent: parent2 } = node;
- if (parent2.kind === 314 /* SourceFile */) {
+ if (parent2.kind === 317 /* SourceFile */) {
return parent2;
}
- Debug.assert(parent2.kind === 271 /* ModuleBlock */);
+ Debug.assert(parent2.kind === 274 /* ModuleBlock */);
return cast(parent2.parent, isAmbientModuleDeclaration);
}
function isAmbientModuleDeclaration(node) {
- return node.kind === 270 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */;
+ return node.kind === 273 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */;
}
function isExternalModuleImportEquals(eq) {
- return eq.moduleReference.kind === 286 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */;
+ return eq.moduleReference.kind === 289 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */;
}
// src/services/findAllReferences.ts
@@ -140077,28 +140335,28 @@ function getContextNode(node) {
if (!node)
return void 0;
switch (node.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return !isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : isVariableStatement(node.parent.parent) ? node.parent.parent : isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getContextNode(node.parent.parent);
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return node.parent.parent.parent;
- case 284 /* ExportSpecifier */:
- case 277 /* NamespaceImport */:
+ case 287 /* ExportSpecifier */:
+ case 280 /* NamespaceImport */:
return node.parent.parent;
- case 276 /* ImportClause */:
- case 283 /* NamespaceExport */:
+ case 279 /* ImportClause */:
+ case 286 /* NamespaceExport */:
return node.parent;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isExpressionStatement(node.parent) ? node.parent : node;
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
return {
start: node.initializer,
end: node.expression
};
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(
findAncestor(
node.parent,
@@ -140140,7 +140398,7 @@ function getImplementationsAtPosition(program, cancellationToken, sourceFiles, s
const node = getTouchingPropertyName(sourceFile, position);
let referenceEntries;
const entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position);
- if (node.parent.kind === 211 /* PropertyAccessExpression */ || node.parent.kind === 208 /* BindingElement */ || node.parent.kind === 212 /* ElementAccessExpression */ || node.kind === 107 /* SuperKeyword */) {
+ if (node.parent.kind === 213 /* PropertyAccessExpression */ || node.parent.kind === 210 /* BindingElement */ || node.parent.kind === 214 /* ElementAccessExpression */ || node.kind === 107 /* SuperKeyword */) {
referenceEntries = entries && [...entries];
} else if (entries) {
const queue = createQueue(entries);
@@ -140161,11 +140419,11 @@ function getImplementationsAtPosition(program, cancellationToken, sourceFiles, s
return map(referenceEntries, (entry) => toImplementationLocation(entry, checker));
}
function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return void 0;
}
const checker = program.getTypeChecker();
- if (node.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.parent.kind === 309 /* ShorthandPropertyAssignment */) {
const result = [];
Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, (node2) => result.push(nodeEntry(node2)));
return result;
@@ -140356,12 +140614,12 @@ function implementationKindDisplayParts(node, checker) {
const symbol = checker.getSymbolAtLocation(isDeclaration(node) && node.name ? node.name : node);
if (symbol) {
return getDefinitionKindAndDisplayParts(symbol, checker, node);
- } else if (node.kind === 210 /* ObjectLiteralExpression */) {
+ } else if (node.kind === 212 /* ObjectLiteralExpression */) {
return {
kind: "interface" /* interfaceElement */,
displayParts: [punctuationPart(20 /* OpenParenToken */), textPart("object literal"), punctuationPart(21 /* CloseParenToken */)]
};
- } else if (node.kind === 232 /* ClassExpression */) {
+ } else if (node.kind === 234 /* ClassExpression */) {
return {
kind: "local class" /* localClassElement */,
displayParts: [punctuationPart(20 /* OpenParenToken */), textPart("anonymous local class"), punctuationPart(21 /* CloseParenToken */)]
@@ -140419,47 +140677,47 @@ function declarationIsWriteAccess(decl) {
if (!!(decl.flags & 16777216 /* Ambient */))
return true;
switch (decl.kind) {
- case 227 /* BinaryExpression */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
+ case 229 /* BinaryExpression */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
case 89 /* DefaultKeyword */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 284 /* ExportSpecifier */:
- case 276 /* ImportClause */:
- case 274 /* ImportEqualsDeclaration */:
- case 279 /* ImportSpecifier */:
- case 267 /* InterfaceDeclaration */:
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
- case 294 /* JsxAttribute */:
- case 270 /* ModuleDeclaration */:
- case 273 /* NamespaceExportDeclaration */:
- case 277 /* NamespaceImport */:
- case 283 /* NamespaceExport */:
- case 168 /* Parameter */:
- case 306 /* ShorthandPropertyAssignment */:
- case 268 /* TypeAliasDeclaration */:
- case 167 /* TypeParameter */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 287 /* ExportSpecifier */:
+ case 279 /* ImportClause */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 282 /* ImportSpecifier */:
+ case 270 /* InterfaceDeclaration */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 297 /* JsxAttribute */:
+ case 273 /* ModuleDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
+ case 280 /* NamespaceImport */:
+ case 286 /* NamespaceExport */:
+ case 169 /* Parameter */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 271 /* TypeAliasDeclaration */:
+ case 168 /* TypeParameter */:
return true;
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return !isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return !!decl.body;
- case 261 /* VariableDeclaration */:
- case 171 /* PropertyDeclaration */:
+ case 263 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
return !!decl.initializer || isCatchClause(decl.parent);
- case 173 /* MethodSignature */:
- case 170 /* PropertySignature */:
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */:
+ case 175 /* MethodSignature */:
+ case 171 /* PropertySignature */:
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
return false;
default:
return Debug.failBadSyntaxKind(decl);
@@ -140648,9 +140906,9 @@ var Core;
if (symbol.declarations) {
for (const decl of symbol.declarations) {
switch (decl.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
if (sourceFilesSet.has(decl.getSourceFile().fileName)) {
references.push(nodeEntry(decl.name));
}
@@ -140740,7 +140998,7 @@ var Core;
}
function getSpecialSearchKind(node) {
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
case 136 /* ConstructorKeyword */:
return SpecialSearchKind.Constructor;
case 79 /* Identifier */:
@@ -140916,7 +141174,7 @@ var Core;
}
function getSymbolScope(symbol) {
const { declarations, flags, parent: parent2, valueDeclaration } = symbol;
- if (valueDeclaration && (valueDeclaration.kind === 218 /* FunctionExpression */ || valueDeclaration.kind === 232 /* ClassExpression */)) {
+ if (valueDeclaration && (valueDeclaration.kind === 220 /* FunctionExpression */ || valueDeclaration.kind === 234 /* ClassExpression */)) {
return valueDeclaration;
}
if (!declarations) {
@@ -140925,7 +141183,7 @@ var Core;
if (flags & (4 /* Property */ | 8192 /* Method */)) {
const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d, 8 /* Private */) || isPrivateIdentifierClassElementDeclaration(d));
if (privateDeclaration) {
- return getAncestor(privateDeclaration, 264 /* ClassDeclaration */);
+ return getAncestor(privateDeclaration, 266 /* ClassDeclaration */);
}
return void 0;
}
@@ -140942,7 +141200,7 @@ var Core;
if (scope && scope !== container) {
return void 0;
}
- if (!container || container.kind === 314 /* SourceFile */ && !isExternalOrCommonJsModule(container)) {
+ if (!container || container.kind === 317 /* SourceFile */ && !isExternalOrCommonJsModule(container)) {
return void 0;
}
scope = container;
@@ -141149,7 +141407,7 @@ var Core;
default:
Debug.assertNever(state.specialSearchKind);
}
- if (isInJSFile(referenceLocation) && referenceLocation.parent.kind === 208 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(referenceLocation.parent.parent.parent)) {
+ if (isInJSFile(referenceLocation) && referenceLocation.parent.kind === 210 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(referenceLocation.parent.parent.parent)) {
referenceSymbol = referenceLocation.parent.symbol;
if (!referenceSymbol)
return;
@@ -141286,14 +141544,14 @@ var Core;
if (constructorSymbol && constructorSymbol.declarations) {
for (const decl of constructorSymbol.declarations) {
const ctrKeyword = findChildOfKind(decl, 136 /* ConstructorKeyword */, sourceFile);
- Debug.assert(decl.kind === 176 /* Constructor */ && !!ctrKeyword);
+ Debug.assert(decl.kind === 178 /* Constructor */ && !!ctrKeyword);
addNode(ctrKeyword);
}
}
if (classSymbol.exports) {
classSymbol.exports.forEach((member) => {
const decl = member.valueDeclaration;
- if (decl && decl.kind === 174 /* MethodDeclaration */) {
+ if (decl && decl.kind === 176 /* MethodDeclaration */) {
const body = decl.body;
if (body) {
forEachDescendantOfKind(body, 109 /* ThisKeyword */, (thisKeyword) => {
@@ -141315,7 +141573,7 @@ var Core;
return;
}
for (const decl of constructor.declarations) {
- Debug.assert(decl.kind === 176 /* Constructor */);
+ Debug.assert(decl.kind === 178 /* Constructor */);
const body = decl.body;
if (body) {
forEachDescendantOfKind(body, 107 /* SuperKeyword */, (node) => {
@@ -141344,7 +141602,7 @@ var Core;
if (refNode.kind !== 79 /* Identifier */) {
return;
}
- if (refNode.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (refNode.parent.kind === 309 /* ShorthandPropertyAssignment */) {
getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2);
}
const containingClass = getContainingClassIfInHeritageClause(refNode);
@@ -141359,7 +141617,7 @@ var Core;
addIfImplementation(typeHavingNode.initializer);
} else if (isFunctionLike(typeHavingNode) && typeHavingNode.body) {
const body = typeHavingNode.body;
- if (body.kind === 242 /* Block */) {
+ if (body.kind === 244 /* Block */) {
forEachReturnStatement(body, (returnStatement) => {
if (returnStatement.expression)
addIfImplementation(returnStatement.expression);
@@ -141381,13 +141639,13 @@ var Core;
}
function isImplementationExpression(node) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isImplementationExpression(node.expression);
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 232 /* ClassExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 234 /* ClassExpression */:
+ case 211 /* ArrayLiteralExpression */:
return true;
default:
return false;
@@ -141417,13 +141675,13 @@ var Core;
}
let staticFlag = 32 /* Static */;
switch (searchSpaceNode.kind) {
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
staticFlag &= getSyntacticModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
@@ -141441,38 +141699,38 @@ var Core;
return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references }];
}
function isParameterName(node) {
- return node.kind === 79 /* Identifier */ && node.parent.kind === 168 /* Parameter */ && node.parent.name === node;
+ return node.kind === 79 /* Identifier */ && node.parent.kind === 169 /* Parameter */ && node.parent.name === node;
}
function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) {
let searchSpaceNode = getThisContainer(thisOrSuperKeyword, false);
let staticFlag = 32 /* Static */;
switch (searchSpaceNode.kind) {
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
if (isObjectLiteralMethod(searchSpaceNode)) {
staticFlag &= getSyntacticModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
}
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
staticFlag &= getSyntacticModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) {
return void 0;
}
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
break;
default:
return void 0;
}
- const references = flatMap(searchSpaceNode.kind === 314 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => {
+ const references = flatMap(searchSpaceNode.kind === 317 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => {
cancellationToken.throwIfCancellationRequested();
return getPossibleSymbolReferenceNodes(sourceFile, "this", isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter((node) => {
if (!isThis(node)) {
@@ -141480,19 +141738,19 @@ var Core;
}
const container = getThisContainer(node, false);
switch (searchSpaceNode.kind) {
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
return searchSpaceNode.symbol === container.symbol;
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol;
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 210 /* ObjectLiteralExpression */:
- case 265 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 212 /* ObjectLiteralExpression */:
+ case 267 /* StructDeclaration */:
return container.parent && searchSpaceNode.symbol === container.parent.symbol && isStatic(container) === !!staticFlag;
- case 314 /* SourceFile */:
- return container.kind === 314 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node);
+ case 317 /* SourceFile */:
+ return container.kind === 317 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node);
}
});
}).map((n) => nodeEntry(n));
@@ -141580,7 +141838,7 @@ var Core;
Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */));
return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]);
}
- const exportSpecifier = getDeclarationOfKind(symbol, 284 /* ExportSpecifier */);
+ const exportSpecifier = getDeclarationOfKind(symbol, 287 /* ExportSpecifier */);
if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) {
const localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier);
if (localSymbol) {
@@ -141608,7 +141866,7 @@ var Core;
return firstDefined(checker.getRootSymbols(sym), (rootSymbol) => cbSymbol(sym, rootSymbol, void 0, kind) || (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */) && allowBaseTypes(rootSymbol) ? getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, (base) => cbSymbol(sym, rootSymbol, base, kind)) : void 0));
}
function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol2, checker2) {
- const bindingElement = getDeclarationOfKind(symbol2, 208 /* BindingElement */);
+ const bindingElement = getDeclarationOfKind(symbol2, 210 /* BindingElement */);
if (bindingElement && isObjectBindingElementWithoutPropertyName(bindingElement)) {
return getPropertySymbolFromBindingElement(checker2, bindingElement);
}
@@ -141786,9 +142044,9 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
}
if (searchOtherFilesOnly && every(symbol.declarations, (d) => d.getSourceFile().fileName === sourceFile.fileName))
return void 0;
- if (parent2.kind === 213 /* CallExpression */ || parent2.kind === 220 /* EtsComponentExpression */ && isCalledStructDeclaration(symbol.getDeclarations())) {
+ if (parent2.kind === 215 /* CallExpression */ || parent2.kind === 222 /* EtsComponentExpression */ && isCalledStructDeclaration(symbol.getDeclarations())) {
const declarations = symbol.getDeclarations();
- if ((declarations == null ? void 0 : declarations.length) && declarations[0].kind === 265 /* StructDeclaration */) {
+ if ((declarations == null ? void 0 : declarations.length) && declarations[0].kind === 267 /* StructDeclaration */) {
return getDefinitionFromSymbol(typeChecker3, symbol, node);
}
}
@@ -141808,7 +142066,7 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
return node.kind === 107 /* SuperKeyword */ ? [sigInfo, ...defs] : [...defs, sigInfo];
}
}
- if (node.parent.kind === 306 /* ShorthandPropertyAssignment */) {
+ if (node.parent.kind === 309 /* ShorthandPropertyAssignment */) {
const shorthandSymbol = typeChecker3.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
const definitions = (shorthandSymbol == null ? void 0 : shorthandSymbol.declarations) ? shorthandSymbol.declarations.map((decl) => createDefinitionInfo(decl, typeChecker3, shorthandSymbol, node, false, failedAliasResolution)) : emptyArray;
return concatenate(definitions, getDefinitionFromObjectLiteralElement(typeChecker3, node) || emptyArray);
@@ -141956,7 +142214,7 @@ function shouldSkipAlias(node, declaration) {
if (node.parent === declaration) {
return true;
}
- if (declaration.kind === 277 /* NamespaceImport */) {
+ if (declaration.kind === 280 /* NamespaceImport */) {
return false;
}
return true;
@@ -142034,19 +142292,19 @@ function isDefinitionVisible(checker, declaration) {
if (hasInitializer(declaration.parent) && declaration.parent.initializer === declaration)
return isDefinitionVisible(checker, declaration.parent);
switch (declaration.kind) {
- case 171 /* PropertyDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
if (hasEffectiveModifier(declaration, 8 /* Private */))
return false;
- case 176 /* Constructor */:
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 210 /* ObjectLiteralExpression */:
- case 232 /* ClassExpression */:
- case 219 /* ArrowFunction */:
- case 218 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 212 /* ObjectLiteralExpression */:
+ case 234 /* ClassExpression */:
+ case 221 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
return isDefinitionVisible(checker, declaration.parent);
default:
return false;
@@ -142081,9 +142339,9 @@ function tryGetSignatureDeclaration(typeChecker3, node) {
}
function isConstructorLike(node) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 178 /* Constructor */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
return true;
default:
return false;
@@ -142120,14 +142378,14 @@ function provideInlayHints(context) {
return;
}
switch (node.kind) {
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 219 /* ArrowFunction */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 221 /* ArrowFunction */:
cancellationToken.throwIfCancellationRequested();
}
if (!textSpanIntersectsWith(span, node.pos, node.getFullWidth())) {
@@ -142267,7 +142525,7 @@ function provideInlayHints(context) {
}
function isHintableLiteral(node) {
switch (node.kind) {
- case 225 /* PrefixUnaryExpression */: {
+ case 227 /* PrefixUnaryExpression */: {
const operand = node.operand;
return isLiteralExpression(operand) || isIdentifier(operand) && isInfinityOrNaNString(operand.escapedText);
}
@@ -142275,7 +142533,7 @@ function provideInlayHints(context) {
case 96 /* FalseKeyword */:
case 105 /* NullKeyword */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return true;
case 79 /* Identifier */: {
const name = node.escapedText;
@@ -142475,8 +142733,8 @@ function getJsDocCommentsFromDeclarations(declarations, checker) {
const parts = [];
forEachUnique(declarations, (declaration) => {
for (const jsdoc of getCommentHavingNodes(declaration)) {
- const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 336 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc"));
- if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 354 /* JSDocTypedefTag */ && declaration.kind !== 347 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 354 /* JSDocTypedefTag */ || t.kind === 347 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 349 /* JSDocParameterTag */ || t.kind === 350 /* JSDocReturnTag */)) {
+ const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 339 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc"));
+ if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 357 /* JSDocTypedefTag */ && declaration.kind !== 350 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 357 /* JSDocTypedefTag */ || t.kind === 350 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 352 /* JSDocParameterTag */ || t.kind === 353 /* JSDocReturnTag */)) {
continue;
}
let newparts = jsdoc.comment ? getDisplayPartsFromComment(jsdoc.comment, checker) : [];
@@ -142495,11 +142753,11 @@ function isIdenticalListOfDisplayParts(parts1, parts2) {
}
function getCommentHavingNodes(declaration) {
switch (declaration.kind) {
- case 349 /* JSDocParameterTag */:
- case 356 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
+ case 359 /* JSDocPropertyTag */:
return [declaration];
- case 347 /* JSDocCallbackTag */:
- case 354 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
return [declaration, declaration.parent];
default:
return getJSDocCommentsAndTags(declaration);
@@ -142509,7 +142767,7 @@ function getJsDocTagsFromDeclarations(declarations, checker) {
const infos = [];
forEachUnique(declarations, (declaration) => {
const tags = getJSDocTags(declaration);
- if (tags.some((t) => t.kind === 354 /* JSDocTypedefTag */ || t.kind === 347 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 349 /* JSDocParameterTag */ || t.kind === 350 /* JSDocReturnTag */)) {
+ if (tags.some((t) => t.kind === 357 /* JSDocTypedefTag */ || t.kind === 350 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 352 /* JSDocParameterTag */ || t.kind === 353 /* JSDocReturnTag */)) {
return;
}
for (const tag of tags) {
@@ -142524,18 +142782,18 @@ function getDisplayPartsFromComment(comment, checker) {
}
return flatMap(
comment,
- (node) => node.kind === 330 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker)
+ (node) => node.kind === 333 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker)
);
}
function getCommentDisplayParts(tag, checker) {
const { comment, kind } = tag;
const namePart = getTagNameDisplayPart(kind);
switch (kind) {
- case 338 /* JSDocImplementsTag */:
+ case 341 /* JSDocImplementsTag */:
return withNode(tag.class);
- case 337 /* JSDocAugmentsTag */:
+ case 340 /* JSDocAugmentsTag */:
return withNode(tag.class);
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
const templateTag = tag;
const displayParts = [];
if (templateTag.constraint) {
@@ -142557,13 +142815,13 @@ function getCommentDisplayParts(tag, checker) {
displayParts.push(...[spacePart(), ...getDisplayPartsFromComment(comment, checker)]);
}
return displayParts;
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return withNode(tag.typeExpression);
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */:
- case 355 /* JSDocSeeTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
+ case 358 /* JSDocSeeTag */:
const { name } = tag;
return name ? withNode(name) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker);
default:
@@ -142586,14 +142844,14 @@ function getCommentDisplayParts(tag, checker) {
}
function getTagNameDisplayPart(kind) {
switch (kind) {
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
return parameterNamePart;
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
return propertyNamePart;
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return typeParameterNamePart;
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
return typeAliasNamePart;
default:
return textPart;
@@ -142718,47 +142976,47 @@ function getCommentOwnerInfo(tokenAtPos, options) {
}
function getCommentOwnerInfoWorker(commentOwner, options) {
switch (commentOwner.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 173 /* MethodSignature */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 175 /* MethodSignature */:
+ case 221 /* ArrowFunction */:
const host = commentOwner;
return { commentOwner, parameters: host.parameters, hasReturn: hasReturn(host, options) };
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getCommentOwnerInfoWorker(commentOwner.initializer, options);
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 268 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 271 /* TypeAliasDeclaration */:
return { commentOwner };
- case 170 /* PropertySignature */: {
+ case 171 /* PropertySignature */: {
const host2 = commentOwner;
return host2.type && isFunctionTypeNode(host2.type) ? { commentOwner, parameters: host2.type.parameters, hasReturn: hasReturn(host2.type, options) } : { commentOwner };
}
- case 244 /* VariableStatement */: {
+ case 246 /* VariableStatement */: {
const varStatement = commentOwner;
const varDeclarations = varStatement.declarationList.declarations;
const host2 = varDeclarations.length === 1 && varDeclarations[0].initializer ? getRightHandSideOfAssignment(varDeclarations[0].initializer) : void 0;
return host2 ? { commentOwner, parameters: host2.parameters, hasReturn: hasReturn(host2, options) } : { commentOwner };
}
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return "quit";
- case 270 /* ModuleDeclaration */:
- return commentOwner.parent.kind === 270 /* ModuleDeclaration */ ? void 0 : { commentOwner };
- case 245 /* ExpressionStatement */:
+ case 273 /* ModuleDeclaration */:
+ return commentOwner.parent.kind === 273 /* ModuleDeclaration */ ? void 0 : { commentOwner };
+ case 247 /* ExpressionStatement */:
return getCommentOwnerInfoWorker(commentOwner.expression, options);
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const be = commentOwner;
if (getAssignmentDeclarationKind(be) === 0 /* None */) {
return "quit";
}
return isFunctionLike(be.right) ? { commentOwner, parameters: be.right.parameters, hasReturn: hasReturn(be.right, options) } : { commentOwner };
}
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
const init = commentOwner.initializer;
if (init && (isFunctionExpression(init) || isArrowFunction(init))) {
return { commentOwner, parameters: init.parameters, hasReturn: hasReturn(init, options) };
@@ -142769,14 +143027,14 @@ function hasReturn(node, options) {
return !!(options == null ? void 0 : options.generateReturnInDocTemplate) && (isFunctionTypeNode(node) || isArrowFunction(node) && isExpression(node.body) || isFunctionLikeDeclaration(node) && node.body && isBlock(node.body) && !!forEachReturnStatement(node.body, (n) => n));
}
function getRightHandSideOfAssignment(rightHandSide) {
- while (rightHandSide.kind === 217 /* ParenthesizedExpression */) {
+ while (rightHandSide.kind === 219 /* ParenthesizedExpression */) {
rightHandSide = rightHandSide.expression;
}
switch (rightHandSide.kind) {
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return rightHandSide;
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return find(rightHandSide.members, isConstructorDeclaration);
}
}
@@ -143100,11 +143358,11 @@ function compareIdentifiers(s1, s2) {
function getModuleSpecifierExpression(declaration) {
var _a2;
switch (declaration.kind) {
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return (_a2 = tryCast(declaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return declaration.moduleSpecifier;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return declaration.declarationList.declarations[0].initializer.arguments[0];
}
}
@@ -143131,19 +143389,19 @@ function compareImportKind(s1, s2) {
function getImportKindOrder(s1) {
var _a2;
switch (s1.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
if (!s1.importClause)
return 0;
if (s1.importClause.isTypeOnly)
return 1;
- if (((_a2 = s1.importClause.namedBindings) == null ? void 0 : _a2.kind) === 277 /* NamespaceImport */)
+ if (((_a2 = s1.importClause.namedBindings) == null ? void 0 : _a2.kind) === 280 /* NamespaceImport */)
return 2;
if (s1.importClause.name)
return 3;
return 4;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return 5;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return 6;
}
}
@@ -143317,21 +143575,21 @@ function createOutliningSpanFromBounds(pos, end, kind) {
}
function getOutliningSpanForNode(n, sourceFile) {
switch (n.kind) {
- case 242 /* Block */:
+ case 244 /* Block */:
if (isFunctionLike(n.parent)) {
return functionSpan(n.parent, n, sourceFile);
}
switch (n.parent.kind) {
- case 247 /* DoStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 249 /* ForStatement */:
- case 246 /* IfStatement */:
- case 248 /* WhileStatement */:
- case 255 /* WithStatement */:
- case 301 /* CatchClause */:
+ case 249 /* DoStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 248 /* IfStatement */:
+ case 250 /* WhileStatement */:
+ case 257 /* WithStatement */:
+ case 304 /* CatchClause */:
return spanForNode(n.parent);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
const tryStatement = n.parent;
if (tryStatement.tryBlock === n) {
return spanForNode(n.parent);
@@ -143343,43 +143601,43 @@ function getOutliningSpanForNode(n, sourceFile) {
default:
return createOutliningSpan(createTextSpanFromNode(n, sourceFile), "code" /* Code */);
}
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return spanForNode(n.parent);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 272 /* CaseBlock */:
- case 187 /* TypeLiteral */:
- case 206 /* ObjectBindingPattern */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 275 /* CaseBlock */:
+ case 189 /* TypeLiteral */:
+ case 208 /* ObjectBindingPattern */:
return spanForNode(n);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
return spanForNode(n, false, !isTupleTypeNode(n.parent), 22 /* OpenBracketToken */);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return spanForNodeArray(n.statements);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return spanForObjectOrArrayLiteral(n);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */);
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return spanForJSXElement(n);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return spanForJSXFragment(n);
- case 288 /* JsxSelfClosingElement */:
- case 289 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
return spanForJSXAttributes(n.attributes);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
case 14 /* NoSubstitutionTemplateLiteral */:
return spanForTemplateLiteral(n);
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return spanForNode(n, false, !isBindingElement(n.parent), 22 /* OpenBracketToken */);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return spanForArrowFunction(n);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return spanForCallExpression(n);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return spanForParenthesizedExpression(n);
}
function spanForCallExpression(node) {
@@ -143444,7 +143702,7 @@ function getOutliningSpanForNode(n, sourceFile) {
function functionSpan(node, body, sourceFile) {
const openToken = tryGetFunctionOpenToken(node, body, sourceFile);
const closeToken = findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile);
- return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, node.kind !== 219 /* ArrowFunction */);
+ return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, node.kind !== 221 /* ArrowFunction */);
}
function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse = false, useFullStart = true) {
const textSpan = createTextSpanFromBounds(useFullStart ? openToken.getFullStart() : openToken.getStart(sourceFile), closeToken.getEnd());
@@ -143558,18 +143816,18 @@ function getInfo19(context, considerPartialSpans = true) {
}
const noSymbolError = (id) => isIdentifier(id) && checker.getSymbolAtLocation(id) ? void 0 : { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_named_export) };
switch (exportNode.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 270 /* ModuleDeclaration */: {
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 273 /* ModuleDeclaration */: {
const node = exportNode;
if (!node.name)
return void 0;
return noSymbolError(node.name) || { exportNode: node, exportName: node.name, wasDefault, exportingModuleSymbol };
}
- case 244 /* VariableStatement */: {
+ case 246 /* VariableStatement */: {
const vs = exportNode;
if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) {
return void 0;
@@ -143580,7 +143838,7 @@ function getInfo19(context, considerPartialSpans = true) {
Debug.assert(!wasDefault, "Can't have a default flag here");
return noSymbolError(decl.name) || { exportNode: vs, exportName: decl.name, wasDefault, exportingModuleSymbol };
}
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
const node = exportNode;
if (node.isExportEquals)
return void 0;
@@ -143606,20 +143864,20 @@ function changeExport(exportingSourceFile, { wasDefault, exportNode, exportName
} else {
const exportKeyword = Debug.checkDefined(findModifier(exportNode, 94 /* ExportKeyword */), "Should find an export keyword in modifier list");
switch (exportNode.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
changes.insertNodeAfter(exportingSourceFile, exportKeyword, factory.createToken(89 /* DefaultKeyword */));
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
const decl = first(exportNode.declarationList.declarations);
if (!ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) {
changes.replaceNode(exportingSourceFile, exportNode, factory.createExportDefault(Debug.checkDefined(decl.initializer, "Initializer was previously known to be present")));
break;
}
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 273 /* ModuleDeclaration */:
changes.deleteModifier(exportingSourceFile, exportKeyword);
changes.insertNodeAfter(exportingSourceFile, exportNode, factory.createExportDefault(factory.createIdentifier(exportName.text)));
break;
@@ -143645,23 +143903,23 @@ function changeImports(program, { wasDefault, exportName, exportingModuleSymbol
function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) {
const { parent: parent2 } = ref;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
changes.replaceNode(importingSourceFile, ref, factory.createIdentifier(exportName));
break;
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */: {
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */: {
const spec = parent2;
changes.replaceNode(importingSourceFile, spec, makeImportSpecifier2(exportName, spec.name.text));
break;
}
- case 276 /* ImportClause */: {
+ case 279 /* ImportClause */: {
const clause = parent2;
Debug.assert(clause.name === ref, "Import clause name should match provided ref");
const spec = makeImportSpecifier2(exportName, ref.text);
const { namedBindings } = clause;
if (!namedBindings) {
changes.replaceNode(importingSourceFile, ref, factory.createNamedImports([spec]));
- } else if (namedBindings.kind === 277 /* NamespaceImport */) {
+ } else if (namedBindings.kind === 280 /* NamespaceImport */) {
changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) });
const quotePreference = isStringLiteral(clause.parent.moduleSpecifier) ? quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */;
const newImport = makeImport(void 0, [makeImportSpecifier2(exportName, ref.text)], clause.parent.moduleSpecifier, quotePreference);
@@ -143672,7 +143930,7 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam
}
break;
}
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
const importTypeNode = parent2;
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.assertions, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf));
break;
@@ -143683,10 +143941,10 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam
function changeNamedToDefaultImport(importingSourceFile, ref, changes) {
const parent2 = ref.parent;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
changes.replaceNode(importingSourceFile, ref, factory.createIdentifier("default"));
break;
- case 279 /* ImportSpecifier */: {
+ case 282 /* ImportSpecifier */: {
const defaultImport = factory.createIdentifier(parent2.name.text);
if (parent2.parent.elements.length === 1) {
changes.replaceNode(importingSourceFile, parent2.parent, defaultImport);
@@ -143696,7 +143954,7 @@ function changeNamedToDefaultImport(importingSourceFile, ref, changes) {
}
break;
}
- case 284 /* ExportSpecifier */: {
+ case 287 /* ExportSpecifier */: {
changes.replaceNode(importingSourceFile, parent2, makeExportSpecifier("default", parent2.name.text));
break;
}
@@ -143786,7 +144044,7 @@ function getImportConversionInfo(context, considerPartialSpans = true) {
if (!importClause.namedBindings) {
return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_namespace_import_or_named_imports) };
}
- if (importClause.namedBindings.kind === 277 /* NamespaceImport */) {
+ if (importClause.namedBindings.kind === 280 /* NamespaceImport */) {
return { convertTo: 0 /* Named */, import: importClause.namedBindings };
}
const shouldUseDefault = getShouldUseDefault(context.program, importClause);
@@ -144207,11 +144465,11 @@ function isAllowedStatementToMove(statement) {
}
function isPureImport(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return true;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return !hasSyntacticModifier(node, 1 /* Export */);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return node.declarationList.declarations.every((d) => !!d.initializer && isRequireCall(d.initializer, true));
default:
return false;
@@ -144300,11 +144558,11 @@ function updateImportsInOtherFiles(changes, program, oldFile, movedSymbols, newM
}
function getNamespaceLikeImport(node) {
switch (node.kind) {
- case 275 /* ImportDeclaration */:
- return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 277 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0;
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 280 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0;
+ case 277 /* ImportEqualsDeclaration */:
return node.name;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return tryCast(node.name, isIdentifier);
default:
return Debug.assertNever(node, `Unexpected node kind ${node.kind}`);
@@ -144334,23 +144592,23 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie
const newNamespaceId = factory.createIdentifier(newNamespaceName);
const newModuleString = factory.createStringLiteral(newModuleSpecifier);
switch (node.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return factory.createImportDeclaration(
void 0,
factory.createImportClause(false, void 0, factory.createNamespaceImport(newNamespaceId)),
newModuleString,
void 0
);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return factory.createImportEqualsDeclaration(void 0, false, newNamespaceId, factory.createExternalModuleReference(newModuleString));
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return factory.createVariableDeclaration(newNamespaceId, void 0, void 0, createRequireCall(newModuleString));
default:
return Debug.assertNever(node, `Unexpected node kind ${node.kind}`);
}
}
function moduleSpecifierFromImport(i) {
- return i.kind === 275 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 274 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0];
+ return i.kind === 278 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 277 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0];
}
function forEachImportInStatement(statement, cb) {
if (isImportDeclaration(statement)) {
@@ -144409,15 +144667,15 @@ function addExports(sourceFile, toMove, needExport, useEs6Exports) {
}
function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) {
switch (importDecl.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused);
break;
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
if (isUnused(importDecl.name)) {
changes.delete(sourceFile, importDecl);
}
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused);
break;
default:
@@ -144429,7 +144687,7 @@ function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnu
return;
const { name, namedBindings } = importDecl.importClause;
const defaultUnused = !name || isUnused(name);
- const namedBindingsUnused = !namedBindings || (namedBindings.kind === 277 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name)));
+ const namedBindingsUnused = !namedBindings || (namedBindings.kind === 280 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name)));
if (defaultUnused && namedBindingsUnused) {
changes.delete(sourceFile, importDecl);
} else {
@@ -144443,7 +144701,7 @@ function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnu
importDecl.importClause,
factory.updateImportClause(importDecl.importClause, importDecl.importClause.isTypeOnly, name, void 0)
);
- } else if (namedBindings.kind === 278 /* NamedImports */) {
+ } else if (namedBindings.kind === 281 /* NamedImports */) {
for (const element of namedBindings.elements) {
if (isUnused(element.name))
changes.delete(sourceFile, element);
@@ -144467,9 +144725,9 @@ function deleteUnusedImportsInVariableDeclaration(sourceFile, varDecl, changes,
}
}
break;
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
break;
- case 206 /* ObjectBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
if (name.elements.every((e) => isIdentifier(e.name) && isUnused(e.name))) {
changes.delete(
sourceFile,
@@ -144584,14 +144842,14 @@ function getUsageInfo(oldFile, toMove, checker) {
}
function isInImport(decl) {
switch (decl.kind) {
- case 274 /* ImportEqualsDeclaration */:
- case 279 /* ImportSpecifier */:
- case 276 /* ImportClause */:
- case 277 /* NamespaceImport */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 282 /* ImportSpecifier */:
+ case 279 /* ImportClause */:
+ case 280 /* NamespaceImport */:
return true;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return isVariableDeclarationInImport(decl);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent);
default:
return false;
@@ -144602,7 +144860,7 @@ function isVariableDeclarationInImport(decl) {
}
function filterImport(i, moduleSpecifier, keep) {
switch (i.kind) {
- case 275 /* ImportDeclaration */: {
+ case 278 /* ImportDeclaration */: {
const clause = i.importClause;
if (!clause)
return void 0;
@@ -144610,9 +144868,9 @@ function filterImport(i, moduleSpecifier, keep) {
const namedBindings = clause.namedBindings && filterNamedBindings(clause.namedBindings, keep);
return defaultImport || namedBindings ? factory.createImportDeclaration(void 0, factory.createImportClause(false, defaultImport, namedBindings), moduleSpecifier, void 0) : void 0;
}
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return keep(i.name) ? i : void 0;
- case 261 /* VariableDeclaration */: {
+ case 263 /* VariableDeclaration */: {
const name = filterBindingName(i.name, keep);
return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : void 0;
}
@@ -144621,7 +144879,7 @@ function filterImport(i, moduleSpecifier, keep) {
}
}
function filterNamedBindings(namedBindings, keep) {
- if (namedBindings.kind === 277 /* NamespaceImport */) {
+ if (namedBindings.kind === 280 /* NamespaceImport */) {
return keep(namedBindings.name) ? namedBindings : void 0;
} else {
const newElements = namedBindings.elements.filter((e) => keep(e.name));
@@ -144632,9 +144890,9 @@ function filterBindingName(name, keep) {
switch (name.kind) {
case 79 /* Identifier */:
return keep(name) ? name : void 0;
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return name;
- case 206 /* ObjectBindingPattern */: {
+ case 208 /* ObjectBindingPattern */: {
const newElements = name.elements.filter((prop) => prop.propertyName || !isIdentifier(prop.name) || keep(prop.name));
return newElements.length ? factory.createObjectBindingPattern(newElements) : void 0;
}
@@ -144691,13 +144949,13 @@ function isTopLevelDeclarationStatement(node) {
}
function isNonVariableTopLevelDeclaration(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return true;
default:
return false;
@@ -144705,17 +144963,17 @@ function isNonVariableTopLevelDeclaration(node) {
}
function forEachTopLevelDeclaration(statement, cb) {
switch (statement.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return cb(statement);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return firstDefined(statement.declarationList.declarations, (decl) => forEachTopLevelDeclarationInBindingName(decl.name, cb));
- case 245 /* ExpressionStatement */: {
+ case 247 /* ExpressionStatement */: {
const { expression } = statement;
return isBinaryExpression(expression) && getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) : void 0;
}
@@ -144725,8 +144983,8 @@ function forEachTopLevelDeclarationInBindingName(name, cb) {
switch (name.kind) {
case 79 /* Identifier */:
return cb(cast(name.parent, (x) => isVariableDeclaration(x) || isBindingElement(x)));
- case 207 /* ArrayBindingPattern */:
- case 206 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
return firstDefined(name.elements, (em) => isOmittedExpression(em) ? void 0 : forEachTopLevelDeclarationInBindingName(em.name, cb));
default:
return Debug.assertNever(name, `Unexpected name kind ${name.kind}`);
@@ -144737,9 +144995,9 @@ function nameOfTopLevelDeclaration(d) {
}
function getTopLevelDeclarationStatement(d) {
switch (d.kind) {
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return d.parent.parent;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return getTopLevelDeclarationStatement(
cast(d.parent.parent, (p) => isVariableDeclaration(p) || isBindingElement(p))
);
@@ -144772,24 +145030,24 @@ function addExport(decl, useEs6Exports) {
function addEs6Export(d) {
const modifiers = canHaveModifiers(d) ? concatenate([factory.createModifier(94 /* ExportKeyword */)], getModifiers(d)) : void 0;
switch (d.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return factory.updateFunctionDeclaration(d, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const decorators = canHaveDecorators(d) ? getDecorators(d) : void 0;
return factory.updateClassDeclaration(d, concatenate(decorators, modifiers), d.name, d.typeParameters, d.heritageClauses, d.members);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return factory.updateVariableStatement(d, modifiers, d.declarationList);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return factory.updateModuleDeclaration(d, modifiers, d.name, d.body);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return factory.updateEnumDeclaration(d, modifiers, d.name, d.members);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return factory.updateTypeAliasDeclaration(d, modifiers, d.name, d.typeParameters, d.type);
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return factory.updateInterfaceDeclaration(d, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return factory.updateImportEqualsDeclaration(d, modifiers, d.isTypeOnly, d.name, d.moduleReference);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return Debug.fail();
default:
return Debug.assertNever(d, `Unexpected declaration kind ${d.kind}`);
@@ -144800,18 +145058,18 @@ function addCommonjsExport(decl) {
}
function getNamesToExportInCommonJS(decl) {
switch (decl.kind) {
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
return [decl.name.text];
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return mapDefined(decl.declarationList.declarations, (d) => isIdentifier(d.name) ? d.name.text : void 0);
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return emptyArray;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return Debug.fail("Can't export an ExpressionStatement");
default:
return Debug.assertNever(decl, `Unexpected decl kind ${decl.kind}`);
@@ -144863,7 +145121,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
const lastDeclaration = signatureDecls[signatureDecls.length - 1];
let updated = lastDeclaration;
switch (lastDeclaration.kind) {
- case 173 /* MethodSignature */: {
+ case 175 /* MethodSignature */: {
updated = factory.updateMethodSignature(
lastDeclaration,
lastDeclaration.modifiers,
@@ -144875,7 +145133,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 174 /* MethodDeclaration */: {
+ case 176 /* MethodDeclaration */: {
updated = factory.updateMethodDeclaration(
lastDeclaration,
lastDeclaration.modifiers,
@@ -144889,7 +145147,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 179 /* CallSignature */: {
+ case 181 /* CallSignature */: {
updated = factory.updateCallSignature(
lastDeclaration,
lastDeclaration.typeParameters,
@@ -144898,7 +145156,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 176 /* Constructor */: {
+ case 178 /* Constructor */: {
updated = factory.updateConstructorDeclaration(
lastDeclaration,
lastDeclaration.modifiers,
@@ -144907,7 +145165,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 180 /* ConstructSignature */: {
+ case 182 /* ConstructSignature */: {
updated = factory.updateConstructSignature(
lastDeclaration,
lastDeclaration.typeParameters,
@@ -144916,7 +145174,7 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
);
break;
}
- case 263 /* FunctionDeclaration */: {
+ case 265 /* FunctionDeclaration */: {
updated = factory.updateFunctionDeclaration(
lastDeclaration,
lastDeclaration.modifiers,
@@ -144987,12 +145245,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
}
function isConvertableSignatureDeclaration(d) {
switch (d.kind) {
- case 173 /* MethodSignature */:
- case 174 /* MethodDeclaration */:
- case 179 /* CallSignature */:
- case 176 /* Constructor */:
- case 180 /* ConstructSignature */:
- case 263 /* FunctionDeclaration */:
+ case 175 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 181 /* CallSignature */:
+ case 178 /* Constructor */:
+ case 182 /* ConstructSignature */:
+ case 265 /* FunctionDeclaration */:
return true;
}
return false;
@@ -145539,14 +145797,14 @@ function entryToFunctionCall(entry) {
const functionReference = entry.node;
const parent2 = functionReference.parent;
switch (parent2.kind) {
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
const callOrNewExpression = tryCast(parent2, isCallOrNewExpression);
if (callOrNewExpression && callOrNewExpression.expression === functionReference) {
return callOrNewExpression;
}
break;
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression);
if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) {
const callOrNewExpression2 = tryCast(propertyAccessExpression.parent, isCallOrNewExpression);
@@ -145555,7 +145813,7 @@ function entryToFunctionCall(entry) {
}
}
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const elementAccessExpression = tryCast(parent2, isElementAccessExpression);
if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) {
const callOrNewExpression2 = tryCast(elementAccessExpression.parent, isCallOrNewExpression);
@@ -145573,13 +145831,13 @@ function entryToAccessExpression(entry) {
const reference = entry.node;
const parent2 = reference.parent;
switch (parent2.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression);
if (propertyAccessExpression && propertyAccessExpression.expression === reference) {
return propertyAccessExpression;
}
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const elementAccessExpression = tryCast(parent2, isElementAccessExpression);
if (elementAccessExpression && elementAccessExpression.expression === reference) {
return elementAccessExpression;
@@ -145621,22 +145879,22 @@ function isValidFunctionDeclaration(functionDeclaration, checker) {
if (!isValidParameterNodeArray(functionDeclaration.parameters, checker))
return false;
switch (functionDeclaration.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
if (isObjectLiteralExpression(functionDeclaration.parent)) {
const contextualSymbol = getSymbolForContextualType(functionDeclaration.name, checker);
return ((_a2 = contextualSymbol == null ? void 0 : contextualSymbol.declarations) == null ? void 0 : _a2.length) === 1 && isSingleImplementation(functionDeclaration, checker);
}
return isSingleImplementation(functionDeclaration, checker);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
if (isClassDeclaration(functionDeclaration.parent)) {
return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker);
} else {
return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker);
}
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return isValidVariableDeclaration(functionDeclaration.parent);
}
return false;
@@ -145796,7 +146054,7 @@ function getParameterName(paramDeclaration) {
}
function getClassNames(constructorDeclaration) {
switch (constructorDeclaration.parent.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
const classDeclaration = constructorDeclaration.parent;
if (classDeclaration.name)
return [classDeclaration.name];
@@ -145805,7 +146063,7 @@ function getClassNames(constructorDeclaration) {
"Nameless class declaration should be a default export"
);
return [defaultModifier];
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
const classExpression = constructorDeclaration.parent;
const variableDeclaration = constructorDeclaration.parent.parent;
const className = classExpression.name;
@@ -145816,7 +146074,7 @@ function getClassNames(constructorDeclaration) {
}
function getFunctionNames(functionDeclaration) {
switch (functionDeclaration.kind) {
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (functionDeclaration.name)
return [functionDeclaration.name];
const defaultModifier = Debug.checkDefined(
@@ -145824,21 +146082,21 @@ function getFunctionNames(functionDeclaration) {
"Nameless function declaration should be a default export"
);
return [defaultModifier];
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return [functionDeclaration.name];
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
const ctrKeyword = Debug.checkDefined(
findChildOfKind(functionDeclaration, 136 /* ConstructorKeyword */, functionDeclaration.getSourceFile()),
"Constructor declaration should have constructor keyword"
);
- if (functionDeclaration.parent.kind === 232 /* ClassExpression */) {
+ if (functionDeclaration.parent.kind === 234 /* ClassExpression */) {
const variableDeclaration = functionDeclaration.parent.parent;
return [variableDeclaration.name, ctrKeyword];
}
return [ctrKeyword];
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return [functionDeclaration.parent.name];
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
if (functionDeclaration.name)
return [functionDeclaration.name, functionDeclaration.parent.name];
return [functionDeclaration.parent.name];
@@ -145921,11 +146179,11 @@ function isNotEqualsOperator(node) {
function getParentBinaryExpression(expr) {
const container = findAncestor(expr.parent, (n) => {
switch (n.kind) {
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return false;
- case 229 /* TemplateExpression */:
- case 227 /* BinaryExpression */:
+ case 231 /* TemplateExpression */:
+ case 229 /* BinaryExpression */:
return !(isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent));
default:
return "quit";
@@ -146545,18 +146803,18 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
function checkForStaticContext(nodeToCheck, containingClass) {
let current = nodeToCheck;
while (current !== containingClass) {
- if (current.kind === 171 /* PropertyDeclaration */) {
+ if (current.kind === 172 /* PropertyDeclaration */) {
if (isStatic(current)) {
rangeFacts |= 32 /* InStaticRegion */;
}
break;
- } else if (current.kind === 168 /* Parameter */) {
+ } else if (current.kind === 169 /* Parameter */) {
const ctorOrMethod = getContainingFunction(current);
- if (ctorOrMethod.kind === 176 /* Constructor */) {
+ if (ctorOrMethod.kind === 178 /* Constructor */) {
rangeFacts |= 32 /* InStaticRegion */;
}
break;
- } else if (current.kind === 174 /* MethodDeclaration */) {
+ } else if (current.kind === 176 /* MethodDeclaration */) {
if (isStatic(current)) {
rangeFacts |= 32 /* InStaticRegion */;
}
@@ -146590,7 +146848,7 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
visit(nodeToCheck);
if (rangeFacts & 8 /* UsesThis */) {
const container = getThisContainer(nodeToCheck, false);
- if (container.kind === 263 /* FunctionDeclaration */ || container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ || container.kind === 218 /* FunctionExpression */) {
+ if (container.kind === 265 /* FunctionDeclaration */ || container.kind === 176 /* MethodDeclaration */ && container.parent.kind === 212 /* ObjectLiteralExpression */ || container.kind === 220 /* FunctionExpression */) {
rangeFacts |= 16 /* UsesThisInFunction */;
}
}
@@ -146600,21 +146858,21 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
return true;
}
if (isDeclaration(node2)) {
- const declaringNode = node2.kind === 261 /* VariableDeclaration */ ? node2.parent.parent : node2;
+ const declaringNode = node2.kind === 263 /* VariableDeclaration */ ? node2.parent.parent : node2;
if (hasSyntacticModifier(declaringNode, 1 /* Export */)) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity));
return true;
}
}
switch (node2.kind) {
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractImport));
return true;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity));
return true;
case 107 /* SuperKeyword */:
- if (node2.parent.kind === 213 /* CallExpression */) {
+ if (node2.parent.kind === 215 /* CallExpression */) {
const containingClass2 = getContainingClass(node2);
if (containingClass2 === void 0 || containingClass2.pos < span.start || containingClass2.end >= span.start + span.length) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractSuper));
@@ -146625,7 +146883,7 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
thisNode = node2;
}
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
forEachChild(node2, function check(n) {
if (isThis(n)) {
rangeFacts |= 8 /* UsesThis */;
@@ -146636,34 +146894,34 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
forEachChild(n, check);
}
});
- case 264 /* ClassDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 265 /* FunctionDeclaration */:
if (isSourceFile(node2.parent) && node2.parent.externalModuleIndicator === void 0) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.functionWillNotBeVisibleInTheNewScope));
}
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return false;
}
const savedPermittedJumps = permittedJumps;
switch (node2.kind) {
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
permittedJumps &= ~4 /* Return */;
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
permittedJumps = 0 /* None */;
break;
- case 242 /* Block */:
- if (node2.parent && node2.parent.kind === 259 /* TryStatement */ && node2.parent.finallyBlock === node2) {
+ case 244 /* Block */:
+ if (node2.parent && node2.parent.kind === 261 /* TryStatement */ && node2.parent.finallyBlock === node2) {
permittedJumps = 4 /* Return */;
}
break;
- case 299 /* DefaultClause */:
- case 298 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 301 /* CaseClause */:
permittedJumps |= 1 /* Break */;
break;
default:
@@ -146673,39 +146931,39 @@ function getRangeToExtract2(sourceFile, span, invoked = true) {
break;
}
switch (node2.kind) {
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
case 109 /* ThisKeyword */:
rangeFacts |= 8 /* UsesThis */;
thisNode = node2;
break;
- case 257 /* LabeledStatement */: {
+ case 259 /* LabeledStatement */: {
const label = node2.label;
(seenLabels || (seenLabels = [])).push(label.escapedText);
forEachChild(node2, visit);
seenLabels.pop();
break;
}
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */: {
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */: {
const label = node2.label;
if (label) {
if (!contains(seenLabels, label.escapedText)) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange));
}
} else {
- if (!(permittedJumps & (node2.kind === 253 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) {
+ if (!(permittedJumps & (node2.kind === 255 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) {
(errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements));
}
}
break;
}
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
rangeFacts |= 4 /* IsAsyncFunction */;
break;
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
rangeFacts |= 2 /* IsGenerator */;
break;
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
if (permittedJumps & 4 /* Return */) {
rangeFacts |= 1 /* HasReturn */;
} else {
@@ -146755,12 +147013,12 @@ function collectEnclosingScopes(range) {
const scopes = [];
while (true) {
current = current.parent;
- if (current.kind === 168 /* Parameter */) {
+ if (current.kind === 169 /* Parameter */) {
current = findAncestor(current, (parent2) => isFunctionLikeDeclaration(parent2)).parent;
}
if (isScope(current)) {
scopes.push(current);
- if (current.kind === 314 /* SourceFile */) {
+ if (current.kind === 317 /* SourceFile */) {
return scopes;
}
}
@@ -146836,28 +147094,28 @@ function getDescriptionForConstantInScope(scope) {
}
function getDescriptionForFunctionLikeDeclaration(scope) {
switch (scope.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return "constructor";
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
return scope.name ? `function '${scope.name.text}'` : ANONYMOUS;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return "arrow function";
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return `method '${scope.name.getText()}'`;
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return `'get ${scope.name.getText()}'`;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return `'set ${scope.name.getText()}'`;
default:
throw Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`);
}
}
function getDescriptionForClassLikeDeclaration(scope) {
- return scope.kind === 264 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression";
+ return scope.kind === 266 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression";
}
function getDescriptionForModuleLikeDeclaration(scope) {
- return scope.kind === 271 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? SpecialScope.Module : SpecialScope.Global;
+ return scope.kind === 274 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? SpecialScope.Module : SpecialScope.Global;
}
var SpecialScope = /* @__PURE__ */ ((SpecialScope2) => {
SpecialScope2[SpecialScope2["Module"] = 0] = "Module";
@@ -147153,7 +147411,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont
changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration);
const localReference = factory.createIdentifier(localNameText);
changeTracker.replaceNode(context.file, node, localReference);
- } else if (node.parent.kind === 245 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) {
+ } else if (node.parent.kind === 247 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) {
const newVariableStatement = factory.createVariableStatement(
void 0,
factory.createVariableDeclarationList([newVariableDeclaration], 2 /* Const */)
@@ -147170,7 +147428,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont
} else {
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, false);
}
- if (node.parent.kind === 245 /* ExpressionStatement */) {
+ if (node.parent.kind === 247 /* ExpressionStatement */) {
changeTracker.delete(context.file, node.parent);
} else {
let localReference = factory.createIdentifier(localNameText);
@@ -147691,27 +147949,27 @@ function getExtractableParent(node) {
function isExtractableExpression(node) {
const { parent: parent2 } = node;
switch (parent2.kind) {
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return false;
}
switch (node.kind) {
case 10 /* StringLiteral */:
- return parent2.kind !== 275 /* ImportDeclaration */ && parent2.kind !== 279 /* ImportSpecifier */;
- case 231 /* SpreadElement */:
- case 206 /* ObjectBindingPattern */:
- case 208 /* BindingElement */:
+ return parent2.kind !== 278 /* ImportDeclaration */ && parent2.kind !== 282 /* ImportSpecifier */;
+ case 233 /* SpreadElement */:
+ case 208 /* ObjectBindingPattern */:
+ case 210 /* BindingElement */:
return false;
case 79 /* Identifier */:
- return parent2.kind !== 208 /* BindingElement */ && parent2.kind !== 279 /* ImportSpecifier */ && parent2.kind !== 284 /* ExportSpecifier */;
+ return parent2.kind !== 210 /* BindingElement */ && parent2.kind !== 282 /* ImportSpecifier */ && parent2.kind !== 287 /* ExportSpecifier */;
}
return true;
}
function isBlockLike(node) {
switch (node.kind) {
- case 242 /* Block */:
- case 314 /* SourceFile */:
- case 271 /* ModuleBlock */:
- case 298 /* CaseClause */:
+ case 244 /* Block */:
+ case 317 /* SourceFile */:
+ case 274 /* ModuleBlock */:
+ case 301 /* CaseClause */:
return true;
default:
return false;
@@ -147851,10 +148109,10 @@ function getInfo21(context) {
}
function isConvertibleDeclaration(node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
return true;
default:
return false;
@@ -147922,7 +148180,7 @@ function getRenameInfoForNode(node, typeChecker3, sourceFile, program, preferenc
return getRenameInfoError(wouldRenameNodeModules);
}
const kind = ts_SymbolDisplay_exports.getSymbolKind(typeChecker3, symbol, node);
- const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 166 /* ComputedPropertyName */ ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0;
+ const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0;
const displayName = specifierName || typeChecker3.symbolToString(symbol);
const fullDisplayName = specifierName || typeChecker3.getFullyQualifiedName(symbol);
return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker3, symbol), node, sourceFile);
@@ -148191,10 +148449,10 @@ function getImmediatelyContainingArgumentInfo(node, position, sourceFile) {
return getArgumentListInfoForTemplate(parent2, 0, sourceFile);
}
return void 0;
- } else if (isTemplateHead(node) && parent2.parent.kind === 215 /* TaggedTemplateExpression */) {
+ } else if (isTemplateHead(node) && parent2.parent.kind === 217 /* TaggedTemplateExpression */) {
const templateExpression = parent2;
const tagExpression = templateExpression.parent;
- Debug.assert(templateExpression.kind === 229 /* TemplateExpression */);
+ Debug.assert(templateExpression.kind === 231 /* TemplateExpression */);
const argumentIndex = isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1;
return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile);
} else if (isTemplateSpan(parent2) && isTaggedTemplateExpression(parent2.parent.parent)) {
@@ -148256,17 +148514,17 @@ function getContextualSignatureLocationInfo(startingToken, sourceFile, position,
return void 0;
const { parent: parent2 } = startingToken;
switch (parent2.kind) {
- case 217 /* ParenthesizedExpression */:
- case 174 /* MethodDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 219 /* ParenthesizedExpression */:
+ case 176 /* MethodDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
const info = getArgumentOrParameterListInfo(startingToken, position, sourceFile);
if (!info)
return void 0;
const { argumentIndex, argumentCount, argumentsSpan } = info;
const contextualType = isMethodDeclaration(parent2) ? checker.getContextualTypeForObjectLiteralElement(parent2) : checker.getContextualType(parent2);
return contextualType && { contextualType, argumentIndex, argumentCount, argumentsSpan };
- case 227 /* BinaryExpression */: {
+ case 229 /* BinaryExpression */: {
const highestBinary = getHighestBinary(parent2);
const contextualType2 = checker.getContextualType(highestBinary);
const argumentIndex2 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1;
@@ -148332,7 +148590,7 @@ function getApplicableSpanForTaggedTemplate(taggedTemplate, sourceFile) {
const template = taggedTemplate.template;
const applicableSpanStart = template.getStart();
let applicableSpanEnd = template.getEnd();
- if (template.kind === 229 /* TemplateExpression */) {
+ if (template.kind === 231 /* TemplateExpression */) {
const lastSpan = last(template.templateSpans);
if (lastSpan.literal.getFullWidth() === 0) {
applicableSpanEnd = skipTrivia(sourceFile.text, applicableSpanEnd, false);
@@ -148599,7 +148857,7 @@ function getSelectionChildren(node) {
const groupedWithPlusMinusTokens = groupChildren(children, (child) => child === node.readonlyToken || child.kind === 147 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */);
const groupedWithBrackets = groupChildren(
groupedWithPlusMinusTokens,
- ({ kind }) => kind === 22 /* OpenBracketToken */ || kind === 167 /* TypeParameter */ || kind === 23 /* CloseBracketToken */
+ ({ kind }) => kind === 22 /* OpenBracketToken */ || kind === 168 /* TypeParameter */ || kind === 23 /* CloseBracketToken */
);
return [
openBraceToken,
@@ -148609,7 +148867,7 @@ function getSelectionChildren(node) {
}
if (isPropertySignature(node)) {
const children = groupChildren(node.getChildren(), (child) => child === node.name || contains(node.modifiers, child));
- const firstJSDocChild = ((_a2 = children[0]) == null ? void 0 : _a2.kind) === 329 /* JSDoc */ ? children[0] : void 0;
+ const firstJSDocChild = ((_a2 = children[0]) == null ? void 0 : _a2.kind) === 332 /* JSDoc */ ? children[0] : void 0;
const withJSDocSeparated = firstJSDocChild ? children.slice(1) : children;
const splittedChildren = splitChildren(withJSDocSeparated, ({ kind }) => kind === 58 /* ColonToken */);
return firstJSDocChild ? [firstJSDocChild, createSyntaxList2(splittedChildren)] : splittedChildren;
@@ -148670,19 +148928,19 @@ function createSyntaxList2(children) {
}
function isListOpener(token) {
const kind = token && token.kind;
- return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ || kind === 289 /* JsxOpeningElement */;
+ return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ || kind === 292 /* JsxOpeningElement */;
}
function isListCloser(token) {
const kind = token && token.kind;
- return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ || kind === 290 /* JsxClosingElement */;
+ return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ || kind === 293 /* JsxClosingElement */;
}
function getEndPos(sourceFile, node) {
switch (node.kind) {
- case 349 /* JSDocParameterTag */:
- case 347 /* JSDocCallbackTag */:
- case 356 /* JSDocPropertyTag */:
- case 354 /* JSDocTypedefTag */:
- case 351 /* JSDocThisTag */:
+ case 352 /* JSDocParameterTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 359 /* JSDocPropertyTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 354 /* JSDocThisTag */:
return sourceFile.getLineEndOfPosition(node.getStart());
default:
return node.getEnd();
@@ -148706,7 +148964,7 @@ function getSymbolKind(typeChecker3, symbol, location) {
}
const flags = getCombinedLocalAndExportSymbolFlags(symbol);
if (flags & 32 /* Class */) {
- return getDeclarationOfKind(symbol, 232 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */;
+ return getDeclarationOfKind(symbol, 234 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */;
}
if (flags & 384 /* Enum */)
return "enum" /* enumElement */;
@@ -148832,13 +149090,13 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
const declaration = find(symbol.declarations, (declaration2) => declaration2.name === location);
if (declaration) {
switch (declaration.kind) {
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
symbolKind = "getter" /* memberGetAccessorElement */;
break;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
symbolKind = "setter" /* memberSetAccessorElement */;
break;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
symbolKind = "accessor" /* memberAccessorVariableElement */;
break;
default:
@@ -148850,7 +149108,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
let signature;
type = isThisExpression ? typeChecker3.getTypeAtLocation(location) : typeChecker3.getTypeOfSymbolAtLocation(symbol, location);
- if (location.parent && location.parent.kind === 211 /* PropertyAccessExpression */) {
+ if (location.parent && location.parent.kind === 213 /* PropertyAccessExpression */) {
const right = location.parent.name;
if (right === location || right && right.getFullWidth() === 0) {
location = location.parent;
@@ -148866,7 +149124,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
if (callExpressionLike) {
signature = typeChecker3.getResolvedSignature(callExpressionLike);
- const useConstructSignatures = callExpressionLike.kind === 214 /* NewExpression */ || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 107 /* SuperKeyword */;
+ const useConstructSignatures = callExpressionLike.kind === 216 /* NewExpression */ || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 107 /* SuperKeyword */;
const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
if (signature && !contains(allSignatures, signature.target) && !contains(allSignatures, signature)) {
signature = allSignatures.length ? allSignatures[0] : void 0;
@@ -148921,21 +149179,21 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
hasAddedSymbolInfo = true;
hasMultipleSignatures = allSignatures.length > 1;
}
- } else if (isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */) || location.kind === 136 /* ConstructorKeyword */ && location.parent.kind === 176 /* Constructor */) {
+ } else if (isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */) || location.kind === 136 /* ConstructorKeyword */ && location.parent.kind === 178 /* Constructor */) {
const functionDeclaration = location.parent;
const locationIsSymbolDeclaration = symbol.declarations && find(symbol.declarations, (declaration) => declaration === (location.kind === 136 /* ConstructorKeyword */ ? functionDeclaration.parent : functionDeclaration));
if (locationIsSymbolDeclaration) {
- const allSignatures = functionDeclaration.kind === 176 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
+ const allSignatures = functionDeclaration.kind === 178 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
if (!typeChecker3.isImplementationOfOverload(functionDeclaration)) {
signature = typeChecker3.getSignatureFromDeclaration(functionDeclaration);
} else {
signature = allSignatures[0];
}
- if (functionDeclaration.kind === 176 /* Constructor */) {
+ if (functionDeclaration.kind === 178 /* Constructor */) {
symbolKind = "constructor" /* constructorImplementationElement */;
addPrefixForAnyFunctionOrVar(type.symbol, symbolKind);
} else {
- addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 179 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind);
+ addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 181 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind);
}
if (signature) {
addSignatureDisplayParts(signature, allSignatures);
@@ -148947,9 +149205,9 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) {
addAliasPrefixIfNecessary();
- if (getDeclarationOfKind(symbol, 232 /* ClassExpression */)) {
+ if (getDeclarationOfKind(symbol, 234 /* ClassExpression */)) {
pushSymbolKind("local class" /* localClassElement */);
- } else if (getDeclarationOfKind(symbol, 265 /* StructDeclaration */)) {
+ } else if (getDeclarationOfKind(symbol, 267 /* StructDeclaration */)) {
displayParts.push(keywordPart(85 /* StructKeyword */));
} else {
displayParts.push(keywordPart(84 /* ClassKeyword */));
@@ -148988,7 +149246,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
if (symbolFlags & 1536 /* Module */ && !isThisExpression) {
prefixNextMeaning();
- const declaration = getDeclarationOfKind(symbol, 270 /* ModuleDeclaration */);
+ const declaration = getDeclarationOfKind(symbol, 273 /* ModuleDeclaration */);
const isNamespace = declaration && declaration.name && declaration.name.kind === 79 /* Identifier */;
displayParts.push(keywordPart(isNamespace ? 144 /* NamespaceKeyword */ : 143 /* ModuleKeyword */));
displayParts.push(spacePart());
@@ -149006,7 +149264,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
addFullSymbolName(symbol.parent, enclosingDeclaration);
writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration);
} else {
- const decl = getDeclarationOfKind(symbol, 167 /* TypeParameter */);
+ const decl = getDeclarationOfKind(symbol, 168 /* TypeParameter */);
if (decl === void 0)
return Debug.fail();
const declaration = decl.parent;
@@ -149014,14 +149272,14 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
if (isFunctionLikeKind(declaration.kind)) {
addInPrefix();
const signature = typeChecker3.getSignatureFromDeclaration(declaration);
- if (declaration.kind === 180 /* ConstructSignature */) {
+ if (declaration.kind === 182 /* ConstructSignature */) {
displayParts.push(keywordPart(104 /* NewKeyword */));
displayParts.push(spacePart());
- } else if (declaration.kind !== 179 /* CallSignature */ && declaration.name) {
+ } else if (declaration.kind !== 181 /* CallSignature */ && declaration.name) {
addFullSymbolName(declaration.symbol);
}
addRange(displayParts, signatureToDisplayParts(typeChecker3, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */));
- } else if (declaration.kind === 268 /* TypeAliasDeclaration */) {
+ } else if (declaration.kind === 271 /* TypeAliasDeclaration */) {
addInPrefix();
displayParts.push(keywordPart(155 /* TypeKeyword */));
displayParts.push(spacePart());
@@ -149035,7 +149293,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
symbolKind = "enum member" /* enumMemberElement */;
addPrefixForAnyFunctionOrVar(symbol, "enum member");
const declaration = (_a2 = symbol.declarations) == null ? void 0 : _a2[0];
- if ((declaration == null ? void 0 : declaration.kind) === 308 /* EnumMember */) {
+ if ((declaration == null ? void 0 : declaration.kind) === 311 /* EnumMember */) {
const constantValue = typeChecker3.getConstantValue(declaration);
if (constantValue !== void 0) {
displayParts.push(spacePart());
@@ -149079,17 +149337,17 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
}
if (symbol.declarations) {
switch (symbol.declarations[0].kind) {
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
displayParts.push(keywordPart(94 /* ExportKeyword */));
displayParts.push(spacePart());
displayParts.push(keywordPart(144 /* NamespaceKeyword */));
break;
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
displayParts.push(keywordPart(94 /* ExportKeyword */));
displayParts.push(spacePart());
displayParts.push(keywordPart(symbol.declarations[0].isExportEquals ? 63 /* EqualsToken */ : 89 /* DefaultKeyword */));
break;
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
displayParts.push(keywordPart(94 /* ExportKeyword */));
break;
default:
@@ -149099,7 +149357,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
displayParts.push(spacePart());
addFullSymbolName(symbol);
forEach(symbol.declarations, (declaration) => {
- if (declaration.kind === 274 /* ImportEqualsDeclaration */) {
+ if (declaration.kind === 277 /* ImportEqualsDeclaration */) {
const importEqualsDeclaration = declaration;
if (isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) {
displayParts.push(spacePart());
@@ -149167,9 +149425,9 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker3, symbol, s
documentation = symbol.getContextualDocumentationComment(enclosingDeclaration, typeChecker3);
}
if (documentation.length === 0 && symbolFlags & 4 /* Property */) {
- if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 314 /* SourceFile */)) {
+ if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 317 /* SourceFile */)) {
for (const declaration of symbol.declarations) {
- if (!declaration.parent || declaration.parent.kind !== 227 /* BinaryExpression */) {
+ if (!declaration.parent || declaration.parent.kind !== 229 /* BinaryExpression */) {
continue;
}
const rhsSymbol = typeChecker3.getSymbolAtLocation(declaration.parent.right);
@@ -149320,14 +149578,14 @@ function isLocalVariableOrFunction(symbol) {
return false;
}
return forEach(symbol.declarations, (declaration) => {
- if (declaration.kind === 218 /* FunctionExpression */) {
+ if (declaration.kind === 220 /* FunctionExpression */) {
return true;
}
- if (declaration.kind !== 261 /* VariableDeclaration */ && declaration.kind !== 263 /* FunctionDeclaration */) {
+ if (declaration.kind !== 263 /* VariableDeclaration */ && declaration.kind !== 265 /* FunctionDeclaration */) {
return false;
}
for (let parent2 = declaration.parent; !isFunctionBlock(parent2); parent2 = parent2.parent) {
- if (parent2.kind === 314 /* SourceFile */ || parent2.kind === 271 /* ModuleBlock */) {
+ if (parent2.kind === 317 /* SourceFile */ || parent2.kind === 274 /* ModuleBlock */) {
return false;
}
}
@@ -149492,7 +149750,7 @@ function getAdjustedEndPosition(sourceFile, node, options) {
return newEnd !== end && (trailingTriviaOption === 2 /* Include */ || isLineBreak(sourceFile.text.charCodeAt(newEnd - 1))) ? newEnd : end;
}
function isSeparator(node, candidate) {
- return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 210 /* ObjectLiteralExpression */);
+ return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 212 /* ObjectLiteralExpression */);
}
function isThisTypeAnnotatable(containingFunction) {
return isFunctionExpression(containingFunction) || isFunctionDeclaration(containingFunction);
@@ -149689,7 +149947,7 @@ var ChangeTracker = class {
endNode2 = first(node.parameters);
}
} else {
- endNode2 = (_a2 = node.kind === 261 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) != null ? _a2 : node.name;
+ endNode2 = (_a2 = node.kind === 263 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) != null ? _a2 : node.name;
}
this.insertNodeAt(sourceFile, endNode2.end, type, { prefix: ": " });
return true;
@@ -149831,19 +150089,19 @@ ${options.prefix}` : "\n" : options.prefix
}
getInsertNodeAfterOptionsWorker(node) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 270 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 273 /* ModuleDeclaration */:
return { prefix: this.newLineCharacter, suffix: this.newLineCharacter };
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
case 10 /* StringLiteral */:
case 79 /* Identifier */:
return { prefix: ", " };
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return { suffix: "," + this.newLineCharacter };
case 94 /* ExportKeyword */:
return { prefix: " " };
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return {};
default:
Debug.assert(isStatement(node) || isClassOrTypeElement(node));
@@ -149852,7 +150110,7 @@ ${options.prefix}` : "\n" : options.prefix
}
insertName(sourceFile, node, name) {
Debug.assert(!node.name);
- if (node.kind === 219 /* ArrowFunction */) {
+ if (node.kind === 221 /* ArrowFunction */) {
const arrow = findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile);
const lparen = findChildOfKind(node, 20 /* OpenParenToken */, sourceFile);
if (lparen) {
@@ -149862,12 +150120,12 @@ ${options.prefix}` : "\n" : options.prefix
this.insertText(sourceFile, first(node.parameters).getStart(sourceFile), `function ${name}(`);
this.replaceRange(sourceFile, arrow, factory.createToken(21 /* CloseParenToken */));
}
- if (node.body.kind !== 242 /* Block */) {
+ if (node.body.kind !== 244 /* Block */) {
this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [factory.createToken(18 /* OpenBraceToken */), factory.createToken(106 /* ReturnKeyword */)], { joiner: " ", suffix: " " });
this.insertNodesAt(sourceFile, node.body.end, [factory.createToken(26 /* SemicolonToken */), factory.createToken(19 /* CloseBraceToken */)], { joiner: " " });
}
} else {
- const pos = findChildOfKind(node, node.kind === 218 /* FunctionExpression */ ? 99 /* FunctionKeyword */ : 84 /* ClassKeyword */, sourceFile).end;
+ const pos = findChildOfKind(node, node.kind === 220 /* FunctionExpression */ ? 99 /* FunctionKeyword */ : 84 /* ClassKeyword */, sourceFile).end;
this.insertNodeAt(sourceFile, pos, factory.createIdentifier(name), { prefix: " " });
}
}
@@ -149988,10 +150246,10 @@ ${options.prefix}` : "\n" : options.prefix
}
};
function updateJSDocHost(parent2) {
- if (parent2.kind !== 219 /* ArrowFunction */) {
+ if (parent2.kind !== 221 /* ArrowFunction */) {
return parent2;
}
- const jsDocNode = parent2.parent.kind === 171 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent;
+ const jsDocNode = parent2.parent.kind === 172 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent;
jsDocNode.jsDoc = parent2.jsDoc;
jsDocNode.jsDocCache = parent2.jsDocCache;
return jsDocNode;
@@ -150001,14 +150259,14 @@ function tryMergeJsdocTags(oldTag, newTag) {
return void 0;
}
switch (oldTag.kind) {
- case 349 /* JSDocParameterTag */: {
+ case 352 /* JSDocParameterTag */: {
const oldParam = oldTag;
const newParam = newTag;
return isIdentifier(oldParam.name) && isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? factory.createJSDocParameterTag(void 0, newParam.name, false, newParam.typeExpression, newParam.isNameFirst, oldParam.comment) : void 0;
}
- case 350 /* JSDocReturnTag */:
+ case 353 /* JSDocReturnTag */:
return factory.createJSDocReturnTag(void 0, newTag.typeExpression, oldTag.comment);
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return factory.createJSDocTypeTag(void 0, newTag.typeExpression, oldTag.comment);
}
}
@@ -150389,13 +150647,13 @@ function isValidLocationToAddComment(sourceFile, position) {
return !isInComment(sourceFile, position) && !isInString(sourceFile, position) && !isInTemplateString(sourceFile, position) && !isInJSXText(sourceFile, position);
}
function needSemicolonBetween(a, b) {
- return (isPropertySignature(a) || isPropertyDeclaration(a)) && isClassOrTypeElement(b) && b.name.kind === 166 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b);
+ return (isPropertySignature(a) || isPropertyDeclaration(a)) && isClassOrTypeElement(b) && b.name.kind === 167 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b);
}
var deleteDeclaration;
((_deleteDeclaration) => {
function deleteDeclaration2(changes, deletedNodesInLists, sourceFile, node) {
switch (node.kind) {
- case 168 /* Parameter */: {
+ case 169 /* Parameter */: {
const oldFunction = node.parent;
if (isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && !findChildOfKind(oldFunction, 20 /* OpenParenToken */, sourceFile)) {
changes.replaceNodeWithText(sourceFile, node, "()");
@@ -150404,29 +150662,29 @@ var deleteDeclaration;
}
break;
}
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
const isFirstImport = sourceFile.imports.length && node === first(sourceFile.imports).parent || node === find(sourceFile.statements, isAnyImportSyntax);
deleteNode(changes, sourceFile, node, {
leadingTriviaOption: isFirstImport ? 0 /* Exclude */ : hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */
});
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
const pattern = node.parent;
- const preserveComma = pattern.kind === 207 /* ArrayBindingPattern */ && node !== last(pattern.elements);
+ const preserveComma = pattern.kind === 209 /* ArrayBindingPattern */ && node !== last(pattern.elements);
if (preserveComma) {
deleteNode(changes, sourceFile, node);
} else {
deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);
}
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node);
break;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);
break;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
const namedImports = node.parent;
if (namedImports.elements.length === 1) {
deleteImportBinding(changes, sourceFile, namedImports);
@@ -150434,7 +150692,7 @@ var deleteDeclaration;
deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);
}
break;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
deleteImportBinding(changes, sourceFile, node);
break;
case 26 /* SemicolonToken */:
@@ -150443,9 +150701,9 @@ var deleteDeclaration;
case 99 /* FunctionKeyword */:
deleteNode(changes, sourceFile, node, { leadingTriviaOption: 0 /* Exclude */ });
break;
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 263 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 265 /* FunctionDeclaration */:
deleteNode(changes, sourceFile, node, { leadingTriviaOption: hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */ });
break;
default:
@@ -150480,13 +150738,13 @@ var deleteDeclaration;
const previousToken = Debug.checkDefined(getTokenAtPosition(sourceFile, node.pos - 1));
changes.deleteRange(sourceFile, { pos: previousToken.getStart(sourceFile), end: node.end });
} else {
- const importDecl = getAncestor(node, 275 /* ImportDeclaration */);
+ const importDecl = getAncestor(node, 278 /* ImportDeclaration */);
deleteNode(changes, sourceFile, importDecl);
}
}
function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) {
const { parent: parent2 } = node;
- if (parent2.kind === 301 /* CatchClause */) {
+ if (parent2.kind === 304 /* CatchClause */) {
changes.deleteNodeRange(sourceFile, findChildOfKind(parent2, 20 /* OpenParenToken */, sourceFile), findChildOfKind(parent2, 21 /* CloseParenToken */, sourceFile));
return;
}
@@ -150496,14 +150754,14 @@ var deleteDeclaration;
}
const gp = parent2.parent;
switch (gp.kind) {
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
changes.replaceNode(sourceFile, node, factory.createObjectLiteralExpression());
break;
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
deleteNode(changes, sourceFile, parent2);
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
deleteNode(changes, sourceFile, gp, { leadingTriviaOption: hasJSDocNodes(gp) ? 2 /* JSDoc */ : 3 /* StartLine */ });
break;
default:
@@ -150715,10 +150973,10 @@ function getFormattingScanner(text, languageVariant, startPos, endPos, cb) {
function shouldRescanJsxIdentifier(node) {
if (node.parent) {
switch (node.parent.kind) {
- case 294 /* JsxAttribute */:
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 297 /* JsxAttribute */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return isKeyword(node.kind) || node.kind === 79 /* Identifier */;
}
}
@@ -150885,7 +151143,7 @@ var RuleFlags = /* @__PURE__ */ ((RuleFlags2) => {
// src/services/formatting/rules.ts
function getAllRules() {
const allTokens = [];
- for (let token = 0 /* FirstToken */; token <= 164 /* LastToken */; token++) {
+ for (let token = 0 /* FirstToken */; token <= 165 /* LastToken */; token++) {
if (token !== 1 /* EndOfFileToken */) {
allTokens.push(token);
}
@@ -150896,9 +151154,9 @@ function getAllRules() {
const anyToken = { tokens: allTokens, isSpecific: false };
const anyTokenIncludingMultilineComments = tokenRangeFrom([...allTokens, 3 /* MultiLineCommentTrivia */]);
const anyTokenIncludingEOF = tokenRangeFrom([...allTokens, 1 /* EndOfFileToken */]);
- const keywords = tokenRangeFromRange(81 /* FirstKeyword */, 164 /* LastKeyword */);
+ const keywords = tokenRangeFromRange(81 /* FirstKeyword */, 165 /* LastKeyword */);
const binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 78 /* LastBinaryOperator */);
- const binaryKeywordOperators = [102 /* InKeyword */, 103 /* InstanceOfKeyword */, 164 /* OfKeyword */, 129 /* AsKeyword */, 141 /* IsKeyword */];
+ const binaryKeywordOperators = [102 /* InKeyword */, 103 /* InstanceOfKeyword */, 165 /* OfKeyword */, 129 /* AsKeyword */, 141 /* IsKeyword */];
const unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */];
const unaryPrefixExpressions = [
8 /* NumericLiteral */,
@@ -151171,40 +151429,40 @@ function isOptionEnabledOrUndefined(optionName) {
return (context) => !context.options || !hasProperty(context.options, optionName) || !!context.options[optionName];
}
function isForContext(context) {
- return context.contextNode.kind === 249 /* ForStatement */;
+ return context.contextNode.kind === 251 /* ForStatement */;
}
function isNotForContext(context) {
return !isForContext(context);
}
function isBinaryOpContext(context) {
switch (context.contextNode.kind) {
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return context.contextNode.operatorToken.kind !== 27 /* CommaToken */;
- case 228 /* ConditionalExpression */:
- case 194 /* ConditionalType */:
- case 235 /* AsExpression */:
- case 284 /* ExportSpecifier */:
- case 279 /* ImportSpecifier */:
- case 182 /* TypePredicate */:
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
- case 239 /* SatisfiesExpression */:
+ case 230 /* ConditionalExpression */:
+ case 196 /* ConditionalType */:
+ case 237 /* AsExpression */:
+ case 287 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 184 /* TypePredicate */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
+ case 241 /* SatisfiesExpression */:
return true;
- case 208 /* BindingElement */:
- case 268 /* TypeAliasDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 280 /* ExportAssignment */:
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 308 /* EnumMember */:
- case 171 /* PropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 210 /* BindingElement */:
+ case 271 /* TypeAliasDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 311 /* EnumMember */:
+ case 172 /* PropertyDeclaration */:
+ case 171 /* PropertySignature */:
return context.currentTokenSpan.kind === 63 /* EqualsToken */ || context.nextTokenSpan.kind === 63 /* EqualsToken */;
- case 250 /* ForInStatement */:
- case 167 /* TypeParameter */:
+ case 252 /* ForInStatement */:
+ case 168 /* TypeParameter */:
return context.currentTokenSpan.kind === 102 /* InKeyword */ || context.nextTokenSpan.kind === 102 /* InKeyword */ || context.currentTokenSpan.kind === 63 /* EqualsToken */ || context.nextTokenSpan.kind === 63 /* EqualsToken */;
- case 251 /* ForOfStatement */:
- return context.currentTokenSpan.kind === 164 /* OfKeyword */ || context.nextTokenSpan.kind === 164 /* OfKeyword */;
+ case 253 /* ForOfStatement */:
+ return context.currentTokenSpan.kind === 165 /* OfKeyword */ || context.nextTokenSpan.kind === 165 /* OfKeyword */;
}
return false;
}
@@ -151216,16 +151474,16 @@ function isNotTypeAnnotationContext(context) {
}
function isTypeAnnotationContext(context) {
const contextKind = context.contextNode.kind;
- return contextKind === 171 /* PropertyDeclaration */ || contextKind === 170 /* PropertySignature */ || contextKind === 168 /* Parameter */ || contextKind === 261 /* VariableDeclaration */ || isFunctionLikeKind(contextKind);
+ return contextKind === 172 /* PropertyDeclaration */ || contextKind === 171 /* PropertySignature */ || contextKind === 169 /* Parameter */ || contextKind === 263 /* VariableDeclaration */ || isFunctionLikeKind(contextKind);
}
function isConditionalOperatorContext(context) {
- return context.contextNode.kind === 228 /* ConditionalExpression */ || context.contextNode.kind === 194 /* ConditionalType */;
+ return context.contextNode.kind === 230 /* ConditionalExpression */ || context.contextNode.kind === 196 /* ConditionalType */;
}
function isSameLineTokenOrBeforeBlockContext(context) {
return context.TokensAreOnSameLine() || isBeforeBlockContext(context);
}
function isBraceWrappedContext(context) {
- return context.contextNode.kind === 206 /* ObjectBindingPattern */ || context.contextNode.kind === 200 /* MappedType */ || isSingleLineBlockContext(context);
+ return context.contextNode.kind === 208 /* ObjectBindingPattern */ || context.contextNode.kind === 202 /* MappedType */ || isSingleLineBlockContext(context);
}
function isBeforeMultilineBlockContext(context) {
return isBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine());
@@ -151247,26 +151505,26 @@ function nodeIsBlockContext(node) {
return true;
}
switch (node.kind) {
- case 242 /* Block */:
- case 272 /* CaseBlock */:
- case 210 /* ObjectLiteralExpression */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 275 /* CaseBlock */:
+ case 212 /* ObjectLiteralExpression */:
+ case 274 /* ModuleBlock */:
return true;
}
return false;
}
function isFunctionDeclContext(context) {
switch (context.contextNode.kind) {
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 179 /* CallSignature */:
- case 218 /* FunctionExpression */:
- case 176 /* Constructor */:
- case 219 /* ArrowFunction */:
- case 267 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 181 /* CallSignature */:
+ case 220 /* FunctionExpression */:
+ case 178 /* Constructor */:
+ case 221 /* ArrowFunction */:
+ case 270 /* InterfaceDeclaration */:
return true;
}
return false;
@@ -151275,41 +151533,41 @@ function isNotFunctionDeclContext(context) {
return !isFunctionDeclContext(context);
}
function isFunctionDeclarationOrFunctionExpressionContext(context) {
- return context.contextNode.kind === 263 /* FunctionDeclaration */ || context.contextNode.kind === 218 /* FunctionExpression */;
+ return context.contextNode.kind === 265 /* FunctionDeclaration */ || context.contextNode.kind === 220 /* FunctionExpression */;
}
function isTypeScriptDeclWithBlockContext(context) {
return nodeIsTypeScriptDeclWithBlockContext(context.contextNode);
}
function nodeIsTypeScriptDeclWithBlockContext(node) {
switch (node.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 187 /* TypeLiteral */:
- case 270 /* ModuleDeclaration */:
- case 281 /* ExportDeclaration */:
- case 282 /* NamedExports */:
- case 275 /* ImportDeclaration */:
- case 278 /* NamedImports */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 189 /* TypeLiteral */:
+ case 273 /* ModuleDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 285 /* NamedExports */:
+ case 278 /* ImportDeclaration */:
+ case 281 /* NamedImports */:
return true;
}
return false;
}
function isAfterCodeBlockContext(context) {
switch (context.currentTokenParent.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 301 /* CatchClause */:
- case 271 /* ModuleBlock */:
- case 256 /* SwitchStatement */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 304 /* CatchClause */:
+ case 274 /* ModuleBlock */:
+ case 258 /* SwitchStatement */:
return true;
- case 242 /* Block */: {
+ case 244 /* Block */: {
const blockParent = context.currentTokenParent.parent;
- if (!blockParent || blockParent.kind !== 219 /* ArrowFunction */ && blockParent.kind !== 218 /* FunctionExpression */) {
+ if (!blockParent || blockParent.kind !== 221 /* ArrowFunction */ && blockParent.kind !== 220 /* FunctionExpression */) {
return true;
}
}
@@ -151318,29 +151576,29 @@ function isAfterCodeBlockContext(context) {
}
function isControlDeclContext(context) {
switch (context.contextNode.kind) {
- case 246 /* IfStatement */:
- case 256 /* SwitchStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 248 /* WhileStatement */:
- case 259 /* TryStatement */:
- case 247 /* DoStatement */:
- case 255 /* WithStatement */:
- case 301 /* CatchClause */:
+ case 248 /* IfStatement */:
+ case 258 /* SwitchStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 250 /* WhileStatement */:
+ case 261 /* TryStatement */:
+ case 249 /* DoStatement */:
+ case 257 /* WithStatement */:
+ case 304 /* CatchClause */:
return true;
default:
return false;
}
}
function isObjectContext(context) {
- return context.contextNode.kind === 210 /* ObjectLiteralExpression */;
+ return context.contextNode.kind === 212 /* ObjectLiteralExpression */;
}
function isFunctionCallContext(context) {
- return context.contextNode.kind === 213 /* CallExpression */;
+ return context.contextNode.kind === 215 /* CallExpression */;
}
function isNewContext(context) {
- return context.contextNode.kind === 214 /* NewExpression */;
+ return context.contextNode.kind === 216 /* NewExpression */;
}
function isFunctionCallOrNewContext(context) {
return isFunctionCallContext(context) || isNewContext(context);
@@ -151355,10 +151613,10 @@ function isNextTokenNotCloseParen(context) {
return context.nextTokenSpan.kind !== 21 /* CloseParenToken */;
}
function isArrowFunctionContext(context) {
- return context.contextNode.kind === 219 /* ArrowFunction */;
+ return context.contextNode.kind === 221 /* ArrowFunction */;
}
function isImportTypeContext(context) {
- return context.contextNode.kind === 205 /* ImportType */;
+ return context.contextNode.kind === 207 /* ImportType */;
}
function isNonJsxSameLineTokenContext(context) {
return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */;
@@ -151367,19 +151625,19 @@ function isNonJsxTextContext(context) {
return context.contextNode.kind !== 11 /* JsxText */;
}
function isNonJsxElementOrFragmentContext(context) {
- return context.contextNode.kind !== 287 /* JsxElement */ && context.contextNode.kind !== 291 /* JsxFragment */;
+ return context.contextNode.kind !== 290 /* JsxElement */ && context.contextNode.kind !== 294 /* JsxFragment */;
}
function isJsxExpressionContext(context) {
- return context.contextNode.kind === 297 /* JsxExpression */ || context.contextNode.kind === 296 /* JsxSpreadAttribute */;
+ return context.contextNode.kind === 300 /* JsxExpression */ || context.contextNode.kind === 299 /* JsxSpreadAttribute */;
}
function isNextTokenParentJsxAttribute(context) {
- return context.nextTokenParent.kind === 294 /* JsxAttribute */;
+ return context.nextTokenParent.kind === 297 /* JsxAttribute */;
}
function isJsxAttributeContext(context) {
- return context.contextNode.kind === 294 /* JsxAttribute */;
+ return context.contextNode.kind === 297 /* JsxAttribute */;
}
function isJsxSelfClosingElementContext(context) {
- return context.contextNode.kind === 288 /* JsxSelfClosingElement */;
+ return context.contextNode.kind === 291 /* JsxSelfClosingElement */;
}
function isNotBeforeBlockInFunctionDeclarationContext(context) {
return !isFunctionDeclContext(context) && !isBeforeBlockContext(context);
@@ -151391,45 +151649,45 @@ function nodeIsInDecoratorContext(node) {
while (node && isExpression(node)) {
node = node.parent;
}
- return node && node.kind === 169 /* Decorator */;
+ return node && node.kind === 170 /* Decorator */;
}
function isStartOfVariableDeclarationList(context) {
- return context.currentTokenParent.kind === 262 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos;
+ return context.currentTokenParent.kind === 264 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos;
}
function isNotFormatOnEnter(context) {
return context.formattingRequestKind !== 2 /* FormatOnEnter */;
}
function isModuleDeclContext(context) {
- return context.contextNode.kind === 270 /* ModuleDeclaration */;
+ return context.contextNode.kind === 273 /* ModuleDeclaration */;
}
function isObjectTypeContext(context) {
- return context.contextNode.kind === 187 /* TypeLiteral */;
+ return context.contextNode.kind === 189 /* TypeLiteral */;
}
function isConstructorSignatureContext(context) {
- return context.contextNode.kind === 180 /* ConstructSignature */;
+ return context.contextNode.kind === 182 /* ConstructSignature */;
}
function isTypeArgumentOrParameterOrAssertion(token, parent2) {
if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) {
return false;
}
switch (parent2.kind) {
- case 183 /* TypeReference */:
- case 216 /* TypeAssertionExpression */:
- case 268 /* TypeAliasDeclaration */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 234 /* ExpressionWithTypeArguments */:
+ case 185 /* TypeReference */:
+ case 218 /* TypeAssertionExpression */:
+ case 271 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
return true;
default:
return false;
@@ -151439,28 +151697,28 @@ function isTypeArgumentOrParameterOrAssertionContext(context) {
return isTypeArgumentOrParameterOrAssertion(context.currentTokenSpan, context.currentTokenParent) || isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent);
}
function isTypeAssertionContext(context) {
- return context.contextNode.kind === 216 /* TypeAssertionExpression */;
+ return context.contextNode.kind === 218 /* TypeAssertionExpression */;
}
function isVoidOpContext(context) {
- return context.currentTokenSpan.kind === 115 /* VoidKeyword */ && context.currentTokenParent.kind === 223 /* VoidExpression */;
+ return context.currentTokenSpan.kind === 115 /* VoidKeyword */ && context.currentTokenParent.kind === 225 /* VoidExpression */;
}
function isYieldOrYieldStarWithOperand(context) {
- return context.contextNode.kind === 230 /* YieldExpression */ && context.contextNode.expression !== void 0;
+ return context.contextNode.kind === 232 /* YieldExpression */ && context.contextNode.expression !== void 0;
}
function isNonNullAssertionContext(context) {
- return context.contextNode.kind === 236 /* NonNullExpression */;
+ return context.contextNode.kind === 238 /* NonNullExpression */;
}
function isNotStatementConditionContext(context) {
return !isStatementConditionContext(context);
}
function isStatementConditionContext(context) {
switch (context.contextNode.kind) {
- case 246 /* IfStatement */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 248 /* IfStatement */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
return true;
default:
return false;
@@ -151486,16 +151744,16 @@ function isSemicolonDeletionContext(context) {
if (startLine === endLine) {
return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */;
}
- if (nextTokenKind === 241 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) {
+ if (nextTokenKind === 243 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) {
return false;
}
- if (context.contextNode.kind === 267 /* InterfaceDeclaration */ || context.contextNode.kind === 268 /* TypeAliasDeclaration */) {
+ if (context.contextNode.kind === 270 /* InterfaceDeclaration */ || context.contextNode.kind === 271 /* TypeAliasDeclaration */) {
return !isPropertySignature(context.currentTokenParent) || !!context.currentTokenParent.type || nextTokenKind !== 20 /* OpenParenToken */;
}
if (isPropertyDeclaration(context.currentTokenParent)) {
return !context.currentTokenParent.initializer;
}
- return context.currentTokenParent.kind !== 249 /* ForStatement */ && context.currentTokenParent.kind !== 243 /* EmptyStatement */ && context.currentTokenParent.kind !== 241 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ && nextTokenKind !== 40 /* MinusToken */ && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ && nextTokenKind !== 229 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */;
+ return context.currentTokenParent.kind !== 251 /* ForStatement */ && context.currentTokenParent.kind !== 245 /* EmptyStatement */ && context.currentTokenParent.kind !== 243 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ && nextTokenKind !== 40 /* MinusToken */ && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ && nextTokenKind !== 231 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */;
}
function isSemicolonInsertionContext(context) {
return positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile);
@@ -151570,12 +151828,12 @@ function buildMap(rules) {
return map2;
}
function getRuleBucketIndex(row, column) {
- Debug.assert(row <= 164 /* LastKeyword */ && column <= 164 /* LastKeyword */, "Must compute formatting context from tokens");
+ Debug.assert(row <= 165 /* LastKeyword */ && column <= 165 /* LastKeyword */, "Must compute formatting context from tokens");
return row * mapRowLength + column;
}
var maskBitSize = 5;
var mask = 31;
-var mapRowLength = 164 /* LastToken */ + 1;
+var mapRowLength = 165 /* LastToken */ + 1;
var RulesPosition = ((RulesPosition2) => {
RulesPosition2[RulesPosition2["StopRulesSpecific"] = 0] = "StopRulesSpecific";
RulesPosition2[RulesPosition2["StopRulesAny"] = maskBitSize * 1] = "StopRulesAny";
@@ -151685,18 +151943,18 @@ function findOutermostNodeWithinListLevel(node) {
}
function isListElement(parent2, node) {
switch (parent2.kind) {
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return rangeContainsRange(parent2.members, node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
const body = parent2.body;
- return !!body && body.kind === 271 /* ModuleBlock */ && rangeContainsRange(body.statements, node);
- case 314 /* SourceFile */:
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
+ return !!body && body.kind === 274 /* ModuleBlock */ && rangeContainsRange(body.statements, node);
+ case 317 /* SourceFile */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
return rangeContainsRange(parent2.statements, node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return rangeContainsRange(parent2.block.statements, node);
}
return false;
@@ -151910,26 +152168,26 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
return modifier.kind;
}
switch (node.kind) {
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return 84 /* ClassKeyword */;
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return 85 /* StructKeyword */;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return 119 /* InterfaceKeyword */;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return 99 /* FunctionKeyword */;
- case 269 /* EnumDeclaration */:
- return 269 /* EnumDeclaration */;
- case 177 /* GetAccessor */:
+ case 272 /* EnumDeclaration */:
+ return 272 /* EnumDeclaration */;
+ case 179 /* GetAccessor */:
return 138 /* GetKeyword */;
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return 152 /* SetKeyword */;
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
if (node.asteriskToken) {
return 41 /* AsteriskToken */;
}
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
const name = getNameOfDeclaration(node);
if (name) {
return name.kind;
@@ -151969,15 +152227,15 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
case 43 /* SlashToken */:
case 31 /* GreaterThanToken */:
switch (container.kind) {
- case 289 /* JsxOpeningElement */:
- case 290 /* JsxClosingElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 293 /* JsxClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return false;
}
break;
case 22 /* OpenBracketToken */:
case 23 /* CloseBracketToken */:
- if (container.kind !== 200 /* MappedType */) {
+ if (container.kind !== 202 /* MappedType */) {
return false;
}
break;
@@ -152061,11 +152319,11 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
return inheritedIndentation;
}
}
- const effectiveParentStartLine = child.kind === 169 /* Decorator */ ? childStartLine : undecoratedParentStartLine;
+ const effectiveParentStartLine = child.kind === 170 /* Decorator */ ? childStartLine : undecoratedParentStartLine;
const childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine);
processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta);
childContextNode = node;
- if (isFirstListItem && parent2.kind === 209 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) {
+ if (isFirstListItem && parent2.kind === 211 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) {
inheritedIndentation = childIndentation.indentation;
}
return inheritedIndentation;
@@ -152438,50 +152696,50 @@ function getRangeOfEnclosingComment(sourceFile, position, precedingToken, tokenA
}
function getOpenTokenForList(node, list) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 219 /* ArrowFunction */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 178 /* Constructor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 221 /* ArrowFunction */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
if (node.typeParameters === list) {
return 29 /* LessThanToken */;
} else if (node.parameters === list) {
return 20 /* OpenParenToken */;
}
break;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
if (node.typeArguments === list) {
return 29 /* LessThanToken */;
} else if (node.arguments === list) {
return 20 /* OpenParenToken */;
}
break;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
if (node.typeParameters === list) {
return 29 /* LessThanToken */;
}
break;
- case 183 /* TypeReference */:
- case 215 /* TaggedTemplateExpression */:
- case 186 /* TypeQuery */:
- case 234 /* ExpressionWithTypeArguments */:
- case 205 /* ImportType */:
+ case 185 /* TypeReference */:
+ case 217 /* TaggedTemplateExpression */:
+ case 188 /* TypeQuery */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 207 /* ImportType */:
if (node.typeArguments === list) {
return 29 /* LessThanToken */;
}
break;
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return 18 /* OpenBraceToken */;
}
return 0 /* Unknown */;
@@ -152564,11 +152822,11 @@ var SmartIndenter;
}
const lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line;
const currentToken = getTokenAtPosition(sourceFile, position);
- const isObjectLiteral = currentToken.kind === 18 /* OpenBraceToken */ && currentToken.parent.kind === 210 /* ObjectLiteralExpression */;
+ const isObjectLiteral = currentToken.kind === 18 /* OpenBraceToken */ && currentToken.parent.kind === 212 /* ObjectLiteralExpression */;
if (options.indentStyle === 1 /* Block */ || isObjectLiteral) {
return getBlockIndent(sourceFile, position, options);
}
- if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 227 /* BinaryExpression */) {
+ if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 229 /* BinaryExpression */) {
const actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options);
if (actualIndentation !== -1 /* Unknown */) {
return actualIndentation;
@@ -152576,7 +152834,7 @@ var SmartIndenter;
}
const containerList = getListByPosition(position, precedingToken.parent, sourceFile);
if (containerList && !rangeContainsRange(containerList, precedingToken)) {
- const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].indexOf(currentToken.parent.kind) !== -1;
+ const useTheSameBaseIndentation = [220 /* FunctionExpression */, 221 /* ArrowFunction */].indexOf(currentToken.parent.kind) !== -1;
const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize;
return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize;
}
@@ -152685,7 +152943,7 @@ var SmartIndenter;
}
}
function getActualIndentationForNode(current, parent2, currentLineAndChar, parentAndChildShareLine, sourceFile, options) {
- const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 314 /* SourceFile */ || !parentAndChildShareLine);
+ const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 317 /* SourceFile */ || !parentAndChildShareLine);
if (!useActualIndentation) {
return -1 /* Unknown */;
}
@@ -152723,7 +152981,7 @@ var SmartIndenter;
}
SmartIndenter2.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled;
function childStartsOnTheSameLineWithElseInIfStatement(parent2, child, childStartLine, sourceFile) {
- if (parent2.kind === 246 /* IfStatement */ && parent2.elseStatement === child) {
+ if (parent2.kind === 248 /* IfStatement */ && parent2.elseStatement === child) {
const elseKeyword = findChildOfKind(parent2, 92 /* ElseKeyword */, sourceFile);
Debug.assert(elseKeyword !== void 0);
const elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line;
@@ -152774,43 +153032,43 @@ var SmartIndenter;
}
function getListByRange(start, end, node, sourceFile) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return getList(node.typeArguments);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return getList(node.properties);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return getList(node.elements);
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return getList(node.members);
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 176 /* Constructor */:
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 178 /* Constructor */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
return getList(node.typeParameters) || getList(node.parameters);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return getList(node.parameters);
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 353 /* JSDocTemplateTag */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 356 /* JSDocTemplateTag */:
return getList(node.typeParameters);
- case 214 /* NewExpression */:
- case 213 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 215 /* CallExpression */:
return getList(node.typeArguments) || getList(node.arguments);
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return getList(node.declarations);
- case 278 /* NamedImports */:
- case 282 /* NamedExports */:
+ case 281 /* NamedImports */:
+ case 285 /* NamedExports */:
return getList(node.elements);
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return getList(node.elements);
}
function getList(list) {
@@ -152833,7 +153091,7 @@ var SmartIndenter;
return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options);
}
function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) {
- if (node.parent && node.parent.kind === 262 /* VariableDeclarationList */) {
+ if (node.parent && node.parent.kind === 264 /* VariableDeclarationList */) {
return -1 /* Unknown */;
}
const containingList = getContainingList(node, sourceFile);
@@ -152894,96 +153152,96 @@ var SmartIndenter;
function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) {
const childKind = child ? child.kind : 0 /* Unknown */;
switch (parent2.kind) {
- case 245 /* ExpressionStatement */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 209 /* ArrayLiteralExpression */:
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
- case 210 /* ObjectLiteralExpression */:
- case 187 /* TypeLiteral */:
- case 200 /* MappedType */:
- case 189 /* TupleType */:
- case 272 /* CaseBlock */:
- case 299 /* DefaultClause */:
- case 298 /* CaseClause */:
- case 217 /* ParenthesizedExpression */:
- case 211 /* PropertyAccessExpression */:
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 244 /* VariableStatement */:
- case 280 /* ExportAssignment */:
- case 254 /* ReturnStatement */:
- case 228 /* ConditionalExpression */:
- case 207 /* ArrayBindingPattern */:
- case 206 /* ObjectBindingPattern */:
- case 289 /* JsxOpeningElement */:
- case 292 /* JsxOpeningFragment */:
- case 288 /* JsxSelfClosingElement */:
- case 297 /* JsxExpression */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 168 /* Parameter */:
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 196 /* ParenthesizedType */:
- case 215 /* TaggedTemplateExpression */:
- case 224 /* AwaitExpression */:
- case 282 /* NamedExports */:
- case 278 /* NamedImports */:
- case 284 /* ExportSpecifier */:
- case 279 /* ImportSpecifier */:
- case 171 /* PropertyDeclaration */:
+ case 247 /* ExpressionStatement */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 211 /* ArrayLiteralExpression */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
+ case 212 /* ObjectLiteralExpression */:
+ case 189 /* TypeLiteral */:
+ case 202 /* MappedType */:
+ case 191 /* TupleType */:
+ case 275 /* CaseBlock */:
+ case 302 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 219 /* ParenthesizedExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 246 /* VariableStatement */:
+ case 283 /* ExportAssignment */:
+ case 256 /* ReturnStatement */:
+ case 230 /* ConditionalExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 292 /* JsxOpeningElement */:
+ case 295 /* JsxOpeningFragment */:
+ case 291 /* JsxSelfClosingElement */:
+ case 300 /* JsxExpression */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 169 /* Parameter */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 198 /* ParenthesizedType */:
+ case 217 /* TaggedTemplateExpression */:
+ case 226 /* AwaitExpression */:
+ case 285 /* NamedExports */:
+ case 281 /* NamedImports */:
+ case 287 /* ExportSpecifier */:
+ case 282 /* ImportSpecifier */:
+ case 172 /* PropertyDeclaration */:
return true;
- case 261 /* VariableDeclaration */:
- case 305 /* PropertyAssignment */:
- case 227 /* BinaryExpression */:
- if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 210 /* ObjectLiteralExpression */) {
+ case 263 /* VariableDeclaration */:
+ case 308 /* PropertyAssignment */:
+ case 229 /* BinaryExpression */:
+ if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 212 /* ObjectLiteralExpression */) {
return rangeIsOnOneLine(sourceFile, child);
}
- if (parent2.kind === 227 /* BinaryExpression */ && sourceFile && child && childKind === 287 /* JsxElement */) {
+ if (parent2.kind === 229 /* BinaryExpression */ && sourceFile && child && childKind === 290 /* JsxElement */) {
const parentStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, parent2.pos)).line;
const childStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, child.pos)).line;
return parentStartLine !== childStartLine;
}
- if (parent2.kind !== 227 /* BinaryExpression */) {
+ if (parent2.kind !== 229 /* BinaryExpression */) {
return true;
}
break;
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 249 /* ForStatement */:
- case 246 /* IfStatement */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- return childKind !== 242 /* Block */;
- case 219 /* ArrowFunction */:
- if (sourceFile && childKind === 217 /* ParenthesizedExpression */) {
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 248 /* IfStatement */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ return childKind !== 244 /* Block */;
+ case 221 /* ArrowFunction */:
+ if (sourceFile && childKind === 219 /* ParenthesizedExpression */) {
return rangeIsOnOneLine(sourceFile, child);
}
- return childKind !== 242 /* Block */;
- case 281 /* ExportDeclaration */:
- return childKind !== 282 /* NamedExports */;
- case 275 /* ImportDeclaration */:
- return childKind !== 276 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 278 /* NamedImports */;
- case 287 /* JsxElement */:
- return childKind !== 290 /* JsxClosingElement */;
- case 291 /* JsxFragment */:
- return childKind !== 293 /* JsxClosingFragment */;
- case 193 /* IntersectionType */:
- case 192 /* UnionType */:
- if (childKind === 187 /* TypeLiteral */ || childKind === 189 /* TupleType */) {
+ return childKind !== 244 /* Block */;
+ case 284 /* ExportDeclaration */:
+ return childKind !== 285 /* NamedExports */;
+ case 278 /* ImportDeclaration */:
+ return childKind !== 279 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 281 /* NamedImports */;
+ case 290 /* JsxElement */:
+ return childKind !== 293 /* JsxClosingElement */;
+ case 294 /* JsxFragment */:
+ return childKind !== 296 /* JsxClosingFragment */;
+ case 195 /* IntersectionType */:
+ case 194 /* UnionType */:
+ if (childKind === 189 /* TypeLiteral */ || childKind === 191 /* TupleType */) {
return false;
}
break;
@@ -152993,11 +153251,11 @@ var SmartIndenter;
SmartIndenter2.nodeWillIndentChild = nodeWillIndentChild;
function isControlFlowEndingStatement(kind, parent2) {
switch (kind) {
- case 254 /* ReturnStatement */:
- case 258 /* ThrowStatement */:
- case 252 /* ContinueStatement */:
- case 253 /* BreakStatement */:
- return parent2.kind !== 242 /* Block */;
+ case 256 /* ReturnStatement */:
+ case 260 /* ThrowStatement */:
+ case 254 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ return parent2.kind !== 244 /* Block */;
default:
return false;
}
@@ -153546,7 +153804,7 @@ var createLogicalNot = Debug.deprecate(function createLogicalNot2(operand) {
}, factoryDeprecation);
var createNode2 = Debug.deprecate(function createNode3(kind, pos = 0, end = 0) {
return setTextRangePosEnd(
- kind === 314 /* SourceFile */ ? parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 79 /* Identifier */ ? parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 80 /* PrivateIdentifier */ ? parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !isNodeKind(kind) ? parseBaseNodeFactory.createBaseTokenNode(kind) : parseBaseNodeFactory.createBaseNode(kind),
+ kind === 317 /* SourceFile */ ? parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 79 /* Identifier */ ? parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 80 /* PrivateIdentifier */ ? parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !isNodeKind(kind) ? parseBaseNodeFactory.createBaseTokenNode(kind) : parseBaseNodeFactory.createBaseNode(kind),
pos,
end
);
@@ -153560,7 +153818,7 @@ var getMutableClone = Debug.deprecate(function getMutableClone2(node) {
// src/deprecatedCompat/4.0/renamedNodeTests.ts
var isTypeAssertion = Debug.deprecate(function isTypeAssertion2(node) {
- return node.kind === 216 /* TypeAssertionExpression */;
+ return node.kind === 218 /* TypeAssertionExpression */;
}, {
since: "4.0",
warnAfter: "4.1",
@@ -154767,7 +155025,7 @@ function unwrapParenthesizedType(tsType) {
function findParentIf(asExpr) {
let node = asExpr.parent;
while (node) {
- if (node.kind === 246 /* IfStatement */) {
+ if (node.kind === 248 /* IfStatement */) {
return node;
}
node = node.parent;
@@ -154843,14 +155101,14 @@ function clearTrueSymbolAtLocationCache() {
trueSymbolAtLocationCache.clear();
}
function isTypeDeclSyntaxKind(kind) {
- return isStructDeclarationKind(kind) || kind === 269 /* EnumDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */;
+ return isStructDeclarationKind(kind) || kind === 272 /* EnumDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */;
}
function symbolHasDuplicateName(symbol, tsDeclKind) {
const symbolDecls = symbol == null ? void 0 : symbol.getDeclarations();
if (symbolDecls) {
for (const symDecl of symbolDecls) {
const declKind = symDecl.kind;
- const isNamespaceTypeCollision = isTypeDeclSyntaxKind(declKind) && tsDeclKind === 270 /* ModuleDeclaration */ || isTypeDeclSyntaxKind(tsDeclKind) && declKind === 270 /* ModuleDeclaration */;
+ const isNamespaceTypeCollision = isTypeDeclSyntaxKind(declKind) && tsDeclKind === 273 /* ModuleDeclaration */ || isTypeDeclSyntaxKind(tsDeclKind) && declKind === 273 /* ModuleDeclaration */;
if (declKind !== 79 /* Identifier */ && declKind !== tsDeclKind && !isNamespaceTypeCollision)
return true;
}
@@ -154962,12 +155220,12 @@ function isCompileTimeExpression(tsExpr) {
return isCompileTimeExpression(tsExpr.expression);
}
switch (tsExpr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return isPrefixUnaryExprValidEnumMemberInit(tsExpr);
- case 217 /* ParenthesizedExpression */:
- case 227 /* BinaryExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 229 /* BinaryExpression */:
return isBinaryExprValidEnumMemberInit(tsExpr);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isConditionalExprValidEnumMemberInit(tsExpr);
case 79 /* Identifier */:
return isIdentifierValidEnumMemberInit(tsExpr);
@@ -154975,7 +155233,7 @@ function isCompileTimeExpression(tsExpr) {
return true;
case 10 /* StringLiteral */:
return true;
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const propertyAccess = tsExpr;
if (isNumberConstantValue(propertyAccess)) {
return true;
@@ -155006,7 +155264,7 @@ function isConditionalExprValidEnumMemberInit(tsExpr) {
function isIdentifierValidEnumMemberInit(tsExpr) {
const tsSymbol = typeChecker.getSymbolAtLocation(tsExpr);
const tsDecl = getDeclaration2(tsSymbol);
- return !!tsDecl && (isVarDeclaration(tsDecl) && isConst(tsDecl.parent) || tsDecl.kind === 308 /* EnumMember */);
+ return !!tsDecl && (isVarDeclaration(tsDecl) && isConst(tsDecl.parent) || tsDecl.kind === 311 /* EnumMember */);
}
function isUnaryOpAllowedForEnumMemberInit(tsPrefixUnaryOp) {
return tsPrefixUnaryOp === 39 /* PlusToken */ || tsPrefixUnaryOp === 40 /* MinusToken */ || tsPrefixUnaryOp === 54 /* TildeToken */;
@@ -155183,7 +155441,7 @@ function validateObjectLiteralType(type) {
return type !== void 0 && type.isClassOrInterface() && hasDefaultCtor(type) && !hasReadonlyFields(type) && !isAbstractClass(type);
}
function isStructDeclarationKind(kind) {
- return kind === 265 /* StructDeclaration */;
+ return kind === 267 /* StructDeclaration */;
}
function isStructDeclaration2(node) {
return isStructDeclarationKind(node.kind);
@@ -155352,7 +155610,7 @@ function validateFields(type, objectLiteral) {
return true;
}
function isSupportedTypeNodeKind(kind) {
- return kind !== 132 /* AnyKeyword */ && kind !== 159 /* UnknownKeyword */ && kind !== 154 /* SymbolKeyword */ && kind !== 199 /* IndexedAccessType */ && kind !== 194 /* ConditionalType */ && kind !== 200 /* MappedType */ && kind !== 195 /* InferType */;
+ return kind !== 132 /* AnyKeyword */ && kind !== 159 /* UnknownKeyword */ && kind !== 154 /* SymbolKeyword */ && kind !== 201 /* IndexedAccessType */ && kind !== 196 /* ConditionalType */ && kind !== 202 /* MappedType */ && kind !== 197 /* InferType */;
}
function isSupportedType(typeNode) {
if (isParenthesizedTypeNode(typeNode))
@@ -156354,28 +156612,28 @@ LinterConfig.terminalTokens = new Set2([
LinterConfig.incrementOnlyTokens = new Map2([
[132 /* AnyKeyword */, 0 /* AnyType */],
[154 /* SymbolKeyword */, 1 /* SymbolType */],
- [197 /* ThisType */, 56 /* ThisType */],
- [186 /* TypeQuery */, 6 /* TypeQuery */],
- [221 /* DeleteExpression */, 33 /* DeleteOperator */],
+ [199 /* ThisType */, 56 /* ThisType */],
+ [188 /* TypeQuery */, 6 /* TypeQuery */],
+ [223 /* DeleteExpression */, 33 /* DeleteOperator */],
[13 /* RegularExpressionLiteral */, 7 /* RegexLiteral */],
- [182 /* TypePredicate */, 8 /* IsOperator */],
- [230 /* YieldExpression */, 10 /* YieldExpression */],
- [181 /* IndexSignature */, 14 /* IndexMember */],
- [255 /* WithStatement */, 15 /* WithStatement */],
- [199 /* IndexedAccessType */, 17 /* IndexedAccessType */],
+ [184 /* TypePredicate */, 8 /* IsOperator */],
+ [232 /* YieldExpression */, 10 /* YieldExpression */],
+ [183 /* IndexSignature */, 14 /* IndexMember */],
+ [257 /* WithStatement */, 15 /* WithStatement */],
+ [201 /* IndexedAccessType */, 17 /* IndexedAccessType */],
[159 /* UnknownKeyword */, 18 /* UnknownType */],
[102 /* InKeyword */, 20 /* InOperator */],
- [179 /* CallSignature */, 39 /* CallSignature */],
- [193 /* IntersectionType */, 23 /* IntersectionType */],
- [187 /* TypeLiteral */, 24 /* ObjectTypeLiteral */],
- [185 /* ConstructorType */, 38 /* ConstructorFuncs */],
+ [181 /* CallSignature */, 39 /* CallSignature */],
+ [195 /* IntersectionType */, 23 /* IntersectionType */],
+ [189 /* TypeLiteral */, 24 /* ObjectTypeLiteral */],
+ [187 /* ConstructorType */, 38 /* ConstructorFuncs */],
[80 /* PrivateIdentifier */, 41 /* PrivateIdentifier */],
- [194 /* ConditionalType */, 43 /* ConditionalType */],
- [200 /* MappedType */, 44 /* MappedType */],
- [287 /* JsxElement */, 51 /* JsxElement */],
- [288 /* JsxSelfClosingElement */, 51 /* JsxElement */],
- [274 /* ImportEqualsDeclaration */, 61 /* ImportAssignment */],
- [273 /* NamespaceExportDeclaration */, 67 /* UMDModuleDefinition */]
+ [196 /* ConditionalType */, 43 /* ConditionalType */],
+ [202 /* MappedType */, 44 /* MappedType */],
+ [290 /* JsxElement */, 51 /* JsxElement */],
+ [291 /* JsxSelfClosingElement */, 51 /* JsxElement */],
+ [277 /* ImportEqualsDeclaration */, 61 /* ImportAssignment */],
+ [276 /* NamespaceExportDeclaration */, 67 /* UMDModuleDefinition */]
]);
// src/linter/ArkTSLinter_1_0/TypeScriptLinter.ts
@@ -156384,53 +156642,53 @@ var _TypeScriptLinter = class {
this.sourceFile = sourceFile;
this.tscStrictDiagnostics = tscStrictDiagnostics;
this.handlersMap = new Map2([
- [210 /* ObjectLiteralExpression */, this.handleObjectLiteralExpression],
- [209 /* ArrayLiteralExpression */, this.handleArrayLiteralExpression],
- [168 /* Parameter */, this.handleParameter],
- [269 /* EnumDeclaration */, this.handleEnumDeclaration],
- [267 /* InterfaceDeclaration */, this.handleInterfaceDeclaration],
- [258 /* ThrowStatement */, this.handleThrowStatement],
- [276 /* ImportClause */, this.handleImportClause],
- [249 /* ForStatement */, this.handleForStatement],
- [250 /* ForInStatement */, this.handleForInStatement],
- [251 /* ForOfStatement */, this.handleForOfStatement],
- [275 /* ImportDeclaration */, this.handleImportDeclaration],
- [211 /* PropertyAccessExpression */, this.handlePropertyAccessExpression],
- [171 /* PropertyDeclaration */, this.handlePropertyAssignmentOrDeclaration],
- [305 /* PropertyAssignment */, this.handlePropertyAssignmentOrDeclaration],
- [218 /* FunctionExpression */, this.handleFunctionExpression],
- [219 /* ArrowFunction */, this.handleArrowFunction],
- [232 /* ClassExpression */, this.handleClassExpression],
- [301 /* CatchClause */, this.handleCatchClause],
- [263 /* FunctionDeclaration */, this.handleFunctionDeclaration],
- [225 /* PrefixUnaryExpression */, this.handlePrefixUnaryExpression],
- [227 /* BinaryExpression */, this.handleBinaryExpression],
- [262 /* VariableDeclarationList */, this.handleVariableDeclarationList],
- [261 /* VariableDeclaration */, this.handleVariableDeclaration],
- [264 /* ClassDeclaration */, this.handleClassDeclaration],
- [270 /* ModuleDeclaration */, this.handleModuleDeclaration],
- [268 /* TypeAliasDeclaration */, this.handleTypeAliasDeclaration],
- [279 /* ImportSpecifier */, this.handleImportSpecifier],
- [277 /* NamespaceImport */, this.handleNamespaceImport],
- [216 /* TypeAssertionExpression */, this.handleTypeAssertionExpression],
- [174 /* MethodDeclaration */, this.handleMethodDeclaration],
+ [212 /* ObjectLiteralExpression */, this.handleObjectLiteralExpression],
+ [211 /* ArrayLiteralExpression */, this.handleArrayLiteralExpression],
+ [169 /* Parameter */, this.handleParameter],
+ [272 /* EnumDeclaration */, this.handleEnumDeclaration],
+ [270 /* InterfaceDeclaration */, this.handleInterfaceDeclaration],
+ [260 /* ThrowStatement */, this.handleThrowStatement],
+ [279 /* ImportClause */, this.handleImportClause],
+ [251 /* ForStatement */, this.handleForStatement],
+ [252 /* ForInStatement */, this.handleForInStatement],
+ [253 /* ForOfStatement */, this.handleForOfStatement],
+ [278 /* ImportDeclaration */, this.handleImportDeclaration],
+ [213 /* PropertyAccessExpression */, this.handlePropertyAccessExpression],
+ [172 /* PropertyDeclaration */, this.handlePropertyAssignmentOrDeclaration],
+ [308 /* PropertyAssignment */, this.handlePropertyAssignmentOrDeclaration],
+ [220 /* FunctionExpression */, this.handleFunctionExpression],
+ [221 /* ArrowFunction */, this.handleArrowFunction],
+ [234 /* ClassExpression */, this.handleClassExpression],
+ [304 /* CatchClause */, this.handleCatchClause],
+ [265 /* FunctionDeclaration */, this.handleFunctionDeclaration],
+ [227 /* PrefixUnaryExpression */, this.handlePrefixUnaryExpression],
+ [229 /* BinaryExpression */, this.handleBinaryExpression],
+ [264 /* VariableDeclarationList */, this.handleVariableDeclarationList],
+ [263 /* VariableDeclaration */, this.handleVariableDeclaration],
+ [266 /* ClassDeclaration */, this.handleClassDeclaration],
+ [273 /* ModuleDeclaration */, this.handleModuleDeclaration],
+ [271 /* TypeAliasDeclaration */, this.handleTypeAliasDeclaration],
+ [282 /* ImportSpecifier */, this.handleImportSpecifier],
+ [280 /* NamespaceImport */, this.handleNamespaceImport],
+ [218 /* TypeAssertionExpression */, this.handleTypeAssertionExpression],
+ [176 /* MethodDeclaration */, this.handleMethodDeclaration],
[79 /* Identifier */, this.handleIdentifier],
- [212 /* ElementAccessExpression */, this.handleElementAccessExpression],
- [308 /* EnumMember */, this.handleEnumMember],
- [183 /* TypeReference */, this.handleTypeReference],
- [280 /* ExportAssignment */, this.handleExportAssignment],
- [213 /* CallExpression */, this.handleCallExpression],
- [237 /* MetaProperty */, this.handleMetaProperty],
- [214 /* NewExpression */, this.handleNewExpression],
- [235 /* AsExpression */, this.handleAsExpression],
- [231 /* SpreadElement */, this.handleSpreadOp],
- [307 /* SpreadAssignment */, this.handleSpreadOp],
- [177 /* GetAccessor */, this.handleGetAccessor],
- [178 /* SetAccessor */, this.handleSetAccessor],
- [180 /* ConstructSignature */, this.handleConstructSignature],
- [234 /* ExpressionWithTypeArguments */, this.handleExpressionWithTypeArguments],
- [166 /* ComputedPropertyName */, this.handleComputedPropertyName],
- [175 /* ClassStaticBlockDeclaration */, this.handleClassStaticBlockDeclaration]
+ [214 /* ElementAccessExpression */, this.handleElementAccessExpression],
+ [311 /* EnumMember */, this.handleEnumMember],
+ [185 /* TypeReference */, this.handleTypeReference],
+ [283 /* ExportAssignment */, this.handleExportAssignment],
+ [215 /* CallExpression */, this.handleCallExpression],
+ [239 /* MetaProperty */, this.handleMetaProperty],
+ [216 /* NewExpression */, this.handleNewExpression],
+ [237 /* AsExpression */, this.handleAsExpression],
+ [233 /* SpreadElement */, this.handleSpreadOp],
+ [310 /* SpreadAssignment */, this.handleSpreadOp],
+ [179 /* GetAccessor */, this.handleGetAccessor],
+ [180 /* SetAccessor */, this.handleSetAccessor],
+ [182 /* ConstructSignature */, this.handleConstructSignature],
+ [236 /* ExpressionWithTypeArguments */, this.handleExpressionWithTypeArguments],
+ [167 /* ComputedPropertyName */, this.handleComputedPropertyName],
+ [177 /* ClassStaticBlockDeclaration */, this.handleClassStaticBlockDeclaration]
]);
this.validatedTypesSet = new Set2();
_TypeScriptLinter.tsTypeChecker = tsProgram.getLinterTypeChecker();
@@ -156659,28 +156917,28 @@ var _TypeScriptLinter = class {
if (!p.declarations)
continue;
const decl = p.declarations[0];
- if (decl.kind === 173 /* MethodSignature */) {
+ if (decl.kind === 175 /* MethodSignature */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 174 /* MethodDeclaration */) {
+ } else if (decl.kind === 176 /* MethodDeclaration */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 171 /* PropertyDeclaration */) {
+ } else if (decl.kind === 172 /* PropertyDeclaration */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 170 /* PropertySignature */) {
+ } else if (decl.kind === 171 /* PropertySignature */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
@@ -156708,7 +156966,7 @@ var _TypeScriptLinter = class {
let noContextTypeForArrayLiteral = false;
const arrayLitElements = arrayLitNode.elements;
for (const element of arrayLitElements) {
- if (element.kind === 210 /* ObjectLiteralExpression */) {
+ if (element.kind === 212 /* ObjectLiteralExpression */) {
const objectLiteralType = _TypeScriptLinter.tsTypeChecker.getContextualType(element);
if (!isDynamicLiteralInitializer(arrayLitNode) && !isExpressionAssignableToType(objectLiteralType, element)) {
noContextTypeForArrayLiteral = true;
@@ -156743,7 +157001,7 @@ var _TypeScriptLinter = class {
return;
let enumDeclCount = 0;
for (const decl of enumDecls) {
- if (decl.kind === 269 /* EnumDeclaration */)
+ if (decl.kind === 272 /* EnumDeclaration */)
enumDeclCount++;
}
if (enumDeclCount > 1)
@@ -156756,7 +157014,7 @@ var _TypeScriptLinter = class {
if (iDecls) {
let iDeclCount = 0;
for (const decl of iDecls) {
- if (decl.kind === 267 /* InterfaceDeclaration */)
+ if (decl.kind === 270 /* InterfaceDeclaration */)
iDeclCount++;
}
if (iDeclCount > 1)
@@ -157102,11 +157360,11 @@ var _TypeScriptLinter = class {
} else if (tsBinaryExpr.operatorToken.kind === 27 /* CommaToken */) {
let tsExprNode = tsBinaryExpr;
let tsParentNode = tsExprNode.parent;
- while (tsParentNode && tsParentNode.kind === 227 /* BinaryExpression */) {
+ while (tsParentNode && tsParentNode.kind === 229 /* BinaryExpression */) {
tsExprNode = tsParentNode;
tsParentNode = tsExprNode.parent;
}
- if (tsParentNode && tsParentNode.kind === 249 /* ForStatement */) {
+ if (tsParentNode && tsParentNode.kind === 251 /* ForStatement */) {
const tsForNode = tsParentNode;
if (tsExprNode === tsForNode.initializer || tsExprNode === tsForNode.incrementor)
return;
@@ -157245,15 +157503,15 @@ var _TypeScriptLinter = class {
if (isModuleBlock(tsModuleBody)) {
for (const tsModuleStmt of tsModuleBody.statements) {
switch (tsModuleStmt.kind) {
- case 244 /* VariableStatement */:
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 246 /* VariableStatement */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 284 /* ExportDeclaration */:
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
break;
default:
this.incrementCounters(tsModuleStmt, 47 /* NonDeclarationInNamespace */);
@@ -157375,7 +157633,7 @@ var _TypeScriptLinter = class {
handleRestrictedValues(tsIdentifier, tsIdentSym) {
const illegalValues = 128 /* ConstEnum */ | 256 /* RegularEnum */ | 512 /* ValueModule */ | 32 /* Class */;
if ((tsIdentSym.flags & 512 /* ValueModule */) !== 0) {
- if (!!tsIdentSym && symbolHasDuplicateName(tsIdentSym, 270 /* ModuleDeclaration */)) {
+ if (!!tsIdentSym && symbolHasDuplicateName(tsIdentSym, 273 /* ModuleDeclaration */)) {
return;
}
}
@@ -157501,7 +157759,7 @@ var _TypeScriptLinter = class {
}
handleGenericCallWithNoTypeArgs(callLikeExpr, callSignature) {
var _a2, _b;
- const tsSyntaxKind = isNewExpression(callLikeExpr) ? 176 /* Constructor */ : 263 /* FunctionDeclaration */;
+ const tsSyntaxKind = isNewExpression(callLikeExpr) ? 178 /* Constructor */ : 265 /* FunctionDeclaration */;
const signDecl = _TypeScriptLinter.tsTypeChecker.signatureToSignatureDeclaration(
callSignature,
tsSyntaxKind,
@@ -157694,10 +157952,10 @@ var _TypeScriptLinter = class {
}
handleConstructSignature(node) {
switch (node.parent.kind) {
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
this.incrementCounters(node, 36 /* ConstructorType */);
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
this.incrementCounters(node, 37 /* ConstructorIface */);
break;
default:
@@ -159022,13 +159280,13 @@ var SENDABLE_DECORATOR = "Sendable";
var SENDABLE_INTERFACE = "ISendable";
var PROMISE = "Promise";
var SENDABLE_DECORATOR_NODES = [
- 264 /* ClassDeclaration */,
- 263 /* FunctionDeclaration */,
- 268 /* TypeAliasDeclaration */
+ 266 /* ClassDeclaration */,
+ 265 /* FunctionDeclaration */,
+ 271 /* TypeAliasDeclaration */
];
var SENDABLE_CLOSURE_DECLS = [
- 264 /* ClassDeclaration */,
- 263 /* FunctionDeclaration */
+ 266 /* ClassDeclaration */,
+ 265 /* FunctionDeclaration */
];
var ARKTS_COLLECTIONS_D_ETS = "@arkts.collections.d.ets";
var COLLECTIONS_NAMESPACE = "collections";
@@ -159114,7 +159372,7 @@ function getInstanceofUnsupportedHighlightRange(nodeOrComment) {
return getKeywordHighlightRange(nodeOrComment.operatorToken, "instanceof");
}
function getConstAssertionHighlightRange(nodeOrComment) {
- if (nodeOrComment.kind === 235 /* AsExpression */) {
+ if (nodeOrComment.kind === 237 /* AsExpression */) {
return [
nodeOrComment.expression.getEnd() + 1,
nodeOrComment.type.getStart() - 1
@@ -159127,11 +159385,11 @@ function getConstAssertionHighlightRange(nodeOrComment) {
}
function getLimitedReturnTypeInferenceHighlightRange(nodeOrComment) {
let node;
- if (nodeOrComment.kind === 218 /* FunctionExpression */) {
+ if (nodeOrComment.kind === 220 /* FunctionExpression */) {
node = nodeOrComment.type;
- } else if (nodeOrComment.kind === 263 /* FunctionDeclaration */) {
+ } else if (nodeOrComment.kind === 265 /* FunctionDeclaration */) {
node = nodeOrComment.name;
- } else if (nodeOrComment.kind === 174 /* MethodDeclaration */) {
+ } else if (nodeOrComment.kind === 176 /* MethodDeclaration */) {
node = nodeOrComment.name;
}
if (node !== void 0) {
@@ -159230,7 +159488,7 @@ function unwrapParenthesizedType2(tsType) {
function findParentIf2(asExpr) {
let node = asExpr.parent;
while (node) {
- if (node.kind === 246 /* IfStatement */) {
+ if (node.kind === 248 /* IfStatement */) {
return node;
}
node = node.parent;
@@ -159308,14 +159566,14 @@ function clearTrueSymbolAtLocationCache2() {
trueSymbolAtLocationCache2.clear();
}
function isTypeDeclSyntaxKind2(kind) {
- return isStructDeclarationKind2(kind) || kind === 269 /* EnumDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */;
+ return isStructDeclarationKind2(kind) || kind === 272 /* EnumDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */;
}
function symbolHasDuplicateName2(symbol, tsDeclKind) {
const symbolDecls = symbol == null ? void 0 : symbol.getDeclarations();
if (symbolDecls) {
for (const symDecl of symbolDecls) {
const declKind = symDecl.kind;
- const isNamespaceTypeCollision = isTypeDeclSyntaxKind2(declKind) && tsDeclKind === 270 /* ModuleDeclaration */ || isTypeDeclSyntaxKind2(tsDeclKind) && declKind === 270 /* ModuleDeclaration */;
+ const isNamespaceTypeCollision = isTypeDeclSyntaxKind2(declKind) && tsDeclKind === 273 /* ModuleDeclaration */ || isTypeDeclSyntaxKind2(tsDeclKind) && declKind === 273 /* ModuleDeclaration */;
if (declKind !== 79 /* Identifier */ && declKind !== tsDeclKind && !isNamespaceTypeCollision)
return true;
}
@@ -159478,12 +159736,12 @@ function isCompileTimeExpression2(tsExpr) {
return isCompileTimeExpression2(tsExpr.expression);
}
switch (tsExpr.kind) {
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return isPrefixUnaryExprValidEnumMemberInit2(tsExpr);
- case 217 /* ParenthesizedExpression */:
- case 227 /* BinaryExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 229 /* BinaryExpression */:
return isBinaryExprValidEnumMemberInit2(tsExpr);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return isConditionalExprValidEnumMemberInit2(tsExpr);
case 79 /* Identifier */:
return isIdentifierValidEnumMemberInit2(tsExpr);
@@ -159491,7 +159749,7 @@ function isCompileTimeExpression2(tsExpr) {
return true;
case 10 /* StringLiteral */:
return true;
- case 211 /* PropertyAccessExpression */: {
+ case 213 /* PropertyAccessExpression */: {
const propertyAccess = tsExpr;
if (isNumberConstantValue2(propertyAccess)) {
return true;
@@ -159522,7 +159780,7 @@ function isConditionalExprValidEnumMemberInit2(tsExpr) {
function isIdentifierValidEnumMemberInit2(tsExpr) {
const tsSymbol = typeChecker2.getSymbolAtLocation(tsExpr);
const tsDecl = getDeclaration3(tsSymbol);
- return !!tsDecl && (isVarDeclaration2(tsDecl) && isConst2(tsDecl.parent) || tsDecl.kind === 308 /* EnumMember */);
+ return !!tsDecl && (isVarDeclaration2(tsDecl) && isConst2(tsDecl.parent) || tsDecl.kind === 311 /* EnumMember */);
}
function isUnaryOpAllowedForEnumMemberInit2(tsPrefixUnaryOp) {
return tsPrefixUnaryOp === 39 /* PlusToken */ || tsPrefixUnaryOp === 40 /* MinusToken */ || tsPrefixUnaryOp === 54 /* TildeToken */;
@@ -159765,7 +160023,7 @@ function validateObjectLiteralType2(type) {
return type !== void 0 && type.isClassOrInterface() && hasDefaultCtor2(type) && !hasReadonlyFields2(type) && !isAbstractClass2(type);
}
function isStructDeclarationKind2(kind) {
- return kind === 265 /* StructDeclaration */;
+ return kind === 267 /* StructDeclaration */;
}
function isStructDeclaration3(node) {
return isStructDeclarationKind2(node.kind);
@@ -159902,7 +160160,7 @@ function validateField(type, prop) {
return true;
}
function isSupportedTypeNodeKind2(kind) {
- return kind !== 132 /* AnyKeyword */ && kind !== 159 /* UnknownKeyword */ && kind !== 154 /* SymbolKeyword */ && kind !== 199 /* IndexedAccessType */ && kind !== 194 /* ConditionalType */ && kind !== 200 /* MappedType */ && kind !== 195 /* InferType */;
+ return kind !== 132 /* AnyKeyword */ && kind !== 159 /* UnknownKeyword */ && kind !== 154 /* SymbolKeyword */ && kind !== 201 /* IndexedAccessType */ && kind !== 196 /* ConditionalType */ && kind !== 202 /* MappedType */ && kind !== 197 /* InferType */;
}
function isSupportedType2(typeNode) {
if (isParenthesizedTypeNode(typeNode))
@@ -160670,7 +160928,7 @@ function getDecoratorsIfInSendableClass(declaration) {
return getDecorators(declaration);
}
function getClassNodeFromDeclaration(declaration) {
- if (declaration.kind === 168 /* Parameter */) {
+ if (declaration.kind === 169 /* Parameter */) {
return isClassDeclaration(declaration.parent.parent) ? declaration.parent.parent : void 0;
}
return isClassDeclaration(declaration.parent) ? declaration.parent : void 0;
@@ -161246,26 +161504,26 @@ LinterConfig2.terminalTokens = new Set2([
LinterConfig2.incrementOnlyTokens = new Map2([
[132 /* AnyKeyword */, 0 /* AnyType */],
[154 /* SymbolKeyword */, 1 /* SymbolType */],
- [197 /* ThisType */, 53 /* ThisType */],
- [186 /* TypeQuery */, 6 /* TypeQuery */],
- [221 /* DeleteExpression */, 30 /* DeleteOperator */],
- [182 /* TypePredicate */, 7 /* IsOperator */],
- [230 /* YieldExpression */, 9 /* YieldExpression */],
- [255 /* WithStatement */, 14 /* WithStatement */],
- [199 /* IndexedAccessType */, 16 /* IndexedAccessType */],
+ [199 /* ThisType */, 53 /* ThisType */],
+ [188 /* TypeQuery */, 6 /* TypeQuery */],
+ [223 /* DeleteExpression */, 30 /* DeleteOperator */],
+ [184 /* TypePredicate */, 7 /* IsOperator */],
+ [232 /* YieldExpression */, 9 /* YieldExpression */],
+ [257 /* WithStatement */, 14 /* WithStatement */],
+ [201 /* IndexedAccessType */, 16 /* IndexedAccessType */],
[159 /* UnknownKeyword */, 17 /* UnknownType */],
- [179 /* CallSignature */, 36 /* CallSignature */],
- [193 /* IntersectionType */, 21 /* IntersectionType */],
- [187 /* TypeLiteral */, 22 /* ObjectTypeLiteral */],
- [185 /* ConstructorType */, 35 /* ConstructorFuncs */],
+ [181 /* CallSignature */, 36 /* CallSignature */],
+ [195 /* IntersectionType */, 21 /* IntersectionType */],
+ [189 /* TypeLiteral */, 22 /* ObjectTypeLiteral */],
+ [187 /* ConstructorType */, 35 /* ConstructorFuncs */],
[80 /* PrivateIdentifier */, 38 /* PrivateIdentifier */],
- [194 /* ConditionalType */, 40 /* ConditionalType */],
- [200 /* MappedType */, 41 /* MappedType */],
- [287 /* JsxElement */, 48 /* JsxElement */],
- [288 /* JsxSelfClosingElement */, 48 /* JsxElement */],
- [274 /* ImportEqualsDeclaration */, 57 /* ImportAssignment */],
- [273 /* NamespaceExportDeclaration */, 63 /* UMDModuleDefinition */],
- [232 /* ClassExpression */, 25 /* ClassExpression */]
+ [196 /* ConditionalType */, 40 /* ConditionalType */],
+ [202 /* MappedType */, 41 /* MappedType */],
+ [290 /* JsxElement */, 48 /* JsxElement */],
+ [291 /* JsxSelfClosingElement */, 48 /* JsxElement */],
+ [277 /* ImportEqualsDeclaration */, 57 /* ImportAssignment */],
+ [276 /* NamespaceExportDeclaration */, 63 /* UMDModuleDefinition */],
+ [234 /* ClassExpression */, 25 /* ClassExpression */]
]);
// src/linter/ArkTSLinter_1_1/TypeScriptLinter.ts
@@ -161277,60 +161535,60 @@ var _TypeScriptLinter2 = class {
this.compatibleSdkVersion = 12;
this.mixCompile = false;
this.handlersMap = new Map2([
- [210 /* ObjectLiteralExpression */, { handler: this.handleObjectLiteralExpression, name: "handleObjectLiteralExpression" }],
- [209 /* ArrayLiteralExpression */, { handler: this.handleArrayLiteralExpression, name: "handleArrayLiteralExpression" }],
- [168 /* Parameter */, { handler: this.handleParameter, name: "handleParameter" }],
- [269 /* EnumDeclaration */, { handler: this.handleEnumDeclaration, name: "handleEnumDeclaration" }],
- [267 /* InterfaceDeclaration */, { handler: this.handleInterfaceDeclaration, name: "handleInterfaceDeclaration" }],
- [258 /* ThrowStatement */, { handler: this.handleThrowStatement, name: "handleThrowStatement" }],
- [276 /* ImportClause */, { handler: this.handleImportClause, name: "handleImportClause" }],
- [249 /* ForStatement */, { handler: this.handleForStatement, name: "handleForStatement" }],
- [250 /* ForInStatement */, { handler: this.handleForInStatement, name: "handleForInStatement" }],
- [251 /* ForOfStatement */, { handler: this.handleForOfStatement, name: "handleForOfStatement" }],
- [275 /* ImportDeclaration */, { handler: this.handleImportDeclaration, name: "handleImportDeclaration" }],
- [211 /* PropertyAccessExpression */, { handler: this.handlePropertyAccessExpression, name: "handlePropertyAccessExpression" }],
- [171 /* PropertyDeclaration */, { handler: this.handlePropertyDeclaration, name: "handlePropertyDeclaration" }],
- [305 /* PropertyAssignment */, { handler: this.handlePropertyAssignment, name: "handlePropertyAssignment" }],
- [170 /* PropertySignature */, { handler: this.handlePropertySignature, name: "handlePropertySignature" }],
- [218 /* FunctionExpression */, { handler: this.handleFunctionExpression, name: "handleFunctionExpression" }],
- [219 /* ArrowFunction */, { handler: this.handleArrowFunction, name: "handleArrowFunction" }],
- [301 /* CatchClause */, { handler: this.handleCatchClause, name: "handleCatchClause" }],
- [263 /* FunctionDeclaration */, { handler: this.handleFunctionDeclaration, name: "handleFunctionDeclaration" }],
- [225 /* PrefixUnaryExpression */, { handler: this.handlePrefixUnaryExpression, name: "handlePrefixUnaryExpression" }],
- [227 /* BinaryExpression */, { handler: this.handleBinaryExpression, name: "handleBinaryExpression" }],
- [262 /* VariableDeclarationList */, { handler: this.handleVariableDeclarationList, name: "handleVariableDeclarationList" }],
- [261 /* VariableDeclaration */, { handler: this.handleVariableDeclaration, name: "handleVariableDeclaration" }],
- [264 /* ClassDeclaration */, { handler: this.handleClassDeclaration, name: "handleClassDeclaration" }],
- [270 /* ModuleDeclaration */, { handler: this.handleModuleDeclaration, name: "handleModuleDeclaration" }],
- [268 /* TypeAliasDeclaration */, { handler: this.handleTypeAliasDeclaration, name: "handleTypeAliasDeclaration" }],
- [279 /* ImportSpecifier */, { handler: this.handleImportSpecifier, name: "handleImportSpecifier" }],
- [277 /* NamespaceImport */, { handler: this.handleNamespaceImport, name: "handleNamespaceImport" }],
- [216 /* TypeAssertionExpression */, { handler: this.handleTypeAssertionExpression, name: "handleTypeAssertionExpression" }],
- [174 /* MethodDeclaration */, { handler: this.handleMethodDeclaration, name: "handleMethodDeclaration" }],
- [173 /* MethodSignature */, { handler: this.handleMethodSignature, name: "handleMethodSignature" }],
+ [212 /* ObjectLiteralExpression */, { handler: this.handleObjectLiteralExpression, name: "handleObjectLiteralExpression" }],
+ [211 /* ArrayLiteralExpression */, { handler: this.handleArrayLiteralExpression, name: "handleArrayLiteralExpression" }],
+ [169 /* Parameter */, { handler: this.handleParameter, name: "handleParameter" }],
+ [272 /* EnumDeclaration */, { handler: this.handleEnumDeclaration, name: "handleEnumDeclaration" }],
+ [270 /* InterfaceDeclaration */, { handler: this.handleInterfaceDeclaration, name: "handleInterfaceDeclaration" }],
+ [260 /* ThrowStatement */, { handler: this.handleThrowStatement, name: "handleThrowStatement" }],
+ [279 /* ImportClause */, { handler: this.handleImportClause, name: "handleImportClause" }],
+ [251 /* ForStatement */, { handler: this.handleForStatement, name: "handleForStatement" }],
+ [252 /* ForInStatement */, { handler: this.handleForInStatement, name: "handleForInStatement" }],
+ [253 /* ForOfStatement */, { handler: this.handleForOfStatement, name: "handleForOfStatement" }],
+ [278 /* ImportDeclaration */, { handler: this.handleImportDeclaration, name: "handleImportDeclaration" }],
+ [213 /* PropertyAccessExpression */, { handler: this.handlePropertyAccessExpression, name: "handlePropertyAccessExpression" }],
+ [172 /* PropertyDeclaration */, { handler: this.handlePropertyDeclaration, name: "handlePropertyDeclaration" }],
+ [308 /* PropertyAssignment */, { handler: this.handlePropertyAssignment, name: "handlePropertyAssignment" }],
+ [171 /* PropertySignature */, { handler: this.handlePropertySignature, name: "handlePropertySignature" }],
+ [220 /* FunctionExpression */, { handler: this.handleFunctionExpression, name: "handleFunctionExpression" }],
+ [221 /* ArrowFunction */, { handler: this.handleArrowFunction, name: "handleArrowFunction" }],
+ [304 /* CatchClause */, { handler: this.handleCatchClause, name: "handleCatchClause" }],
+ [265 /* FunctionDeclaration */, { handler: this.handleFunctionDeclaration, name: "handleFunctionDeclaration" }],
+ [227 /* PrefixUnaryExpression */, { handler: this.handlePrefixUnaryExpression, name: "handlePrefixUnaryExpression" }],
+ [229 /* BinaryExpression */, { handler: this.handleBinaryExpression, name: "handleBinaryExpression" }],
+ [264 /* VariableDeclarationList */, { handler: this.handleVariableDeclarationList, name: "handleVariableDeclarationList" }],
+ [263 /* VariableDeclaration */, { handler: this.handleVariableDeclaration, name: "handleVariableDeclaration" }],
+ [266 /* ClassDeclaration */, { handler: this.handleClassDeclaration, name: "handleClassDeclaration" }],
+ [273 /* ModuleDeclaration */, { handler: this.handleModuleDeclaration, name: "handleModuleDeclaration" }],
+ [271 /* TypeAliasDeclaration */, { handler: this.handleTypeAliasDeclaration, name: "handleTypeAliasDeclaration" }],
+ [282 /* ImportSpecifier */, { handler: this.handleImportSpecifier, name: "handleImportSpecifier" }],
+ [280 /* NamespaceImport */, { handler: this.handleNamespaceImport, name: "handleNamespaceImport" }],
+ [218 /* TypeAssertionExpression */, { handler: this.handleTypeAssertionExpression, name: "handleTypeAssertionExpression" }],
+ [176 /* MethodDeclaration */, { handler: this.handleMethodDeclaration, name: "handleMethodDeclaration" }],
+ [175 /* MethodSignature */, { handler: this.handleMethodSignature, name: "handleMethodSignature" }],
[79 /* Identifier */, { handler: this.handleIdentifier, name: "handleIdentifier" }],
- [212 /* ElementAccessExpression */, { handler: this.handleElementAccessExpression, name: "handleElementAccessExpression" }],
- [308 /* EnumMember */, { handler: this.handleEnumMember, name: "handleEnumMember" }],
- [183 /* TypeReference */, { handler: this.handleTypeReference, name: "handleTypeReference" }],
- [280 /* ExportAssignment */, { handler: this.handleExportAssignment, name: "handleExportAssignment" }],
- [213 /* CallExpression */, { handler: this.handleCallExpression, name: "handleCallExpression" }],
- [237 /* MetaProperty */, { handler: this.handleMetaProperty, name: "handleMetaProperty" }],
- [214 /* NewExpression */, { handler: this.handleNewExpression, name: "handleNewExpression" }],
- [235 /* AsExpression */, { handler: this.handleAsExpression, name: "handleAsExpression" }],
- [231 /* SpreadElement */, { handler: this.handleSpreadOp, name: "handleSpreadOp" }],
- [307 /* SpreadAssignment */, { handler: this.handleSpreadOp, name: "handleSpreadOp" }],
- [177 /* GetAccessor */, { handler: this.handleGetAccessor, name: "handleGetAccessor" }],
- [178 /* SetAccessor */, { handler: this.handleSetAccessor, name: "handleSetAccessor" }],
- [180 /* ConstructSignature */, { handler: this.handleConstructSignature, name: "handleConstructSignature" }],
- [234 /* ExpressionWithTypeArguments */, { handler: this.handleExpressionWithTypeArguments, name: "handleExpressionWithTypeArguments" }],
- [166 /* ComputedPropertyName */, { handler: this.handleComputedPropertyName, name: "handleComputedPropertyName" }],
- [220 /* EtsComponentExpression */, { handler: this.handleEtsComponentExpression, name: "handleEtsComponentExpression" }],
- [175 /* ClassStaticBlockDeclaration */, { handler: this.handleClassStaticBlockDeclaration, name: "handleClassStaticBlockDeclaration" }],
- [181 /* IndexSignature */, { handler: this.handleIndexSignature, name: "handleIndexSignature" }],
+ [214 /* ElementAccessExpression */, { handler: this.handleElementAccessExpression, name: "handleElementAccessExpression" }],
+ [311 /* EnumMember */, { handler: this.handleEnumMember, name: "handleEnumMember" }],
+ [185 /* TypeReference */, { handler: this.handleTypeReference, name: "handleTypeReference" }],
+ [283 /* ExportAssignment */, { handler: this.handleExportAssignment, name: "handleExportAssignment" }],
+ [215 /* CallExpression */, { handler: this.handleCallExpression, name: "handleCallExpression" }],
+ [239 /* MetaProperty */, { handler: this.handleMetaProperty, name: "handleMetaProperty" }],
+ [216 /* NewExpression */, { handler: this.handleNewExpression, name: "handleNewExpression" }],
+ [237 /* AsExpression */, { handler: this.handleAsExpression, name: "handleAsExpression" }],
+ [233 /* SpreadElement */, { handler: this.handleSpreadOp, name: "handleSpreadOp" }],
+ [310 /* SpreadAssignment */, { handler: this.handleSpreadOp, name: "handleSpreadOp" }],
+ [179 /* GetAccessor */, { handler: this.handleGetAccessor, name: "handleGetAccessor" }],
+ [180 /* SetAccessor */, { handler: this.handleSetAccessor, name: "handleSetAccessor" }],
+ [182 /* ConstructSignature */, { handler: this.handleConstructSignature, name: "handleConstructSignature" }],
+ [236 /* ExpressionWithTypeArguments */, { handler: this.handleExpressionWithTypeArguments, name: "handleExpressionWithTypeArguments" }],
+ [167 /* ComputedPropertyName */, { handler: this.handleComputedPropertyName, name: "handleComputedPropertyName" }],
+ [222 /* EtsComponentExpression */, { handler: this.handleEtsComponentExpression, name: "handleEtsComponentExpression" }],
+ [177 /* ClassStaticBlockDeclaration */, { handler: this.handleClassStaticBlockDeclaration, name: "handleClassStaticBlockDeclaration" }],
+ [183 /* IndexSignature */, { handler: this.handleIndexSignature, name: "handleIndexSignature" }],
[94 /* ExportKeyword */, { handler: this.handleExportKeyword, name: "handleExportKeyword" }],
- [281 /* ExportDeclaration */, { handler: this.handleExportDeclaration, name: "handleExportDeclaration" }],
- [254 /* ReturnStatement */, { handler: this.handleReturnStatement, name: "handleReturnStatement" }],
- [169 /* Decorator */, { handler: this.handleDecorator, name: "handleDecorator" }]
+ [284 /* ExportDeclaration */, { handler: this.handleExportDeclaration, name: "handleExportDeclaration" }],
+ [256 /* ReturnStatement */, { handler: this.handleReturnStatement, name: "handleReturnStatement" }],
+ [170 /* Decorator */, { handler: this.handleDecorator, name: "handleDecorator" }]
]);
this.validatedTypesSet = new Set2();
_TypeScriptLinter2.tsTypeChecker = tsProgram.getLinterTypeChecker();
@@ -161588,28 +161846,28 @@ var _TypeScriptLinter2 = class {
if (!p.declarations)
continue;
const decl = p.declarations[0];
- if (decl.kind === 173 /* MethodSignature */) {
+ if (decl.kind === 175 /* MethodSignature */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 174 /* MethodDeclaration */) {
+ } else if (decl.kind === 176 /* MethodDeclaration */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 171 /* PropertyDeclaration */) {
+ } else if (decl.kind === 172 /* PropertyDeclaration */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
p.name,
decl.type
);
- } else if (decl.kind === 170 /* PropertySignature */) {
+ } else if (decl.kind === 171 /* PropertySignature */) {
this.countInterfaceExtendsDifferentPropertyTypes(
node,
prop2type,
@@ -161700,7 +161958,7 @@ var _TypeScriptLinter2 = class {
const arrayLitElements = arrayLitNode.elements;
for (const element of arrayLitElements) {
const elementContextType = _TypeScriptLinter2.tsTypeChecker.getContextualType(element);
- if (element.kind === 210 /* ObjectLiteralExpression */) {
+ if (element.kind === 212 /* ObjectLiteralExpression */) {
if (!isDynamicLiteralInitializer2(arrayLitNode) && !isObjectLiteralAssignable2(elementContextType, element)) {
noContextTypeForArrayLiteral = true;
break;
@@ -161740,7 +161998,7 @@ var _TypeScriptLinter2 = class {
return;
let enumDeclCount = 0;
for (const decl of enumDecls) {
- if (decl.kind === 269 /* EnumDeclaration */)
+ if (decl.kind === 272 /* EnumDeclaration */)
enumDeclCount++;
}
if (enumDeclCount > 1)
@@ -161753,7 +162011,7 @@ var _TypeScriptLinter2 = class {
if (iDecls) {
let iDeclCount = 0;
for (const decl of iDecls) {
- if (decl.kind === 267 /* InterfaceDeclaration */)
+ if (decl.kind === 270 /* InterfaceDeclaration */)
iDeclCount++;
}
if (iDeclCount > 1)
@@ -162205,11 +162463,11 @@ var _TypeScriptLinter2 = class {
} else if (tsBinaryExpr.operatorToken.kind === 27 /* CommaToken */) {
let tsExprNode = tsBinaryExpr;
let tsParentNode = tsExprNode.parent;
- while (tsParentNode && tsParentNode.kind === 227 /* BinaryExpression */) {
+ while (tsParentNode && tsParentNode.kind === 229 /* BinaryExpression */) {
tsExprNode = tsParentNode;
tsParentNode = tsExprNode.parent;
}
- if (tsParentNode && tsParentNode.kind === 249 /* ForStatement */) {
+ if (tsParentNode && tsParentNode.kind === 251 /* ForStatement */) {
const tsForNode = tsParentNode;
if (tsExprNode === tsForNode.initializer || tsExprNode === tsForNode.incrementor)
return;
@@ -162474,15 +162732,15 @@ var _TypeScriptLinter2 = class {
if (isModuleBlock(tsModuleBody)) {
for (const tsModuleStmt of tsModuleBody.statements) {
switch (tsModuleStmt.kind) {
- case 244 /* VariableStatement */:
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 269 /* EnumDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 246 /* VariableStatement */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 284 /* ExportDeclaration */:
break;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
break;
default:
this.incrementCounters(tsModuleStmt, 44 /* NonDeclarationInNamespace */);
@@ -162609,7 +162867,7 @@ var _TypeScriptLinter2 = class {
handleRestrictedValues(tsIdentifier, tsIdentSym) {
const illegalValues = 128 /* ConstEnum */ | 256 /* RegularEnum */ | 512 /* ValueModule */ | 32 /* Class */;
if ((tsIdentSym.flags & 512 /* ValueModule */) !== 0) {
- if (!!tsIdentSym && symbolHasDuplicateName2(tsIdentSym, 270 /* ModuleDeclaration */)) {
+ if (!!tsIdentSym && symbolHasDuplicateName2(tsIdentSym, 273 /* ModuleDeclaration */)) {
return;
}
}
@@ -162905,25 +163163,25 @@ var _TypeScriptLinter2 = class {
}
isEsObjectPossiblyAllowed(typeRef) {
switch (typeRef.parent.kind) {
- case 261 /* VariableDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 168 /* Parameter */:
- case 184 /* FunctionType */:
- case 170 /* PropertySignature */:
- case 188 /* ArrayType */:
- case 214 /* NewExpression */:
+ case 263 /* VariableDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 169 /* Parameter */:
+ case 186 /* FunctionType */:
+ case 171 /* PropertySignature */:
+ case 190 /* ArrayType */:
+ case 216 /* NewExpression */:
return true;
- case 219 /* ArrowFunction */:
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
+ case 221 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
return this.isObjectLiteralFromFunc(typeRef.parent);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
const promiseType = typeRef.parent;
if (promiseType.typeName.getText() === PROMISE) {
return this.isObjectLiteralFromFunc(typeRef.parent.parent, true);
}
return true;
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return !isObjectLiteralExpression(typeRef.parent.expression);
default:
return false;
@@ -163002,10 +163260,10 @@ var _TypeScriptLinter2 = class {
}
handleConstructSignature(node) {
switch (node.parent.kind) {
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
this.incrementCounters(node, 33 /* ConstructorType */);
break;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
this.incrementCounters(node, 34 /* ConstructorIface */);
break;
default:
@@ -163082,9 +163340,9 @@ var _TypeScriptLinter2 = class {
if (decl.exclamationToken === void 0) {
return;
}
- if (decl.kind === 171 /* PropertyDeclaration */) {
+ if (decl.kind === 172 /* PropertyDeclaration */) {
const parentDecl = decl.parent;
- if (parentDecl.kind === 264 /* ClassDeclaration */ && hasSendableDecorator(parentDecl)) {
+ if (parentDecl.kind === 266 /* ClassDeclaration */ && hasSendableDecorator(parentDecl)) {
this.incrementCounters(decl, 82 /* SendableDefiniteAssignment */);
return;
}
@@ -163215,28 +163473,28 @@ var _TypeScriptLinter2 = class {
return;
}
switch (parentNode.kind) {
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (isConstEnum(parentNode.symbol)) {
break;
} else {
this.incrementCounters((_a2 = parentNode.name) != null ? _a2 : parentNode, 90 /* SharedModuleExports */);
}
return;
- case 267 /* InterfaceDeclaration */:
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
if (!isShareableType(_TypeScriptLinter2.tsTypeChecker.getTypeAtLocation(parentNode))) {
this.incrementCounters((_b = parentNode.name) != null ? _b : parentNode, 90 /* SharedModuleExports */);
}
return;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
for (const variableDeclaration of parentNode.declarationList.declarations) {
if (!isShareableEntity(variableDeclaration.name)) {
this.incrementCounters(variableDeclaration.name, 90 /* SharedModuleExports */);
}
}
return;
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
if (!isShareableEntity(parentNode)) {
this.incrementCounters(parentNode, 108 /* SharedModuleExportsWarning */);
}
@@ -163345,15 +163603,15 @@ var _InteropTypescriptLinter = class {
this.D_ETS = ".d.ets";
this.ETS = ".ets";
this.handlersMap = new Map2([
- [275 /* ImportDeclaration */, this.handleImportDeclaration],
- [267 /* InterfaceDeclaration */, this.handleInterfaceDeclaration],
- [264 /* ClassDeclaration */, this.handleClassDeclaration],
- [214 /* NewExpression */, this.handleNewExpression],
- [210 /* ObjectLiteralExpression */, this.handleObjectLiteralExpression],
- [209 /* ArrayLiteralExpression */, this.handleArrayLiteralExpression],
- [235 /* AsExpression */, this.handleAsExpression],
- [281 /* ExportDeclaration */, this.handleExportDeclaration],
- [280 /* ExportAssignment */, this.handleExportAssignment]
+ [278 /* ImportDeclaration */, this.handleImportDeclaration],
+ [270 /* InterfaceDeclaration */, this.handleInterfaceDeclaration],
+ [266 /* ClassDeclaration */, this.handleClassDeclaration],
+ [216 /* NewExpression */, this.handleNewExpression],
+ [212 /* ObjectLiteralExpression */, this.handleObjectLiteralExpression],
+ [211 /* ArrayLiteralExpression */, this.handleArrayLiteralExpression],
+ [237 /* AsExpression */, this.handleAsExpression],
+ [284 /* ExportDeclaration */, this.handleExportDeclaration],
+ [283 /* ExportAssignment */, this.handleExportAssignment]
]);
_InteropTypescriptLinter.tsTypeChecker = tsProgram.getLinterTypeChecker();
_InteropTypescriptLinter.etsLoaderPath = tsProgram.getCompilerOptions().etsLoaderPath;
@@ -165825,6 +166083,9 @@ if (typeof console !== "undefined") {
isOptionalTypeNode,
isOuterExpression,
isOutermostOptionalChain,
+ isOverloadDeclaration,
+ isOverloadElement,
+ isOverloadPropertyDeclaration,
isOverrideModifier,
isPackedArrayLiteral,
isParameter,
diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js
index 0e80c82271..60e528a610 100644
--- a/lib/typingsInstaller.js
+++ b/lib/typingsInstaller.js
@@ -2947,208 +2947,211 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
SyntaxKind4[SyntaxKind4["GlobalKeyword"] = 161] = "GlobalKeyword";
SyntaxKind4[SyntaxKind4["BigIntKeyword"] = 162] = "BigIntKeyword";
SyntaxKind4[SyntaxKind4["OverrideKeyword"] = 163] = "OverrideKeyword";
- SyntaxKind4[SyntaxKind4["OfKeyword"] = 164] = "OfKeyword";
- SyntaxKind4[SyntaxKind4["QualifiedName"] = 165] = "QualifiedName";
- SyntaxKind4[SyntaxKind4["ComputedPropertyName"] = 166] = "ComputedPropertyName";
- SyntaxKind4[SyntaxKind4["TypeParameter"] = 167] = "TypeParameter";
- SyntaxKind4[SyntaxKind4["Parameter"] = 168] = "Parameter";
- SyntaxKind4[SyntaxKind4["Decorator"] = 169] = "Decorator";
- SyntaxKind4[SyntaxKind4["PropertySignature"] = 170] = "PropertySignature";
- SyntaxKind4[SyntaxKind4["PropertyDeclaration"] = 171] = "PropertyDeclaration";
- SyntaxKind4[SyntaxKind4["AnnotationPropertyDeclaration"] = 172] = "AnnotationPropertyDeclaration";
- SyntaxKind4[SyntaxKind4["MethodSignature"] = 173] = "MethodSignature";
- SyntaxKind4[SyntaxKind4["MethodDeclaration"] = 174] = "MethodDeclaration";
- SyntaxKind4[SyntaxKind4["ClassStaticBlockDeclaration"] = 175] = "ClassStaticBlockDeclaration";
- SyntaxKind4[SyntaxKind4["Constructor"] = 176] = "Constructor";
- SyntaxKind4[SyntaxKind4["GetAccessor"] = 177] = "GetAccessor";
- SyntaxKind4[SyntaxKind4["SetAccessor"] = 178] = "SetAccessor";
- SyntaxKind4[SyntaxKind4["CallSignature"] = 179] = "CallSignature";
- SyntaxKind4[SyntaxKind4["ConstructSignature"] = 180] = "ConstructSignature";
- SyntaxKind4[SyntaxKind4["IndexSignature"] = 181] = "IndexSignature";
- SyntaxKind4[SyntaxKind4["TypePredicate"] = 182] = "TypePredicate";
- SyntaxKind4[SyntaxKind4["TypeReference"] = 183] = "TypeReference";
- SyntaxKind4[SyntaxKind4["FunctionType"] = 184] = "FunctionType";
- SyntaxKind4[SyntaxKind4["ConstructorType"] = 185] = "ConstructorType";
- SyntaxKind4[SyntaxKind4["TypeQuery"] = 186] = "TypeQuery";
- SyntaxKind4[SyntaxKind4["TypeLiteral"] = 187] = "TypeLiteral";
- SyntaxKind4[SyntaxKind4["ArrayType"] = 188] = "ArrayType";
- SyntaxKind4[SyntaxKind4["TupleType"] = 189] = "TupleType";
- SyntaxKind4[SyntaxKind4["OptionalType"] = 190] = "OptionalType";
- SyntaxKind4[SyntaxKind4["RestType"] = 191] = "RestType";
- SyntaxKind4[SyntaxKind4["UnionType"] = 192] = "UnionType";
- SyntaxKind4[SyntaxKind4["IntersectionType"] = 193] = "IntersectionType";
- SyntaxKind4[SyntaxKind4["ConditionalType"] = 194] = "ConditionalType";
- SyntaxKind4[SyntaxKind4["InferType"] = 195] = "InferType";
- SyntaxKind4[SyntaxKind4["ParenthesizedType"] = 196] = "ParenthesizedType";
- SyntaxKind4[SyntaxKind4["ThisType"] = 197] = "ThisType";
- SyntaxKind4[SyntaxKind4["TypeOperator"] = 198] = "TypeOperator";
- SyntaxKind4[SyntaxKind4["IndexedAccessType"] = 199] = "IndexedAccessType";
- SyntaxKind4[SyntaxKind4["MappedType"] = 200] = "MappedType";
- SyntaxKind4[SyntaxKind4["LiteralType"] = 201] = "LiteralType";
- SyntaxKind4[SyntaxKind4["NamedTupleMember"] = 202] = "NamedTupleMember";
- SyntaxKind4[SyntaxKind4["TemplateLiteralType"] = 203] = "TemplateLiteralType";
- SyntaxKind4[SyntaxKind4["TemplateLiteralTypeSpan"] = 204] = "TemplateLiteralTypeSpan";
- SyntaxKind4[SyntaxKind4["ImportType"] = 205] = "ImportType";
- SyntaxKind4[SyntaxKind4["ObjectBindingPattern"] = 206] = "ObjectBindingPattern";
- SyntaxKind4[SyntaxKind4["ArrayBindingPattern"] = 207] = "ArrayBindingPattern";
- SyntaxKind4[SyntaxKind4["BindingElement"] = 208] = "BindingElement";
- SyntaxKind4[SyntaxKind4["ArrayLiteralExpression"] = 209] = "ArrayLiteralExpression";
- SyntaxKind4[SyntaxKind4["ObjectLiteralExpression"] = 210] = "ObjectLiteralExpression";
- SyntaxKind4[SyntaxKind4["PropertyAccessExpression"] = 211] = "PropertyAccessExpression";
- SyntaxKind4[SyntaxKind4["ElementAccessExpression"] = 212] = "ElementAccessExpression";
- SyntaxKind4[SyntaxKind4["CallExpression"] = 213] = "CallExpression";
- SyntaxKind4[SyntaxKind4["NewExpression"] = 214] = "NewExpression";
- SyntaxKind4[SyntaxKind4["TaggedTemplateExpression"] = 215] = "TaggedTemplateExpression";
- SyntaxKind4[SyntaxKind4["TypeAssertionExpression"] = 216] = "TypeAssertionExpression";
- SyntaxKind4[SyntaxKind4["ParenthesizedExpression"] = 217] = "ParenthesizedExpression";
- SyntaxKind4[SyntaxKind4["FunctionExpression"] = 218] = "FunctionExpression";
- SyntaxKind4[SyntaxKind4["ArrowFunction"] = 219] = "ArrowFunction";
- SyntaxKind4[SyntaxKind4["EtsComponentExpression"] = 220] = "EtsComponentExpression";
- SyntaxKind4[SyntaxKind4["DeleteExpression"] = 221] = "DeleteExpression";
- SyntaxKind4[SyntaxKind4["TypeOfExpression"] = 222] = "TypeOfExpression";
- SyntaxKind4[SyntaxKind4["VoidExpression"] = 223] = "VoidExpression";
- SyntaxKind4[SyntaxKind4["AwaitExpression"] = 224] = "AwaitExpression";
- SyntaxKind4[SyntaxKind4["PrefixUnaryExpression"] = 225] = "PrefixUnaryExpression";
- SyntaxKind4[SyntaxKind4["PostfixUnaryExpression"] = 226] = "PostfixUnaryExpression";
- SyntaxKind4[SyntaxKind4["BinaryExpression"] = 227] = "BinaryExpression";
- SyntaxKind4[SyntaxKind4["ConditionalExpression"] = 228] = "ConditionalExpression";
- SyntaxKind4[SyntaxKind4["TemplateExpression"] = 229] = "TemplateExpression";
- SyntaxKind4[SyntaxKind4["YieldExpression"] = 230] = "YieldExpression";
- SyntaxKind4[SyntaxKind4["SpreadElement"] = 231] = "SpreadElement";
- SyntaxKind4[SyntaxKind4["ClassExpression"] = 232] = "ClassExpression";
- SyntaxKind4[SyntaxKind4["OmittedExpression"] = 233] = "OmittedExpression";
- SyntaxKind4[SyntaxKind4["ExpressionWithTypeArguments"] = 234] = "ExpressionWithTypeArguments";
- SyntaxKind4[SyntaxKind4["AsExpression"] = 235] = "AsExpression";
- SyntaxKind4[SyntaxKind4["NonNullExpression"] = 236] = "NonNullExpression";
- SyntaxKind4[SyntaxKind4["MetaProperty"] = 237] = "MetaProperty";
- SyntaxKind4[SyntaxKind4["SyntheticExpression"] = 238] = "SyntheticExpression";
- SyntaxKind4[SyntaxKind4["SatisfiesExpression"] = 239] = "SatisfiesExpression";
- SyntaxKind4[SyntaxKind4["TemplateSpan"] = 240] = "TemplateSpan";
- SyntaxKind4[SyntaxKind4["SemicolonClassElement"] = 241] = "SemicolonClassElement";
- SyntaxKind4[SyntaxKind4["Block"] = 242] = "Block";
- SyntaxKind4[SyntaxKind4["EmptyStatement"] = 243] = "EmptyStatement";
- SyntaxKind4[SyntaxKind4["VariableStatement"] = 244] = "VariableStatement";
- SyntaxKind4[SyntaxKind4["ExpressionStatement"] = 245] = "ExpressionStatement";
- SyntaxKind4[SyntaxKind4["IfStatement"] = 246] = "IfStatement";
- SyntaxKind4[SyntaxKind4["DoStatement"] = 247] = "DoStatement";
- SyntaxKind4[SyntaxKind4["WhileStatement"] = 248] = "WhileStatement";
- SyntaxKind4[SyntaxKind4["ForStatement"] = 249] = "ForStatement";
- SyntaxKind4[SyntaxKind4["ForInStatement"] = 250] = "ForInStatement";
- SyntaxKind4[SyntaxKind4["ForOfStatement"] = 251] = "ForOfStatement";
- SyntaxKind4[SyntaxKind4["ContinueStatement"] = 252] = "ContinueStatement";
- SyntaxKind4[SyntaxKind4["BreakStatement"] = 253] = "BreakStatement";
- SyntaxKind4[SyntaxKind4["ReturnStatement"] = 254] = "ReturnStatement";
- SyntaxKind4[SyntaxKind4["WithStatement"] = 255] = "WithStatement";
- SyntaxKind4[SyntaxKind4["SwitchStatement"] = 256] = "SwitchStatement";
- SyntaxKind4[SyntaxKind4["LabeledStatement"] = 257] = "LabeledStatement";
- SyntaxKind4[SyntaxKind4["ThrowStatement"] = 258] = "ThrowStatement";
- SyntaxKind4[SyntaxKind4["TryStatement"] = 259] = "TryStatement";
- SyntaxKind4[SyntaxKind4["DebuggerStatement"] = 260] = "DebuggerStatement";
- SyntaxKind4[SyntaxKind4["VariableDeclaration"] = 261] = "VariableDeclaration";
- SyntaxKind4[SyntaxKind4["VariableDeclarationList"] = 262] = "VariableDeclarationList";
- SyntaxKind4[SyntaxKind4["FunctionDeclaration"] = 263] = "FunctionDeclaration";
- SyntaxKind4[SyntaxKind4["ClassDeclaration"] = 264] = "ClassDeclaration";
- SyntaxKind4[SyntaxKind4["StructDeclaration"] = 265] = "StructDeclaration";
- SyntaxKind4[SyntaxKind4["AnnotationDeclaration"] = 266] = "AnnotationDeclaration";
- SyntaxKind4[SyntaxKind4["InterfaceDeclaration"] = 267] = "InterfaceDeclaration";
- SyntaxKind4[SyntaxKind4["TypeAliasDeclaration"] = 268] = "TypeAliasDeclaration";
- SyntaxKind4[SyntaxKind4["EnumDeclaration"] = 269] = "EnumDeclaration";
- SyntaxKind4[SyntaxKind4["ModuleDeclaration"] = 270] = "ModuleDeclaration";
- SyntaxKind4[SyntaxKind4["ModuleBlock"] = 271] = "ModuleBlock";
- SyntaxKind4[SyntaxKind4["CaseBlock"] = 272] = "CaseBlock";
- SyntaxKind4[SyntaxKind4["NamespaceExportDeclaration"] = 273] = "NamespaceExportDeclaration";
- SyntaxKind4[SyntaxKind4["ImportEqualsDeclaration"] = 274] = "ImportEqualsDeclaration";
- SyntaxKind4[SyntaxKind4["ImportDeclaration"] = 275] = "ImportDeclaration";
- SyntaxKind4[SyntaxKind4["ImportClause"] = 276] = "ImportClause";
- SyntaxKind4[SyntaxKind4["NamespaceImport"] = 277] = "NamespaceImport";
- SyntaxKind4[SyntaxKind4["NamedImports"] = 278] = "NamedImports";
- SyntaxKind4[SyntaxKind4["ImportSpecifier"] = 279] = "ImportSpecifier";
- SyntaxKind4[SyntaxKind4["ExportAssignment"] = 280] = "ExportAssignment";
- SyntaxKind4[SyntaxKind4["ExportDeclaration"] = 281] = "ExportDeclaration";
- SyntaxKind4[SyntaxKind4["NamedExports"] = 282] = "NamedExports";
- SyntaxKind4[SyntaxKind4["NamespaceExport"] = 283] = "NamespaceExport";
- SyntaxKind4[SyntaxKind4["ExportSpecifier"] = 284] = "ExportSpecifier";
- SyntaxKind4[SyntaxKind4["MissingDeclaration"] = 285] = "MissingDeclaration";
- SyntaxKind4[SyntaxKind4["ExternalModuleReference"] = 286] = "ExternalModuleReference";
- SyntaxKind4[SyntaxKind4["JsxElement"] = 287] = "JsxElement";
- SyntaxKind4[SyntaxKind4["JsxSelfClosingElement"] = 288] = "JsxSelfClosingElement";
- SyntaxKind4[SyntaxKind4["JsxOpeningElement"] = 289] = "JsxOpeningElement";
- SyntaxKind4[SyntaxKind4["JsxClosingElement"] = 290] = "JsxClosingElement";
- SyntaxKind4[SyntaxKind4["JsxFragment"] = 291] = "JsxFragment";
- SyntaxKind4[SyntaxKind4["JsxOpeningFragment"] = 292] = "JsxOpeningFragment";
- SyntaxKind4[SyntaxKind4["JsxClosingFragment"] = 293] = "JsxClosingFragment";
- SyntaxKind4[SyntaxKind4["JsxAttribute"] = 294] = "JsxAttribute";
- SyntaxKind4[SyntaxKind4["JsxAttributes"] = 295] = "JsxAttributes";
- SyntaxKind4[SyntaxKind4["JsxSpreadAttribute"] = 296] = "JsxSpreadAttribute";
- SyntaxKind4[SyntaxKind4["JsxExpression"] = 297] = "JsxExpression";
- SyntaxKind4[SyntaxKind4["CaseClause"] = 298] = "CaseClause";
- SyntaxKind4[SyntaxKind4["DefaultClause"] = 299] = "DefaultClause";
- SyntaxKind4[SyntaxKind4["HeritageClause"] = 300] = "HeritageClause";
- SyntaxKind4[SyntaxKind4["CatchClause"] = 301] = "CatchClause";
- SyntaxKind4[SyntaxKind4["AssertClause"] = 302] = "AssertClause";
- SyntaxKind4[SyntaxKind4["AssertEntry"] = 303] = "AssertEntry";
- SyntaxKind4[SyntaxKind4["ImportTypeAssertionContainer"] = 304] = "ImportTypeAssertionContainer";
- SyntaxKind4[SyntaxKind4["PropertyAssignment"] = 305] = "PropertyAssignment";
- SyntaxKind4[SyntaxKind4["ShorthandPropertyAssignment"] = 306] = "ShorthandPropertyAssignment";
- SyntaxKind4[SyntaxKind4["SpreadAssignment"] = 307] = "SpreadAssignment";
- SyntaxKind4[SyntaxKind4["EnumMember"] = 308] = "EnumMember";
- SyntaxKind4[SyntaxKind4["UnparsedPrologue"] = 309] = "UnparsedPrologue";
- SyntaxKind4[SyntaxKind4["UnparsedPrepend"] = 310] = "UnparsedPrepend";
- SyntaxKind4[SyntaxKind4["UnparsedText"] = 311] = "UnparsedText";
- SyntaxKind4[SyntaxKind4["UnparsedInternalText"] = 312] = "UnparsedInternalText";
- SyntaxKind4[SyntaxKind4["UnparsedSyntheticReference"] = 313] = "UnparsedSyntheticReference";
- SyntaxKind4[SyntaxKind4["SourceFile"] = 314] = "SourceFile";
- SyntaxKind4[SyntaxKind4["Bundle"] = 315] = "Bundle";
- SyntaxKind4[SyntaxKind4["UnparsedSource"] = 316] = "UnparsedSource";
- SyntaxKind4[SyntaxKind4["InputFiles"] = 317] = "InputFiles";
- SyntaxKind4[SyntaxKind4["JSDocTypeExpression"] = 318] = "JSDocTypeExpression";
- SyntaxKind4[SyntaxKind4["JSDocNameReference"] = 319] = "JSDocNameReference";
- SyntaxKind4[SyntaxKind4["JSDocMemberName"] = 320] = "JSDocMemberName";
- SyntaxKind4[SyntaxKind4["JSDocAllType"] = 321] = "JSDocAllType";
- SyntaxKind4[SyntaxKind4["JSDocUnknownType"] = 322] = "JSDocUnknownType";
- SyntaxKind4[SyntaxKind4["JSDocNullableType"] = 323] = "JSDocNullableType";
- SyntaxKind4[SyntaxKind4["JSDocNonNullableType"] = 324] = "JSDocNonNullableType";
- SyntaxKind4[SyntaxKind4["JSDocOptionalType"] = 325] = "JSDocOptionalType";
- SyntaxKind4[SyntaxKind4["JSDocFunctionType"] = 326] = "JSDocFunctionType";
- SyntaxKind4[SyntaxKind4["JSDocVariadicType"] = 327] = "JSDocVariadicType";
- SyntaxKind4[SyntaxKind4["JSDocNamepathType"] = 328] = "JSDocNamepathType";
- SyntaxKind4[SyntaxKind4["JSDoc"] = 329] = "JSDoc";
- SyntaxKind4[SyntaxKind4["JSDocComment"] = 329 /* JSDoc */] = "JSDocComment";
- SyntaxKind4[SyntaxKind4["JSDocText"] = 330] = "JSDocText";
- SyntaxKind4[SyntaxKind4["JSDocTypeLiteral"] = 331] = "JSDocTypeLiteral";
- SyntaxKind4[SyntaxKind4["JSDocSignature"] = 332] = "JSDocSignature";
- SyntaxKind4[SyntaxKind4["JSDocLink"] = 333] = "JSDocLink";
- SyntaxKind4[SyntaxKind4["JSDocLinkCode"] = 334] = "JSDocLinkCode";
- SyntaxKind4[SyntaxKind4["JSDocLinkPlain"] = 335] = "JSDocLinkPlain";
- SyntaxKind4[SyntaxKind4["JSDocTag"] = 336] = "JSDocTag";
- SyntaxKind4[SyntaxKind4["JSDocAugmentsTag"] = 337] = "JSDocAugmentsTag";
- SyntaxKind4[SyntaxKind4["JSDocImplementsTag"] = 338] = "JSDocImplementsTag";
- SyntaxKind4[SyntaxKind4["JSDocAuthorTag"] = 339] = "JSDocAuthorTag";
- SyntaxKind4[SyntaxKind4["JSDocDeprecatedTag"] = 340] = "JSDocDeprecatedTag";
- SyntaxKind4[SyntaxKind4["JSDocClassTag"] = 341] = "JSDocClassTag";
- SyntaxKind4[SyntaxKind4["JSDocPublicTag"] = 342] = "JSDocPublicTag";
- SyntaxKind4[SyntaxKind4["JSDocPrivateTag"] = 343] = "JSDocPrivateTag";
- SyntaxKind4[SyntaxKind4["JSDocProtectedTag"] = 344] = "JSDocProtectedTag";
- SyntaxKind4[SyntaxKind4["JSDocReadonlyTag"] = 345] = "JSDocReadonlyTag";
- SyntaxKind4[SyntaxKind4["JSDocOverrideTag"] = 346] = "JSDocOverrideTag";
- SyntaxKind4[SyntaxKind4["JSDocCallbackTag"] = 347] = "JSDocCallbackTag";
- SyntaxKind4[SyntaxKind4["JSDocEnumTag"] = 348] = "JSDocEnumTag";
- SyntaxKind4[SyntaxKind4["JSDocParameterTag"] = 349] = "JSDocParameterTag";
- SyntaxKind4[SyntaxKind4["JSDocReturnTag"] = 350] = "JSDocReturnTag";
- SyntaxKind4[SyntaxKind4["JSDocThisTag"] = 351] = "JSDocThisTag";
- SyntaxKind4[SyntaxKind4["JSDocTypeTag"] = 352] = "JSDocTypeTag";
- SyntaxKind4[SyntaxKind4["JSDocTemplateTag"] = 353] = "JSDocTemplateTag";
- SyntaxKind4[SyntaxKind4["JSDocTypedefTag"] = 354] = "JSDocTypedefTag";
- SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 355] = "JSDocSeeTag";
- SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 356] = "JSDocPropertyTag";
- SyntaxKind4[SyntaxKind4["SyntaxList"] = 357] = "SyntaxList";
- SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 358] = "NotEmittedStatement";
- SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 359] = "PartiallyEmittedExpression";
- SyntaxKind4[SyntaxKind4["CommaListExpression"] = 360] = "CommaListExpression";
- SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 361] = "MergeDeclarationMarker";
- SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 362] = "EndOfDeclarationMarker";
- SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 363] = "SyntheticReferenceExpression";
- SyntaxKind4[SyntaxKind4["Count"] = 364] = "Count";
+ SyntaxKind4[SyntaxKind4["OverloadKeyword"] = 164] = "OverloadKeyword";
+ SyntaxKind4[SyntaxKind4["OfKeyword"] = 165] = "OfKeyword";
+ SyntaxKind4[SyntaxKind4["QualifiedName"] = 166] = "QualifiedName";
+ SyntaxKind4[SyntaxKind4["ComputedPropertyName"] = 167] = "ComputedPropertyName";
+ SyntaxKind4[SyntaxKind4["TypeParameter"] = 168] = "TypeParameter";
+ SyntaxKind4[SyntaxKind4["Parameter"] = 169] = "Parameter";
+ SyntaxKind4[SyntaxKind4["Decorator"] = 170] = "Decorator";
+ SyntaxKind4[SyntaxKind4["PropertySignature"] = 171] = "PropertySignature";
+ SyntaxKind4[SyntaxKind4["PropertyDeclaration"] = 172] = "PropertyDeclaration";
+ SyntaxKind4[SyntaxKind4["AnnotationPropertyDeclaration"] = 173] = "AnnotationPropertyDeclaration";
+ SyntaxKind4[SyntaxKind4["OverloadPropertyDeclaration"] = 174] = "OverloadPropertyDeclaration";
+ SyntaxKind4[SyntaxKind4["MethodSignature"] = 175] = "MethodSignature";
+ SyntaxKind4[SyntaxKind4["MethodDeclaration"] = 176] = "MethodDeclaration";
+ SyntaxKind4[SyntaxKind4["ClassStaticBlockDeclaration"] = 177] = "ClassStaticBlockDeclaration";
+ SyntaxKind4[SyntaxKind4["Constructor"] = 178] = "Constructor";
+ SyntaxKind4[SyntaxKind4["GetAccessor"] = 179] = "GetAccessor";
+ SyntaxKind4[SyntaxKind4["SetAccessor"] = 180] = "SetAccessor";
+ SyntaxKind4[SyntaxKind4["CallSignature"] = 181] = "CallSignature";
+ SyntaxKind4[SyntaxKind4["ConstructSignature"] = 182] = "ConstructSignature";
+ SyntaxKind4[SyntaxKind4["IndexSignature"] = 183] = "IndexSignature";
+ SyntaxKind4[SyntaxKind4["TypePredicate"] = 184] = "TypePredicate";
+ SyntaxKind4[SyntaxKind4["TypeReference"] = 185] = "TypeReference";
+ SyntaxKind4[SyntaxKind4["FunctionType"] = 186] = "FunctionType";
+ SyntaxKind4[SyntaxKind4["ConstructorType"] = 187] = "ConstructorType";
+ SyntaxKind4[SyntaxKind4["TypeQuery"] = 188] = "TypeQuery";
+ SyntaxKind4[SyntaxKind4["TypeLiteral"] = 189] = "TypeLiteral";
+ SyntaxKind4[SyntaxKind4["ArrayType"] = 190] = "ArrayType";
+ SyntaxKind4[SyntaxKind4["TupleType"] = 191] = "TupleType";
+ SyntaxKind4[SyntaxKind4["OptionalType"] = 192] = "OptionalType";
+ SyntaxKind4[SyntaxKind4["RestType"] = 193] = "RestType";
+ SyntaxKind4[SyntaxKind4["UnionType"] = 194] = "UnionType";
+ SyntaxKind4[SyntaxKind4["IntersectionType"] = 195] = "IntersectionType";
+ SyntaxKind4[SyntaxKind4["ConditionalType"] = 196] = "ConditionalType";
+ SyntaxKind4[SyntaxKind4["InferType"] = 197] = "InferType";
+ SyntaxKind4[SyntaxKind4["ParenthesizedType"] = 198] = "ParenthesizedType";
+ SyntaxKind4[SyntaxKind4["ThisType"] = 199] = "ThisType";
+ SyntaxKind4[SyntaxKind4["TypeOperator"] = 200] = "TypeOperator";
+ SyntaxKind4[SyntaxKind4["IndexedAccessType"] = 201] = "IndexedAccessType";
+ SyntaxKind4[SyntaxKind4["MappedType"] = 202] = "MappedType";
+ SyntaxKind4[SyntaxKind4["LiteralType"] = 203] = "LiteralType";
+ SyntaxKind4[SyntaxKind4["NamedTupleMember"] = 204] = "NamedTupleMember";
+ SyntaxKind4[SyntaxKind4["TemplateLiteralType"] = 205] = "TemplateLiteralType";
+ SyntaxKind4[SyntaxKind4["TemplateLiteralTypeSpan"] = 206] = "TemplateLiteralTypeSpan";
+ SyntaxKind4[SyntaxKind4["ImportType"] = 207] = "ImportType";
+ SyntaxKind4[SyntaxKind4["ObjectBindingPattern"] = 208] = "ObjectBindingPattern";
+ SyntaxKind4[SyntaxKind4["ArrayBindingPattern"] = 209] = "ArrayBindingPattern";
+ SyntaxKind4[SyntaxKind4["BindingElement"] = 210] = "BindingElement";
+ SyntaxKind4[SyntaxKind4["ArrayLiteralExpression"] = 211] = "ArrayLiteralExpression";
+ SyntaxKind4[SyntaxKind4["ObjectLiteralExpression"] = 212] = "ObjectLiteralExpression";
+ SyntaxKind4[SyntaxKind4["PropertyAccessExpression"] = 213] = "PropertyAccessExpression";
+ SyntaxKind4[SyntaxKind4["ElementAccessExpression"] = 214] = "ElementAccessExpression";
+ SyntaxKind4[SyntaxKind4["CallExpression"] = 215] = "CallExpression";
+ SyntaxKind4[SyntaxKind4["NewExpression"] = 216] = "NewExpression";
+ SyntaxKind4[SyntaxKind4["TaggedTemplateExpression"] = 217] = "TaggedTemplateExpression";
+ SyntaxKind4[SyntaxKind4["TypeAssertionExpression"] = 218] = "TypeAssertionExpression";
+ SyntaxKind4[SyntaxKind4["ParenthesizedExpression"] = 219] = "ParenthesizedExpression";
+ SyntaxKind4[SyntaxKind4["FunctionExpression"] = 220] = "FunctionExpression";
+ SyntaxKind4[SyntaxKind4["ArrowFunction"] = 221] = "ArrowFunction";
+ SyntaxKind4[SyntaxKind4["EtsComponentExpression"] = 222] = "EtsComponentExpression";
+ SyntaxKind4[SyntaxKind4["DeleteExpression"] = 223] = "DeleteExpression";
+ SyntaxKind4[SyntaxKind4["TypeOfExpression"] = 224] = "TypeOfExpression";
+ SyntaxKind4[SyntaxKind4["VoidExpression"] = 225] = "VoidExpression";
+ SyntaxKind4[SyntaxKind4["AwaitExpression"] = 226] = "AwaitExpression";
+ SyntaxKind4[SyntaxKind4["PrefixUnaryExpression"] = 227] = "PrefixUnaryExpression";
+ SyntaxKind4[SyntaxKind4["PostfixUnaryExpression"] = 228] = "PostfixUnaryExpression";
+ SyntaxKind4[SyntaxKind4["BinaryExpression"] = 229] = "BinaryExpression";
+ SyntaxKind4[SyntaxKind4["ConditionalExpression"] = 230] = "ConditionalExpression";
+ SyntaxKind4[SyntaxKind4["TemplateExpression"] = 231] = "TemplateExpression";
+ SyntaxKind4[SyntaxKind4["YieldExpression"] = 232] = "YieldExpression";
+ SyntaxKind4[SyntaxKind4["SpreadElement"] = 233] = "SpreadElement";
+ SyntaxKind4[SyntaxKind4["ClassExpression"] = 234] = "ClassExpression";
+ SyntaxKind4[SyntaxKind4["OmittedExpression"] = 235] = "OmittedExpression";
+ SyntaxKind4[SyntaxKind4["ExpressionWithTypeArguments"] = 236] = "ExpressionWithTypeArguments";
+ SyntaxKind4[SyntaxKind4["AsExpression"] = 237] = "AsExpression";
+ SyntaxKind4[SyntaxKind4["NonNullExpression"] = 238] = "NonNullExpression";
+ SyntaxKind4[SyntaxKind4["MetaProperty"] = 239] = "MetaProperty";
+ SyntaxKind4[SyntaxKind4["SyntheticExpression"] = 240] = "SyntheticExpression";
+ SyntaxKind4[SyntaxKind4["SatisfiesExpression"] = 241] = "SatisfiesExpression";
+ SyntaxKind4[SyntaxKind4["TemplateSpan"] = 242] = "TemplateSpan";
+ SyntaxKind4[SyntaxKind4["SemicolonClassElement"] = 243] = "SemicolonClassElement";
+ SyntaxKind4[SyntaxKind4["Block"] = 244] = "Block";
+ SyntaxKind4[SyntaxKind4["EmptyStatement"] = 245] = "EmptyStatement";
+ SyntaxKind4[SyntaxKind4["VariableStatement"] = 246] = "VariableStatement";
+ SyntaxKind4[SyntaxKind4["ExpressionStatement"] = 247] = "ExpressionStatement";
+ SyntaxKind4[SyntaxKind4["IfStatement"] = 248] = "IfStatement";
+ SyntaxKind4[SyntaxKind4["DoStatement"] = 249] = "DoStatement";
+ SyntaxKind4[SyntaxKind4["WhileStatement"] = 250] = "WhileStatement";
+ SyntaxKind4[SyntaxKind4["ForStatement"] = 251] = "ForStatement";
+ SyntaxKind4[SyntaxKind4["ForInStatement"] = 252] = "ForInStatement";
+ SyntaxKind4[SyntaxKind4["ForOfStatement"] = 253] = "ForOfStatement";
+ SyntaxKind4[SyntaxKind4["ContinueStatement"] = 254] = "ContinueStatement";
+ SyntaxKind4[SyntaxKind4["BreakStatement"] = 255] = "BreakStatement";
+ SyntaxKind4[SyntaxKind4["ReturnStatement"] = 256] = "ReturnStatement";
+ SyntaxKind4[SyntaxKind4["WithStatement"] = 257] = "WithStatement";
+ SyntaxKind4[SyntaxKind4["SwitchStatement"] = 258] = "SwitchStatement";
+ SyntaxKind4[SyntaxKind4["LabeledStatement"] = 259] = "LabeledStatement";
+ SyntaxKind4[SyntaxKind4["ThrowStatement"] = 260] = "ThrowStatement";
+ SyntaxKind4[SyntaxKind4["TryStatement"] = 261] = "TryStatement";
+ SyntaxKind4[SyntaxKind4["DebuggerStatement"] = 262] = "DebuggerStatement";
+ SyntaxKind4[SyntaxKind4["VariableDeclaration"] = 263] = "VariableDeclaration";
+ SyntaxKind4[SyntaxKind4["VariableDeclarationList"] = 264] = "VariableDeclarationList";
+ SyntaxKind4[SyntaxKind4["FunctionDeclaration"] = 265] = "FunctionDeclaration";
+ SyntaxKind4[SyntaxKind4["ClassDeclaration"] = 266] = "ClassDeclaration";
+ SyntaxKind4[SyntaxKind4["StructDeclaration"] = 267] = "StructDeclaration";
+ SyntaxKind4[SyntaxKind4["AnnotationDeclaration"] = 268] = "AnnotationDeclaration";
+ SyntaxKind4[SyntaxKind4["OverloadDeclaration"] = 269] = "OverloadDeclaration";
+ SyntaxKind4[SyntaxKind4["InterfaceDeclaration"] = 270] = "InterfaceDeclaration";
+ SyntaxKind4[SyntaxKind4["TypeAliasDeclaration"] = 271] = "TypeAliasDeclaration";
+ SyntaxKind4[SyntaxKind4["EnumDeclaration"] = 272] = "EnumDeclaration";
+ SyntaxKind4[SyntaxKind4["ModuleDeclaration"] = 273] = "ModuleDeclaration";
+ SyntaxKind4[SyntaxKind4["ModuleBlock"] = 274] = "ModuleBlock";
+ SyntaxKind4[SyntaxKind4["CaseBlock"] = 275] = "CaseBlock";
+ SyntaxKind4[SyntaxKind4["NamespaceExportDeclaration"] = 276] = "NamespaceExportDeclaration";
+ SyntaxKind4[SyntaxKind4["ImportEqualsDeclaration"] = 277] = "ImportEqualsDeclaration";
+ SyntaxKind4[SyntaxKind4["ImportDeclaration"] = 278] = "ImportDeclaration";
+ SyntaxKind4[SyntaxKind4["ImportClause"] = 279] = "ImportClause";
+ SyntaxKind4[SyntaxKind4["NamespaceImport"] = 280] = "NamespaceImport";
+ SyntaxKind4[SyntaxKind4["NamedImports"] = 281] = "NamedImports";
+ SyntaxKind4[SyntaxKind4["ImportSpecifier"] = 282] = "ImportSpecifier";
+ SyntaxKind4[SyntaxKind4["ExportAssignment"] = 283] = "ExportAssignment";
+ SyntaxKind4[SyntaxKind4["ExportDeclaration"] = 284] = "ExportDeclaration";
+ SyntaxKind4[SyntaxKind4["NamedExports"] = 285] = "NamedExports";
+ SyntaxKind4[SyntaxKind4["NamespaceExport"] = 286] = "NamespaceExport";
+ SyntaxKind4[SyntaxKind4["ExportSpecifier"] = 287] = "ExportSpecifier";
+ SyntaxKind4[SyntaxKind4["MissingDeclaration"] = 288] = "MissingDeclaration";
+ SyntaxKind4[SyntaxKind4["ExternalModuleReference"] = 289] = "ExternalModuleReference";
+ SyntaxKind4[SyntaxKind4["JsxElement"] = 290] = "JsxElement";
+ SyntaxKind4[SyntaxKind4["JsxSelfClosingElement"] = 291] = "JsxSelfClosingElement";
+ SyntaxKind4[SyntaxKind4["JsxOpeningElement"] = 292] = "JsxOpeningElement";
+ SyntaxKind4[SyntaxKind4["JsxClosingElement"] = 293] = "JsxClosingElement";
+ SyntaxKind4[SyntaxKind4["JsxFragment"] = 294] = "JsxFragment";
+ SyntaxKind4[SyntaxKind4["JsxOpeningFragment"] = 295] = "JsxOpeningFragment";
+ SyntaxKind4[SyntaxKind4["JsxClosingFragment"] = 296] = "JsxClosingFragment";
+ SyntaxKind4[SyntaxKind4["JsxAttribute"] = 297] = "JsxAttribute";
+ SyntaxKind4[SyntaxKind4["JsxAttributes"] = 298] = "JsxAttributes";
+ SyntaxKind4[SyntaxKind4["JsxSpreadAttribute"] = 299] = "JsxSpreadAttribute";
+ SyntaxKind4[SyntaxKind4["JsxExpression"] = 300] = "JsxExpression";
+ SyntaxKind4[SyntaxKind4["CaseClause"] = 301] = "CaseClause";
+ SyntaxKind4[SyntaxKind4["DefaultClause"] = 302] = "DefaultClause";
+ SyntaxKind4[SyntaxKind4["HeritageClause"] = 303] = "HeritageClause";
+ SyntaxKind4[SyntaxKind4["CatchClause"] = 304] = "CatchClause";
+ SyntaxKind4[SyntaxKind4["AssertClause"] = 305] = "AssertClause";
+ SyntaxKind4[SyntaxKind4["AssertEntry"] = 306] = "AssertEntry";
+ SyntaxKind4[SyntaxKind4["ImportTypeAssertionContainer"] = 307] = "ImportTypeAssertionContainer";
+ SyntaxKind4[SyntaxKind4["PropertyAssignment"] = 308] = "PropertyAssignment";
+ SyntaxKind4[SyntaxKind4["ShorthandPropertyAssignment"] = 309] = "ShorthandPropertyAssignment";
+ SyntaxKind4[SyntaxKind4["SpreadAssignment"] = 310] = "SpreadAssignment";
+ SyntaxKind4[SyntaxKind4["EnumMember"] = 311] = "EnumMember";
+ SyntaxKind4[SyntaxKind4["UnparsedPrologue"] = 312] = "UnparsedPrologue";
+ SyntaxKind4[SyntaxKind4["UnparsedPrepend"] = 313] = "UnparsedPrepend";
+ SyntaxKind4[SyntaxKind4["UnparsedText"] = 314] = "UnparsedText";
+ SyntaxKind4[SyntaxKind4["UnparsedInternalText"] = 315] = "UnparsedInternalText";
+ SyntaxKind4[SyntaxKind4["UnparsedSyntheticReference"] = 316] = "UnparsedSyntheticReference";
+ SyntaxKind4[SyntaxKind4["SourceFile"] = 317] = "SourceFile";
+ SyntaxKind4[SyntaxKind4["Bundle"] = 318] = "Bundle";
+ SyntaxKind4[SyntaxKind4["UnparsedSource"] = 319] = "UnparsedSource";
+ SyntaxKind4[SyntaxKind4["InputFiles"] = 320] = "InputFiles";
+ SyntaxKind4[SyntaxKind4["JSDocTypeExpression"] = 321] = "JSDocTypeExpression";
+ SyntaxKind4[SyntaxKind4["JSDocNameReference"] = 322] = "JSDocNameReference";
+ SyntaxKind4[SyntaxKind4["JSDocMemberName"] = 323] = "JSDocMemberName";
+ SyntaxKind4[SyntaxKind4["JSDocAllType"] = 324] = "JSDocAllType";
+ SyntaxKind4[SyntaxKind4["JSDocUnknownType"] = 325] = "JSDocUnknownType";
+ SyntaxKind4[SyntaxKind4["JSDocNullableType"] = 326] = "JSDocNullableType";
+ SyntaxKind4[SyntaxKind4["JSDocNonNullableType"] = 327] = "JSDocNonNullableType";
+ SyntaxKind4[SyntaxKind4["JSDocOptionalType"] = 328] = "JSDocOptionalType";
+ SyntaxKind4[SyntaxKind4["JSDocFunctionType"] = 329] = "JSDocFunctionType";
+ SyntaxKind4[SyntaxKind4["JSDocVariadicType"] = 330] = "JSDocVariadicType";
+ SyntaxKind4[SyntaxKind4["JSDocNamepathType"] = 331] = "JSDocNamepathType";
+ SyntaxKind4[SyntaxKind4["JSDoc"] = 332] = "JSDoc";
+ SyntaxKind4[SyntaxKind4["JSDocComment"] = 332 /* JSDoc */] = "JSDocComment";
+ SyntaxKind4[SyntaxKind4["JSDocText"] = 333] = "JSDocText";
+ SyntaxKind4[SyntaxKind4["JSDocTypeLiteral"] = 334] = "JSDocTypeLiteral";
+ SyntaxKind4[SyntaxKind4["JSDocSignature"] = 335] = "JSDocSignature";
+ SyntaxKind4[SyntaxKind4["JSDocLink"] = 336] = "JSDocLink";
+ SyntaxKind4[SyntaxKind4["JSDocLinkCode"] = 337] = "JSDocLinkCode";
+ SyntaxKind4[SyntaxKind4["JSDocLinkPlain"] = 338] = "JSDocLinkPlain";
+ SyntaxKind4[SyntaxKind4["JSDocTag"] = 339] = "JSDocTag";
+ SyntaxKind4[SyntaxKind4["JSDocAugmentsTag"] = 340] = "JSDocAugmentsTag";
+ SyntaxKind4[SyntaxKind4["JSDocImplementsTag"] = 341] = "JSDocImplementsTag";
+ SyntaxKind4[SyntaxKind4["JSDocAuthorTag"] = 342] = "JSDocAuthorTag";
+ SyntaxKind4[SyntaxKind4["JSDocDeprecatedTag"] = 343] = "JSDocDeprecatedTag";
+ SyntaxKind4[SyntaxKind4["JSDocClassTag"] = 344] = "JSDocClassTag";
+ SyntaxKind4[SyntaxKind4["JSDocPublicTag"] = 345] = "JSDocPublicTag";
+ SyntaxKind4[SyntaxKind4["JSDocPrivateTag"] = 346] = "JSDocPrivateTag";
+ SyntaxKind4[SyntaxKind4["JSDocProtectedTag"] = 347] = "JSDocProtectedTag";
+ SyntaxKind4[SyntaxKind4["JSDocReadonlyTag"] = 348] = "JSDocReadonlyTag";
+ SyntaxKind4[SyntaxKind4["JSDocOverrideTag"] = 349] = "JSDocOverrideTag";
+ SyntaxKind4[SyntaxKind4["JSDocCallbackTag"] = 350] = "JSDocCallbackTag";
+ SyntaxKind4[SyntaxKind4["JSDocEnumTag"] = 351] = "JSDocEnumTag";
+ SyntaxKind4[SyntaxKind4["JSDocParameterTag"] = 352] = "JSDocParameterTag";
+ SyntaxKind4[SyntaxKind4["JSDocReturnTag"] = 353] = "JSDocReturnTag";
+ SyntaxKind4[SyntaxKind4["JSDocThisTag"] = 354] = "JSDocThisTag";
+ SyntaxKind4[SyntaxKind4["JSDocTypeTag"] = 355] = "JSDocTypeTag";
+ SyntaxKind4[SyntaxKind4["JSDocTemplateTag"] = 356] = "JSDocTemplateTag";
+ SyntaxKind4[SyntaxKind4["JSDocTypedefTag"] = 357] = "JSDocTypedefTag";
+ SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 358] = "JSDocSeeTag";
+ SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 359] = "JSDocPropertyTag";
+ SyntaxKind4[SyntaxKind4["SyntaxList"] = 360] = "SyntaxList";
+ SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 361] = "NotEmittedStatement";
+ SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 362] = "PartiallyEmittedExpression";
+ SyntaxKind4[SyntaxKind4["CommaListExpression"] = 363] = "CommaListExpression";
+ SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 364] = "MergeDeclarationMarker";
+ SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 365] = "EndOfDeclarationMarker";
+ SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 366] = "SyntheticReferenceExpression";
+ SyntaxKind4[SyntaxKind4["Count"] = 367] = "Count";
SyntaxKind4[SyntaxKind4["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
SyntaxKind4[SyntaxKind4["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -3156,15 +3159,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
SyntaxKind4[SyntaxKind4["FirstReservedWord"] = 81 /* BreakKeyword */] = "FirstReservedWord";
SyntaxKind4[SyntaxKind4["LastReservedWord"] = 117 /* WithKeyword */] = "LastReservedWord";
SyntaxKind4[SyntaxKind4["FirstKeyword"] = 81 /* BreakKeyword */] = "FirstKeyword";
- SyntaxKind4[SyntaxKind4["LastKeyword"] = 164 /* OfKeyword */] = "LastKeyword";
+ SyntaxKind4[SyntaxKind4["LastKeyword"] = 165 /* OfKeyword */] = "LastKeyword";
SyntaxKind4[SyntaxKind4["FirstFutureReservedWord"] = 118 /* ImplementsKeyword */] = "FirstFutureReservedWord";
SyntaxKind4[SyntaxKind4["LastFutureReservedWord"] = 126 /* YieldKeyword */] = "LastFutureReservedWord";
- SyntaxKind4[SyntaxKind4["FirstTypeNode"] = 182 /* TypePredicate */] = "FirstTypeNode";
- SyntaxKind4[SyntaxKind4["LastTypeNode"] = 205 /* ImportType */] = "LastTypeNode";
+ SyntaxKind4[SyntaxKind4["FirstTypeNode"] = 184 /* TypePredicate */] = "FirstTypeNode";
+ SyntaxKind4[SyntaxKind4["LastTypeNode"] = 207 /* ImportType */] = "LastTypeNode";
SyntaxKind4[SyntaxKind4["FirstPunctuation"] = 18 /* OpenBraceToken */] = "FirstPunctuation";
SyntaxKind4[SyntaxKind4["LastPunctuation"] = 78 /* CaretEqualsToken */] = "LastPunctuation";
SyntaxKind4[SyntaxKind4["FirstToken"] = 0 /* Unknown */] = "FirstToken";
- SyntaxKind4[SyntaxKind4["LastToken"] = 164 /* LastKeyword */] = "LastToken";
+ SyntaxKind4[SyntaxKind4["LastToken"] = 165 /* LastKeyword */] = "LastToken";
SyntaxKind4[SyntaxKind4["FirstTriviaToken"] = 2 /* SingleLineCommentTrivia */] = "FirstTriviaToken";
SyntaxKind4[SyntaxKind4["LastTriviaToken"] = 7 /* ConflictMarkerTrivia */] = "LastTriviaToken";
SyntaxKind4[SyntaxKind4["FirstLiteralToken"] = 8 /* NumericLiteral */] = "FirstLiteralToken";
@@ -3173,15 +3176,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
SyntaxKind4[SyntaxKind4["LastTemplateToken"] = 17 /* TemplateTail */] = "LastTemplateToken";
SyntaxKind4[SyntaxKind4["FirstBinaryOperator"] = 29 /* LessThanToken */] = "FirstBinaryOperator";
SyntaxKind4[SyntaxKind4["LastBinaryOperator"] = 78 /* CaretEqualsToken */] = "LastBinaryOperator";
- SyntaxKind4[SyntaxKind4["FirstStatement"] = 244 /* VariableStatement */] = "FirstStatement";
- SyntaxKind4[SyntaxKind4["LastStatement"] = 260 /* DebuggerStatement */] = "LastStatement";
- SyntaxKind4[SyntaxKind4["FirstNode"] = 165 /* QualifiedName */] = "FirstNode";
- SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 318 /* JSDocTypeExpression */] = "FirstJSDocNode";
- SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 356 /* JSDocPropertyTag */] = "LastJSDocNode";
- SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 336 /* JSDocTag */] = "FirstJSDocTagNode";
- SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 356 /* JSDocPropertyTag */] = "LastJSDocTagNode";
+ SyntaxKind4[SyntaxKind4["FirstStatement"] = 246 /* VariableStatement */] = "FirstStatement";
+ SyntaxKind4[SyntaxKind4["LastStatement"] = 262 /* DebuggerStatement */] = "LastStatement";
+ SyntaxKind4[SyntaxKind4["FirstNode"] = 166 /* QualifiedName */] = "FirstNode";
+ SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 321 /* JSDocTypeExpression */] = "FirstJSDocNode";
+ SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 359 /* JSDocPropertyTag */] = "LastJSDocNode";
+ SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 339 /* JSDocTag */] = "FirstJSDocTagNode";
+ SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 359 /* JSDocPropertyTag */] = "LastJSDocTagNode";
SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 127 /* AbstractKeyword */] = "FirstContextualKeyword";
- SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 164 /* OfKeyword */] = "LastContextualKeyword";
+ SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword";
return SyntaxKind4;
})(SyntaxKind || {});
var NodeFlags = /* @__PURE__ */ ((NodeFlags3) => {
@@ -7349,6 +7352,7 @@ var textToKeywordObj = {
protected: 123 /* ProtectedKeyword */,
public: 124 /* PublicKeyword */,
override: 163 /* OverrideKeyword */,
+ overload: 164 /* OverloadKeyword */,
out: 146 /* OutKeyword */,
readonly: 147 /* ReadonlyKeyword */,
require: 148 /* RequireKeyword */,
@@ -7379,7 +7383,7 @@ var textToKeywordObj = {
yield: 126 /* YieldKeyword */,
async: 133 /* AsyncKeyword */,
await: 134 /* AwaitKeyword */,
- of: 164 /* OfKeyword */
+ of: 165 /* OfKeyword */
};
var textToKeyword = new Map2(getEntries(textToKeywordObj));
var textToToken = new Map2(getEntries({
@@ -9324,7 +9328,7 @@ function createTextChangeRange(span, newLength) {
}
var unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
function isParameterPropertyDeclaration(node, parent) {
- return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent.kind === 176 /* Constructor */;
+ return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent.kind === 178 /* Constructor */;
}
function walkUpBindingElementsAndPatterns(binding) {
let node = binding.parent;
@@ -9338,14 +9342,14 @@ function getCombinedFlags(node, getFlags) {
node = walkUpBindingElementsAndPatterns(node);
}
let flags = getFlags(node);
- if (node.kind === 261 /* VariableDeclaration */) {
+ if (node.kind === 263 /* VariableDeclaration */) {
node = node.parent;
}
- if (node && node.kind === 262 /* VariableDeclarationList */) {
+ if (node && node.kind === 264 /* VariableDeclarationList */) {
flags |= getFlags(node);
node = node.parent;
}
- if (node && node.kind === 244 /* VariableStatement */) {
+ if (node && node.kind === 246 /* VariableStatement */) {
flags |= getFlags(node);
}
return flags;
@@ -9416,30 +9420,30 @@ function nameForNamelessJSDocTypedef(declaration) {
return getDeclarationIdentifier(hostNode);
}
switch (hostNode.kind) {
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
if (hostNode.declarationList && hostNode.declarationList.declarations[0]) {
return getDeclarationIdentifier(hostNode.declarationList.declarations[0]);
}
break;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
let expr = hostNode.expression;
- if (expr.kind === 227 /* BinaryExpression */ && expr.operatorToken.kind === 63 /* EqualsToken */) {
+ if (expr.kind === 229 /* BinaryExpression */ && expr.operatorToken.kind === 63 /* EqualsToken */) {
expr = expr.left;
}
switch (expr.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return expr.name;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const arg = expr.argumentExpression;
if (isIdentifier(arg)) {
return arg;
}
}
break;
- case 217 /* ParenthesizedExpression */: {
+ case 219 /* ParenthesizedExpression */: {
return getDeclarationIdentifier(hostNode.expression);
}
- case 257 /* LabeledStatement */: {
+ case 259 /* LabeledStatement */: {
if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) {
return getDeclarationIdentifier(hostNode.statement);
}
@@ -9470,16 +9474,16 @@ function getNonAssignedNameOfDeclaration(declaration) {
switch (declaration.kind) {
case 79 /* Identifier */:
return declaration;
- case 356 /* JSDocPropertyTag */:
- case 349 /* JSDocParameterTag */: {
+ case 359 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */: {
const { name } = declaration;
- if (name.kind === 165 /* QualifiedName */) {
+ if (name.kind === 166 /* QualifiedName */) {
return name.right;
}
break;
}
- case 213 /* CallExpression */:
- case 227 /* BinaryExpression */: {
+ case 215 /* CallExpression */:
+ case 229 /* BinaryExpression */: {
const expr2 = declaration;
switch (getAssignmentDeclarationKind(expr2)) {
case 1 /* ExportsProperty */:
@@ -9495,15 +9499,15 @@ function getNonAssignedNameOfDeclaration(declaration) {
return void 0;
}
}
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return getNameOfJSDocTypedef(declaration);
- case 348 /* JSDocEnumTag */:
+ case 351 /* JSDocEnumTag */:
return nameForNamelessJSDocTypedef(declaration);
- case 280 /* ExportAssignment */: {
+ case 283 /* ExportAssignment */: {
const { expression } = declaration;
return isIdentifier(expression) ? expression : void 0;
}
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = declaration;
if (isBindableStaticElementAccessExpression(expr)) {
return expr.argumentExpression;
@@ -9615,10 +9619,10 @@ function getFirstJSDocTag(node, predicate, noCache) {
return find(getJSDocTagsWorker(node, noCache), predicate);
}
function getTextOfJSDocComment(comment) {
- return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 330 /* JSDocText */ ? c.text : formatJSDocLink(c)).join("");
+ return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 333 /* JSDocText */ ? c.text : formatJSDocLink(c)).join("");
}
function formatJSDocLink(link) {
- const kind = link.kind === 333 /* JSDocLink */ ? "link" : link.kind === 334 /* JSDocLinkCode */ ? "linkcode" : "linkplain";
+ const kind = link.kind === 336 /* JSDocLink */ ? "link" : link.kind === 337 /* JSDocLinkCode */ ? "linkcode" : "linkplain";
const name = link.name ? entityNameToString(link.name) : "";
const space = link.name && link.text.startsWith("://") ? "" : " ";
return `{@${kind} ${name}${space}${link.text}}`;
@@ -9637,7 +9641,7 @@ function isCallChain(node) {
}
function isOptionalChain(node) {
const kind = node.kind;
- return !!(node.flags & 32 /* OptionalChain */) && (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */ || kind === 213 /* CallExpression */ || kind === 236 /* NonNullExpression */);
+ return !!(node.flags & 32 /* OptionalChain */) && (kind === 213 /* PropertyAccessExpression */ || kind === 214 /* ElementAccessExpression */ || kind === 215 /* CallExpression */ || kind === 238 /* NonNullExpression */);
}
function isOptionalChainRoot(node) {
return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken;
@@ -9649,7 +9653,7 @@ function isOutermostOptionalChain(node) {
return !isOptionalChain(node.parent) || isOptionalChainRoot(node.parent) || node !== node.parent.expression;
}
function isNullishCoalesce(node) {
- return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
+ return node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
}
function skipPartiallyEmittedExpressions(node) {
return skipOuterExpressions(node, 8 /* PartiallyEmittedExpressions */);
@@ -9658,25 +9662,25 @@ function isNonNullChain(node) {
return isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */);
}
function isNamedExportBindings(node) {
- return node.kind === 283 /* NamespaceExport */ || node.kind === 282 /* NamedExports */;
+ return node.kind === 286 /* NamespaceExport */ || node.kind === 285 /* NamedExports */;
}
function isUnparsedTextLike(node) {
switch (node.kind) {
- case 311 /* UnparsedText */:
- case 312 /* UnparsedInternalText */:
+ case 314 /* UnparsedText */:
+ case 315 /* UnparsedInternalText */:
return true;
default:
return false;
}
}
function isUnparsedNode(node) {
- return isUnparsedTextLike(node) || node.kind === 309 /* UnparsedPrologue */ || node.kind === 313 /* UnparsedSyntheticReference */;
+ return isUnparsedTextLike(node) || node.kind === 312 /* UnparsedPrologue */ || node.kind === 316 /* UnparsedSyntheticReference */;
}
function isNodeKind(kind) {
- return kind >= 165 /* FirstNode */;
+ return kind >= 166 /* FirstNode */;
}
function isTokenKind(kind) {
- return kind >= 0 /* FirstToken */ && kind <= 164 /* LastToken */;
+ return kind >= 0 /* FirstToken */ && kind <= 165 /* LastToken */;
}
function isToken(n) {
return isTokenKind(n.kind);
@@ -9741,15 +9745,15 @@ function isModifier(node) {
}
function isEntityName(node) {
const kind = node.kind;
- return kind === 165 /* QualifiedName */ || kind === 79 /* Identifier */;
+ return kind === 166 /* QualifiedName */ || kind === 79 /* Identifier */;
}
function isPropertyName(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 80 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ || kind === 166 /* ComputedPropertyName */;
+ return kind === 79 /* Identifier */ || kind === 80 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ || kind === 167 /* ComputedPropertyName */;
}
function isBindingName(node) {
const kind = node.kind;
- return kind === 79 /* Identifier */ || kind === 206 /* ObjectBindingPattern */ || kind === 207 /* ArrayBindingPattern */;
+ return kind === 79 /* Identifier */ || kind === 208 /* ObjectBindingPattern */ || kind === 209 /* ArrayBindingPattern */;
}
function isFunctionLike(node) {
return !!node && isFunctionLikeKind(node.kind);
@@ -9762,13 +9766,13 @@ function isFunctionLikeDeclaration(node) {
}
function isFunctionLikeDeclarationKind(kind) {
switch (kind) {
- case 263 /* FunctionDeclaration */:
- case 174 /* MethodDeclaration */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 265 /* FunctionDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return true;
default:
return false;
@@ -9776,14 +9780,14 @@ function isFunctionLikeDeclarationKind(kind) {
}
function isFunctionLikeKind(kind) {
switch (kind) {
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 184 /* FunctionType */:
- case 326 /* JSDocFunctionType */:
- case 185 /* ConstructorType */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 186 /* FunctionType */:
+ case 329 /* JSDocFunctionType */:
+ case 187 /* ConstructorType */:
return true;
default:
return isFunctionLikeDeclarationKind(kind);
@@ -9791,26 +9795,30 @@ function isFunctionLikeKind(kind) {
}
function isAnnotationElement(node) {
const kind = node.kind;
- return kind === 172 /* AnnotationPropertyDeclaration */;
+ return kind === 173 /* AnnotationPropertyDeclaration */;
+}
+function isOverloadElement(node) {
+ const kind = node.kind;
+ return kind === 174 /* OverloadPropertyDeclaration */;
}
function isClassElement(node) {
const kind = node.kind;
- return kind === 176 /* Constructor */ || kind === 171 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 241 /* SemicolonClassElement */;
+ return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */;
}
function isClassLike(node) {
- return node && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || node.kind === 265 /* StructDeclaration */);
+ return node && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 267 /* StructDeclaration */);
}
function isAccessor(node) {
- return node && (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */);
+ return node && (node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */);
}
function isAutoAccessorPropertyDeclaration(node) {
return isPropertyDeclaration(node) && hasAccessorModifier(node);
}
function isMethodOrAccessor(node) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return true;
default:
return false;
@@ -9821,19 +9829,19 @@ function isModifierLike(node) {
}
function isTypeElement(node) {
const kind = node.kind;
- return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 170 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function isObjectLiteralElementLike(node) {
const kind = node.kind;
- return kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 307 /* SpreadAssignment */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
+ return kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 310 /* SpreadAssignment */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
}
function isTypeNode(node) {
return isTypeNodeKind(node.kind);
}
function isFunctionOrConstructorTypeNode(node) {
switch (node.kind) {
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return true;
}
return false;
@@ -9841,50 +9849,50 @@ function isFunctionOrConstructorTypeNode(node) {
function isBindingPattern(node) {
if (node) {
const kind = node.kind;
- return kind === 207 /* ArrayBindingPattern */ || kind === 206 /* ObjectBindingPattern */;
+ return kind === 209 /* ArrayBindingPattern */ || kind === 208 /* ObjectBindingPattern */;
}
return false;
}
function isAssignmentPattern(node) {
const kind = node.kind;
- return kind === 209 /* ArrayLiteralExpression */ || kind === 210 /* ObjectLiteralExpression */;
+ return kind === 211 /* ArrayLiteralExpression */ || kind === 212 /* ObjectLiteralExpression */;
}
function isArrayBindingElement(node) {
const kind = node.kind;
- return kind === 208 /* BindingElement */ || kind === 233 /* OmittedExpression */;
+ return kind === 210 /* BindingElement */ || kind === 235 /* OmittedExpression */;
}
function isDeclarationBindingElement(bindingElement) {
switch (bindingElement.kind) {
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
return true;
}
return false;
}
function isTemplateLiteral(node) {
const kind = node.kind;
- return kind === 229 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */;
+ return kind === 231 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */;
}
function isLeftHandSideExpression(node) {
return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind);
}
function isLeftHandSideExpressionKind(kind) {
switch (kind) {
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
- case 214 /* NewExpression */:
- case 213 /* CallExpression */:
- case 287 /* JsxElement */:
- case 288 /* JsxSelfClosingElement */:
- case 291 /* JsxFragment */:
- case 215 /* TaggedTemplateExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 217 /* ParenthesizedExpression */:
- case 210 /* ObjectLiteralExpression */:
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
- case 220 /* EtsComponentExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 216 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 290 /* JsxElement */:
+ case 291 /* JsxSelfClosingElement */:
+ case 294 /* JsxFragment */:
+ case 217 /* TaggedTemplateExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 212 /* ObjectLiteralExpression */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
+ case 222 /* EtsComponentExpression */:
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
case 13 /* RegularExpressionLiteral */:
@@ -9892,15 +9900,15 @@ function isLeftHandSideExpressionKind(kind) {
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
case 96 /* FalseKeyword */:
case 105 /* NullKeyword */:
case 109 /* ThisKeyword */:
case 111 /* TrueKeyword */:
case 107 /* SuperKeyword */:
- case 236 /* NonNullExpression */:
- case 234 /* ExpressionWithTypeArguments */:
- case 237 /* MetaProperty */:
+ case 238 /* NonNullExpression */:
+ case 236 /* ExpressionWithTypeArguments */:
+ case 239 /* MetaProperty */:
case 101 /* ImportKeyword */:
return true;
default:
@@ -9912,13 +9920,13 @@ function isUnaryExpression(node) {
}
function isUnaryExpressionKind(kind) {
switch (kind) {
- case 225 /* PrefixUnaryExpression */:
- case 226 /* PostfixUnaryExpression */:
- case 221 /* DeleteExpression */:
- case 222 /* TypeOfExpression */:
- case 223 /* VoidExpression */:
- case 224 /* AwaitExpression */:
- case 216 /* TypeAssertionExpression */:
+ case 227 /* PrefixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
+ case 223 /* DeleteExpression */:
+ case 224 /* TypeOfExpression */:
+ case 225 /* VoidExpression */:
+ case 226 /* AwaitExpression */:
+ case 218 /* TypeAssertionExpression */:
return true;
default:
return isLeftHandSideExpressionKind(kind);
@@ -9929,23 +9937,23 @@ function isExpression(node) {
}
function isExpressionKind(kind) {
switch (kind) {
- case 228 /* ConditionalExpression */:
- case 230 /* YieldExpression */:
- case 219 /* ArrowFunction */:
- case 227 /* BinaryExpression */:
- case 231 /* SpreadElement */:
- case 235 /* AsExpression */:
- case 233 /* OmittedExpression */:
- case 360 /* CommaListExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 239 /* SatisfiesExpression */:
+ case 230 /* ConditionalExpression */:
+ case 232 /* YieldExpression */:
+ case 221 /* ArrowFunction */:
+ case 229 /* BinaryExpression */:
+ case 233 /* SpreadElement */:
+ case 237 /* AsExpression */:
+ case 235 /* OmittedExpression */:
+ case 363 /* CommaListExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 241 /* SatisfiesExpression */:
return true;
default:
return isUnaryExpressionKind(kind);
}
}
function isForInOrOfStatement(node) {
- return node.kind === 250 /* ForInStatement */ || node.kind === 251 /* ForOfStatement */;
+ return node.kind === 252 /* ForInStatement */ || node.kind === 253 /* ForOfStatement */;
}
function isConciseBody(node) {
return isBlock(node) || isExpression(node);
@@ -9955,24 +9963,24 @@ function isForInitializer(node) {
}
function isModuleBody(node) {
const kind = node.kind;
- return kind === 271 /* ModuleBlock */ || kind === 270 /* ModuleDeclaration */ || kind === 79 /* Identifier */;
+ return kind === 274 /* ModuleBlock */ || kind === 273 /* ModuleDeclaration */ || kind === 79 /* Identifier */;
}
function isNamedImportBindings(node) {
const kind = node.kind;
- return kind === 278 /* NamedImports */ || kind === 277 /* NamespaceImport */;
+ return kind === 281 /* NamedImports */ || kind === 280 /* NamespaceImport */;
}
function isDeclarationKind(kind) {
- return kind === 219 /* ArrowFunction */ || kind === 208 /* BindingElement */ || kind === 264 /* ClassDeclaration */ || kind === 232 /* ClassExpression */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 176 /* Constructor */ || kind === 269 /* EnumDeclaration */ || kind === 308 /* EnumMember */ || kind === 284 /* ExportSpecifier */ || kind === 263 /* FunctionDeclaration */ || kind === 218 /* FunctionExpression */ || kind === 177 /* GetAccessor */ || kind === 276 /* ImportClause */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 279 /* ImportSpecifier */ || kind === 267 /* InterfaceDeclaration */ || kind === 294 /* JsxAttribute */ || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 270 /* ModuleDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 277 /* NamespaceImport */ || kind === 283 /* NamespaceExport */ || kind === 168 /* Parameter */ || kind === 305 /* PropertyAssignment */ || kind === 171 /* PropertyDeclaration */ || kind === 172 /* AnnotationPropertyDeclaration */ || kind === 170 /* PropertySignature */ || kind === 178 /* SetAccessor */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 268 /* TypeAliasDeclaration */ || kind === 167 /* TypeParameter */ || kind === 261 /* VariableDeclaration */ || kind === 354 /* JSDocTypedefTag */ || kind === 347 /* JSDocCallbackTag */ || kind === 356 /* JSDocPropertyTag */;
+ return kind === 221 /* ArrowFunction */ || kind === 210 /* BindingElement */ || kind === 266 /* ClassDeclaration */ || kind === 234 /* ClassExpression */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 174 /* OverloadPropertyDeclaration */ || kind === 178 /* Constructor */ || kind === 272 /* EnumDeclaration */ || kind === 311 /* EnumMember */ || kind === 287 /* ExportSpecifier */ || kind === 265 /* FunctionDeclaration */ || kind === 220 /* FunctionExpression */ || kind === 179 /* GetAccessor */ || kind === 279 /* ImportClause */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 282 /* ImportSpecifier */ || kind === 270 /* InterfaceDeclaration */ || kind === 297 /* JsxAttribute */ || kind === 176 /* MethodDeclaration */ || kind === 175 /* MethodSignature */ || kind === 273 /* ModuleDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 280 /* NamespaceImport */ || kind === 286 /* NamespaceExport */ || kind === 169 /* Parameter */ || kind === 308 /* PropertyAssignment */ || kind === 172 /* PropertyDeclaration */ || kind === 173 /* AnnotationPropertyDeclaration */ || kind === 171 /* PropertySignature */ || kind === 180 /* SetAccessor */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 271 /* TypeAliasDeclaration */ || kind === 168 /* TypeParameter */ || kind === 263 /* VariableDeclaration */ || kind === 357 /* JSDocTypedefTag */ || kind === 350 /* JSDocCallbackTag */ || kind === 359 /* JSDocPropertyTag */;
}
function isDeclarationStatementKind(kind) {
- return kind === 263 /* FunctionDeclaration */ || kind === 285 /* MissingDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 280 /* ExportAssignment */ || kind === 273 /* NamespaceExportDeclaration */;
+ return kind === 265 /* FunctionDeclaration */ || kind === 288 /* MissingDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 269 /* OverloadDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 276 /* NamespaceExportDeclaration */;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 253 /* BreakStatement */ || kind === 252 /* ContinueStatement */ || kind === 260 /* DebuggerStatement */ || kind === 247 /* DoStatement */ || kind === 245 /* ExpressionStatement */ || kind === 243 /* EmptyStatement */ || kind === 250 /* ForInStatement */ || kind === 251 /* ForOfStatement */ || kind === 249 /* ForStatement */ || kind === 246 /* IfStatement */ || kind === 257 /* LabeledStatement */ || kind === 254 /* ReturnStatement */ || kind === 256 /* SwitchStatement */ || kind === 258 /* ThrowStatement */ || kind === 259 /* TryStatement */ || kind === 244 /* VariableStatement */ || kind === 248 /* WhileStatement */ || kind === 255 /* WithStatement */ || kind === 358 /* NotEmittedStatement */ || kind === 362 /* EndOfDeclarationMarker */ || kind === 361 /* MergeDeclarationMarker */;
+ return kind === 255 /* BreakStatement */ || kind === 254 /* ContinueStatement */ || kind === 262 /* DebuggerStatement */ || kind === 249 /* DoStatement */ || kind === 247 /* ExpressionStatement */ || kind === 245 /* EmptyStatement */ || kind === 252 /* ForInStatement */ || kind === 253 /* ForOfStatement */ || kind === 251 /* ForStatement */ || kind === 248 /* IfStatement */ || kind === 259 /* LabeledStatement */ || kind === 256 /* ReturnStatement */ || kind === 258 /* SwitchStatement */ || kind === 260 /* ThrowStatement */ || kind === 261 /* TryStatement */ || kind === 246 /* VariableStatement */ || kind === 250 /* WhileStatement */ || kind === 257 /* WithStatement */ || kind === 361 /* NotEmittedStatement */ || kind === 365 /* EndOfDeclarationMarker */ || kind === 364 /* MergeDeclarationMarker */;
}
function isDeclaration(node) {
- if (node.kind === 167 /* TypeParameter */) {
- return node.parent && node.parent.kind !== 353 /* JSDocTemplateTag */ || isInJSFile(node);
+ if (node.kind === 168 /* TypeParameter */) {
+ return node.parent && node.parent.kind !== 356 /* JSDocTemplateTag */ || isInJSFile(node);
}
return isDeclarationKind(node.kind);
}
@@ -9987,10 +9995,10 @@ function isStatement(node) {
return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || isBlockStatement(node);
}
function isBlockStatement(node) {
- if (node.kind !== 242 /* Block */)
+ if (node.kind !== 244 /* Block */)
return false;
if (node.parent !== void 0) {
- if (node.parent.kind === 259 /* TryStatement */ || node.parent.kind === 301 /* CatchClause */) {
+ if (node.parent.kind === 261 /* TryStatement */ || node.parent.kind === 304 /* CatchClause */) {
return false;
}
}
@@ -9998,37 +10006,37 @@ function isBlockStatement(node) {
}
function isStatementOrBlock(node) {
const kind = node.kind;
- return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 242 /* Block */;
+ return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 244 /* Block */;
}
function isModuleReference(node) {
const kind = node.kind;
- return kind === 286 /* ExternalModuleReference */ || kind === 165 /* QualifiedName */ || kind === 79 /* Identifier */;
+ return kind === 289 /* ExternalModuleReference */ || kind === 166 /* QualifiedName */ || kind === 79 /* Identifier */;
}
function isJsxTagNameExpression(node) {
const kind = node.kind;
- return kind === 109 /* ThisKeyword */ || kind === 79 /* Identifier */ || kind === 211 /* PropertyAccessExpression */;
+ return kind === 109 /* ThisKeyword */ || kind === 79 /* Identifier */ || kind === 213 /* PropertyAccessExpression */;
}
function isJsxChild(node) {
const kind = node.kind;
- return kind === 287 /* JsxElement */ || kind === 297 /* JsxExpression */ || kind === 288 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ || kind === 291 /* JsxFragment */;
+ return kind === 290 /* JsxElement */ || kind === 300 /* JsxExpression */ || kind === 291 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ || kind === 294 /* JsxFragment */;
}
function isJsxAttributeLike(node) {
const kind = node.kind;
- return kind === 294 /* JsxAttribute */ || kind === 296 /* JsxSpreadAttribute */;
+ return kind === 297 /* JsxAttribute */ || kind === 299 /* JsxSpreadAttribute */;
}
function isStringLiteralOrJsxExpression(node) {
const kind = node.kind;
- return kind === 10 /* StringLiteral */ || kind === 297 /* JsxExpression */;
+ return kind === 10 /* StringLiteral */ || kind === 300 /* JsxExpression */;
}
function isCaseOrDefaultClause(node) {
const kind = node.kind;
- return kind === 298 /* CaseClause */ || kind === 299 /* DefaultClause */;
+ return kind === 301 /* CaseClause */ || kind === 302 /* DefaultClause */;
}
function isJSDocNode(node) {
- return node.kind >= 318 /* FirstJSDocNode */ && node.kind <= 356 /* LastJSDocNode */;
+ return node.kind >= 321 /* FirstJSDocNode */ && node.kind <= 359 /* LastJSDocNode */;
}
function isJSDocTag(node) {
- return node.kind >= 336 /* FirstJSDocTagNode */ && node.kind <= 356 /* LastJSDocTagNode */;
+ return node.kind >= 339 /* FirstJSDocTagNode */ && node.kind <= 359 /* LastJSDocTagNode */;
}
function hasJSDocNodes(node) {
const { jsDoc } = node;
@@ -10166,7 +10174,7 @@ function aggregateChildData(node) {
}
}
function getSourceFileOfNode(node) {
- while (node && node.kind !== 314 /* SourceFile */) {
+ while (node && node.kind !== 317 /* SourceFile */) {
node = node.parent;
}
return node;
@@ -10223,7 +10231,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
if (includeJsDoc && hasJSDocNodes(node)) {
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
}
- if (node.kind === 357 /* SyntaxList */ && node._children.length > 0) {
+ if (node.kind === 360 /* SyntaxList */ && node._children.length > 0) {
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
}
return node.virtual ? node.pos : skipTrivia(
@@ -10316,7 +10324,7 @@ function isBlockOrCatchScoped(declaration) {
}
function isCatchClauseVariableDeclarationOrBindingElement(declaration) {
const node = getRootDeclaration(declaration);
- return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 301 /* CatchClause */;
+ return node.kind === 263 /* VariableDeclaration */ && node.parent.kind === 304 /* CatchClause */;
}
function isAmbientModule(node) {
return isModuleDeclaration(node) && (node.name.kind === 10 /* StringLiteral */ || isGlobalScopeAugmentation(node));
@@ -10332,34 +10340,34 @@ function isGlobalScopeAugmentation(module2) {
}
function isModuleAugmentationExternal(node) {
switch (node.parent.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return isExternalModule(node.parent);
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return isAmbientModule(node.parent.parent) && isSourceFile(node.parent.parent.parent) && !isExternalModule(node.parent.parent.parent);
}
return false;
}
function isBlockScope(node, parentNode) {
switch (node.kind) {
- case 314 /* SourceFile */:
- case 272 /* CaseBlock */:
- case 301 /* CatchClause */:
- case 270 /* ModuleDeclaration */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 176 /* Constructor */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 317 /* SourceFile */:
+ case 275 /* CaseBlock */:
+ case 304 /* CatchClause */:
+ case 273 /* ModuleDeclaration */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 178 /* Constructor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return true;
- case 242 /* Block */:
+ case 244 /* Block */:
return !isFunctionLikeOrClassStaticBlockDeclaration(parentNode);
}
return false;
@@ -10375,7 +10383,7 @@ function declarationNameToString(name) {
}
}
function isComputedNonLiteralName(name) {
- return name.kind === 166 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
+ return name.kind === 167 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
}
function tryGetTextOfPropertyName(name) {
switch (name.kind) {
@@ -10386,7 +10394,7 @@ function tryGetTextOfPropertyName(name) {
case 8 /* NumericLiteral */:
case 14 /* NoSubstitutionTemplateLiteral */:
return escapeLeadingUnderscores(name.text);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
if (isStringOrNumericLiteralLike(name.expression))
return escapeLeadingUnderscores(name.expression.text);
return void 0;
@@ -10404,15 +10412,15 @@ function entityNameToString(name) {
case 80 /* PrivateIdentifier */:
case 79 /* Identifier */:
return getFullWidth(name) === 0 ? idText(name) : getTextOfNode(name);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return entityNameToString(name.left) + "." + entityNameToString(name.right);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
if (isIdentifier(name.name) || isPrivateIdentifier(name.name)) {
return entityNameToString(name.expression) + "." + entityNameToString(name.name);
} else {
return Debug.assertNever(name.name);
}
- case 320 /* JSDocMemberName */:
+ case 323 /* JSDocMemberName */:
return entityNameToString(name.left) + entityNameToString(name.right);
default:
return Debug.assertNever(name);
@@ -10438,7 +10446,7 @@ function getSpanOfTokenAtPosition(sourceFile, pos) {
}
function getErrorSpanForArrowFunction(sourceFile, node) {
const pos = skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 242 /* Block */) {
+ if (node.body && node.body.kind === 244 /* Block */) {
const { line: startLine } = getLineAndCharacterOfPosition(sourceFile, node.body.pos);
const { line: endLine } = getLineAndCharacterOfPosition(sourceFile, node.body.end);
if (startLine < endLine) {
@@ -10450,37 +10458,37 @@ function getErrorSpanForArrowFunction(sourceFile, node) {
function getErrorSpanForNode(sourceFile, node) {
let errorNode = node;
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
const pos2 = skipTrivia(sourceFile.text, 0, false);
if (pos2 === sourceFile.text.length) {
return createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos2);
- case 261 /* VariableDeclaration */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
- case 308 /* EnumMember */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 268 /* TypeAliasDeclaration */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
- case 277 /* NamespaceImport */:
+ case 263 /* VariableDeclaration */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 311 /* EnumMember */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 271 /* TypeAliasDeclaration */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 280 /* NamespaceImport */:
errorNode = node.name;
break;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return getErrorSpanForArrowFunction(sourceFile, node);
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
const start = skipTrivia(sourceFile.text, node.pos);
const end = node.statements.length > 0 ? node.statements[0].pos : node.end;
return createTextSpanFromBounds(start, end);
@@ -10519,7 +10527,7 @@ function isLiteralImportTypeNode(n) {
return isImportTypeNode(n) && isLiteralTypeNode(n.argument) && isStringLiteral(n.argument.literal);
}
function isPrologueDirective(node) {
- return node.kind === 245 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */;
+ return node.kind === 247 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */;
}
function isCustomPrologue(node) {
return !!(getEmitFlags(node) & 1048576 /* CustomPrologue */);
@@ -10534,7 +10542,7 @@ function isHoistedVariableStatement(node) {
return isCustomPrologue(node) && isVariableStatement(node) && every(node.declarationList.declarations, isHoistedVariable);
}
function getJSDocCommentRanges(node, text) {
- const commentRanges = node.kind === 168 /* Parameter */ || node.kind === 167 /* TypeParameter */ || node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */ || node.kind === 217 /* ParenthesizedExpression */ || node.kind === 261 /* VariableDeclaration */ || node.kind === 284 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos);
+ const commentRanges = node.kind === 169 /* Parameter */ || node.kind === 168 /* TypeParameter */ || node.kind === 220 /* FunctionExpression */ || node.kind === 221 /* ArrowFunction */ || node.kind === 219 /* ParenthesizedExpression */ || node.kind === 263 /* VariableDeclaration */ || node.kind === 287 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos);
return filter(commentRanges, (comment) => text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */);
}
var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/;
@@ -10544,72 +10552,72 @@ var defaultLibReferenceRegEx = /^(\/\/\/\s*= 0 /* FirstToken */ && node.kind <= 164 /* LastToken */) {
+ if (node.kind >= 0 /* FirstToken */ && node.kind <= 165 /* LastToken */) {
return 0 /* None */;
}
if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) {
@@ -11808,7 +11816,7 @@ function modifierToFlag(token) {
return 32768 /* In */;
case 146 /* OutKeyword */:
return 65536 /* Out */;
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return 131072 /* Decorator */;
}
return 0 /* None */;
@@ -11825,7 +11833,7 @@ function isAssignmentExpression(node, excludeCompoundAssignment) {
function isDestructuringAssignment(node) {
if (isAssignmentExpression(node, true)) {
const kind = node.left.kind;
- return kind === 210 /* ObjectLiteralExpression */ || kind === 209 /* ArrayLiteralExpression */;
+ return kind === 212 /* ObjectLiteralExpression */ || kind === 211 /* ArrayLiteralExpression */;
}
return false;
}
@@ -11833,7 +11841,7 @@ function isEntityNameExpression(node) {
return node.kind === 79 /* Identifier */ || isPropertyAccessEntityNameExpression(node);
}
function isDottedName(node) {
- return node.kind === 79 /* Identifier */ || node.kind === 109 /* ThisKeyword */ || node.kind === 107 /* SuperKeyword */ || node.kind === 237 /* MetaProperty */ || node.kind === 211 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 217 /* ParenthesizedExpression */ && isDottedName(node.expression);
+ return node.kind === 79 /* Identifier */ || node.kind === 109 /* ThisKeyword */ || node.kind === 107 /* SuperKeyword */ || node.kind === 239 /* MetaProperty */ || node.kind === 213 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 219 /* ParenthesizedExpression */ && isDottedName(node.expression);
}
function isPropertyAccessEntityNameExpression(node) {
return isPropertyAccessExpression(node) && isIdentifier(node.name) && isEntityNameExpression(node.expression);
@@ -11842,7 +11850,7 @@ function isPrototypeAccess(node) {
return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype";
}
function isEmptyObjectLiteral(expression) {
- return expression.kind === 210 /* ObjectLiteralExpression */ && expression.properties.length === 0;
+ return expression.kind === 212 /* ObjectLiteralExpression */ && expression.properties.length === 0;
}
function tryExtractTSExtension(fileName) {
return find(supportedTSExtensionsForExtractExtension, (extension) => fileExtensionIs(fileName, extension));
@@ -11943,10 +11951,10 @@ function getLastChild(node) {
return lastChild;
}
function isTypeNodeKind(kind) {
- return kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */ || kind === 132 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 149 /* NumberKeyword */ || kind === 162 /* BigIntKeyword */ || kind === 150 /* ObjectKeyword */ || kind === 135 /* BooleanKeyword */ || kind === 153 /* StringKeyword */ || kind === 154 /* SymbolKeyword */ || kind === 115 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 145 /* NeverKeyword */ || kind === 234 /* ExpressionWithTypeArguments */ || kind === 321 /* JSDocAllType */ || kind === 322 /* JSDocUnknownType */ || kind === 323 /* JSDocNullableType */ || kind === 324 /* JSDocNonNullableType */ || kind === 325 /* JSDocOptionalType */ || kind === 326 /* JSDocFunctionType */ || kind === 327 /* JSDocVariadicType */;
+ return kind >= 184 /* FirstTypeNode */ && kind <= 207 /* LastTypeNode */ || kind === 132 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 149 /* NumberKeyword */ || kind === 162 /* BigIntKeyword */ || kind === 150 /* ObjectKeyword */ || kind === 135 /* BooleanKeyword */ || kind === 153 /* StringKeyword */ || kind === 154 /* SymbolKeyword */ || kind === 115 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 145 /* NeverKeyword */ || kind === 236 /* ExpressionWithTypeArguments */ || kind === 324 /* JSDocAllType */ || kind === 325 /* JSDocUnknownType */ || kind === 326 /* JSDocNullableType */ || kind === 327 /* JSDocNonNullableType */ || kind === 328 /* JSDocOptionalType */ || kind === 329 /* JSDocFunctionType */ || kind === 330 /* JSDocVariadicType */;
}
function isAccessExpression(node) {
- return node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */;
+ return node.kind === 213 /* PropertyAccessExpression */ || node.kind === 214 /* ElementAccessExpression */;
}
function isBundleFileTextLike(section) {
switch (section.kind) {
@@ -11966,28 +11974,28 @@ function getLeftmostAccessExpression(expr) {
function getLeftmostExpression(node, stopAtCallExpressions) {
while (true) {
switch (node.kind) {
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
node = node.operand;
continue;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
node = node.left;
continue;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
node = node.condition;
continue;
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
node = node.tag;
continue;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
if (stopAtCallExpressions) {
return node;
}
- case 235 /* AsExpression */:
- case 212 /* ElementAccessExpression */:
- case 211 /* PropertyAccessExpression */:
- case 236 /* NonNullExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 239 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 214 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 238 /* NonNullExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 241 /* SatisfiesExpression */:
node = node.expression;
continue;
}
@@ -12585,20 +12593,20 @@ function getContainingNodeArray(node) {
if (!node.parent)
return void 0;
switch (node.kind) {
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
const { parent: parent2 } = node;
- return parent2.kind === 195 /* InferType */ ? void 0 : parent2.typeParameters;
- case 168 /* Parameter */:
+ return parent2.kind === 197 /* InferType */ ? void 0 : parent2.typeParameters;
+ case 169 /* Parameter */:
return node.parent.parameters;
- case 204 /* TemplateLiteralTypeSpan */:
+ case 206 /* TemplateLiteralTypeSpan */:
return node.parent.templateSpans;
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return node.parent.templateSpans;
- case 169 /* Decorator */: {
+ case 170 /* Decorator */: {
const { parent: parent3 } = node;
return canHaveDecorators(parent3) ? parent3.modifiers : canHaveIllegalDecorators(parent3) ? parent3.illegalDecorators : void 0;
}
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return node.parent.heritageClauses;
}
const { parent } = node;
@@ -12606,43 +12614,43 @@ function getContainingNodeArray(node) {
return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags;
}
switch (parent.kind) {
- case 187 /* TypeLiteral */:
- case 267 /* InterfaceDeclaration */:
+ case 189 /* TypeLiteral */:
+ case 270 /* InterfaceDeclaration */:
return isTypeElement(node) ? parent.members : void 0;
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return parent.types;
- case 189 /* TupleType */:
- case 209 /* ArrayLiteralExpression */:
- case 360 /* CommaListExpression */:
- case 278 /* NamedImports */:
- case 282 /* NamedExports */:
+ case 191 /* TupleType */:
+ case 211 /* ArrayLiteralExpression */:
+ case 363 /* CommaListExpression */:
+ case 281 /* NamedImports */:
+ case 285 /* NamedExports */:
return parent.elements;
- case 210 /* ObjectLiteralExpression */:
- case 295 /* JsxAttributes */:
+ case 212 /* ObjectLiteralExpression */:
+ case 298 /* JsxAttributes */:
return parent.properties;
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
return isTypeNode(node) ? parent.typeArguments : parent.expression === node ? void 0 : parent.arguments;
- case 287 /* JsxElement */:
- case 291 /* JsxFragment */:
+ case 290 /* JsxElement */:
+ case 294 /* JsxFragment */:
return isJsxChild(node) ? parent.children : void 0;
- case 289 /* JsxOpeningElement */:
- case 288 /* JsxSelfClosingElement */:
+ case 292 /* JsxOpeningElement */:
+ case 291 /* JsxSelfClosingElement */:
return isTypeNode(node) ? parent.typeArguments : void 0;
- case 242 /* Block */:
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
+ case 274 /* ModuleBlock */:
return parent.statements;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return parent.clauses;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return isClassElement(node) ? parent.members : void 0;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return isEnumMember(node) ? parent.members : void 0;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return parent.statements;
}
}
@@ -12866,16 +12874,16 @@ function createParenthesizerRules(factory2) {
return parenthesizerRule;
}
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
- const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator);
- const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator);
+ const binaryOperatorPrecedence = getOperatorPrecedence(229 /* BinaryExpression */, binaryOperator);
+ const binaryOperatorAssociativity = getOperatorAssociativity(229 /* BinaryExpression */, binaryOperator);
const emittedOperand = skipPartiallyEmittedExpressions(operand);
- if (!isLeftSideOfBinary && operand.kind === 219 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
+ if (!isLeftSideOfBinary && operand.kind === 221 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
return true;
}
const operandPrecedence = getExpressionPrecedence(emittedOperand);
switch (compareValues(operandPrecedence, binaryOperatorPrecedence)) {
case -1 /* LessThan */:
- if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 230 /* YieldExpression */) {
+ if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 232 /* YieldExpression */) {
return false;
}
return true;
@@ -12909,7 +12917,7 @@ function createParenthesizerRules(factory2) {
if (isLiteralKind(node.kind)) {
return node.kind;
}
- if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {
+ if (node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {
if (node.cachedLiteralKind !== void 0) {
return node.cachedLiteralKind;
}
@@ -12922,7 +12930,7 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
const skipped = skipPartiallyEmittedExpressions(operand);
- if (skipped.kind === 217 /* ParenthesizedExpression */) {
+ if (skipped.kind === 219 /* ParenthesizedExpression */) {
return operand;
}
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory2.createParenthesizedExpression(operand) : operand;
@@ -12937,7 +12945,7 @@ function createParenthesizerRules(factory2) {
return isCommaSequence(expression) ? factory2.createParenthesizedExpression(expression) : expression;
}
function parenthesizeConditionOfConditionalExpression(condition) {
- const conditionalPrecedence = getOperatorPrecedence(228 /* ConditionalExpression */, 57 /* QuestionToken */);
+ const conditionalPrecedence = getOperatorPrecedence(230 /* ConditionalExpression */, 57 /* QuestionToken */);
const emittedCondition = skipPartiallyEmittedExpressions(condition);
const conditionPrecedence = getExpressionPrecedence(emittedCondition);
if (compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) {
@@ -12954,8 +12962,8 @@ function createParenthesizerRules(factory2) {
let needsParens = isCommaSequence(check);
if (!needsParens) {
switch (getLeftmostExpression(check, false).kind) {
- case 232 /* ClassExpression */:
- case 218 /* FunctionExpression */:
+ case 234 /* ClassExpression */:
+ case 220 /* FunctionExpression */:
needsParens = true;
}
}
@@ -12964,16 +12972,16 @@ function createParenthesizerRules(factory2) {
function parenthesizeExpressionOfNew(expression) {
const leftmostExpr = getLeftmostExpression(expression, true);
switch (leftmostExpr.kind) {
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return factory2.createParenthesizedExpression(expression);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return !leftmostExpr.arguments ? factory2.createParenthesizedExpression(expression) : expression;
}
return parenthesizeLeftSideOfAccess(expression);
}
function parenthesizeLeftSideOfAccess(expression, optionalChain) {
const emittedExpression = skipPartiallyEmittedExpressions(expression);
- if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 214 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) {
+ if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 216 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) {
return expression;
}
return setTextRange(factory2.createParenthesizedExpression(expression), expression);
@@ -12991,7 +12999,7 @@ function createParenthesizerRules(factory2) {
function parenthesizeExpressionForDisallowedComma(expression) {
const emittedExpression = skipPartiallyEmittedExpressions(expression);
const expressionPrecedence = getExpressionPrecedence(emittedExpression);
- const commaPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, 27 /* CommaToken */);
+ const commaPrecedence = getOperatorPrecedence(229 /* BinaryExpression */, 27 /* CommaToken */);
return expressionPrecedence > commaPrecedence ? expression : setTextRange(factory2.createParenthesizedExpression(expression), expression);
}
function parenthesizeExpressionOfExpressionStatement(expression) {
@@ -12999,7 +13007,7 @@ function createParenthesizerRules(factory2) {
if (isCallExpression(emittedExpression)) {
const callee = emittedExpression.expression;
const kind = skipPartiallyEmittedExpressions(callee).kind;
- if (kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */) {
+ if (kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */) {
const updated = factory2.updateCallExpression(
emittedExpression,
setTextRange(factory2.createParenthesizedExpression(callee), callee),
@@ -13010,37 +13018,37 @@ function createParenthesizerRules(factory2) {
}
}
const leftmostExpressionKind = getLeftmostExpression(emittedExpression, false).kind;
- if (leftmostExpressionKind === 210 /* ObjectLiteralExpression */ || leftmostExpressionKind === 218 /* FunctionExpression */) {
+ if (leftmostExpressionKind === 212 /* ObjectLiteralExpression */ || leftmostExpressionKind === 220 /* FunctionExpression */) {
return setTextRange(factory2.createParenthesizedExpression(expression), expression);
}
return expression;
}
function parenthesizeConciseBodyOfArrowFunction(body) {
- if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 210 /* ObjectLiteralExpression */)) {
+ if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 212 /* ObjectLiteralExpression */)) {
return setTextRange(factory2.createParenthesizedExpression(body), body);
}
return body;
}
function parenthesizeCheckTypeOfConditionalType(checkType) {
switch (checkType.kind) {
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 194 /* ConditionalType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 196 /* ConditionalType */:
return factory2.createParenthesizedType(checkType);
}
return checkType;
}
function parenthesizeExtendsTypeOfConditionalType(extendsType) {
switch (extendsType.kind) {
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return factory2.createParenthesizedType(extendsType);
}
return extendsType;
}
function parenthesizeConstituentTypeOfUnionType(type) {
switch (type.kind) {
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeCheckTypeOfConditionalType(type);
@@ -13050,8 +13058,8 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeConstituentTypeOfIntersectionType(type) {
switch (type.kind) {
- case 192 /* UnionType */:
- case 193 /* IntersectionType */:
+ case 194 /* UnionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeConstituentTypeOfUnionType(type);
@@ -13061,23 +13069,23 @@ function createParenthesizerRules(factory2) {
}
function parenthesizeOperandOfTypeOperator(type) {
switch (type.kind) {
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return factory2.createParenthesizedType(type);
}
return parenthesizeConstituentTypeOfIntersectionType(type);
}
function parenthesizeOperandOfReadonlyTypeOperator(type) {
switch (type.kind) {
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return factory2.createParenthesizedType(type);
}
return parenthesizeOperandOfTypeOperator(type);
}
function parenthesizeNonArrayTypeOfPostfixType(type) {
switch (type.kind) {
- case 195 /* InferType */:
- case 198 /* TypeOperator */:
- case 186 /* TypeQuery */:
+ case 197 /* InferType */:
+ case 200 /* TypeOperator */:
+ case 188 /* TypeQuery */:
return factory2.createParenthesizedType(type);
}
return parenthesizeOperandOfTypeOperator(type);
@@ -13231,11 +13239,11 @@ function createNodeConverters(factory2) {
}
function convertToAssignmentPattern(node) {
switch (node.kind) {
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return convertToArrayAssignmentPattern(node);
- case 206 /* ObjectBindingPattern */:
- case 210 /* ObjectLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 212 /* ObjectLiteralExpression */:
return convertToObjectAssignmentPattern(node);
}
}
@@ -13349,6 +13357,8 @@ function createNodeFactory(flags, baseFactory2) {
updatePropertyDeclaration,
createAnnotationPropertyDeclaration,
updateAnnotationPropertyDeclaration,
+ createOverloadPropertyDeclaration,
+ updateOverloadPropertyDeclaration,
createMethodSignature,
updateMethodSignature,
createMethodDeclaration,
@@ -13544,6 +13554,8 @@ function createNodeFactory(flags, baseFactory2) {
updateStructDeclaration,
createAnnotationDeclaration,
updateAnnotationDeclaration,
+ createOverloadDeclaration,
+ updateOverloadDeclaration,
createInterfaceDeclaration,
updateInterfaceDeclaration,
createTypeAliasDeclaration,
@@ -13590,40 +13602,40 @@ function createNodeFactory(flags, baseFactory2) {
createExternalModuleReference,
updateExternalModuleReference,
get createJSDocAllType() {
- return getJSDocPrimaryTypeCreateFunction(321 /* JSDocAllType */);
+ return getJSDocPrimaryTypeCreateFunction(324 /* JSDocAllType */);
},
get createJSDocUnknownType() {
- return getJSDocPrimaryTypeCreateFunction(322 /* JSDocUnknownType */);
+ return getJSDocPrimaryTypeCreateFunction(325 /* JSDocUnknownType */);
},
get createJSDocNonNullableType() {
- return getJSDocPrePostfixUnaryTypeCreateFunction(324 /* JSDocNonNullableType */);
+ return getJSDocPrePostfixUnaryTypeCreateFunction(327 /* JSDocNonNullableType */);
},
get updateJSDocNonNullableType() {
- return getJSDocPrePostfixUnaryTypeUpdateFunction(324 /* JSDocNonNullableType */);
+ return getJSDocPrePostfixUnaryTypeUpdateFunction(327 /* JSDocNonNullableType */);
},
get createJSDocNullableType() {
- return getJSDocPrePostfixUnaryTypeCreateFunction(323 /* JSDocNullableType */);
+ return getJSDocPrePostfixUnaryTypeCreateFunction(326 /* JSDocNullableType */);
},
get updateJSDocNullableType() {
- return getJSDocPrePostfixUnaryTypeUpdateFunction(323 /* JSDocNullableType */);
+ return getJSDocPrePostfixUnaryTypeUpdateFunction(326 /* JSDocNullableType */);
},
get createJSDocOptionalType() {
- return getJSDocUnaryTypeCreateFunction(325 /* JSDocOptionalType */);
+ return getJSDocUnaryTypeCreateFunction(328 /* JSDocOptionalType */);
},
get updateJSDocOptionalType() {
- return getJSDocUnaryTypeUpdateFunction(325 /* JSDocOptionalType */);
+ return getJSDocUnaryTypeUpdateFunction(328 /* JSDocOptionalType */);
},
get createJSDocVariadicType() {
- return getJSDocUnaryTypeCreateFunction(327 /* JSDocVariadicType */);
+ return getJSDocUnaryTypeCreateFunction(330 /* JSDocVariadicType */);
},
get updateJSDocVariadicType() {
- return getJSDocUnaryTypeUpdateFunction(327 /* JSDocVariadicType */);
+ return getJSDocUnaryTypeUpdateFunction(330 /* JSDocVariadicType */);
},
get createJSDocNamepathType() {
- return getJSDocUnaryTypeCreateFunction(328 /* JSDocNamepathType */);
+ return getJSDocUnaryTypeCreateFunction(331 /* JSDocNamepathType */);
},
get updateJSDocNamepathType() {
- return getJSDocUnaryTypeUpdateFunction(328 /* JSDocNamepathType */);
+ return getJSDocUnaryTypeUpdateFunction(331 /* JSDocNamepathType */);
},
createJSDocFunctionType,
updateJSDocFunctionType,
@@ -13660,76 +13672,76 @@ function createNodeFactory(flags, baseFactory2) {
createJSDocLinkPlain,
updateJSDocLinkPlain,
get createJSDocTypeTag() {
- return getJSDocTypeLikeTagCreateFunction(352 /* JSDocTypeTag */);
+ return getJSDocTypeLikeTagCreateFunction(355 /* JSDocTypeTag */);
},
get updateJSDocTypeTag() {
- return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocTypeTag */);
+ return getJSDocTypeLikeTagUpdateFunction(355 /* JSDocTypeTag */);
},
get createJSDocReturnTag() {
- return getJSDocTypeLikeTagCreateFunction(350 /* JSDocReturnTag */);
+ return getJSDocTypeLikeTagCreateFunction(353 /* JSDocReturnTag */);
},
get updateJSDocReturnTag() {
- return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocReturnTag */);
+ return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocReturnTag */);
},
get createJSDocThisTag() {
- return getJSDocTypeLikeTagCreateFunction(351 /* JSDocThisTag */);
+ return getJSDocTypeLikeTagCreateFunction(354 /* JSDocThisTag */);
},
get updateJSDocThisTag() {
- return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocThisTag */);
+ return getJSDocTypeLikeTagUpdateFunction(354 /* JSDocThisTag */);
},
get createJSDocEnumTag() {
- return getJSDocTypeLikeTagCreateFunction(348 /* JSDocEnumTag */);
+ return getJSDocTypeLikeTagCreateFunction(351 /* JSDocEnumTag */);
},
get updateJSDocEnumTag() {
- return getJSDocTypeLikeTagUpdateFunction(348 /* JSDocEnumTag */);
+ return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocEnumTag */);
},
get createJSDocAuthorTag() {
- return getJSDocSimpleTagCreateFunction(339 /* JSDocAuthorTag */);
+ return getJSDocSimpleTagCreateFunction(342 /* JSDocAuthorTag */);
},
get updateJSDocAuthorTag() {
- return getJSDocSimpleTagUpdateFunction(339 /* JSDocAuthorTag */);
+ return getJSDocSimpleTagUpdateFunction(342 /* JSDocAuthorTag */);
},
get createJSDocClassTag() {
- return getJSDocSimpleTagCreateFunction(341 /* JSDocClassTag */);
+ return getJSDocSimpleTagCreateFunction(344 /* JSDocClassTag */);
},
get updateJSDocClassTag() {
- return getJSDocSimpleTagUpdateFunction(341 /* JSDocClassTag */);
+ return getJSDocSimpleTagUpdateFunction(344 /* JSDocClassTag */);
},
get createJSDocPublicTag() {
- return getJSDocSimpleTagCreateFunction(342 /* JSDocPublicTag */);
+ return getJSDocSimpleTagCreateFunction(345 /* JSDocPublicTag */);
},
get updateJSDocPublicTag() {
- return getJSDocSimpleTagUpdateFunction(342 /* JSDocPublicTag */);
+ return getJSDocSimpleTagUpdateFunction(345 /* JSDocPublicTag */);
},
get createJSDocPrivateTag() {
- return getJSDocSimpleTagCreateFunction(343 /* JSDocPrivateTag */);
+ return getJSDocSimpleTagCreateFunction(346 /* JSDocPrivateTag */);
},
get updateJSDocPrivateTag() {
- return getJSDocSimpleTagUpdateFunction(343 /* JSDocPrivateTag */);
+ return getJSDocSimpleTagUpdateFunction(346 /* JSDocPrivateTag */);
},
get createJSDocProtectedTag() {
- return getJSDocSimpleTagCreateFunction(344 /* JSDocProtectedTag */);
+ return getJSDocSimpleTagCreateFunction(347 /* JSDocProtectedTag */);
},
get updateJSDocProtectedTag() {
- return getJSDocSimpleTagUpdateFunction(344 /* JSDocProtectedTag */);
+ return getJSDocSimpleTagUpdateFunction(347 /* JSDocProtectedTag */);
},
get createJSDocReadonlyTag() {
- return getJSDocSimpleTagCreateFunction(345 /* JSDocReadonlyTag */);
+ return getJSDocSimpleTagCreateFunction(348 /* JSDocReadonlyTag */);
},
get updateJSDocReadonlyTag() {
- return getJSDocSimpleTagUpdateFunction(345 /* JSDocReadonlyTag */);
+ return getJSDocSimpleTagUpdateFunction(348 /* JSDocReadonlyTag */);
},
get createJSDocOverrideTag() {
- return getJSDocSimpleTagCreateFunction(346 /* JSDocOverrideTag */);
+ return getJSDocSimpleTagCreateFunction(349 /* JSDocOverrideTag */);
},
get updateJSDocOverrideTag() {
- return getJSDocSimpleTagUpdateFunction(346 /* JSDocOverrideTag */);
+ return getJSDocSimpleTagUpdateFunction(349 /* JSDocOverrideTag */);
},
get createJSDocDeprecatedTag() {
- return getJSDocSimpleTagCreateFunction(340 /* JSDocDeprecatedTag */);
+ return getJSDocSimpleTagCreateFunction(343 /* JSDocDeprecatedTag */);
},
get updateJSDocDeprecatedTag() {
- return getJSDocSimpleTagUpdateFunction(340 /* JSDocDeprecatedTag */);
+ return getJSDocSimpleTagUpdateFunction(343 /* JSDocDeprecatedTag */);
},
createJSDocUnknownTag,
updateJSDocUnknownTag,
@@ -13980,12 +13992,13 @@ function createNodeFactory(flags, baseFactory2) {
}
if (name) {
switch (node.kind) {
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 305 /* PropertyAssignment */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 308 /* PropertyAssignment */:
if (isIdentifier(name)) {
node.transformFlags |= propagateIdentifierNameFlags(name);
break;
@@ -14252,7 +14265,7 @@ function createNodeFactory(flags, baseFactory2) {
return baseFactory2.createBaseTokenNode(kind);
}
function createToken(token) {
- Debug.assert(token >= 0 /* FirstToken */ && token <= 164 /* LastToken */, "Invalid token");
+ Debug.assert(token >= 0 /* FirstToken */ && token <= 165 /* LastToken */, "Invalid token");
Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals.");
Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals.");
Debug.assert(token !== 79 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers");
@@ -14356,7 +14369,7 @@ function createNodeFactory(flags, baseFactory2) {
return result.length ? result : void 0;
}
function createQualifiedName(left, right) {
- const node = createBaseNode(165 /* QualifiedName */);
+ const node = createBaseNode(166 /* QualifiedName */);
node.left = left;
node.right = asName(right);
node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right);
@@ -14366,7 +14379,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.right !== right ? update(createQualifiedName(left, right), node) : node;
}
function createComputedPropertyName(expression) {
- const node = createBaseNode(166 /* ComputedPropertyName */);
+ const node = createBaseNode(167 /* ComputedPropertyName */);
node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */;
return node;
@@ -14376,7 +14389,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) {
const node = createBaseNamedDeclaration(
- 167 /* TypeParameter */,
+ 168 /* TypeParameter */,
modifiers,
name
);
@@ -14390,7 +14403,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 168 /* Parameter */,
+ 169 /* Parameter */,
modifiers,
name,
type,
@@ -14415,7 +14428,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? update(createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer), node) : node;
}
function createDecorator(expression, annotationDeclaration) {
- const node = createBaseNode(169 /* Decorator */);
+ const node = createBaseNode(170 /* Decorator */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.annotationDeclaration = annotationDeclaration;
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */ | 8192 /* ContainsTypeScriptClassSyntax */ | 33554432 /* ContainsDecorators */;
@@ -14426,7 +14439,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertySignature(modifiers, name, questionToken, type) {
const node = createBaseNamedDeclaration(
- 170 /* PropertySignature */,
+ 171 /* PropertySignature */,
modifiers,
name
);
@@ -14439,6 +14452,21 @@ function createNodeFactory(flags, baseFactory2) {
function updatePropertySignature(node, modifiers, name, questionToken, type) {
return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature(modifiers, name, questionToken, type), node) : node;
}
+ function createOverloadPropertyDeclaration(modifiers, name, questionToken, type) {
+ const node = createBaseNamedDeclaration(
+ 174 /* OverloadPropertyDeclaration */,
+ modifiers,
+ name
+ );
+ node.type = type;
+ node.questionToken = questionToken;
+ node.transformFlags = 1 /* ContainsTypeScript */;
+ node.initializer = void 0;
+ return node;
+ }
+ function updateOverloadPropertyDeclaration(node, modifiers, name, questionToken, type) {
+ return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createOverloadPropertyDeclaration(modifiers, name, questionToken, type), node) : node;
+ }
function finishUpdatePropertySignature(updated, original) {
if (updated !== original) {
updated.initializer = original.initializer;
@@ -14447,7 +14475,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 171 /* PropertyDeclaration */,
+ 172 /* PropertyDeclaration */,
modifiers,
name,
type,
@@ -14469,7 +14497,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createAnnotationPropertyDeclaration(name, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
void 0,
name,
type,
@@ -14483,7 +14511,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 173 /* MethodSignature */,
+ 175 /* MethodSignature */,
modifiers,
name,
typeParameters,
@@ -14499,7 +14527,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 174 /* MethodDeclaration */,
+ 176 /* MethodDeclaration */,
modifiers,
name,
typeParameters,
@@ -14536,7 +14564,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassStaticBlockDeclaration(body) {
const node = createBaseGenericNamedDeclaration(
- 175 /* ClassStaticBlockDeclaration */,
+ 177 /* ClassStaticBlockDeclaration */,
void 0,
void 0,
void 0
@@ -14559,7 +14587,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructorDeclaration(modifiers, parameters, body) {
const node = createBaseFunctionLikeDeclaration(
- 176 /* Constructor */,
+ 178 /* Constructor */,
modifiers,
void 0,
void 0,
@@ -14586,7 +14614,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createGetAccessorDeclaration(modifiers, name, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 177 /* GetAccessor */,
+ 179 /* GetAccessor */,
modifiers,
name,
void 0,
@@ -14608,7 +14636,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createSetAccessorDeclaration(modifiers, name, parameters, body) {
const node = createBaseFunctionLikeDeclaration(
- 178 /* SetAccessor */,
+ 180 /* SetAccessor */,
modifiers,
name,
void 0,
@@ -14632,7 +14660,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createCallSignature(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 179 /* CallSignature */,
+ 181 /* CallSignature */,
void 0,
void 0,
typeParameters,
@@ -14647,7 +14675,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructSignature(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 180 /* ConstructSignature */,
+ 182 /* ConstructSignature */,
void 0,
void 0,
typeParameters,
@@ -14662,7 +14690,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createIndexSignature(modifiers, parameters, type) {
const node = createBaseSignatureDeclaration(
- 181 /* IndexSignature */,
+ 183 /* IndexSignature */,
modifiers,
void 0,
void 0,
@@ -14676,7 +14704,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature(modifiers, parameters, type), node) : node;
}
function createTemplateLiteralTypeSpan(type, literal) {
- const node = createBaseNode(204 /* TemplateLiteralTypeSpan */);
+ const node = createBaseNode(206 /* TemplateLiteralTypeSpan */);
node.type = type;
node.literal = literal;
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -14689,7 +14717,7 @@ function createNodeFactory(flags, baseFactory2) {
return createToken(kind);
}
function createTypePredicateNode(assertsModifier, parameterName, type) {
- const node = createBaseNode(182 /* TypePredicate */);
+ const node = createBaseNode(184 /* TypePredicate */);
node.assertsModifier = assertsModifier;
node.parameterName = asName(parameterName);
node.type = type;
@@ -14700,7 +14728,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode(assertsModifier, parameterName, type), node) : node;
}
function createTypeReferenceNode(typeName, typeArguments) {
- const node = createBaseNode(183 /* TypeReference */);
+ const node = createBaseNode(185 /* TypeReference */);
node.typeName = asName(typeName);
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments));
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -14711,7 +14739,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionTypeNode(typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 184 /* FunctionType */,
+ 186 /* FunctionType */,
void 0,
void 0,
typeParameters,
@@ -14736,7 +14764,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
- 185 /* ConstructorType */,
+ 187 /* ConstructorType */,
modifiers,
void 0,
typeParameters,
@@ -14759,7 +14787,7 @@ function createNodeFactory(flags, baseFactory2) {
return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);
}
function createTypeQueryNode(exprName, typeArguments) {
- const node = createBaseNode(186 /* TypeQuery */);
+ const node = createBaseNode(188 /* TypeQuery */);
node.exprName = exprName;
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -14769,7 +14797,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node;
}
function createTypeLiteralNode(members) {
- const node = createBaseNode(187 /* TypeLiteral */);
+ const node = createBaseNode(189 /* TypeLiteral */);
node.members = createNodeArray(members);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -14778,7 +14806,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.members !== members ? update(createTypeLiteralNode(members), node) : node;
}
function createArrayTypeNode(elementType) {
- const node = createBaseNode(188 /* ArrayType */);
+ const node = createBaseNode(190 /* ArrayType */);
node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -14787,7 +14815,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elementType !== elementType ? update(createArrayTypeNode(elementType), node) : node;
}
function createTupleTypeNode(elements) {
- const node = createBaseNode(189 /* TupleType */);
+ const node = createBaseNode(191 /* TupleType */);
node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements));
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -14796,7 +14824,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node;
}
function createNamedTupleMember(dotDotDotToken, name, questionToken, type) {
- const node = createBaseNode(202 /* NamedTupleMember */);
+ const node = createBaseNode(204 /* NamedTupleMember */);
node.dotDotDotToken = dotDotDotToken;
node.name = name;
node.questionToken = questionToken;
@@ -14808,7 +14836,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node) : node;
}
function createOptionalTypeNode(type) {
- const node = createBaseNode(190 /* OptionalType */);
+ const node = createBaseNode(192 /* OptionalType */);
node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -14817,7 +14845,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createOptionalTypeNode(type), node) : node;
}
function createRestTypeNode(type) {
- const node = createBaseNode(191 /* RestType */);
+ const node = createBaseNode(193 /* RestType */);
node.type = type;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -14835,19 +14863,19 @@ function createNodeFactory(flags, baseFactory2) {
return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node;
}
function createUnionTypeNode(types) {
- return createUnionOrIntersectionTypeNode(192 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
+ return createUnionOrIntersectionTypeNode(194 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
}
function updateUnionTypeNode(node, types) {
return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType);
}
function createIntersectionTypeNode(types) {
- return createUnionOrIntersectionTypeNode(193 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
+ return createUnionOrIntersectionTypeNode(195 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
}
function updateIntersectionTypeNode(node, types) {
return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType);
}
function createConditionalTypeNode(checkType, extendsType, trueType, falseType) {
- const node = createBaseNode(194 /* ConditionalType */);
+ const node = createBaseNode(196 /* ConditionalType */);
node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType);
node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType);
node.trueType = trueType;
@@ -14859,7 +14887,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) : node;
}
function createInferTypeNode(typeParameter) {
- const node = createBaseNode(195 /* InferType */);
+ const node = createBaseNode(197 /* InferType */);
node.typeParameter = typeParameter;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -14868,7 +14896,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.typeParameter !== typeParameter ? update(createInferTypeNode(typeParameter), node) : node;
}
function createTemplateLiteralType(head, templateSpans) {
- const node = createBaseNode(203 /* TemplateLiteralType */);
+ const node = createBaseNode(205 /* TemplateLiteralType */);
node.head = head;
node.templateSpans = createNodeArray(templateSpans);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -14878,7 +14906,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
}
function createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf = false) {
- const node = createBaseNode(205 /* ImportType */);
+ const node = createBaseNode(207 /* ImportType */);
node.argument = argument;
node.assertions = assertions;
node.qualifier = qualifier;
@@ -14891,7 +14919,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node;
}
function createParenthesizedType(type) {
- const node = createBaseNode(196 /* ParenthesizedType */);
+ const node = createBaseNode(198 /* ParenthesizedType */);
node.type = type;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -14900,12 +14928,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createParenthesizedType(type), node) : node;
}
function createThisTypeNode() {
- const node = createBaseNode(197 /* ThisType */);
+ const node = createBaseNode(199 /* ThisType */);
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
}
function createTypeOperatorNode(operator, type) {
- const node = createBaseNode(198 /* TypeOperator */);
+ const node = createBaseNode(200 /* TypeOperator */);
node.operator = operator;
node.type = operator === 147 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type);
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -14915,7 +14943,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createTypeOperatorNode(node.operator, type), node) : node;
}
function createIndexedAccessTypeNode(objectType, indexType) {
- const node = createBaseNode(199 /* IndexedAccessType */);
+ const node = createBaseNode(201 /* IndexedAccessType */);
node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType);
node.indexType = indexType;
node.transformFlags = 1 /* ContainsTypeScript */;
@@ -14925,7 +14953,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node;
}
function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) {
- const node = createBaseNode(200 /* MappedType */);
+ const node = createBaseNode(202 /* MappedType */);
node.readonlyToken = readonlyToken;
node.typeParameter = typeParameter;
node.nameType = nameType;
@@ -14939,7 +14967,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node;
}
function createLiteralTypeNode(literal) {
- const node = createBaseNode(201 /* LiteralType */);
+ const node = createBaseNode(203 /* LiteralType */);
node.literal = literal;
node.transformFlags = 1 /* ContainsTypeScript */;
return node;
@@ -14948,7 +14976,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.literal !== literal ? update(createLiteralTypeNode(literal), node) : node;
}
function createObjectBindingPattern(elements) {
- const node = createBaseNode(206 /* ObjectBindingPattern */);
+ const node = createBaseNode(208 /* ObjectBindingPattern */);
node.elements = createNodeArray(elements);
node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */;
if (node.transformFlags & 32768 /* ContainsRestOrSpread */) {
@@ -14960,7 +14988,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createObjectBindingPattern(elements), node) : node;
}
function createArrayBindingPattern(elements) {
- const node = createBaseNode(207 /* ArrayBindingPattern */);
+ const node = createBaseNode(209 /* ArrayBindingPattern */);
node.elements = createNodeArray(elements);
node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */;
return node;
@@ -14970,7 +14998,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createBindingElement(dotDotDotToken, propertyName, name, initializer) {
const node = createBaseBindingLikeDeclaration(
- 208 /* BindingElement */,
+ 210 /* BindingElement */,
void 0,
name,
initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
@@ -14993,7 +15021,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createArrayLiteralExpression(elements, multiLine) {
- const node = createBaseExpression(209 /* ArrayLiteralExpression */);
+ const node = createBaseExpression(211 /* ArrayLiteralExpression */);
const lastElement = elements && lastOrUndefined(elements);
const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0);
node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray);
@@ -15005,7 +15033,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node;
}
function createObjectLiteralExpression(properties, multiLine) {
- const node = createBaseExpression(210 /* ObjectLiteralExpression */);
+ const node = createBaseExpression(212 /* ObjectLiteralExpression */);
node.properties = createNodeArray(properties);
node.multiLine = multiLine;
node.transformFlags |= propagateChildrenFlags(node.properties);
@@ -15015,7 +15043,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node;
}
function createPropertyAccessExpression(expression, name) {
- const node = createBaseExpression(211 /* PropertyAccessExpression */);
+ const node = createBaseExpression(213 /* PropertyAccessExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.name = asName(name);
node.transformFlags = propagateChildFlags(node.expression) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
@@ -15031,7 +15059,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node;
}
function createPropertyAccessChain(expression, questionDotToken, name) {
- const node = createBaseExpression(211 /* PropertyAccessExpression */);
+ const node = createBaseExpression(213 /* PropertyAccessExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -15044,7 +15072,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain(expression, questionDotToken, name), node) : node;
}
function createElementAccessExpression(expression, index) {
- const node = createBaseExpression(212 /* ElementAccessExpression */);
+ const node = createBaseExpression(214 /* ElementAccessExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.argumentExpression = asExpression(index);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.argumentExpression);
@@ -15060,7 +15088,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node;
}
function createElementAccessChain(expression, questionDotToken, index) {
- const node = createBaseExpression(212 /* ElementAccessExpression */);
+ const node = createBaseExpression(214 /* ElementAccessExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -15073,7 +15101,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node;
}
function createCallExpression(expression, typeArguments, argumentsArray) {
- const node = createBaseExpression(213 /* CallExpression */);
+ const node = createBaseExpression(215 /* CallExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
@@ -15095,7 +15123,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node;
}
function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) {
- const node = createBaseExpression(213 /* CallExpression */);
+ const node = createBaseExpression(215 /* CallExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.questionDotToken = questionDotToken;
@@ -15115,7 +15143,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node;
}
function createNewExpression(expression, typeArguments, argumentsArray) {
- const node = createBaseExpression(214 /* NewExpression */);
+ const node = createBaseExpression(216 /* NewExpression */);
node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0;
@@ -15129,7 +15157,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createNewExpression(expression, typeArguments, argumentsArray), node) : node;
}
function createTaggedTemplateExpression(tag, typeArguments, template) {
- const node = createBaseExpression(215 /* TaggedTemplateExpression */);
+ const node = createBaseExpression(217 /* TaggedTemplateExpression */);
node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag, false);
node.typeArguments = asNodeArray(typeArguments);
node.template = template;
@@ -15146,7 +15174,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node;
}
function createTypeAssertion(type, expression) {
- const node = createBaseExpression(216 /* TypeAssertionExpression */);
+ const node = createBaseExpression(218 /* TypeAssertionExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -15156,7 +15184,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node;
}
function createParenthesizedExpression(expression) {
- const node = createBaseExpression(217 /* ParenthesizedExpression */);
+ const node = createBaseExpression(219 /* ParenthesizedExpression */);
node.expression = expression;
node.transformFlags = propagateChildFlags(node.expression);
return node;
@@ -15166,7 +15194,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 218 /* FunctionExpression */,
+ 220 /* FunctionExpression */,
modifiers,
name,
typeParameters,
@@ -15194,7 +15222,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node;
}
function createEtsComponentExpression(name, argumentsArray, body) {
- const node = createBaseExpression(220 /* EtsComponentExpression */);
+ const node = createBaseExpression(222 /* EtsComponentExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(name);
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
node.body = body;
@@ -15205,7 +15233,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
const node = createBaseFunctionLikeDeclaration(
- 219 /* ArrowFunction */,
+ 221 /* ArrowFunction */,
modifiers,
void 0,
typeParameters,
@@ -15224,7 +15252,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node;
}
function createDeleteExpression(expression) {
- const node = createBaseExpression(221 /* DeleteExpression */);
+ const node = createBaseExpression(223 /* DeleteExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -15233,7 +15261,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createDeleteExpression(expression), node) : node;
}
function createTypeOfExpression(expression) {
- const node = createBaseExpression(222 /* TypeOfExpression */);
+ const node = createBaseExpression(224 /* TypeOfExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -15242,7 +15270,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node;
}
function createVoidExpression(expression) {
- const node = createBaseExpression(223 /* VoidExpression */);
+ const node = createBaseExpression(225 /* VoidExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -15251,7 +15279,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createVoidExpression(expression), node) : node;
}
function createAwaitExpression(expression) {
- const node = createBaseExpression(224 /* AwaitExpression */);
+ const node = createBaseExpression(226 /* AwaitExpression */);
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */;
return node;
@@ -15260,7 +15288,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createAwaitExpression(expression), node) : node;
}
function createPrefixUnaryExpression(operator, operand) {
- const node = createBaseExpression(225 /* PrefixUnaryExpression */);
+ const node = createBaseExpression(227 /* PrefixUnaryExpression */);
node.operator = operator;
node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand);
node.transformFlags |= propagateChildFlags(node.operand);
@@ -15273,7 +15301,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node;
}
function createPostfixUnaryExpression(operand, operator) {
- const node = createBaseExpression(226 /* PostfixUnaryExpression */);
+ const node = createBaseExpression(228 /* PostfixUnaryExpression */);
node.operator = operator;
node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand);
node.transformFlags |= propagateChildFlags(node.operand);
@@ -15286,7 +15314,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node;
}
function createBinaryExpression(left, operator, right) {
- const node = createBaseExpression(227 /* BinaryExpression */);
+ const node = createBaseExpression(229 /* BinaryExpression */);
const operatorToken = asToken(operator);
const operatorKind = operatorToken.kind;
node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left);
@@ -15335,7 +15363,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node;
}
function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) {
- const node = createBaseExpression(228 /* ConditionalExpression */);
+ const node = createBaseExpression(230 /* ConditionalExpression */);
node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition);
node.questionToken = questionToken != null ? questionToken : createToken(57 /* QuestionToken */);
node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue);
@@ -15348,7 +15376,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node;
}
function createTemplateExpression(head, templateSpans) {
- const node = createBaseExpression(229 /* TemplateExpression */);
+ const node = createBaseExpression(231 /* TemplateExpression */);
node.head = head;
node.templateSpans = createNodeArray(templateSpans);
node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */;
@@ -15401,7 +15429,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createYieldExpression(asteriskToken, expression) {
Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression.");
- const node = createBaseExpression(230 /* YieldExpression */);
+ const node = createBaseExpression(232 /* YieldExpression */);
node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.asteriskToken = asteriskToken;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */;
@@ -15411,7 +15439,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node;
}
function createSpreadElement(expression) {
- const node = createBaseExpression(231 /* SpreadElement */);
+ const node = createBaseExpression(233 /* SpreadElement */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */;
return node;
@@ -15421,7 +15449,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 232 /* ClassExpression */,
+ 234 /* ClassExpression */,
modifiers,
name,
typeParameters,
@@ -15435,10 +15463,10 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) : node;
}
function createOmittedExpression() {
- return createBaseExpression(233 /* OmittedExpression */);
+ return createBaseExpression(235 /* OmittedExpression */);
}
function createExpressionWithTypeArguments(expression, typeArguments) {
- const node = createBaseNode(234 /* ExpressionWithTypeArguments */);
+ const node = createBaseNode(236 /* ExpressionWithTypeArguments */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | 1024 /* ContainsES2015 */;
@@ -15448,7 +15476,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node;
}
function createAsExpression(expression, type) {
- const node = createBaseExpression(235 /* AsExpression */);
+ const node = createBaseExpression(237 /* AsExpression */);
node.expression = expression;
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -15458,7 +15486,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node;
}
function createNonNullExpression(expression) {
- const node = createBaseExpression(236 /* NonNullExpression */);
+ const node = createBaseExpression(238 /* NonNullExpression */);
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
return node;
@@ -15470,7 +15498,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createNonNullExpression(expression), node) : node;
}
function createSatisfiesExpression(expression, type) {
- const node = createBaseExpression(239 /* SatisfiesExpression */);
+ const node = createBaseExpression(241 /* SatisfiesExpression */);
node.expression = expression;
node.type = type;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -15480,7 +15508,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node;
}
function createNonNullChain(expression) {
- const node = createBaseExpression(236 /* NonNullExpression */);
+ const node = createBaseExpression(238 /* NonNullExpression */);
node.flags |= 32 /* OptionalChain */;
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -15491,7 +15519,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createNonNullChain(expression), node) : node;
}
function createMetaProperty(keywordToken, name) {
- const node = createBaseExpression(237 /* MetaProperty */);
+ const node = createBaseExpression(239 /* MetaProperty */);
node.keywordToken = keywordToken;
node.name = name;
node.transformFlags |= propagateChildFlags(node.name);
@@ -15511,7 +15539,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createMetaProperty(node.keywordToken, name), node) : node;
}
function createTemplateSpan(expression, literal) {
- const node = createBaseNode(240 /* TemplateSpan */);
+ const node = createBaseNode(242 /* TemplateSpan */);
node.expression = expression;
node.literal = literal;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */;
@@ -15521,12 +15549,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan(expression, literal), node) : node;
}
function createSemicolonClassElement() {
- const node = createBaseNode(241 /* SemicolonClassElement */);
+ const node = createBaseNode(243 /* SemicolonClassElement */);
node.transformFlags |= 1024 /* ContainsES2015 */;
return node;
}
function createBlock(statements, multiLine) {
- const node = createBaseNode(242 /* Block */);
+ const node = createBaseNode(244 /* Block */);
node.statements = createNodeArray(statements);
node.multiLine = multiLine;
node.transformFlags |= propagateChildrenFlags(node.statements);
@@ -15536,7 +15564,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node;
}
function createVariableStatement(modifiers, declarationList) {
- const node = createBaseDeclaration(244 /* VariableStatement */);
+ const node = createBaseDeclaration(246 /* VariableStatement */);
node.modifiers = asNodeArray(modifiers);
node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList);
@@ -15549,10 +15577,10 @@ function createNodeFactory(flags, baseFactory2) {
return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node;
}
function createEmptyStatement() {
- return createBaseNode(243 /* EmptyStatement */);
+ return createBaseNode(245 /* EmptyStatement */);
}
function createExpressionStatement(expression) {
- const node = createBaseNode(245 /* ExpressionStatement */);
+ const node = createBaseNode(247 /* ExpressionStatement */);
node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -15561,7 +15589,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createExpressionStatement(expression), node) : node;
}
function createIfStatement(expression, thenStatement, elseStatement) {
- const node = createBaseNode(246 /* IfStatement */);
+ const node = createBaseNode(248 /* IfStatement */);
node.expression = expression;
node.thenStatement = asEmbeddedStatement(thenStatement);
node.elseStatement = asEmbeddedStatement(elseStatement);
@@ -15572,7 +15600,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? update(createIfStatement(expression, thenStatement, elseStatement), node) : node;
}
function createDoStatement(statement, expression) {
- const node = createBaseNode(247 /* DoStatement */);
+ const node = createBaseNode(249 /* DoStatement */);
node.statement = asEmbeddedStatement(statement);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression);
@@ -15582,7 +15610,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statement !== statement || node.expression !== expression ? update(createDoStatement(statement, expression), node) : node;
}
function createWhileStatement(expression, statement) {
- const node = createBaseNode(248 /* WhileStatement */);
+ const node = createBaseNode(250 /* WhileStatement */);
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
@@ -15592,7 +15620,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statement !== statement ? update(createWhileStatement(expression, statement), node) : node;
}
function createForStatement(initializer, condition, incrementor, statement) {
- const node = createBaseNode(249 /* ForStatement */);
+ const node = createBaseNode(251 /* ForStatement */);
node.initializer = initializer;
node.condition = condition;
node.incrementor = incrementor;
@@ -15604,7 +15632,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement ? update(createForStatement(initializer, condition, incrementor, statement), node) : node;
}
function createForInStatement(initializer, expression, statement) {
- const node = createBaseNode(250 /* ForInStatement */);
+ const node = createBaseNode(252 /* ForInStatement */);
node.initializer = initializer;
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
@@ -15615,7 +15643,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForInStatement(initializer, expression, statement), node) : node;
}
function createForOfStatement(awaitModifier, initializer, expression, statement) {
- const node = createBaseNode(251 /* ForOfStatement */);
+ const node = createBaseNode(253 /* ForOfStatement */);
node.awaitModifier = awaitModifier;
node.initializer = initializer;
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
@@ -15629,7 +15657,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForOfStatement(awaitModifier, initializer, expression, statement), node) : node;
}
function createContinueStatement(label) {
- const node = createBaseNode(252 /* ContinueStatement */);
+ const node = createBaseNode(254 /* ContinueStatement */);
node.label = asName(label);
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -15638,7 +15666,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label ? update(createContinueStatement(label), node) : node;
}
function createBreakStatement(label) {
- const node = createBaseNode(253 /* BreakStatement */);
+ const node = createBaseNode(255 /* BreakStatement */);
node.label = asName(label);
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -15647,7 +15675,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label ? update(createBreakStatement(label), node) : node;
}
function createReturnStatement(expression) {
- const node = createBaseNode(254 /* ReturnStatement */);
+ const node = createBaseNode(256 /* ReturnStatement */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
return node;
@@ -15656,7 +15684,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createReturnStatement(expression), node) : node;
}
function createWithStatement(expression, statement) {
- const node = createBaseNode(255 /* WithStatement */);
+ const node = createBaseNode(257 /* WithStatement */);
node.expression = expression;
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
@@ -15666,7 +15694,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statement !== statement ? update(createWithStatement(expression, statement), node) : node;
}
function createSwitchStatement(expression, caseBlock) {
- const node = createBaseNode(256 /* SwitchStatement */);
+ const node = createBaseNode(258 /* SwitchStatement */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.caseBlock = caseBlock;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock);
@@ -15676,7 +15704,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.caseBlock !== caseBlock ? update(createSwitchStatement(expression, caseBlock), node) : node;
}
function createLabeledStatement(label, statement) {
- const node = createBaseNode(257 /* LabeledStatement */);
+ const node = createBaseNode(259 /* LabeledStatement */);
node.label = asName(label);
node.statement = asEmbeddedStatement(statement);
node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement);
@@ -15686,7 +15714,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.label !== label || node.statement !== statement ? update(createLabeledStatement(label, statement), node) : node;
}
function createThrowStatement(expression) {
- const node = createBaseNode(258 /* ThrowStatement */);
+ const node = createBaseNode(260 /* ThrowStatement */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression);
return node;
@@ -15695,7 +15723,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createThrowStatement(expression), node) : node;
}
function createTryStatement(tryBlock, catchClause, finallyBlock) {
- const node = createBaseNode(259 /* TryStatement */);
+ const node = createBaseNode(261 /* TryStatement */);
node.tryBlock = tryBlock;
node.catchClause = catchClause;
node.finallyBlock = finallyBlock;
@@ -15706,11 +15734,11 @@ function createNodeFactory(flags, baseFactory2) {
return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node;
}
function createDebuggerStatement() {
- return createBaseNode(260 /* DebuggerStatement */);
+ return createBaseNode(262 /* DebuggerStatement */);
}
function createVariableDeclaration(name, exclamationToken, type, initializer) {
const node = createBaseVariableLikeDeclaration(
- 261 /* VariableDeclaration */,
+ 263 /* VariableDeclaration */,
void 0,
name,
type,
@@ -15727,7 +15755,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration(name, exclamationToken, type, initializer), node) : node;
}
function createVariableDeclarationList(declarations, flags2 = 0 /* None */) {
- const node = createBaseNode(262 /* VariableDeclarationList */);
+ const node = createBaseNode(264 /* VariableDeclarationList */);
node.flags |= flags2 & 3 /* BlockScoped */;
node.declarations = createNodeArray(declarations);
node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
@@ -15741,7 +15769,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
const node = createBaseFunctionLikeDeclaration(
- 263 /* FunctionDeclaration */,
+ 265 /* FunctionDeclaration */,
modifiers,
name,
typeParameters,
@@ -15778,7 +15806,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 264 /* ClassDeclaration */,
+ 266 /* ClassDeclaration */,
modifiers,
name,
typeParameters,
@@ -15800,7 +15828,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createStructDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseClassLikeDeclaration(
- 265 /* StructDeclaration */,
+ 267 /* StructDeclaration */,
modifiers,
name,
typeParameters,
@@ -15822,7 +15850,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createAnnotationDeclaration(modifiers, name, members) {
const node = createBaseNamedDeclaration(
- 266 /* AnnotationDeclaration */,
+ 268 /* AnnotationDeclaration */,
modifiers,
name
);
@@ -15839,9 +15867,28 @@ function createNodeFactory(flags, baseFactory2) {
function updateAnnotationDeclaration(node, modifiers, name, members) {
return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createAnnotationDeclaration(modifiers, name, members), node) : node;
}
+ function createOverloadDeclaration(modifiers, name, members) {
+ const node = createBaseNamedDeclaration(
+ 269 /* OverloadDeclaration */,
+ modifiers,
+ name
+ );
+ node.members = createNodeArray(members);
+ node.transformFlags |= propagateChildrenFlags(node.members);
+ if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
+ node.transformFlags = 1 /* ContainsTypeScript */;
+ } else {
+ node.transformFlags |= 1024 /* ContainsES2015 */;
+ node.transformFlags |= 1 /* ContainsTypeScript */;
+ }
+ return node;
+ }
+ function updateOverloadDeclaration(node, modifiers, name, members) {
+ return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createOverloadDeclaration(modifiers, name, members), node) : node;
+ }
function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
const node = createBaseInterfaceOrClassLikeDeclaration(
- 267 /* InterfaceDeclaration */,
+ 270 /* InterfaceDeclaration */,
modifiers,
name,
typeParameters,
@@ -15863,7 +15910,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createTypeAliasDeclaration(modifiers, name, typeParameters, type) {
const node = createBaseGenericNamedDeclaration(
- 268 /* TypeAliasDeclaration */,
+ 271 /* TypeAliasDeclaration */,
modifiers,
name,
typeParameters
@@ -15884,7 +15931,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createEnumDeclaration(modifiers, name, members) {
const node = createBaseNamedDeclaration(
- 269 /* EnumDeclaration */,
+ 272 /* EnumDeclaration */,
modifiers,
name
);
@@ -15904,7 +15951,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createModuleDeclaration(modifiers, name, body, flags2 = 0 /* None */) {
- const node = createBaseDeclaration(270 /* ModuleDeclaration */);
+ const node = createBaseDeclaration(273 /* ModuleDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.flags |= flags2 & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */);
node.name = name;
@@ -15928,7 +15975,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createModuleBlock(statements) {
- const node = createBaseNode(271 /* ModuleBlock */);
+ const node = createBaseNode(274 /* ModuleBlock */);
node.statements = createNodeArray(statements);
node.transformFlags |= propagateChildrenFlags(node.statements);
return node;
@@ -15937,7 +15984,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createModuleBlock(statements), node) : node;
}
function createCaseBlock(clauses) {
- const node = createBaseNode(272 /* CaseBlock */);
+ const node = createBaseNode(275 /* CaseBlock */);
node.clauses = createNodeArray(clauses);
node.transformFlags |= propagateChildrenFlags(node.clauses);
return node;
@@ -15947,7 +15994,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createNamespaceExportDeclaration(name) {
const node = createBaseNamedDeclaration(
- 273 /* NamespaceExportDeclaration */,
+ 276 /* NamespaceExportDeclaration */,
void 0,
name
);
@@ -15968,7 +16015,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) {
const node = createBaseNamedDeclaration(
- 274 /* ImportEqualsDeclaration */,
+ 277 /* ImportEqualsDeclaration */,
modifiers,
name
);
@@ -15991,7 +16038,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) {
- const node = createBaseDeclaration(275 /* ImportDeclaration */);
+ const node = createBaseDeclaration(278 /* ImportDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.importClause = importClause;
node.moduleSpecifier = moduleSpecifier;
@@ -16011,7 +16058,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createImportClause(isTypeOnly, name, namedBindings) {
- const node = createBaseNode(276 /* ImportClause */);
+ const node = createBaseNode(279 /* ImportClause */);
node.isTypeOnly = isTypeOnly;
node.name = name;
node.namedBindings = namedBindings;
@@ -16033,7 +16080,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createAssertClause(elements, multiLine) {
- const node = createBaseNode(302 /* AssertClause */);
+ const node = createBaseNode(305 /* AssertClause */);
node.elements = createNodeArray(elements);
node.multiLine = multiLine;
node.transformFlags |= 4 /* ContainsESNext */;
@@ -16043,7 +16090,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements || node.multiLine !== multiLine ? update(createAssertClause(elements, multiLine), node) : node;
}
function createAssertEntry(name, value) {
- const node = createBaseNode(303 /* AssertEntry */);
+ const node = createBaseNode(306 /* AssertEntry */);
node.name = name;
node.value = value;
node.transformFlags |= 4 /* ContainsESNext */;
@@ -16053,7 +16100,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.value !== value ? update(createAssertEntry(name, value), node) : node;
}
function createImportTypeAssertionContainer(clause, multiLine) {
- const node = createBaseNode(304 /* ImportTypeAssertionContainer */);
+ const node = createBaseNode(307 /* ImportTypeAssertionContainer */);
node.assertClause = clause;
node.multiLine = multiLine;
return node;
@@ -16062,7 +16109,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
}
function createNamespaceImport(name) {
- const node = createBaseNode(277 /* NamespaceImport */);
+ const node = createBaseNode(280 /* NamespaceImport */);
node.name = name;
node.transformFlags |= propagateChildFlags(node.name);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -16072,7 +16119,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createNamespaceImport(name), node) : node;
}
function createNamespaceExport(name) {
- const node = createBaseNode(283 /* NamespaceExport */);
+ const node = createBaseNode(286 /* NamespaceExport */);
node.name = name;
node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */;
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -16082,7 +16129,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createNamespaceExport(name), node) : node;
}
function createNamedImports(elements) {
- const node = createBaseNode(278 /* NamedImports */);
+ const node = createBaseNode(281 /* NamedImports */);
node.elements = createNodeArray(elements);
node.transformFlags |= propagateChildrenFlags(node.elements);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -16092,7 +16139,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createNamedImports(elements), node) : node;
}
function createImportSpecifier(isTypeOnly, propertyName, name) {
- const node = createBaseNode(279 /* ImportSpecifier */);
+ const node = createBaseNode(282 /* ImportSpecifier */);
node.isTypeOnly = isTypeOnly;
node.propertyName = propertyName;
node.name = name;
@@ -16104,7 +16151,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier(isTypeOnly, propertyName, name), node) : node;
}
function createExportAssignment(modifiers, isExportEquals, expression) {
- const node = createBaseDeclaration(280 /* ExportAssignment */);
+ const node = createBaseDeclaration(283 /* ExportAssignment */);
node.modifiers = asNodeArray(modifiers);
node.isExportEquals = isExportEquals;
node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary(63 /* EqualsToken */, void 0, expression) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression);
@@ -16123,7 +16170,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
- const node = createBaseDeclaration(281 /* ExportDeclaration */);
+ const node = createBaseDeclaration(284 /* ExportDeclaration */);
node.modifiers = asNodeArray(modifiers);
node.isTypeOnly = isTypeOnly;
node.exportClause = exportClause;
@@ -16144,7 +16191,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createNamedExports(elements) {
- const node = createBaseNode(282 /* NamedExports */);
+ const node = createBaseNode(285 /* NamedExports */);
node.elements = createNodeArray(elements);
node.transformFlags |= propagateChildrenFlags(node.elements);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -16154,7 +16201,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createNamedExports(elements), node) : node;
}
function createExportSpecifier(isTypeOnly, propertyName, name) {
- const node = createBaseNode(284 /* ExportSpecifier */);
+ const node = createBaseNode(287 /* ExportSpecifier */);
node.isTypeOnly = isTypeOnly;
node.propertyName = asName(propertyName);
node.name = asName(name);
@@ -16166,11 +16213,11 @@ function createNodeFactory(flags, baseFactory2) {
return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier(isTypeOnly, propertyName, name), node) : node;
}
function createMissingDeclaration() {
- const node = createBaseDeclaration(285 /* MissingDeclaration */);
+ const node = createBaseDeclaration(288 /* MissingDeclaration */);
return node;
}
function createExternalModuleReference(expression) {
- const node = createBaseNode(286 /* ExternalModuleReference */);
+ const node = createBaseNode(289 /* ExternalModuleReference */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression);
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -16203,7 +16250,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createJSDocFunctionType(parameters, type) {
const node = createBaseSignatureDeclaration(
- 326 /* JSDocFunctionType */,
+ 329 /* JSDocFunctionType */,
void 0,
void 0,
void 0,
@@ -16216,7 +16263,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node;
}
function createJSDocTypeLiteral(propertyTags, isArrayType = false) {
- const node = createBaseNode(331 /* JSDocTypeLiteral */);
+ const node = createBaseNode(334 /* JSDocTypeLiteral */);
node.jsDocPropertyTags = asNodeArray(propertyTags);
node.isArrayType = isArrayType;
return node;
@@ -16225,7 +16272,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral(propertyTags, isArrayType), node) : node;
}
function createJSDocTypeExpression(type) {
- const node = createBaseNode(318 /* JSDocTypeExpression */);
+ const node = createBaseNode(321 /* JSDocTypeExpression */);
node.type = type;
return node;
}
@@ -16233,7 +16280,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.type !== type ? update(createJSDocTypeExpression(type), node) : node;
}
function createJSDocSignature(typeParameters, parameters, type) {
- const node = createBaseNode(332 /* JSDocSignature */);
+ const node = createBaseNode(335 /* JSDocSignature */);
node.typeParameters = asNodeArray(typeParameters);
node.parameters = createNodeArray(parameters);
node.type = type;
@@ -16253,7 +16300,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) {
- const node = createBaseJSDocTag(353 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier("template"), comment);
+ const node = createBaseJSDocTag(356 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier("template"), comment);
node.constraint = constraint;
node.typeParameters = createNodeArray(typeParameters);
return node;
@@ -16262,7 +16309,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node;
}
function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) {
- const node = createBaseJSDocTag(354 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment);
+ const node = createBaseJSDocTag(357 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment);
node.typeExpression = typeExpression;
node.fullName = fullName;
node.name = getJSDocTypeAliasName(fullName);
@@ -16272,7 +16319,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node;
}
function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
- const node = createBaseJSDocTag(349 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment);
+ const node = createBaseJSDocTag(352 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment);
node.typeExpression = typeExpression;
node.name = name;
node.isNameFirst = !!isNameFirst;
@@ -16283,7 +16330,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node;
}
function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
- const node = createBaseJSDocTag(356 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment);
+ const node = createBaseJSDocTag(359 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment);
node.typeExpression = typeExpression;
node.name = name;
node.isNameFirst = !!isNameFirst;
@@ -16294,7 +16341,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node;
}
function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) {
- const node = createBaseJSDocTag(347 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment);
+ const node = createBaseJSDocTag(350 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment);
node.typeExpression = typeExpression;
node.fullName = fullName;
node.name = getJSDocTypeAliasName(fullName);
@@ -16304,7 +16351,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node;
}
function createJSDocAugmentsTag(tagName, className, comment) {
- const node = createBaseJSDocTag(337 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier("augments"), comment);
+ const node = createBaseJSDocTag(340 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier("augments"), comment);
node.class = className;
return node;
}
@@ -16312,12 +16359,12 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag(tagName, className, comment), node) : node;
}
function createJSDocImplementsTag(tagName, className, comment) {
- const node = createBaseJSDocTag(338 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier("implements"), comment);
+ const node = createBaseJSDocTag(341 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier("implements"), comment);
node.class = className;
return node;
}
function createJSDocSeeTag(tagName, name, comment) {
- const node = createBaseJSDocTag(355 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier("see"), comment);
+ const node = createBaseJSDocTag(358 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier("see"), comment);
node.name = name;
return node;
}
@@ -16325,7 +16372,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.name !== name || node.comment !== comment ? update(createJSDocSeeTag(tagName, name, comment), node) : node;
}
function createJSDocNameReference(name) {
- const node = createBaseNode(319 /* JSDocNameReference */);
+ const node = createBaseNode(322 /* JSDocNameReference */);
node.name = name;
return node;
}
@@ -16333,7 +16380,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocNameReference(name), node) : node;
}
function createJSDocMemberName(left, right) {
- const node = createBaseNode(320 /* JSDocMemberName */);
+ const node = createBaseNode(323 /* JSDocMemberName */);
node.left = left;
node.right = right;
node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.right);
@@ -16343,7 +16390,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.left !== left || node.right !== right ? update(createJSDocMemberName(left, right), node) : node;
}
function createJSDocLink(name, text) {
- const node = createBaseNode(333 /* JSDocLink */);
+ const node = createBaseNode(336 /* JSDocLink */);
node.name = name;
node.text = text;
return node;
@@ -16352,7 +16399,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocLink(name, text), node) : node;
}
function createJSDocLinkCode(name, text) {
- const node = createBaseNode(334 /* JSDocLinkCode */);
+ const node = createBaseNode(337 /* JSDocLinkCode */);
node.name = name;
node.text = text;
return node;
@@ -16361,7 +16408,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name ? update(createJSDocLinkCode(name, text), node) : node;
}
function createJSDocLinkPlain(name, text) {
- const node = createBaseNode(335 /* JSDocLinkPlain */);
+ const node = createBaseNode(338 /* JSDocLinkPlain */);
node.name = name;
node.text = text;
return node;
@@ -16388,14 +16435,14 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment), node) : node;
}
function createJSDocUnknownTag(tagName, comment) {
- const node = createBaseJSDocTag(336 /* JSDocTag */, tagName, comment);
+ const node = createBaseJSDocTag(339 /* JSDocTag */, tagName, comment);
return node;
}
function updateJSDocUnknownTag(node, tagName, comment) {
return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node;
}
function createJSDocText(text) {
- const node = createBaseNode(330 /* JSDocText */);
+ const node = createBaseNode(333 /* JSDocText */);
node.text = text;
return node;
}
@@ -16403,7 +16450,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.text !== text ? update(createJSDocText(text), node) : node;
}
function createJSDocComment(comment, tags) {
- const node = createBaseNode(329 /* JSDoc */);
+ const node = createBaseNode(332 /* JSDoc */);
node.comment = comment;
node.tags = asNodeArray(tags);
return node;
@@ -16412,7 +16459,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.comment !== comment || node.tags !== tags ? update(createJSDocComment(comment, tags), node) : node;
}
function createJsxElement(openingElement, children, closingElement) {
- const node = createBaseNode(287 /* JsxElement */);
+ const node = createBaseNode(290 /* JsxElement */);
node.openingElement = openingElement;
node.children = createNodeArray(children);
node.closingElement = closingElement;
@@ -16423,7 +16470,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement(openingElement, children, closingElement), node) : node;
}
function createJsxSelfClosingElement(tagName, typeArguments, attributes) {
- const node = createBaseNode(288 /* JsxSelfClosingElement */);
+ const node = createBaseNode(291 /* JsxSelfClosingElement */);
node.tagName = tagName;
node.typeArguments = asNodeArray(typeArguments);
node.attributes = attributes;
@@ -16437,7 +16484,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement(tagName, typeArguments, attributes), node) : node;
}
function createJsxOpeningElement(tagName, typeArguments, attributes) {
- const node = createBaseNode(289 /* JsxOpeningElement */);
+ const node = createBaseNode(292 /* JsxOpeningElement */);
node.tagName = tagName;
node.typeArguments = asNodeArray(typeArguments);
node.attributes = attributes;
@@ -16451,7 +16498,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement(tagName, typeArguments, attributes), node) : node;
}
function createJsxClosingElement(tagName) {
- const node = createBaseNode(290 /* JsxClosingElement */);
+ const node = createBaseNode(293 /* JsxClosingElement */);
node.tagName = tagName;
node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */;
return node;
@@ -16460,7 +16507,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.tagName !== tagName ? update(createJsxClosingElement(tagName), node) : node;
}
function createJsxFragment(openingFragment, children, closingFragment) {
- const node = createBaseNode(291 /* JsxFragment */);
+ const node = createBaseNode(294 /* JsxFragment */);
node.openingFragment = openingFragment;
node.children = createNodeArray(children);
node.closingFragment = closingFragment;
@@ -16481,17 +16528,17 @@ function createNodeFactory(flags, baseFactory2) {
return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText(text, containsOnlyTriviaWhiteSpaces), node) : node;
}
function createJsxOpeningFragment() {
- const node = createBaseNode(292 /* JsxOpeningFragment */);
+ const node = createBaseNode(295 /* JsxOpeningFragment */);
node.transformFlags |= 2 /* ContainsJsx */;
return node;
}
function createJsxJsxClosingFragment() {
- const node = createBaseNode(293 /* JsxClosingFragment */);
+ const node = createBaseNode(296 /* JsxClosingFragment */);
node.transformFlags |= 2 /* ContainsJsx */;
return node;
}
function createJsxAttribute(name, initializer) {
- const node = createBaseNode(294 /* JsxAttribute */);
+ const node = createBaseNode(297 /* JsxAttribute */);
node.name = name;
node.initializer = initializer;
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */;
@@ -16501,7 +16548,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node;
}
function createJsxAttributes(properties) {
- const node = createBaseNode(295 /* JsxAttributes */);
+ const node = createBaseNode(298 /* JsxAttributes */);
node.properties = createNodeArray(properties);
node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */;
return node;
@@ -16510,7 +16557,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.properties !== properties ? update(createJsxAttributes(properties), node) : node;
}
function createJsxSpreadAttribute(expression) {
- const node = createBaseNode(296 /* JsxSpreadAttribute */);
+ const node = createBaseNode(299 /* JsxSpreadAttribute */);
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */;
return node;
@@ -16519,7 +16566,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createJsxSpreadAttribute(expression), node) : node;
}
function createJsxExpression(dotDotDotToken, expression) {
- const node = createBaseNode(297 /* JsxExpression */);
+ const node = createBaseNode(300 /* JsxExpression */);
node.dotDotDotToken = dotDotDotToken;
node.expression = expression;
node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */;
@@ -16529,7 +16576,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createJsxExpression(node.dotDotDotToken, expression), node) : node;
}
function createCaseClause(expression, statements) {
- const node = createBaseNode(298 /* CaseClause */);
+ const node = createBaseNode(301 /* CaseClause */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.statements = createNodeArray(statements);
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements);
@@ -16539,7 +16586,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression || node.statements !== statements ? update(createCaseClause(expression, statements), node) : node;
}
function createDefaultClause(statements) {
- const node = createBaseNode(299 /* DefaultClause */);
+ const node = createBaseNode(302 /* DefaultClause */);
node.statements = createNodeArray(statements);
node.transformFlags = propagateChildrenFlags(node.statements);
return node;
@@ -16548,7 +16595,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements ? update(createDefaultClause(statements), node) : node;
}
function createHeritageClause(token, types) {
- const node = createBaseNode(300 /* HeritageClause */);
+ const node = createBaseNode(303 /* HeritageClause */);
node.token = token;
node.types = createNodeArray(types);
node.transformFlags |= propagateChildrenFlags(node.types);
@@ -16568,7 +16615,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.types !== types ? update(createHeritageClause(node.token, types), node) : node;
}
function createCatchClause(variableDeclaration, block) {
- const node = createBaseNode(301 /* CatchClause */);
+ const node = createBaseNode(304 /* CatchClause */);
if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
variableDeclaration = createVariableDeclaration(
variableDeclaration,
@@ -16589,7 +16636,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createPropertyAssignment(name, initializer) {
const node = createBaseNamedDeclaration(
- 305 /* PropertyAssignment */,
+ 308 /* PropertyAssignment */,
void 0,
name
);
@@ -16615,7 +16662,7 @@ function createNodeFactory(flags, baseFactory2) {
}
function createShorthandPropertyAssignment(name, objectAssignmentInitializer) {
const node = createBaseNamedDeclaration(
- 306 /* ShorthandPropertyAssignment */,
+ 309 /* ShorthandPropertyAssignment */,
void 0,
name
);
@@ -16642,7 +16689,7 @@ function createNodeFactory(flags, baseFactory2) {
return update(updated, original);
}
function createSpreadAssignment(expression) {
- const node = createBaseNode(307 /* SpreadAssignment */);
+ const node = createBaseNode(310 /* SpreadAssignment */);
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */;
return node;
@@ -16651,7 +16698,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node;
}
function createEnumMember(name, initializer) {
- const node = createBaseNode(308 /* EnumMember */);
+ const node = createBaseNode(311 /* EnumMember */);
node.name = asName(name);
node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */;
@@ -16661,7 +16708,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.name !== name || node.initializer !== initializer ? update(createEnumMember(name, initializer), node) : node;
}
function createSourceFile2(statements, endOfFileToken, flags2) {
- const node = baseFactory2.createBaseSourceFileNode(314 /* SourceFile */);
+ const node = baseFactory2.createBaseSourceFileNode(317 /* SourceFile */);
node.statements = createNodeArray(statements);
node.endOfFileToken = endOfFileToken;
node.flags |= flags2;
@@ -16676,7 +16723,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
- const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(314 /* SourceFile */);
+ const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(317 /* SourceFile */);
for (const p in source) {
if (p === "emitNode" || hasProperty(node, p) || !hasProperty(source, p))
continue;
@@ -16698,7 +16745,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node;
}
function createBundle(sourceFiles, prepends = emptyArray) {
- const node = createBaseNode(315 /* Bundle */);
+ const node = createBaseNode(318 /* Bundle */);
node.prepends = prepends;
node.sourceFiles = sourceFiles;
return node;
@@ -16707,7 +16754,7 @@ function createNodeFactory(flags, baseFactory2) {
return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle(sourceFiles, prepends), node) : node;
}
function createUnparsedSource(prologues, syntheticReferences, texts) {
- const node = createBaseNode(316 /* UnparsedSource */);
+ const node = createBaseNode(319 /* UnparsedSource */);
node.prologues = prologues;
node.syntheticReferences = syntheticReferences;
node.texts = texts;
@@ -16724,48 +16771,48 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createUnparsedPrologue(data) {
- return createBaseUnparsedNode(309 /* UnparsedPrologue */, data);
+ return createBaseUnparsedNode(312 /* UnparsedPrologue */, data);
}
function createUnparsedPrepend(data, texts) {
- const node = createBaseUnparsedNode(310 /* UnparsedPrepend */, data);
+ const node = createBaseUnparsedNode(313 /* UnparsedPrepend */, data);
node.texts = texts;
return node;
}
function createUnparsedTextLike(data, internal) {
- return createBaseUnparsedNode(internal ? 312 /* UnparsedInternalText */ : 311 /* UnparsedText */, data);
+ return createBaseUnparsedNode(internal ? 315 /* UnparsedInternalText */ : 314 /* UnparsedText */, data);
}
function createUnparsedSyntheticReference(section) {
- const node = createBaseNode(313 /* UnparsedSyntheticReference */);
+ const node = createBaseNode(316 /* UnparsedSyntheticReference */);
node.data = section.data;
node.section = section;
return node;
}
function createInputFiles2() {
- const node = createBaseNode(317 /* InputFiles */);
+ const node = createBaseNode(320 /* InputFiles */);
node.javascriptText = "";
node.declarationText = "";
return node;
}
function createSyntheticExpression(type, isSpread = false, tupleNameSource) {
- const node = createBaseNode(238 /* SyntheticExpression */);
+ const node = createBaseNode(240 /* SyntheticExpression */);
node.type = type;
node.isSpread = isSpread;
node.tupleNameSource = tupleNameSource;
return node;
}
function createSyntaxList(children) {
- const node = createBaseNode(357 /* SyntaxList */);
+ const node = createBaseNode(360 /* SyntaxList */);
node._children = children;
return node;
}
function createNotEmittedStatement(original) {
- const node = createBaseNode(358 /* NotEmittedStatement */);
+ const node = createBaseNode(361 /* NotEmittedStatement */);
node.original = original;
setTextRange(node, original);
return node;
}
function createPartiallyEmittedExpression(expression, original) {
- const node = createBaseNode(359 /* PartiallyEmittedExpression */);
+ const node = createBaseNode(362 /* PartiallyEmittedExpression */);
node.expression = expression;
node.original = original;
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -16787,7 +16834,7 @@ function createNodeFactory(flags, baseFactory2) {
return node;
}
function createCommaListExpression(elements) {
- const node = createBaseNode(360 /* CommaListExpression */);
+ const node = createBaseNode(363 /* CommaListExpression */);
node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
node.transformFlags |= propagateChildrenFlags(node.elements);
return node;
@@ -16796,19 +16843,19 @@ function createNodeFactory(flags, baseFactory2) {
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
}
function createEndOfDeclarationMarker(original) {
- const node = createBaseNode(362 /* EndOfDeclarationMarker */);
+ const node = createBaseNode(365 /* EndOfDeclarationMarker */);
node.emitNode = {};
node.original = original;
return node;
}
function createMergeDeclarationMarker(original) {
- const node = createBaseNode(361 /* MergeDeclarationMarker */);
+ const node = createBaseNode(364 /* MergeDeclarationMarker */);
node.emitNode = {};
node.original = original;
return node;
}
function createSyntheticReferenceExpression(expression, thisArg) {
- const node = createBaseNode(363 /* SyntheticReferenceExpression */);
+ const node = createBaseNode(366 /* SyntheticReferenceExpression */);
node.expression = expression;
node.thisArg = thisArg;
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -16821,7 +16868,7 @@ function createNodeFactory(flags, baseFactory2) {
if (node === void 0) {
return node;
}
- const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(314 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
+ const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(317 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
clone2.flags |= node.flags & ~8 /* Synthesized */;
clone2.transformFlags = node.transformFlags;
setOriginalNode(clone2, node);
@@ -16946,17 +16993,17 @@ function createNodeFactory(flags, baseFactory2) {
}
function updateOuterExpression(outerExpression, expression) {
switch (outerExpression.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return updateParenthesizedExpression(outerExpression, expression);
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return updateTypeAssertion(outerExpression, outerExpression.type, expression);
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return updateAsExpression(outerExpression, expression, outerExpression.type);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return updateNonNullExpression(outerExpression, expression);
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return updatePartiallyEmittedExpression(outerExpression, expression);
}
}
@@ -16996,13 +17043,13 @@ function createNodeFactory(flags, baseFactory2) {
case 9 /* BigIntLiteral */:
case 10 /* StringLiteral */:
return false;
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
const elements = target.elements;
if (elements.length === 0) {
return false;
}
return true;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return target.properties.length > 0;
default:
return true;
@@ -17249,7 +17296,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray(array) : void 0;
@@ -17282,41 +17329,41 @@ function updateWithOriginal(updated, original) {
}
function getDefaultTagNameForKind(kind) {
switch (kind) {
- case 352 /* JSDocTypeTag */:
+ case 355 /* JSDocTypeTag */:
return "type";
- case 350 /* JSDocReturnTag */:
+ case 353 /* JSDocReturnTag */:
return "returns";
- case 351 /* JSDocThisTag */:
+ case 354 /* JSDocThisTag */:
return "this";
- case 348 /* JSDocEnumTag */:
+ case 351 /* JSDocEnumTag */:
return "enum";
- case 339 /* JSDocAuthorTag */:
+ case 342 /* JSDocAuthorTag */:
return "author";
- case 341 /* JSDocClassTag */:
+ case 344 /* JSDocClassTag */:
return "class";
- case 342 /* JSDocPublicTag */:
+ case 345 /* JSDocPublicTag */:
return "public";
- case 343 /* JSDocPrivateTag */:
+ case 346 /* JSDocPrivateTag */:
return "private";
- case 344 /* JSDocProtectedTag */:
+ case 347 /* JSDocProtectedTag */:
return "protected";
- case 345 /* JSDocReadonlyTag */:
+ case 348 /* JSDocReadonlyTag */:
return "readonly";
- case 346 /* JSDocOverrideTag */:
+ case 349 /* JSDocOverrideTag */:
return "override";
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return "template";
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return "typedef";
- case 349 /* JSDocParameterTag */:
+ case 352 /* JSDocParameterTag */:
return "param";
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
return "prop";
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
return "callback";
- case 337 /* JSDocAugmentsTag */:
+ case 340 /* JSDocAugmentsTag */:
return "augments";
- case 338 /* JSDocImplementsTag */:
+ case 341 /* JSDocImplementsTag */:
return "implements";
default:
return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`);
@@ -17389,35 +17436,35 @@ function aggregateChildrenFlags(children) {
children.transformFlags = subtreeFlags;
}
function getTransformFlagsSubtreeExclusions(kind) {
- if (kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */) {
+ if (kind >= 184 /* FirstTypeNode */ && kind <= 207 /* LastTypeNode */) {
return -2 /* TypeExcludes */;
}
switch (kind) {
- case 213 /* CallExpression */:
- case 214 /* NewExpression */:
- case 209 /* ArrayLiteralExpression */:
+ case 215 /* CallExpression */:
+ case 216 /* NewExpression */:
+ case 211 /* ArrayLiteralExpression */:
return -2147450880 /* ArrayLiteralOrCallOrNewExcludes */;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return -1941676032 /* ModuleExcludes */;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return -2147483648 /* ParameterExcludes */;
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return -2072174592 /* ArrowFunctionExcludes */;
- case 218 /* FunctionExpression */:
- case 263 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
return -1937940480 /* FunctionExcludes */;
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return -2146893824 /* VariableDeclarationListExcludes */;
- case 264 /* ClassDeclaration */:
- case 232 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 234 /* ClassExpression */:
return -2147344384 /* ClassExcludes */;
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return -1937948672 /* ConstructorExcludes */;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return -2013249536 /* PropertyExcludes */;
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return -2005057536 /* MethodOrAccessorExcludes */;
case 132 /* AnyKeyword */:
case 149 /* NumberKeyword */:
@@ -17428,31 +17475,31 @@ function getTransformFlagsSubtreeExclusions(kind) {
case 135 /* BooleanKeyword */:
case 154 /* SymbolKeyword */:
case 115 /* VoidKeyword */:
- case 167 /* TypeParameter */:
- case 170 /* PropertySignature */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 168 /* TypeParameter */:
+ case 171 /* PropertySignature */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return -2 /* TypeExcludes */;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return -2147278848 /* ObjectLiteralExcludes */;
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return -2147418112 /* CatchClauseExcludes */;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return -2147450880 /* BindingPatternExcludes */;
- case 216 /* TypeAssertionExpression */:
- case 239 /* SatisfiesExpression */:
- case 235 /* AsExpression */:
- case 359 /* PartiallyEmittedExpression */:
- case 217 /* ParenthesizedExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 241 /* SatisfiesExpression */:
+ case 237 /* AsExpression */:
+ case 362 /* PartiallyEmittedExpression */:
+ case 219 /* ParenthesizedExpression */:
case 107 /* SuperKeyword */:
return -2147483648 /* OuterExpressionExcludes */;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return -2147483648 /* PropertyAccessExcludes */;
default:
return -2147483648 /* NodeExcludes */;
@@ -17534,7 +17581,7 @@ function getOrCreateEmitNode(node) {
var _a2;
if (!node.emitNode) {
if (isParseTreeNode(node)) {
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
return node.emitNode = { annotatedNodes: [node] };
}
const sourceFile = (_a2 = getSourceFileOfNode(getParseTreeNode(getSourceFileOfNode(node)))) != null ? _a2 : Debug.fail("Could not determine parsed source file.");
@@ -17707,382 +17754,388 @@ function isImportKeyword(node) {
return node.kind === 101 /* ImportKeyword */;
}
function isComputedPropertyName(node) {
- return node.kind === 166 /* ComputedPropertyName */;
+ return node.kind === 167 /* ComputedPropertyName */;
}
function isTypeParameterDeclaration(node) {
- return node.kind === 167 /* TypeParameter */;
+ return node.kind === 168 /* TypeParameter */;
}
function isParameter(node) {
- return node.kind === 168 /* Parameter */;
+ return node.kind === 169 /* Parameter */;
}
function isDecoratorOrAnnotation(node) {
- return node.kind === 169 /* Decorator */;
+ return node.kind === 170 /* Decorator */;
}
function isPropertySignature(node) {
- return node.kind === 170 /* PropertySignature */;
+ return node.kind === 171 /* PropertySignature */;
+}
+function isOverloadPropertyDeclaration(node) {
+ return node.kind === 174 /* OverloadPropertyDeclaration */;
}
function isPropertyDeclaration(node) {
- return node.kind === 171 /* PropertyDeclaration */;
+ return node.kind === 172 /* PropertyDeclaration */;
}
function isAnnotationPropertyDeclaration(node) {
- return node.kind === 172 /* AnnotationPropertyDeclaration */;
+ return node.kind === 173 /* AnnotationPropertyDeclaration */;
}
function isMethodSignature(node) {
- return node.kind === 173 /* MethodSignature */;
+ return node.kind === 175 /* MethodSignature */;
}
function isMethodDeclaration(node) {
- return node.kind === 174 /* MethodDeclaration */;
+ return node.kind === 176 /* MethodDeclaration */;
}
function isClassStaticBlockDeclaration(node) {
- return node.kind === 175 /* ClassStaticBlockDeclaration */;
+ return node.kind === 177 /* ClassStaticBlockDeclaration */;
}
function isConstructorDeclaration(node) {
- return node.kind === 176 /* Constructor */;
+ return node.kind === 178 /* Constructor */;
}
function isGetAccessorDeclaration(node) {
- return node.kind === 177 /* GetAccessor */;
+ return node.kind === 179 /* GetAccessor */;
}
function isSetAccessorDeclaration(node) {
- return node.kind === 178 /* SetAccessor */;
+ return node.kind === 180 /* SetAccessor */;
}
function isCallSignatureDeclaration(node) {
- return node.kind === 179 /* CallSignature */;
+ return node.kind === 181 /* CallSignature */;
}
function isConstructSignatureDeclaration(node) {
- return node.kind === 180 /* ConstructSignature */;
+ return node.kind === 182 /* ConstructSignature */;
}
function isIndexSignatureDeclaration(node) {
- return node.kind === 181 /* IndexSignature */;
+ return node.kind === 183 /* IndexSignature */;
}
function isTypePredicateNode(node) {
- return node.kind === 182 /* TypePredicate */;
+ return node.kind === 184 /* TypePredicate */;
}
function isTypeReferenceNode(node) {
- return node.kind === 183 /* TypeReference */;
+ return node.kind === 185 /* TypeReference */;
}
function isFunctionTypeNode(node) {
- return node.kind === 184 /* FunctionType */;
+ return node.kind === 186 /* FunctionType */;
}
function isConstructorTypeNode(node) {
- return node.kind === 185 /* ConstructorType */;
+ return node.kind === 187 /* ConstructorType */;
}
function isTypeQueryNode(node) {
- return node.kind === 186 /* TypeQuery */;
+ return node.kind === 188 /* TypeQuery */;
}
function isTypeLiteralNode(node) {
- return node.kind === 187 /* TypeLiteral */;
+ return node.kind === 189 /* TypeLiteral */;
}
function isArrayTypeNode(node) {
- return node.kind === 188 /* ArrayType */;
+ return node.kind === 190 /* ArrayType */;
}
function isTupleTypeNode(node) {
- return node.kind === 189 /* TupleType */;
+ return node.kind === 191 /* TupleType */;
}
function isNamedTupleMember(node) {
- return node.kind === 202 /* NamedTupleMember */;
+ return node.kind === 204 /* NamedTupleMember */;
}
function isOptionalTypeNode(node) {
- return node.kind === 190 /* OptionalType */;
+ return node.kind === 192 /* OptionalType */;
}
function isRestTypeNode(node) {
- return node.kind === 191 /* RestType */;
+ return node.kind === 193 /* RestType */;
}
function isUnionTypeNode(node) {
- return node.kind === 192 /* UnionType */;
+ return node.kind === 194 /* UnionType */;
}
function isIntersectionTypeNode(node) {
- return node.kind === 193 /* IntersectionType */;
+ return node.kind === 195 /* IntersectionType */;
}
function isConditionalTypeNode(node) {
- return node.kind === 194 /* ConditionalType */;
+ return node.kind === 196 /* ConditionalType */;
}
function isInferTypeNode(node) {
- return node.kind === 195 /* InferType */;
+ return node.kind === 197 /* InferType */;
}
function isParenthesizedTypeNode(node) {
- return node.kind === 196 /* ParenthesizedType */;
+ return node.kind === 198 /* ParenthesizedType */;
}
function isThisTypeNode(node) {
- return node.kind === 197 /* ThisType */;
+ return node.kind === 199 /* ThisType */;
}
function isTypeOperatorNode(node) {
- return node.kind === 198 /* TypeOperator */;
+ return node.kind === 200 /* TypeOperator */;
}
function isIndexedAccessTypeNode(node) {
- return node.kind === 199 /* IndexedAccessType */;
+ return node.kind === 201 /* IndexedAccessType */;
}
function isMappedTypeNode(node) {
- return node.kind === 200 /* MappedType */;
+ return node.kind === 202 /* MappedType */;
}
function isLiteralTypeNode(node) {
- return node.kind === 201 /* LiteralType */;
+ return node.kind === 203 /* LiteralType */;
}
function isImportTypeNode(node) {
- return node.kind === 205 /* ImportType */;
+ return node.kind === 207 /* ImportType */;
}
function isTemplateLiteralTypeSpan(node) {
- return node.kind === 204 /* TemplateLiteralTypeSpan */;
+ return node.kind === 206 /* TemplateLiteralTypeSpan */;
}
function isObjectBindingPattern(node) {
- return node.kind === 206 /* ObjectBindingPattern */;
+ return node.kind === 208 /* ObjectBindingPattern */;
}
function isArrayBindingPattern(node) {
- return node.kind === 207 /* ArrayBindingPattern */;
+ return node.kind === 209 /* ArrayBindingPattern */;
}
function isBindingElement(node) {
- return node.kind === 208 /* BindingElement */;
+ return node.kind === 210 /* BindingElement */;
}
function isArrayLiteralExpression(node) {
- return node.kind === 209 /* ArrayLiteralExpression */;
+ return node.kind === 211 /* ArrayLiteralExpression */;
}
function isObjectLiteralExpression(node) {
- return node.kind === 210 /* ObjectLiteralExpression */;
+ return node.kind === 212 /* ObjectLiteralExpression */;
}
function isPropertyAccessExpression(node) {
- return node.kind === 211 /* PropertyAccessExpression */;
+ return node.kind === 213 /* PropertyAccessExpression */;
}
function isElementAccessExpression(node) {
- return node.kind === 212 /* ElementAccessExpression */;
+ return node.kind === 214 /* ElementAccessExpression */;
}
function isCallExpression(node) {
- return node.kind === 213 /* CallExpression */;
+ return node.kind === 215 /* CallExpression */;
}
function isTaggedTemplateExpression(node) {
- return node.kind === 215 /* TaggedTemplateExpression */;
+ return node.kind === 217 /* TaggedTemplateExpression */;
}
function isParenthesizedExpression(node) {
- return node.kind === 217 /* ParenthesizedExpression */;
+ return node.kind === 219 /* ParenthesizedExpression */;
}
function isFunctionExpression(node) {
- return node.kind === 218 /* FunctionExpression */;
+ return node.kind === 220 /* FunctionExpression */;
}
function isEtsComponentExpression(node) {
- return node.kind === 220 /* EtsComponentExpression */;
+ return node.kind === 222 /* EtsComponentExpression */;
}
function isArrowFunction(node) {
- return node.kind === 219 /* ArrowFunction */;
+ return node.kind === 221 /* ArrowFunction */;
}
function isTypeOfExpression(node) {
- return node.kind === 222 /* TypeOfExpression */;
+ return node.kind === 224 /* TypeOfExpression */;
}
function isVoidExpression(node) {
- return node.kind === 223 /* VoidExpression */;
+ return node.kind === 225 /* VoidExpression */;
}
function isPrefixUnaryExpression(node) {
- return node.kind === 225 /* PrefixUnaryExpression */;
+ return node.kind === 227 /* PrefixUnaryExpression */;
}
function isBinaryExpression(node) {
- return node.kind === 227 /* BinaryExpression */;
+ return node.kind === 229 /* BinaryExpression */;
}
function isSpreadElement(node) {
- return node.kind === 231 /* SpreadElement */;
+ return node.kind === 233 /* SpreadElement */;
}
function isClassExpression(node) {
- return node.kind === 232 /* ClassExpression */;
+ return node.kind === 234 /* ClassExpression */;
}
function isOmittedExpression(node) {
- return node.kind === 233 /* OmittedExpression */;
+ return node.kind === 235 /* OmittedExpression */;
}
function isExpressionWithTypeArguments(node) {
- return node.kind === 234 /* ExpressionWithTypeArguments */;
+ return node.kind === 236 /* ExpressionWithTypeArguments */;
}
function isNonNullExpression(node) {
- return node.kind === 236 /* NonNullExpression */;
+ return node.kind === 238 /* NonNullExpression */;
}
function isMetaProperty(node) {
- return node.kind === 237 /* MetaProperty */;
+ return node.kind === 239 /* MetaProperty */;
}
function isPartiallyEmittedExpression(node) {
- return node.kind === 359 /* PartiallyEmittedExpression */;
+ return node.kind === 362 /* PartiallyEmittedExpression */;
}
function isCommaListExpression(node) {
- return node.kind === 360 /* CommaListExpression */;
+ return node.kind === 363 /* CommaListExpression */;
}
function isTemplateSpan(node) {
- return node.kind === 240 /* TemplateSpan */;
+ return node.kind === 242 /* TemplateSpan */;
}
function isBlock(node) {
- return node.kind === 242 /* Block */;
+ return node.kind === 244 /* Block */;
}
function isVariableStatement(node) {
- return node.kind === 244 /* VariableStatement */;
+ return node.kind === 246 /* VariableStatement */;
}
function isEmptyStatement(node) {
- return node.kind === 243 /* EmptyStatement */;
+ return node.kind === 245 /* EmptyStatement */;
}
function isExpressionStatement(node) {
- return node.kind === 245 /* ExpressionStatement */;
+ return node.kind === 247 /* ExpressionStatement */;
}
function isLabeledStatement(node) {
- return node.kind === 257 /* LabeledStatement */;
+ return node.kind === 259 /* LabeledStatement */;
}
function isVariableDeclaration(node) {
- return node.kind === 261 /* VariableDeclaration */;
+ return node.kind === 263 /* VariableDeclaration */;
}
function isVariableDeclarationList(node) {
- return node.kind === 262 /* VariableDeclarationList */;
+ return node.kind === 264 /* VariableDeclarationList */;
}
function isFunctionDeclaration(node) {
- return node.kind === 263 /* FunctionDeclaration */;
+ return node.kind === 265 /* FunctionDeclaration */;
}
function isClassDeclaration(node) {
- return node.kind === 264 /* ClassDeclaration */;
+ return node.kind === 266 /* ClassDeclaration */;
}
function isStructDeclaration(node) {
- return node.kind === 265 /* StructDeclaration */;
+ return node.kind === 267 /* StructDeclaration */;
}
function isAnnotationDeclaration(node) {
- return node.kind === 266 /* AnnotationDeclaration */;
+ return node.kind === 268 /* AnnotationDeclaration */;
+}
+function isOverloadDeclaration(node) {
+ return node.kind === 269 /* OverloadDeclaration */;
}
function isInterfaceDeclaration(node) {
- return node.kind === 267 /* InterfaceDeclaration */;
+ return node.kind === 270 /* InterfaceDeclaration */;
}
function isTypeAliasDeclaration(node) {
- return node.kind === 268 /* TypeAliasDeclaration */;
+ return node.kind === 271 /* TypeAliasDeclaration */;
}
function isEnumDeclaration(node) {
- return node.kind === 269 /* EnumDeclaration */;
+ return node.kind === 272 /* EnumDeclaration */;
}
function isModuleDeclaration(node) {
- return node.kind === 270 /* ModuleDeclaration */;
+ return node.kind === 273 /* ModuleDeclaration */;
}
function isModuleBlock(node) {
- return node.kind === 271 /* ModuleBlock */;
+ return node.kind === 274 /* ModuleBlock */;
}
function isCaseBlock(node) {
- return node.kind === 272 /* CaseBlock */;
+ return node.kind === 275 /* CaseBlock */;
}
function isImportEqualsDeclaration(node) {
- return node.kind === 274 /* ImportEqualsDeclaration */;
+ return node.kind === 277 /* ImportEqualsDeclaration */;
}
function isImportDeclaration(node) {
- return node.kind === 275 /* ImportDeclaration */;
+ return node.kind === 278 /* ImportDeclaration */;
}
function isImportClause(node) {
- return node.kind === 276 /* ImportClause */;
+ return node.kind === 279 /* ImportClause */;
}
function isImportTypeAssertionContainer(node) {
- return node.kind === 304 /* ImportTypeAssertionContainer */;
+ return node.kind === 307 /* ImportTypeAssertionContainer */;
}
function isAssertClause(node) {
- return node.kind === 302 /* AssertClause */;
+ return node.kind === 305 /* AssertClause */;
}
function isAssertEntry(node) {
- return node.kind === 303 /* AssertEntry */;
+ return node.kind === 306 /* AssertEntry */;
}
function isNamespaceImport(node) {
- return node.kind === 277 /* NamespaceImport */;
+ return node.kind === 280 /* NamespaceImport */;
}
function isNamespaceExport(node) {
- return node.kind === 283 /* NamespaceExport */;
+ return node.kind === 286 /* NamespaceExport */;
}
function isImportSpecifier(node) {
- return node.kind === 279 /* ImportSpecifier */;
+ return node.kind === 282 /* ImportSpecifier */;
}
function isExportAssignment(node) {
- return node.kind === 280 /* ExportAssignment */;
+ return node.kind === 283 /* ExportAssignment */;
}
function isExportDeclaration(node) {
- return node.kind === 281 /* ExportDeclaration */;
+ return node.kind === 284 /* ExportDeclaration */;
}
function isExportSpecifier(node) {
- return node.kind === 284 /* ExportSpecifier */;
+ return node.kind === 287 /* ExportSpecifier */;
}
function isNotEmittedStatement(node) {
- return node.kind === 358 /* NotEmittedStatement */;
+ return node.kind === 361 /* NotEmittedStatement */;
}
function isExternalModuleReference(node) {
- return node.kind === 286 /* ExternalModuleReference */;
+ return node.kind === 289 /* ExternalModuleReference */;
}
function isJsxOpeningElement(node) {
- return node.kind === 289 /* JsxOpeningElement */;
+ return node.kind === 292 /* JsxOpeningElement */;
}
function isJsxClosingElement(node) {
- return node.kind === 290 /* JsxClosingElement */;
+ return node.kind === 293 /* JsxClosingElement */;
}
function isJsxOpeningFragment(node) {
- return node.kind === 292 /* JsxOpeningFragment */;
+ return node.kind === 295 /* JsxOpeningFragment */;
}
function isJsxClosingFragment(node) {
- return node.kind === 293 /* JsxClosingFragment */;
+ return node.kind === 296 /* JsxClosingFragment */;
}
function isJsxAttributes(node) {
- return node.kind === 295 /* JsxAttributes */;
+ return node.kind === 298 /* JsxAttributes */;
}
function isDefaultClause(node) {
- return node.kind === 299 /* DefaultClause */;
+ return node.kind === 302 /* DefaultClause */;
}
function isHeritageClause(node) {
- return node.kind === 300 /* HeritageClause */;
+ return node.kind === 303 /* HeritageClause */;
}
function isCatchClause(node) {
- return node.kind === 301 /* CatchClause */;
+ return node.kind === 304 /* CatchClause */;
}
function isPropertyAssignment(node) {
- return node.kind === 305 /* PropertyAssignment */;
+ return node.kind === 308 /* PropertyAssignment */;
}
function isShorthandPropertyAssignment(node) {
- return node.kind === 306 /* ShorthandPropertyAssignment */;
+ return node.kind === 309 /* ShorthandPropertyAssignment */;
}
function isEnumMember(node) {
- return node.kind === 308 /* EnumMember */;
+ return node.kind === 311 /* EnumMember */;
}
function isUnparsedPrepend(node) {
- return node.kind === 310 /* UnparsedPrepend */;
+ return node.kind === 313 /* UnparsedPrepend */;
}
function isSourceFile(node) {
- return node.kind === 314 /* SourceFile */;
+ return node.kind === 317 /* SourceFile */;
}
function isUnparsedSource(node) {
- return node.kind === 316 /* UnparsedSource */;
+ return node.kind === 319 /* UnparsedSource */;
}
function isJSDocTypeExpression(node) {
- return node.kind === 318 /* JSDocTypeExpression */;
+ return node.kind === 321 /* JSDocTypeExpression */;
}
function isJSDocNullableType(node) {
- return node.kind === 323 /* JSDocNullableType */;
+ return node.kind === 326 /* JSDocNullableType */;
}
function isJSDocFunctionType(node) {
- return node.kind === 326 /* JSDocFunctionType */;
+ return node.kind === 329 /* JSDocFunctionType */;
}
function isJSDoc(node) {
- return node.kind === 329 /* JSDoc */;
+ return node.kind === 332 /* JSDoc */;
}
function isJSDocTypeLiteral(node) {
- return node.kind === 331 /* JSDocTypeLiteral */;
+ return node.kind === 334 /* JSDocTypeLiteral */;
}
function isJSDocPublicTag(node) {
- return node.kind === 342 /* JSDocPublicTag */;
+ return node.kind === 345 /* JSDocPublicTag */;
}
function isJSDocPrivateTag(node) {
- return node.kind === 343 /* JSDocPrivateTag */;
+ return node.kind === 346 /* JSDocPrivateTag */;
}
function isJSDocProtectedTag(node) {
- return node.kind === 344 /* JSDocProtectedTag */;
+ return node.kind === 347 /* JSDocProtectedTag */;
}
function isJSDocReadonlyTag(node) {
- return node.kind === 345 /* JSDocReadonlyTag */;
+ return node.kind === 348 /* JSDocReadonlyTag */;
}
function isJSDocOverrideTag(node) {
- return node.kind === 346 /* JSDocOverrideTag */;
+ return node.kind === 349 /* JSDocOverrideTag */;
}
function isJSDocDeprecatedTag(node) {
- return node.kind === 340 /* JSDocDeprecatedTag */;
+ return node.kind === 343 /* JSDocDeprecatedTag */;
}
function isJSDocEnumTag(node) {
- return node.kind === 348 /* JSDocEnumTag */;
+ return node.kind === 351 /* JSDocEnumTag */;
}
function isJSDocParameterTag(node) {
- return node.kind === 349 /* JSDocParameterTag */;
+ return node.kind === 352 /* JSDocParameterTag */;
}
function isJSDocReturnTag(node) {
- return node.kind === 350 /* JSDocReturnTag */;
+ return node.kind === 353 /* JSDocReturnTag */;
}
function isJSDocTypeTag(node) {
- return node.kind === 352 /* JSDocTypeTag */;
+ return node.kind === 355 /* JSDocTypeTag */;
}
function isJSDocTemplateTag(node) {
- return node.kind === 353 /* JSDocTemplateTag */;
+ return node.kind === 356 /* JSDocTemplateTag */;
}
// src/compiler/factory/utilities.ts
@@ -18105,25 +18158,25 @@ function findUseStrictPrologue(statements) {
return void 0;
}
function isCommaSequence(node) {
- return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 360 /* CommaListExpression */;
+ return node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 363 /* CommaListExpression */;
}
function isJSDocTypeAssertion(node) {
return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
}
function isOuterExpression(node, kinds = 15 /* All */) {
switch (node.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
if (kinds & 16 /* ExcludeJSDocTypeAssertion */ && isJSDocTypeAssertion(node)) {
return false;
}
return (kinds & 1 /* Parentheses */) !== 0;
- case 216 /* TypeAssertionExpression */:
- case 235 /* AsExpression */:
- case 239 /* SatisfiesExpression */:
+ case 218 /* TypeAssertionExpression */:
+ case 237 /* AsExpression */:
+ case 241 /* SatisfiesExpression */:
return (kinds & 2 /* TypeAssertions */) !== 0;
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return (kinds & 4 /* NonNullAssertions */) !== 0;
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
}
return false;
@@ -18153,11 +18206,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) {
}
if (isObjectLiteralElementLike(bindingElement)) {
switch (bindingElement.kind) {
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return bindingElement.name;
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return getTargetOfBindingOrAssignmentElement(bindingElement.expression);
}
}
@@ -18171,11 +18224,11 @@ function getTargetOfBindingOrAssignmentElement(bindingElement) {
}
function getElementsOfBindingOrAssignmentPattern(name) {
switch (name.kind) {
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
- case 209 /* ArrayLiteralExpression */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
+ case 211 /* ArrayLiteralExpression */:
return name.elements;
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return name.properties;
}
}
@@ -18192,7 +18245,7 @@ function getJSDocTypeAliasName(fullName) {
}
function canHaveIllegalDecorators(node) {
const kind = node.kind;
- return kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 263 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 285 /* MissingDeclaration */ || kind === 244 /* VariableStatement */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 280 /* ExportAssignment */;
+ return kind === 308 /* PropertyAssignment */ || kind === 309 /* ShorthandPropertyAssignment */ || kind === 265 /* FunctionDeclaration */ || kind === 178 /* Constructor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 288 /* MissingDeclaration */ || kind === 246 /* VariableStatement */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 276 /* NamespaceExportDeclaration */ || kind === 284 /* ExportDeclaration */ || kind === 283 /* ExportAssignment */;
}
var isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration);
var isQuestionOrExclamationToken = or(isQuestionToken, isExclamationToken);
@@ -18419,11 +18472,11 @@ function setTextRange(range, location) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 167 /* TypeParameter */ || kind === 168 /* Parameter */ || kind === 170 /* PropertySignature */ || kind === 171 /* PropertyDeclaration */ || kind === 173 /* MethodSignature */ || kind === 174 /* MethodDeclaration */ || kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 185 /* ConstructorType */ || kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || kind === 232 /* ClassExpression */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 244 /* VariableStatement */ || kind === 263 /* FunctionDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 280 /* ExportAssignment */ || kind === 281 /* ExportDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 168 /* Parameter */ || kind === 171 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 232 /* ClassExpression */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* StructDeclaration */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */;
}
// src/compiler/parser.ts
@@ -18478,430 +18531,434 @@ function isImportMeta(node) {
return isMetaProperty(node) && node.keywordToken === 101 /* ImportKeyword */ && node.name.escapedText === "meta";
}
var forEachChildTable = {
- [165 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) {
+ [166 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right);
},
- [167 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) {
+ [168 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression);
},
- [306 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) {
+ [309 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer);
},
- [307 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) {
+ [310 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [168 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) {
+ [169 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [171 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) {
+ [172 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [172 /* AnnotationPropertyDeclaration */]: function forEachChildInAnnotationPropertyDeclaration(node, cbNode, _cbNodes) {
+ [173 /* AnnotationPropertyDeclaration */]: function forEachChildInAnnotationPropertyDeclaration(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [170 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) {
+ [171 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) {
+ return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
+ },
+ [174 /* OverloadPropertyDeclaration */]: function forEachChildInOverloadPropertyDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [305 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) {
+ [308 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer);
},
- [261 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) {
+ [263 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer);
},
- [208 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) {
+ [210 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [181 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) {
+ [183 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [185 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) {
+ [187 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [184 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) {
+ [186 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [179 /* CallSignature */]: forEachChildInCallOrConstructSignature,
- [180 /* ConstructSignature */]: forEachChildInCallOrConstructSignature,
- [220 /* EtsComponentExpression */]: function forEachChildInEtsComponentExpression(node, cbNode, cbNodes) {
+ [181 /* CallSignature */]: forEachChildInCallOrConstructSignature,
+ [182 /* ConstructSignature */]: forEachChildInCallOrConstructSignature,
+ [222 /* EtsComponentExpression */]: function forEachChildInEtsComponentExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.arguments) || visitNode2(cbNode, node.body);
},
- [174 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) {
+ [176 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [173 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) {
+ [175 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [176 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) {
+ [178 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [177 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) {
+ [179 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [178 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) {
+ [180 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [263 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) {
+ [265 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [218 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) {
+ [220 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body);
},
- [219 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) {
+ [221 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body);
},
- [175 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) {
+ [177 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body);
},
- [183 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) {
+ [185 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [182 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) {
+ [184 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.assertsModifier) || visitNode2(cbNode, node.parameterName) || visitNode2(cbNode, node.type);
},
- [186 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) {
+ [188 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.exprName) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [187 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) {
+ [189 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.members);
},
- [188 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) {
+ [190 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.elementType);
},
- [189 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) {
+ [191 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [192 /* UnionType */]: forEachChildInUnionOrIntersectionType,
- [193 /* IntersectionType */]: forEachChildInUnionOrIntersectionType,
- [194 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) {
+ [194 /* UnionType */]: forEachChildInUnionOrIntersectionType,
+ [195 /* IntersectionType */]: forEachChildInUnionOrIntersectionType,
+ [196 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.checkType) || visitNode2(cbNode, node.extendsType) || visitNode2(cbNode, node.trueType) || visitNode2(cbNode, node.falseType);
},
- [195 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) {
+ [197 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.typeParameter);
},
- [205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
+ [207 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.assertions) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [304 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
+ [307 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.assertClause);
},
- [196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
- [198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
- [199 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) {
+ [198 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
+ [200 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
+ [201 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.objectType) || visitNode2(cbNode, node.indexType);
},
- [200 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) {
+ [202 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.readonlyToken) || visitNode2(cbNode, node.typeParameter) || visitNode2(cbNode, node.nameType) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNodes(cbNode, cbNodes, node.members);
},
- [201 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) {
+ [203 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.literal);
},
- [202 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) {
+ [204 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type);
},
- [206 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
- [207 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
- [209 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) {
+ [208 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
+ [209 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern,
+ [211 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [210 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) {
+ [212 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.properties);
},
- [211 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) {
+ [213 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.name);
},
- [212 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) {
+ [214 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.argumentExpression);
},
- [213 /* CallExpression */]: forEachChildInCallOrNewExpression,
- [214 /* NewExpression */]: forEachChildInCallOrNewExpression,
- [215 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) {
+ [215 /* CallExpression */]: forEachChildInCallOrNewExpression,
+ [216 /* NewExpression */]: forEachChildInCallOrNewExpression,
+ [217 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tag) || visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.template);
},
- [216 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) {
+ [218 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.expression);
},
- [217 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) {
+ [219 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [221 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) {
+ [223 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [222 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) {
+ [224 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [223 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) {
+ [225 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [225 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) {
+ [227 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.operand);
},
- [230 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) {
+ [232 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.expression);
},
- [224 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) {
+ [226 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [226 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) {
+ [228 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.operand);
},
- [227 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) {
+ [229 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.operatorToken) || visitNode2(cbNode, node.right);
},
- [235 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) {
+ [237 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type);
},
- [236 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) {
+ [238 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [239 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) {
+ [241 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type);
},
- [237 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) {
+ [239 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [228 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) {
+ [230 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.whenTrue) || visitNode2(cbNode, node.colonToken) || visitNode2(cbNode, node.whenFalse);
},
- [231 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) {
+ [233 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [242 /* Block */]: forEachChildInBlock,
- [271 /* ModuleBlock */]: forEachChildInBlock,
- [314 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) {
+ [244 /* Block */]: forEachChildInBlock,
+ [274 /* ModuleBlock */]: forEachChildInBlock,
+ [317 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken);
},
- [244 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) {
+ [246 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList);
},
- [262 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) {
+ [264 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.declarations);
},
- [245 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) {
+ [247 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [246 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) {
+ [248 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.thenStatement) || visitNode2(cbNode, node.elseStatement);
},
- [247 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) {
+ [249 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.statement) || visitNode2(cbNode, node.expression);
},
- [248 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) {
+ [250 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [249 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) {
+ [251 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.incrementor) || visitNode2(cbNode, node.statement);
},
- [250 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) {
+ [252 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [251 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) {
+ [253 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.awaitModifier) || visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [252 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement,
- [253 /* BreakStatement */]: forEachChildInContinueOrBreakStatement,
- [254 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) {
+ [254 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement,
+ [255 /* BreakStatement */]: forEachChildInContinueOrBreakStatement,
+ [256 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [255 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) {
+ [257 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement);
},
- [256 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) {
+ [258 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.caseBlock);
},
- [272 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) {
+ [275 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.clauses);
},
- [298 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) {
+ [301 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements);
},
- [299 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) {
+ [302 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.statements);
},
- [257 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) {
+ [259 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.label) || visitNode2(cbNode, node.statement);
},
- [258 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) {
+ [260 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [259 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) {
+ [261 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.tryBlock) || visitNode2(cbNode, node.catchClause) || visitNode2(cbNode, node.finallyBlock);
},
- [301 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) {
+ [304 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.variableDeclaration) || visitNode2(cbNode, node.block);
},
- [169 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) {
+ [170 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [264 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression,
- [232 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression,
- [265 /* StructDeclaration */]: forEachChildInClassDeclarationOrExpression,
- [266 /* AnnotationDeclaration */]: forEachChildInAnnotationDeclaration,
- [267 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) {
+ [266 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression,
+ [234 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression,
+ [267 /* StructDeclaration */]: forEachChildInClassDeclarationOrExpression,
+ [268 /* AnnotationDeclaration */]: forEachChildInAnnotationDeclaration,
+ [269 /* OverloadDeclaration */]: forEachChildInOverloadDeclaration,
+ [270 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members);
},
- [268 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) {
+ [271 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type);
},
- [269 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) {
+ [272 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
},
- [308 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) {
+ [311 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [270 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) {
+ [273 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body);
},
- [274 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) {
+ [277 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
},
- [275 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
+ [278 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
},
- [276 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
+ [279 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
},
- [302 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) {
+ [305 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [303 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) {
+ [306 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
},
- [273 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
+ [276 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNode2(cbNode, node.name);
},
- [277 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) {
+ [280 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [283 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) {
+ [286 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [278 /* NamedImports */]: forEachChildInNamedImportsOrExports,
- [282 /* NamedExports */]: forEachChildInNamedImportsOrExports,
- [281 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
+ [281 /* NamedImports */]: forEachChildInNamedImportsOrExports,
+ [285 /* NamedExports */]: forEachChildInNamedImportsOrExports,
+ [284 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
},
- [279 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
- [284 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
- [280 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) {
+ [282 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
+ [287 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
+ [283 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression);
},
- [229 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) {
+ [231 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
},
- [240 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) {
+ [242 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.literal);
},
- [203 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) {
+ [205 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
},
- [204 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) {
+ [206 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.literal);
},
- [166 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) {
+ [167 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [300 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) {
+ [303 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.types);
},
- [234 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) {
+ [236 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments);
},
- [286 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) {
+ [289 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [285 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
+ [288 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
},
- [360 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
+ [363 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
},
- [287 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
+ [290 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingElement);
},
- [291 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) {
+ [294 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingFragment);
},
- [288 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
- [289 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
- [295 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) {
+ [291 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
+ [292 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement,
+ [298 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.properties);
},
- [294 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) {
+ [297 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer);
},
- [296 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) {
+ [299 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
},
- [297 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) {
+ [300 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.expression);
},
- [290 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) {
+ [293 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.tagName);
},
- [190 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [191 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [318 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [324 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [323 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [325 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [327 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
- [326 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) {
+ [192 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [193 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [321 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [327 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [326 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [328 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [330 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier,
+ [329 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
},
- [329 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) {
+ [332 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) {
return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags);
},
- [355 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
+ [358 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [319 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) {
+ [322 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.name);
},
- [320 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) {
+ [323 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right);
},
- [349 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
- [356 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
- [339 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) {
+ [352 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
+ [359 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
+ [342 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [338 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) {
+ [341 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [337 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) {
+ [340 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [353 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
+ [356 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [354 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
- return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 318 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)));
+ [357 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
+ return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 321 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)));
},
- [347 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
+ [350 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
},
- [350 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
- [352 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
- [351 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
- [348 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
- [332 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
+ [353 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
+ [355 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
+ [354 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
+ [351 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
+ [335 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type);
},
- [333 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain,
- [334 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain,
- [335 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain,
- [331 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) {
+ [336 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain,
+ [337 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain,
+ [338 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain,
+ [334 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) {
return forEach(node.jsDocPropertyTags, cbNode);
},
- [336 /* JSDocTag */]: forEachChildInJSDocTag,
- [341 /* JSDocClassTag */]: forEachChildInJSDocTag,
- [342 /* JSDocPublicTag */]: forEachChildInJSDocTag,
- [343 /* JSDocPrivateTag */]: forEachChildInJSDocTag,
- [344 /* JSDocProtectedTag */]: forEachChildInJSDocTag,
- [345 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
- [340 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
- [346 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
- [359 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
+ [339 /* JSDocTag */]: forEachChildInJSDocTag,
+ [344 /* JSDocClassTag */]: forEachChildInJSDocTag,
+ [345 /* JSDocPublicTag */]: forEachChildInJSDocTag,
+ [346 /* JSDocPrivateTag */]: forEachChildInJSDocTag,
+ [347 /* JSDocProtectedTag */]: forEachChildInJSDocTag,
+ [348 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
+ [343 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
+ [349 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
+ [362 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
};
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
@@ -18930,6 +18987,9 @@ function forEachChildInClassDeclarationOrExpression(node, cbNode, cbNodes) {
function forEachChildInAnnotationDeclaration(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
}
+function forEachChildInOverloadDeclaration(node, cbNode, cbNodes) {
+ return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members);
+}
function forEachChildInNamedImportsOrExports(node, cbNode, cbNodes) {
return visitNodes(cbNode, cbNodes, node.elements);
}
@@ -18958,7 +19018,7 @@ function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) {
return visitNode2(cbNode, node.expression);
}
function forEachChild(node, cbNode, cbNodes) {
- if (node === void 0 || node.kind <= 164 /* LastToken */) {
+ if (node === void 0 || node.kind <= 165 /* LastToken */) {
return;
}
const fn = forEachChildTable[node.kind];
@@ -18993,7 +19053,7 @@ function forEachChildRecursively(rootNode, cbNode, cbNodes) {
continue;
return res;
}
- if (current.kind >= 165 /* FirstNode */) {
+ if (current.kind >= 166 /* FirstNode */) {
for (const child of gatherPossibleChildren(current)) {
queue.push(child);
parents.push(current);
@@ -19917,7 +19977,7 @@ var Parser;
parseErrorAtCurrentToken(diagnosticMessage, arg0);
}
const pos = getNodePos();
- const result = kind === 79 /* Identifier */ ? factory2.createIdentifier("", void 0, void 0) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, "", "", void 0) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral("", void 0) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral("", void 0) : kind === 285 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind);
+ const result = kind === 79 /* Identifier */ ? factory2.createIdentifier("", void 0, void 0) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, "", "", void 0) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral("", void 0) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral("", void 0) : kind === 288 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind);
return finishNode(result, pos);
}
function internIdentifier(text) {
@@ -20042,6 +20102,9 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
+ if (token() === 164 /* OverloadKeyword */) {
+ return true;
+ }
return canFollowExportModifier();
case 89 /* DefaultKeyword */:
return nextTokenCanFollowDefaultKeyword();
@@ -20066,7 +20129,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -20341,15 +20404,15 @@ var Parser;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 176 /* Constructor */:
- case 181 /* IndexSignature */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 241 /* SemicolonClassElement */:
+ case 178 /* Constructor */:
+ case 183 /* IndexSignature */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 243 /* SemicolonClassElement */:
return true;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return !inStructContext();
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
const methodDeclaration = node;
const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 136 /* ConstructorKeyword */;
return !nameIsConstructor;
@@ -20360,8 +20423,8 @@ var Parser;
function isReusableSwitchClause(node) {
if (node) {
switch (node.kind) {
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
return true;
}
}
@@ -20370,66 +20433,66 @@ var Parser;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 263 /* FunctionDeclaration */:
- case 244 /* VariableStatement */:
- case 242 /* Block */:
- case 246 /* IfStatement */:
- case 245 /* ExpressionStatement */:
- case 258 /* ThrowStatement */:
- case 254 /* ReturnStatement */:
- case 256 /* SwitchStatement */:
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 249 /* ForStatement */:
- case 248 /* WhileStatement */:
- case 255 /* WithStatement */:
- case 243 /* EmptyStatement */:
- case 259 /* TryStatement */:
- case 257 /* LabeledStatement */:
- case 247 /* DoStatement */:
- case 260 /* DebuggerStatement */:
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
- case 281 /* ExportDeclaration */:
- case 280 /* ExportAssignment */:
- case 270 /* ModuleDeclaration */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 267 /* InterfaceDeclaration */:
- case 269 /* EnumDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 265 /* FunctionDeclaration */:
+ case 246 /* VariableStatement */:
+ case 244 /* Block */:
+ case 248 /* IfStatement */:
+ case 247 /* ExpressionStatement */:
+ case 260 /* ThrowStatement */:
+ case 256 /* ReturnStatement */:
+ case 258 /* SwitchStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 251 /* ForStatement */:
+ case 250 /* WhileStatement */:
+ case 257 /* WithStatement */:
+ case 245 /* EmptyStatement */:
+ case 261 /* TryStatement */:
+ case 259 /* LabeledStatement */:
+ case 249 /* DoStatement */:
+ case 262 /* DebuggerStatement */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 284 /* ExportDeclaration */:
+ case 283 /* ExportAssignment */:
+ case 273 /* ModuleDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
}
}
return false;
}
function isReusableEnumMember(node) {
- return node.kind === 308 /* EnumMember */;
+ return node.kind === 311 /* EnumMember */;
}
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 180 /* ConstructSignature */:
- case 173 /* MethodSignature */:
- case 181 /* IndexSignature */:
- case 170 /* PropertySignature */:
- case 179 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 175 /* MethodSignature */:
+ case 183 /* IndexSignature */:
+ case 171 /* PropertySignature */:
+ case 181 /* CallSignature */:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 261 /* VariableDeclaration */) {
+ if (node.kind !== 263 /* VariableDeclaration */) {
return false;
}
const variableDeclarator = node;
return variableDeclarator.initializer === void 0;
}
function isReusableParameter(node) {
- if (node.kind !== 168 /* Parameter */) {
+ if (node.kind !== 169 /* Parameter */) {
return false;
}
const parameter = node;
@@ -20720,14 +20783,14 @@ var Parser;
}
function typeHasArrowFunctionBlockingParseError(node) {
switch (node.kind) {
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return nodeIsMissing(node.typeName);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */: {
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */: {
const { parameters, type } = node;
return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type);
}
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return typeHasArrowFunctionBlockingParseError(node.type);
default:
return false;
@@ -20968,14 +21031,14 @@ var Parser;
function parseSignatureMember(kind) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
- if (kind === 180 /* ConstructSignature */) {
+ if (kind === 182 /* ConstructSignature */) {
parseExpected(104 /* NewKeyword */);
}
const typeParameters = parseTypeParameters();
const parameters = parseParameters(4 /* Type */);
const type = parseReturnType(58 /* ColonToken */, true);
parseTypeMemberSemicolon();
- const node = kind === 179 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type);
+ const node = kind === 181 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function isIndexSignature() {
@@ -21013,6 +21076,17 @@ var Parser;
node.illegalDecorators = decorators;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+ function parseOverloadPropertyDeclaration(pos, hasJSDoc, modifiers) {
+ const name = parsePropertyName();
+ const questionToken = parseOptionalToken(57 /* QuestionToken */);
+ let node;
+ const type = parseTypeAnnotation();
+ node = factory2.createOverloadPropertyDeclaration(modifiers, name, questionToken, type);
+ if (token() === 63 /* EqualsToken */)
+ node.initializer = parseInitializer();
+ parseTypeMemberSemicolon();
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
+ }
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
@@ -21054,19 +21128,19 @@ var Parser;
}
function parseTypeMember() {
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) {
- return parseSignatureMember(179 /* CallSignature */);
+ return parseSignatureMember(181 /* CallSignature */);
}
if (token() === 104 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) {
- return parseSignatureMember(180 /* ConstructSignature */);
+ return parseSignatureMember(182 /* ConstructSignature */);
}
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 177 /* GetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 179 /* GetAccessor */, 4 /* Type */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 178 /* SetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 180 /* SetAccessor */, 4 /* Type */);
}
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
@@ -21942,7 +22016,7 @@ var Parser;
return void 0;
}
let unwrappedType = type;
- while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 196 /* ParenthesizedType */) {
+ while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 198 /* ParenthesizedType */) {
unwrappedType = unwrappedType.type;
}
const hasJSDocFunctionType = unwrappedType && isJSDocFunctionType(unwrappedType);
@@ -22005,7 +22079,7 @@ var Parser;
return parseBinaryExpressionRest(precedence, leftOperand, pos);
}
function isInOrOfKeyword(t) {
- return t === 102 /* InKeyword */ || t === 164 /* OfKeyword */;
+ return t === 102 /* InKeyword */ || t === 165 /* OfKeyword */;
}
function parseBinaryExpressionRest(precedence, leftOperand, pos) {
while (true) {
@@ -22087,7 +22161,7 @@ var Parser;
if (token() === 42 /* AsteriskAsteriskToken */) {
const pos = skipTrivia(sourceText, simpleUnaryExpression.pos);
const { end } = simpleUnaryExpression;
- if (simpleUnaryExpression.kind === 216 /* TypeAssertionExpression */) {
+ if (simpleUnaryExpression.kind === 218 /* TypeAssertionExpression */) {
parseErrorAt(pos, end, Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
} else {
parseErrorAt(pos, end, Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator));
@@ -22210,11 +22284,11 @@ var Parser;
const pos = getNodePos();
const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext);
let result;
- if (opening.kind === 289 /* JsxOpeningElement */) {
+ if (opening.kind === 292 /* JsxOpeningElement */) {
let children = parseJsxChildren(opening);
let closingElement;
const lastChild = children[children.length - 1];
- if ((lastChild == null ? void 0 : lastChild.kind) === 287 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) {
+ if ((lastChild == null ? void 0 : lastChild.kind) === 290 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) {
const end = lastChild.children.end;
const newLast = finishNode(
factory2.createJsxElement(
@@ -22238,10 +22312,10 @@ var Parser;
}
}
result = finishNode(factory2.createJsxElement(opening, children, closingElement), pos);
- } else if (opening.kind === 292 /* JsxOpeningFragment */) {
+ } else if (opening.kind === 295 /* JsxOpeningFragment */) {
result = finishNode(factory2.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos);
} else {
- Debug.assert(opening.kind === 288 /* JsxSelfClosingElement */);
+ Debug.assert(opening.kind === 291 /* JsxSelfClosingElement */);
result = opening;
}
if (inExpressionContext && token() === 29 /* LessThanToken */) {
@@ -22297,7 +22371,7 @@ var Parser;
if (!child)
break;
list.push(child);
- if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 287 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) {
+ if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 290 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) {
break;
}
}
@@ -22505,7 +22579,7 @@ var Parser;
continue;
}
if (isTemplateStartOfTaggedTemplate()) {
- expression = !questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest(pos, expression, questionDotToken, void 0);
+ expression = !questionDotToken && expression.kind === 236 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest(pos, expression, questionDotToken, void 0);
continue;
}
if (!questionDotToken) {
@@ -22553,7 +22627,7 @@ var Parser;
}
}
if (typeArguments || token() === 20 /* OpenParenToken */) {
- if (!questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (!questionDotToken && expression.kind === 236 /* ExpressionWithTypeArguments */) {
typeArguments = expression.typeArguments;
expression = expression.expression;
}
@@ -22780,10 +22854,10 @@ var Parser;
const decorators = parseDecorators();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 177 /* GetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 0 /* None */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 178 /* SetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 0 /* None */);
}
const asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
const tokenIsIdentifier = isIdentifier2();
@@ -22853,7 +22927,7 @@ var Parser;
const expressionPos = getNodePos();
let expression = parseMemberExpressionRest(expressionPos, parsePrimaryExpression(), false);
let typeArguments;
- if (expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (expression.kind === 236 /* ExpressionWithTypeArguments */) {
typeArguments = expression.typeArguments;
expression = expression.expression;
}
@@ -22961,7 +23035,7 @@ var Parser;
}
}
let node;
- if (awaitToken ? parseExpected(164 /* OfKeyword */) : parseOptional(164 /* OfKeyword */)) {
+ if (awaitToken ? parseExpected(165 /* OfKeyword */) : parseOptional(165 /* OfKeyword */)) {
const expression = allowInAnd(() => parseAssignmentExpressionOrHigher(true));
parseExpected(21 /* CloseParenToken */);
node = factory2.createForOfStatement(awaitToken, initializer, expression, parseStatement());
@@ -22982,10 +23056,10 @@ var Parser;
function parseBreakOrContinueStatement(kind) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
- parseExpected(kind === 253 /* BreakStatement */ ? 81 /* BreakKeyword */ : 87 /* ContinueKeyword */);
+ parseExpected(kind === 255 /* BreakStatement */ ? 81 /* BreakKeyword */ : 87 /* ContinueKeyword */);
const label = canParseSemicolon() ? void 0 : parseIdentifier();
parseSemicolon();
- const node = kind === 253 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label);
+ const node = kind === 255 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseReturnStatement() {
@@ -23139,6 +23213,8 @@ var Parser;
return inEtsContext();
case 59 /* AtToken */:
return inAllowAnnotationContext() && nextToken() === 119 /* InterfaceKeyword */;
+ case 164 /* OverloadKeyword */:
+ return nextTokenIsIdentifierOnSameLine();
case 119 /* InterfaceKeyword */:
case 155 /* TypeKeyword */:
return nextTokenIsIdentifierOnSameLine();
@@ -23273,9 +23349,9 @@ var Parser;
case 98 /* ForKeyword */:
return parseForOrForInOrForOfStatement();
case 87 /* ContinueKeyword */:
- return parseBreakOrContinueStatement(252 /* ContinueStatement */);
+ return parseBreakOrContinueStatement(254 /* ContinueStatement */);
case 81 /* BreakKeyword */:
- return parseBreakOrContinueStatement(253 /* BreakStatement */);
+ return parseBreakOrContinueStatement(255 /* BreakStatement */);
case 106 /* ReturnKeyword */:
return parseReturnStatement();
case 117 /* WithKeyword */:
@@ -23291,6 +23367,7 @@ var Parser;
case 88 /* DebuggerKeyword */:
return parseDebuggerStatement();
case 59 /* AtToken */:
+ case 164 /* OverloadKeyword */:
return parseDeclaration();
case 133 /* AsyncKeyword */:
case 119 /* InterfaceKeyword */:
@@ -23339,6 +23416,19 @@ var Parser;
const node = factory2.createAnnotationDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+ function parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers) {
+ parseExpected(164 /* OverloadKeyword */);
+ const name = createIdentifier(isBindingIdentifier());
+ let members;
+ if (parseExpected(18 /* OpenBraceToken */)) {
+ members = parseOverloadMembers();
+ parseExpected(19 /* CloseBraceToken */);
+ } else {
+ members = createMissingList();
+ }
+ const node = factory2.createOverloadDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
+ }
function parseDeclaration() {
var _a2, _b;
const pos = getNodePos();
@@ -23408,6 +23498,8 @@ var Parser;
return parseAnnotationDeclaration(pos, hasJSDoc, decorators, modifiers);
}
return parseDeclarationDefault(pos, decorators, modifiers);
+ case 164 /* OverloadKeyword */:
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
case 119 /* InterfaceKeyword */:
return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
case 155 /* TypeKeyword */:
@@ -23437,7 +23529,7 @@ var Parser;
}
function parseDeclarationDefault(pos, decorators, modifiers) {
if (decorators || modifiers) {
- const missing = createMissingNode(285 /* MissingDeclaration */, true, Diagnostics.Declaration_expected);
+ const missing = createMissingNode(288 /* MissingDeclaration */, true, Diagnostics.Declaration_expected);
setTextRangePos(missing, pos);
missing.illegalDecorators = decorators;
missing.modifiers = modifiers;
@@ -23547,7 +23639,7 @@ var Parser;
}
nextToken();
let declarations;
- if (token() === 164 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {
+ if (token() === 165 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {
declarations = createMissingList();
} else {
const savedDisallowIn = inDisallowInContext();
@@ -23577,7 +23669,7 @@ var Parser;
const asteriskToken = parseOptionalToken(41 /* AsteriskToken */);
const name = modifierFlags & 1024 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier();
if (name && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
- fileStylesComponents.set(name.escapedText.toString(), 263 /* FunctionDeclaration */);
+ fileStylesComponents.set(name.escapedText.toString(), 265 /* FunctionDeclaration */);
}
const originalUICallbackContext = inUICallbackContext();
setEtsBuilderContext(hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions));
@@ -23681,7 +23773,7 @@ var Parser;
setUICallbackContext(inBuildContext() || inBuilderContext());
if (inStructContext() && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
if (methodName && currentStructName) {
- structStylesComponents.set(methodName, { structName: currentStructName, kind: 174 /* MethodDeclaration */ });
+ structStylesComponents.set(methodName, { structName: currentStructName, kind: 176 /* MethodDeclaration */ });
}
const stylesEtsComponentDecoratorNames = getEtsStylesDecoratorComponentNames(decorators, sourceFileCompilerOptions);
if (stylesEtsComponentDecoratorNames.length > 0) {
@@ -23770,7 +23862,7 @@ var Parser;
const parameters = parseParameters(0 /* None */);
const type = parseReturnType(58 /* ColonToken */, false);
const body = parseFunctionBlockOrSemicolon(flags);
- const node = kind === 177 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body);
+ const node = kind === 179 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body);
node.typeParameters = typeParameters;
if (isSetAccessorDeclaration(node))
node.type = type;
@@ -23982,10 +24074,10 @@ var Parser;
return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 177 /* GetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 0 /* None */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 178 /* SetAccessor */, 0 /* None */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 0 /* None */);
}
if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers);
@@ -24021,35 +24113,35 @@ var Parser;
const hasJSDoc = hasPrecedingJSDocComment();
if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (parseContextualModifier(138 /* GetKeyword */)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
}
if (isIndexSignature()) {
return createMissingNode(
- 172 /* AnnotationPropertyDeclaration */,
+ 173 /* AnnotationPropertyDeclaration */,
true,
Diagnostics.Unexpected_keyword_or_identifier
);
@@ -24060,11 +24152,66 @@ var Parser;
}
return Debug.fail("Should not have attempted to parse annotation member declaration.");
}
+ function parseOverloadElement() {
+ const pos = getNodePos();
+ if (token() === 26 /* SemicolonToken */) {
+ parseErrorAt(pos, pos, Diagnostics.Unexpected_keyword_or_identifier);
+ }
+ const hasJSDoc = hasPrecedingJSDocComment();
+ if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (parseContextualModifier(138 /* GetKeyword */)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (parseContextualModifier(152 /* SetKeyword */)) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (isIndexSignature()) {
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ if (tokenIsIdentifierOrKeyword(token())) {
+ const modifiers = parseModifiers();
+ let overloadPropertyDeclaration = parseOverloadPropertyDeclaration(pos, hasJSDoc, modifiers);
+ if (overloadPropertyDeclaration.kind === 174 /* OverloadPropertyDeclaration */) {
+ return overloadPropertyDeclaration;
+ }
+ return createMissingNode(
+ 174 /* OverloadPropertyDeclaration */,
+ true,
+ Diagnostics.Unexpected_keyword_or_identifier
+ );
+ }
+ return Debug.fail("Should not have attempted to parse annotation member declaration.");
+ }
function parseClassExpression() {
- return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0, 232 /* ClassExpression */);
+ return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0, 234 /* ClassExpression */);
}
function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) {
- return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 264 /* ClassDeclaration */);
+ return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 266 /* ClassDeclaration */);
}
function parseStructDeclaration(pos, hasJSDoc, decorators, modifiers) {
return parseStructDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers);
@@ -24085,7 +24232,7 @@ var Parser;
members = createMissingList();
}
setAwaitContext(savedAwaitContext);
- const node = kind === 264 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
+ const node = kind === 266 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseStructDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers) {
@@ -24149,7 +24296,7 @@ var Parser;
function parseExpressionWithTypeArguments() {
const pos = getNodePos();
const expression = parseLeftHandSideExpressionOrHigher();
- if (expression.kind === 234 /* ExpressionWithTypeArguments */) {
+ if (expression.kind === 236 /* ExpressionWithTypeArguments */) {
return expression;
}
const typeArguments = tryParseTypeArguments();
@@ -24167,13 +24314,16 @@ var Parser;
function parseAnnotationMembers() {
return parseList(ParsingContext.AnnotationMembers, parseAnnotationElement);
}
+ function parseOverloadMembers() {
+ return parseList(ParsingContext.TypeMembers, parseOverloadElement);
+ }
function parseStructMembers(pos) {
const structMembers = parseList(ParsingContext.ClassMembers, parseClassElement);
const virtualStructMembers = [];
const virtualParameterProperties = [];
structMembers.forEach((member) => {
virtualStructMembers.push(member);
- if (member.kind === 171 /* PropertyDeclaration */) {
+ if (member.kind === 172 /* PropertyDeclaration */) {
const property = member;
virtualParameterProperties.push(
finishVirtualNode(
@@ -24420,7 +24570,7 @@ var Parser;
function parseImportClause(identifier, pos, isTypeOnly) {
let namedBindings;
if (!identifier || parseOptional(27 /* CommaToken */)) {
- namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(278 /* NamedImports */);
+ namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(281 /* NamedImports */);
}
return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos);
}
@@ -24453,15 +24603,15 @@ var Parser;
}
function parseNamedImportsOrExports(kind) {
const pos = getNodePos();
- const node = kind === 278 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */));
+ const node = kind === 281 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */));
return finishNode(node, pos);
}
function parseExportSpecifier() {
const hasJSDoc = hasPrecedingJSDocComment();
- return withJSDoc(parseImportOrExportSpecifier(284 /* ExportSpecifier */), hasJSDoc);
+ return withJSDoc(parseImportOrExportSpecifier(287 /* ExportSpecifier */), hasJSDoc);
}
function parseImportSpecifier() {
- return parseImportOrExportSpecifier(279 /* ImportSpecifier */);
+ return parseImportOrExportSpecifier(282 /* ImportSpecifier */);
}
function parseImportOrExportSpecifier(kind) {
const pos = getNodePos();
@@ -24505,10 +24655,10 @@ var Parser;
parseExpected(129 /* AsKeyword */);
name = parseNameWithKeywordCheck();
}
- if (kind === 279 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
+ if (kind === 282 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected);
}
- const node = kind === 279 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
+ const node = kind === 282 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
return finishNode(node, pos);
function parseNameWithKeywordCheck() {
checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2();
@@ -24535,7 +24685,7 @@ var Parser;
parseExpected(160 /* FromKeyword */);
moduleSpecifier = parseModuleSpecifier();
} else {
- exportClause = parseNamedImportsOrExports(282 /* NamedExports */);
+ exportClause = parseNamedImportsOrExports(285 /* NamedExports */);
if (token() === 160 /* FromKeyword */ || token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak()) {
parseExpected(160 /* FromKeyword */);
moduleSpecifier = parseModuleSpecifier();
@@ -25109,7 +25259,7 @@ var Parser;
switch (node.kind) {
case 150 /* ObjectKeyword */:
return true;
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return isObjectOrObjectArrayTypeReference(node.elementType);
default:
return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments;
@@ -25139,12 +25289,12 @@ var Parser;
let child;
let children;
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) {
- if (child.kind === 349 /* JSDocParameterTag */ || child.kind === 356 /* JSDocPropertyTag */) {
+ if (child.kind === 352 /* JSDocParameterTag */ || child.kind === 359 /* JSDocPropertyTag */) {
children = append(children, child);
}
}
if (children) {
- const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 188 /* ArrayType */), pos);
+ const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 190 /* ArrayType */), pos);
return finishNode(factory2.createJSDocTypeExpression(literal), pos);
}
}
@@ -25257,7 +25407,7 @@ var Parser;
let hasChildren = false;
while (child = tryParse(() => parseChildPropertyTag(indent2))) {
hasChildren = true;
- if (child.kind === 352 /* JSDocTypeTag */) {
+ if (child.kind === 355 /* JSDocTypeTag */) {
if (childTypeTag) {
const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
if (lastError) {
@@ -25272,7 +25422,7 @@ var Parser;
}
}
if (hasChildren) {
- const isArrayType = typeExpression && typeExpression.type.kind === 188 /* ArrayType */;
+ const isArrayType = typeExpression && typeExpression.type.kind === 190 /* ArrayType */;
const jsdocTypeLiteral = factory2.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType);
typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral, start2);
end2 = typeExpression.end;
@@ -25323,7 +25473,7 @@ var Parser;
const returnTag = tryParse(() => {
if (parseOptionalJsdoc(59 /* AtToken */)) {
const tag = parseTag(indent2);
- if (tag && tag.kind === 350 /* JSDocReturnTag */) {
+ if (tag && tag.kind === 353 /* JSDocReturnTag */) {
return tag;
}
}
@@ -25357,7 +25507,7 @@ var Parser;
case 59 /* AtToken */:
if (canParseTag) {
const child = tryParseChildTag(target, indent2);
- if (child && (child.kind === 349 /* JSDocParameterTag */ || child.kind === 356 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
+ if (child && (child.kind === 352 /* JSDocParameterTag */ || child.kind === 359 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
return false;
}
return child;
@@ -27642,7 +27792,7 @@ function convertConfigFileToObject(sourceFile, errors, reportOptionsErrors, opti
var _a2;
const rootExpression = (_a2 = sourceFile.statements[0]) == null ? void 0 : _a2.expression;
const knownRootOptions = reportOptionsErrors ? getTsconfigRootOptionsMap() : void 0;
- if (rootExpression && rootExpression.kind !== 210 /* ObjectLiteralExpression */) {
+ if (rootExpression && rootExpression.kind !== 212 /* ObjectLiteralExpression */) {
errors.push(createDiagnosticForNodeInSourceFile(
sourceFile,
rootExpression,
@@ -27670,7 +27820,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) {
const result = returnValue ? {} : void 0;
for (const element of node.properties) {
- if (element.kind !== 305 /* PropertyAssignment */) {
+ if (element.kind !== 308 /* PropertyAssignment */) {
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element, Diagnostics.Property_assignment_expected));
continue;
}
@@ -27758,13 +27908,13 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
case 8 /* NumericLiteral */:
reportInvalidOptionValue(option && option.type !== "number");
return validateValue(Number(valueExpression.text));
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) {
break;
}
reportInvalidOptionValue(option && option.type !== "number");
return validateValue(-Number(valueExpression.operand.text));
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
reportInvalidOptionValue(option && option.type !== "object");
const objectLiteralExpression = valueExpression;
if (option) {
@@ -27783,7 +27933,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
void 0
));
}
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
reportInvalidOptionValue(option && option.type !== "list");
return validateValue(convertArrayLiteralExpressionToJson(
valueExpression.elements,
@@ -29331,7 +29481,7 @@ function getEtsExtendDecoratorsComponentNames(decorators, compilerOptions) {
const extendComponents = [];
const extendDecorator = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.extend) == null ? void 0 : _b.decorator) != null ? _c : "Extend";
decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (decorator.expression.kind === 213 /* CallExpression */) {
+ if (decorator.expression.kind === 215 /* CallExpression */) {
const identifier = decorator.expression.expression;
const args = decorator.expression.arguments;
if (identifier.kind === 79 /* Identifier */ && (extendDecorator == null ? void 0 : extendDecorator.includes(identifier.escapedText.toString())) && args.length) {
@@ -29348,7 +29498,7 @@ function getEtsStylesDecoratorComponentNames(decorators, compilerOptions) {
const stylesComponents = [];
const stylesDecorator = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.styles) == null ? void 0 : _b.decorator) != null ? _c : "Styles";
decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (decorator.kind === 169 /* Decorator */ && decorator.expression.kind === 79 /* Identifier */) {
+ if (decorator.kind === 170 /* Decorator */ && decorator.expression.kind === 79 /* Identifier */) {
const identifier = decorator.expression;
if (identifier.kind === 79 /* Identifier */ && identifier.escapedText === stylesDecorator) {
stylesComponents.push(identifier.escapedText);
@@ -29605,23 +29755,23 @@ function getModuleInstanceStateCached(node, visited = new Map2()) {
}
function getModuleInstanceStateWorker(node, visited) {
switch (node.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return 0 /* NonInstantiated */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
if (isEnumConst(node)) {
return 2 /* ConstEnumOnly */;
}
break;
- case 275 /* ImportDeclaration */:
- case 274 /* ImportEqualsDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
if (!hasSyntacticModifier(node, 1 /* Export */)) {
return 0 /* NonInstantiated */;
}
break;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
const exportDeclaration = node;
- if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 282 /* NamedExports */) {
+ if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 285 /* NamedExports */) {
let state = 0 /* NonInstantiated */;
for (const specifier of exportDeclaration.exportClause.elements) {
const specifierState = getModuleInstanceStateForAliasTarget(specifier, visited);
@@ -29635,7 +29785,7 @@ function getModuleInstanceStateWorker(node, visited) {
return state;
}
break;
- case 271 /* ModuleBlock */: {
+ case 274 /* ModuleBlock */: {
let state = 0 /* NonInstantiated */;
forEachChild(node, (n) => {
const childState = getModuleInstanceStateCached(n, visited);
@@ -29654,7 +29804,7 @@ function getModuleInstanceStateWorker(node, visited) {
});
return state;
}
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return getModuleInstanceState(node, visited);
case 79 /* Identifier */:
if (node.isInJSDocNamespace) {
@@ -29804,7 +29954,7 @@ function createBinder() {
}
}
function getDeclarationName(node) {
- if (node.kind === 280 /* ExportAssignment */) {
+ if (node.kind === 283 /* ExportAssignment */) {
return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
}
const name = getNameOfDeclaration(node);
@@ -29813,7 +29963,7 @@ function createBinder() {
const moduleName = getTextOfIdentifierOrLiteral(name);
return isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName}"`;
}
- if (name.kind === 166 /* ComputedPropertyName */) {
+ if (name.kind === 167 /* ComputedPropertyName */) {
const nameExpression = name.expression;
if (isStringOrNumericLiteralLike(nameExpression)) {
return escapeLeadingUnderscores(nameExpression.text);
@@ -29835,30 +29985,30 @@ function createBinder() {
return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0;
}
switch (node.kind) {
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return "__constructor" /* Constructor */;
- case 184 /* FunctionType */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
+ case 186 /* FunctionType */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
return "__call" /* Call */;
- case 185 /* ConstructorType */:
- case 180 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 182 /* ConstructSignature */:
return "__new" /* New */;
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return "__index" /* Index */;
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return "__export" /* ExportStar */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return "export=" /* ExportEquals */;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) {
return "export=" /* ExportEquals */;
}
Debug.fail("Unknown binary declaration kind");
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */;
- case 168 /* Parameter */:
- Debug.assert(node.parent.kind === 326 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
+ case 169 /* Parameter */:
+ Debug.assert(node.parent.kind === 329 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
const functionType = node.parent;
const index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -29905,7 +30055,7 @@ function createBinder() {
messageNeedsName = false;
multipleDefaultExports = true;
} else {
- if (symbol.declarations && symbol.declarations.length && (node.kind === 280 /* ExportAssignment */ && !node.isExportEquals)) {
+ if (symbol.declarations && symbol.declarations.length && (node.kind === 283 /* ExportAssignment */ && !node.isExportEquals)) {
message = Diagnostics.A_module_cannot_have_multiple_default_exports;
messageNeedsName = false;
multipleDefaultExports = true;
@@ -29944,7 +30094,7 @@ function createBinder() {
function declareModuleMember(node, symbolFlags, symbolExcludes) {
const hasExportModifier = !!(getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node);
if (symbolFlags & 2097152 /* Alias */) {
- if (node.kind === 284 /* ExportSpecifier */ || node.kind === 274 /* ImportEqualsDeclaration */ && hasExportModifier) {
+ if (node.kind === 287 /* ExportSpecifier */ || node.kind === 277 /* ImportEqualsDeclaration */ && hasExportModifier) {
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
} else {
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
@@ -29988,7 +30138,7 @@ function createBinder() {
const saveThisParentContainer = thisParentContainer;
const savedBlockScopeContainer = blockScopeContainer;
if (containerFlags & 1 /* IsContainer */) {
- if (node.kind !== 219 /* ArrowFunction */) {
+ if (node.kind !== 221 /* ArrowFunction */) {
thisParentContainer = container;
}
container = blockScopeContainer = node;
@@ -30008,14 +30158,14 @@ function createBinder() {
const saveExceptionTarget = currentExceptionTarget;
const saveActiveLabelList = activeLabelList;
const saveHasExplicitReturn = hasExplicitReturn;
- const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 512 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */;
+ const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 512 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 177 /* ClassStaticBlockDeclaration */;
if (!isImmediatelyInvoked) {
currentFlow = initFlowNode({ flags: 2 /* Start */ });
if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) {
currentFlow.node = node;
}
}
- currentReturnTarget = isImmediatelyInvoked || node.kind === 176 /* Constructor */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */) ? createBranchLabel() : void 0;
+ currentReturnTarget = isImmediatelyInvoked || node.kind === 178 /* Constructor */ || isInJSFile(node) && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */) ? createBranchLabel() : void 0;
currentExceptionTarget = void 0;
currentBreakTarget = void 0;
currentContinueTarget = void 0;
@@ -30029,14 +30179,14 @@ function createBinder() {
node.flags |= 512 /* HasExplicitReturn */;
node.endFlowNode = currentFlow;
}
- if (node.kind === 314 /* SourceFile */) {
+ if (node.kind === 317 /* SourceFile */) {
node.flags |= emitFlags;
node.endFlowNode = currentFlow;
}
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
currentFlow = finishFlowLabel(currentReturnTarget);
- if (node.kind === 176 /* Constructor */ || node.kind === 175 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) {
+ if (node.kind === 178 /* Constructor */ || node.kind === 177 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 265 /* FunctionDeclaration */ || node.kind === 220 /* FunctionExpression */)) {
node.returnFlowNode = currentFlow;
}
}
@@ -30061,8 +30211,8 @@ function createBinder() {
blockScopeContainer = savedBlockScopeContainer;
}
function bindEachFunctionsFirst(nodes) {
- bindEach(nodes, (n) => n.kind === 263 /* FunctionDeclaration */ ? bind(n) : void 0);
- bindEach(nodes, (n) => n.kind !== 263 /* FunctionDeclaration */ ? bind(n) : void 0);
+ bindEach(nodes, (n) => n.kind === 265 /* FunctionDeclaration */ ? bind(n) : void 0);
+ bindEach(nodes, (n) => n.kind !== 265 /* FunctionDeclaration */ ? bind(n) : void 0);
}
function bindEach(nodes, bindFunction = bind) {
if (nodes === void 0) {
@@ -30082,59 +30232,59 @@ function createBinder() {
inAssignmentPattern = saveInAssignmentPattern;
return;
}
- if (node.kind >= 244 /* FirstStatement */ && node.kind <= 260 /* LastStatement */ && !options.allowUnreachableCode) {
+ if (node.kind >= 246 /* FirstStatement */ && node.kind <= 262 /* LastStatement */ && !options.allowUnreachableCode) {
node.flowNode = currentFlow;
}
switch (node.kind) {
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
bindWhileStatement(node);
break;
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
bindDoStatement(node);
break;
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
bindForStatement(node);
break;
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
bindForInOrForOfStatement(node);
break;
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
bindIfStatement(node);
break;
- case 254 /* ReturnStatement */:
- case 258 /* ThrowStatement */:
+ case 256 /* ReturnStatement */:
+ case 260 /* ThrowStatement */:
bindReturnOrThrow(node);
break;
- case 253 /* BreakStatement */:
- case 252 /* ContinueStatement */:
+ case 255 /* BreakStatement */:
+ case 254 /* ContinueStatement */:
bindBreakOrContinueStatement(node);
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
bindTryStatement(node);
break;
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
bindSwitchStatement(node);
break;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
bindCaseBlock(node);
break;
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
bindCaseClause(node);
break;
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
bindExpressionStatement(node);
break;
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
bindLabeledStatement(node);
break;
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
bindPrefixUnaryExpressionFlow(node);
break;
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
bindPostfixUnaryExpressionFlow(node);
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
if (isDestructuringAssignment(node)) {
inAssignmentPattern = saveInAssignmentPattern;
bindDestructuringAssignmentFlow(node);
@@ -30142,49 +30292,49 @@ function createBinder() {
}
bindBinaryExpressionFlow(node);
break;
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
bindDeleteExpressionFlow(node);
break;
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
bindConditionalExpressionFlow(node);
break;
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
bindVariableDeclarationFlow(node);
break;
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
bindAccessExpressionFlow(node);
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
bindCallExpressionFlow(node);
break;
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
bindNonNullExpressionFlow(node);
break;
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
bindJSDocTypeAlias(node);
break;
- case 314 /* SourceFile */: {
+ case 317 /* SourceFile */: {
bindEachFunctionsFirst(node.statements);
bind(node.endOfFileToken);
break;
}
- case 242 /* Block */:
- case 271 /* ModuleBlock */:
+ case 244 /* Block */:
+ case 274 /* ModuleBlock */:
bindEachFunctionsFirst(node.statements);
break;
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
bindBindingElementFlow(node);
break;
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
bindParameterFlow(node);
break;
- case 210 /* ObjectLiteralExpression */:
- case 209 /* ArrayLiteralExpression */:
- case 305 /* PropertyAssignment */:
- case 231 /* SpreadElement */:
+ case 212 /* ObjectLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
+ case 308 /* PropertyAssignment */:
+ case 233 /* SpreadElement */:
inAssignmentPattern = saveInAssignmentPattern;
default:
bindEachChild(node);
@@ -30198,19 +30348,19 @@ function createBinder() {
case 79 /* Identifier */:
case 80 /* PrivateIdentifier */:
case 109 /* ThisKeyword */:
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return containsNarrowableReference(expr);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return hasNarrowableArgument(expr);
- case 217 /* ParenthesizedExpression */:
- case 236 /* NonNullExpression */:
+ case 219 /* ParenthesizedExpression */:
+ case 238 /* NonNullExpression */:
return isNarrowingExpression(expr.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return isNarrowingBinaryExpression(expr);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return isNarrowingExpression(expr.expression);
}
return false;
@@ -30229,7 +30379,7 @@ function createBinder() {
}
}
}
- if (expr.expression.kind === 211 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) {
+ if (expr.expression.kind === 213 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) {
return true;
}
return false;
@@ -30260,9 +30410,9 @@ function createBinder() {
}
function isNarrowableOperand(expr) {
switch (expr.kind) {
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return isNarrowableOperand(expr.expression);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
switch (expr.operatorToken.kind) {
case 63 /* EqualsToken */:
return isNarrowableOperand(expr.left);
@@ -30335,24 +30485,24 @@ function createBinder() {
function isStatementCondition(node) {
const parent2 = node.parent;
switch (parent2.kind) {
- case 246 /* IfStatement */:
- case 248 /* WhileStatement */:
- case 247 /* DoStatement */:
+ case 248 /* IfStatement */:
+ case 250 /* WhileStatement */:
+ case 249 /* DoStatement */:
return parent2.expression === node;
- case 249 /* ForStatement */:
- case 228 /* ConditionalExpression */:
+ case 251 /* ForStatement */:
+ case 230 /* ConditionalExpression */:
return parent2.condition === node;
}
return false;
}
function isLogicalExpression(node) {
while (true) {
- if (node.kind === 217 /* ParenthesizedExpression */) {
+ if (node.kind === 219 /* ParenthesizedExpression */) {
node = node.expression;
- } else if (node.kind === 225 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
+ } else if (node.kind === 227 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {
node = node.operand;
} else {
- return node.kind === 227 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */);
+ return node.kind === 229 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */);
}
}
}
@@ -30393,7 +30543,7 @@ function createBinder() {
}
function setContinueTarget(node, target) {
let label = activeLabelList;
- while (label && node.parent.kind === 257 /* LabeledStatement */) {
+ while (label && node.parent.kind === 259 /* LabeledStatement */) {
label.continueTarget = target;
label = label.next;
node = node.parent;
@@ -30444,12 +30594,12 @@ function createBinder() {
bind(node.expression);
addAntecedent(preLoopLabel, currentFlow);
currentFlow = preLoopLabel;
- if (node.kind === 251 /* ForOfStatement */) {
+ if (node.kind === 253 /* ForOfStatement */) {
bind(node.awaitModifier);
}
addAntecedent(postLoopLabel, currentFlow);
bind(node.initializer);
- if (node.initializer.kind !== 262 /* VariableDeclarationList */) {
+ if (node.initializer.kind !== 264 /* VariableDeclarationList */) {
bindAssignmentTargetFlow(node.initializer);
}
bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
@@ -30471,7 +30621,7 @@ function createBinder() {
}
function bindReturnOrThrow(node) {
bind(node.expression);
- if (node.kind === 254 /* ReturnStatement */) {
+ if (node.kind === 256 /* ReturnStatement */) {
hasExplicitReturn = true;
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
@@ -30488,7 +30638,7 @@ function createBinder() {
return void 0;
}
function bindBreakOrContinueFlow(node, breakTarget, continueTarget) {
- const flowLabel = node.kind === 253 /* BreakStatement */ ? breakTarget : continueTarget;
+ const flowLabel = node.kind === 255 /* BreakStatement */ ? breakTarget : continueTarget;
if (flowLabel) {
addAntecedent(flowLabel, currentFlow);
currentFlow = unreachableFlow;
@@ -30558,7 +30708,7 @@ function createBinder() {
preSwitchCaseFlow = currentFlow;
bind(node.caseBlock);
addAntecedent(postSwitchLabel, currentFlow);
- const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 299 /* DefaultClause */);
+ const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 302 /* DefaultClause */);
node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents;
if (!hasDefault) {
addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0));
@@ -30601,7 +30751,7 @@ function createBinder() {
maybeBindExpressionFlowIfCall(node.expression);
}
function maybeBindExpressionFlowIfCall(node) {
- if (node.kind === 213 /* CallExpression */) {
+ if (node.kind === 215 /* CallExpression */) {
const call = node;
if (call.expression.kind !== 107 /* SuperKeyword */ && isDottedName(call.expression)) {
currentFlow = createFlowCall(currentFlow, call);
@@ -30627,7 +30777,7 @@ function createBinder() {
currentFlow = finishFlowLabel(postStatementLabel);
}
function bindDestructuringTargetFlow(node) {
- if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */) {
+ if (node.kind === 229 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */) {
bindAssignmentTargetFlow(node.left);
} else {
bindAssignmentTargetFlow(node);
@@ -30636,21 +30786,21 @@ function createBinder() {
function bindAssignmentTargetFlow(node) {
if (isNarrowableReference(node)) {
currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node);
- } else if (node.kind === 209 /* ArrayLiteralExpression */) {
+ } else if (node.kind === 211 /* ArrayLiteralExpression */) {
for (const e of node.elements) {
- if (e.kind === 231 /* SpreadElement */) {
+ if (e.kind === 233 /* SpreadElement */) {
bindAssignmentTargetFlow(e.expression);
} else {
bindDestructuringTargetFlow(e);
}
}
- } else if (node.kind === 210 /* ObjectLiteralExpression */) {
+ } else if (node.kind === 212 /* ObjectLiteralExpression */) {
for (const p of node.properties) {
- if (p.kind === 305 /* PropertyAssignment */) {
+ if (p.kind === 308 /* PropertyAssignment */) {
bindDestructuringTargetFlow(p.initializer);
- } else if (p.kind === 306 /* ShorthandPropertyAssignment */) {
+ } else if (p.kind === 309 /* ShorthandPropertyAssignment */) {
bindAssignmentTargetFlow(p.name);
- } else if (p.kind === 307 /* SpreadAssignment */) {
+ } else if (p.kind === 310 /* SpreadAssignment */) {
bindAssignmentTargetFlow(p.expression);
}
}
@@ -30773,7 +30923,7 @@ function createBinder() {
const operator = node.operatorToken.kind;
if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
- if (operator === 63 /* EqualsToken */ && node.left.kind === 212 /* ElementAccessExpression */) {
+ if (operator === 63 /* EqualsToken */ && node.left.kind === 214 /* ElementAccessExpression */) {
const elementAccess = node.left;
if (isNarrowableOperand(elementAccess.expression)) {
currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
@@ -30801,7 +30951,7 @@ function createBinder() {
}
function bindDeleteExpressionFlow(node) {
bindEachChild(node);
- if (node.expression.kind === 211 /* PropertyAccessExpression */) {
+ if (node.expression.kind === 213 /* PropertyAccessExpression */) {
bindAssignmentTargetFlow(node.expression);
}
}
@@ -30866,7 +31016,7 @@ function createBinder() {
}
function bindJSDocTypeAlias(node) {
bind(node.tagName);
- if (node.kind !== 348 /* JSDocEnumTag */ && node.fullName) {
+ if (node.kind !== 351 /* JSDocEnumTag */ && node.fullName) {
setParent(node.fullName, node);
setParentRecursive(node.fullName, false);
}
@@ -30877,7 +31027,7 @@ function createBinder() {
function bindJSDocClassTag(node) {
bindEachChild(node);
const host = getHostSignatureFromJSDoc(node);
- if (host && host.kind !== 174 /* MethodDeclaration */) {
+ if (host && host.kind !== 176 /* MethodDeclaration */) {
addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
}
}
@@ -30890,15 +31040,15 @@ function createBinder() {
}
function bindOptionalChainRest(node) {
switch (node.kind) {
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
bind(node.questionDotToken);
bind(node.name);
break;
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
bind(node.questionDotToken);
bind(node.argumentExpression);
break;
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
bind(node.questionDotToken);
bindEach(node.typeArguments);
bindEach(node.arguments);
@@ -30945,7 +31095,7 @@ function createBinder() {
bindOptionalChainFlow(node);
} else {
const expr = skipParentheses(node.expression);
- if (expr.kind === 218 /* FunctionExpression */ || expr.kind === 219 /* ArrowFunction */) {
+ if (expr.kind === 220 /* FunctionExpression */ || expr.kind === 221 /* ArrowFunction */) {
bindEach(node.typeArguments);
bindEach(node.arguments);
bind(node.expression);
@@ -30956,7 +31106,7 @@ function createBinder() {
}
}
}
- if (node.expression.kind === 211 /* PropertyAccessExpression */) {
+ if (node.expression.kind === 213 /* PropertyAccessExpression */) {
const propertyAccess = node.expression;
if (isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && isPushOrUnshiftIdentifier(propertyAccess.name)) {
currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);
@@ -30965,58 +31115,60 @@ function createBinder() {
}
function getContainerFlags(node) {
switch (node.kind) {
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
- case 269 /* EnumDeclaration */:
- case 210 /* ObjectLiteralExpression */:
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 295 /* JsxAttributes */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ case 272 /* EnumDeclaration */:
+ case 212 /* ObjectLiteralExpression */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 298 /* JsxAttributes */:
return 1 /* IsContainer */;
- case 267 /* InterfaceDeclaration */:
+ case 270 /* InterfaceDeclaration */:
return 1 /* IsContainer */ | 64 /* IsInterface */;
- case 270 /* ModuleDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 200 /* MappedType */:
- case 181 /* IndexSignature */:
+ case 273 /* ModuleDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 202 /* MappedType */:
+ case 183 /* IndexSignature */:
return 1 /* IsContainer */ | 32 /* HasLocals */;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 174 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
}
- case 176 /* Constructor */:
- case 263 /* FunctionDeclaration */:
- case 173 /* MethodSignature */:
- case 179 /* CallSignature */:
- case 332 /* JSDocSignature */:
- case 326 /* JSDocFunctionType */:
- case 184 /* FunctionType */:
- case 180 /* ConstructSignature */:
- case 185 /* ConstructorType */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 265 /* FunctionDeclaration */:
+ case 175 /* MethodSignature */:
+ case 181 /* CallSignature */:
+ case 335 /* JSDocSignature */:
+ case 329 /* JSDocFunctionType */:
+ case 186 /* FunctionType */:
+ case 182 /* ConstructSignature */:
+ case 187 /* ConstructorType */:
+ case 177 /* ClassStaticBlockDeclaration */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return 4 /* IsControlFlowContainer */;
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
- case 301 /* CatchClause */:
- case 249 /* ForStatement */:
- case 250 /* ForInStatement */:
- case 251 /* ForOfStatement */:
- case 272 /* CaseBlock */:
+ case 304 /* CatchClause */:
+ case 251 /* ForStatement */:
+ case 252 /* ForInStatement */:
+ case 253 /* ForOfStatement */:
+ case 275 /* CaseBlock */:
return 2 /* IsBlockScopedContainer */;
- case 242 /* Block */:
+ case 244 /* Block */:
return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */;
}
return 0 /* None */;
@@ -31029,43 +31181,44 @@ function createBinder() {
}
function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) {
switch (container.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return declareModuleMember(node, symbolFlags, symbolExcludes);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
- case 266 /* AnnotationDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
+ case 268 /* AnnotationDeclaration */:
+ case 269 /* OverloadDeclaration */:
return declareClassMember(node, symbolFlags, symbolExcludes);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 210 /* ObjectLiteralExpression */:
- case 267 /* InterfaceDeclaration */:
- case 295 /* JsxAttributes */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 212 /* ObjectLiteralExpression */:
+ case 270 /* InterfaceDeclaration */:
+ case 298 /* JsxAttributes */:
return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
- case 184 /* FunctionType */:
- case 185 /* ConstructorType */:
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 332 /* JSDocSignature */:
- case 181 /* IndexSignature */:
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
- case 176 /* Constructor */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
- case 326 /* JSDocFunctionType */:
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 175 /* ClassStaticBlockDeclaration */:
- case 268 /* TypeAliasDeclaration */:
- case 200 /* MappedType */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 335 /* JSDocSignature */:
+ case 183 /* IndexSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
+ case 178 /* Constructor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
+ case 329 /* JSDocFunctionType */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 177 /* ClassStaticBlockDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
+ case 202 /* MappedType */:
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
}
}
@@ -31151,10 +31304,10 @@ function createBinder() {
}
function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {
switch (blockScopeContainer.kind) {
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (isExternalOrCommonJsModule(container)) {
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
@@ -31344,7 +31497,7 @@ function createBinder() {
}
function checkStrictModeFunctionDeclaration(node) {
if (languageVersion < 2 /* ES2015 */) {
- if (blockScopeContainer.kind !== 314 /* SourceFile */ && blockScopeContainer.kind !== 270 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
+ if (blockScopeContainer.kind !== 317 /* SourceFile */ && blockScopeContainer.kind !== 273 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) {
const errorSpan = getErrorSpanForNode(file, node);
file.bindDiagnostics.push(createFileDiagnostic(
file,
@@ -31411,7 +31564,7 @@ function createBinder() {
node.tracingPath = file.path;
const saveInStrictMode = inStrictMode;
bindWorker(node);
- if (node.kind > 164 /* LastToken */) {
+ if (node.kind > 165 /* LastToken */) {
const saveParent = parent;
parent = node;
const containerFlags = getContainerFlags(node);
@@ -31473,23 +31626,23 @@ function createBinder() {
break;
}
case 109 /* ThisKeyword */:
- if (currentFlow && (isExpression(node) || parent.kind === 306 /* ShorthandPropertyAssignment */)) {
+ if (currentFlow && (isExpression(node) || parent.kind === 309 /* ShorthandPropertyAssignment */)) {
node.flowNode = currentFlow;
}
return checkContextualIdentifier(node);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
if (currentFlow && isPartOfTypeQuery(node)) {
node.flowNode = currentFlow;
}
break;
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
case 107 /* SuperKeyword */:
node.flowNode = currentFlow;
break;
case 80 /* PrivateIdentifier */:
return checkPrivateIdentifier(node);
- case 211 /* PropertyAccessExpression */:
- case 212 /* ElementAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
+ case 214 /* ElementAccessExpression */:
const expr = node;
if (currentFlow && isNarrowableReference(expr)) {
expr.flowNode = currentFlow;
@@ -31507,7 +31660,7 @@ function createBinder() {
);
}
break;
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
const specialKind = getAssignmentDeclarationKind(node);
switch (specialKind) {
case 1 /* ExportsProperty */:
@@ -31542,79 +31695,80 @@ function createBinder() {
Debug.fail("Unknown binary expression special property assignment kind");
}
return checkStrictModeBinaryExpression(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return checkStrictModeCatchClause(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return checkStrictModeDeleteExpression(node);
case 8 /* NumericLiteral */:
return checkStrictModeNumericLiteral(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return checkStrictModePostfixUnaryExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return checkStrictModePrefixUnaryExpression(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return checkStrictModeWithStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return checkStrictModeLabeledStatement(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
seenThisKeyword = true;
return;
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
break;
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return bindTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return bindParameter(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return bindVariableDeclarationOrBindingElement(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
node.flowNode = currentFlow;
return bindVariableDeclarationOrBindingElement(node);
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 170 /* PropertySignature */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 171 /* PropertySignature */:
+ case 174 /* OverloadPropertyDeclaration */:
return bindPropertyWorker(node);
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */);
- case 179 /* CallSignature */:
- case 180 /* ConstructSignature */:
- case 181 /* IndexSignature */:
+ case 181 /* CallSignature */:
+ case 182 /* ConstructSignature */:
+ case 183 /* IndexSignature */:
return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */);
- case 174 /* MethodDeclaration */:
- case 173 /* MethodSignature */:
+ case 176 /* MethodDeclaration */:
+ case 175 /* MethodSignature */:
return bindPropertyOrMethodOrAccessor(
node,
8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */),
isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */
);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return bindFunctionDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, 0 /* None */);
- case 177 /* GetAccessor */:
+ case 179 /* GetAccessor */:
return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */);
- case 178 /* SetAccessor */:
+ case 180 /* SetAccessor */:
return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */);
- case 184 /* FunctionType */:
- case 326 /* JSDocFunctionType */:
- case 332 /* JSDocSignature */:
- case 185 /* ConstructorType */:
+ case 186 /* FunctionType */:
+ case 329 /* JSDocFunctionType */:
+ case 335 /* JSDocSignature */:
+ case 187 /* ConstructorType */:
return bindFunctionOrConstructorType(node);
- case 187 /* TypeLiteral */:
- case 331 /* JSDocTypeLiteral */:
- case 200 /* MappedType */:
+ case 189 /* TypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
+ case 202 /* MappedType */:
return bindAnonymousTypeWorker(node);
- case 341 /* JSDocClassTag */:
+ case 344 /* JSDocClassTag */:
return bindJSDocClassTag(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return bindObjectLiteralExpression(node);
- case 218 /* FunctionExpression */:
- case 219 /* ArrowFunction */:
+ case 220 /* FunctionExpression */:
+ case 221 /* ArrowFunction */:
return bindFunctionExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
const assignmentKind = getAssignmentDeclarationKind(node);
switch (assignmentKind) {
case 7 /* ObjectDefinePropertyValue */:
@@ -31632,61 +31786,63 @@ function createBinder() {
bindCallExpression(node);
}
break;
- case 232 /* ClassExpression */:
- case 264 /* ClassDeclaration */:
- case 265 /* StructDeclaration */:
+ case 234 /* ClassExpression */:
+ case 266 /* ClassDeclaration */:
+ case 267 /* StructDeclaration */:
inStrictMode = true;
return bindClassLikeDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return bindAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return bindOverloadDeclaration(node);
+ case 270 /* InterfaceDeclaration */:
return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return bindEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return bindModuleDeclaration(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return bindJsxAttributes(node);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */);
- case 274 /* ImportEqualsDeclaration */:
- case 277 /* NamespaceImport */:
- case 279 /* ImportSpecifier */:
- case 284 /* ExportSpecifier */:
+ case 277 /* ImportEqualsDeclaration */:
+ case 280 /* NamespaceImport */:
+ case 282 /* ImportSpecifier */:
+ case 287 /* ExportSpecifier */:
return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return bindNamespaceExportDeclaration(node);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return bindImportClause(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return bindExportDeclaration(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return bindExportAssignment(node);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
updateStrictModeStatementList(node.statements);
return bindSourceFileIfExternalModule();
- case 242 /* Block */:
+ case 244 /* Block */:
if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) {
return;
}
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return updateStrictModeStatementList(node.statements);
- case 349 /* JSDocParameterTag */:
- if (node.parent.kind === 332 /* JSDocSignature */) {
+ case 352 /* JSDocParameterTag */:
+ if (node.parent.kind === 335 /* JSDocSignature */) {
return bindParameter(node);
}
- if (node.parent.kind !== 331 /* JSDocTypeLiteral */) {
+ if (node.parent.kind !== 334 /* JSDocTypeLiteral */) {
break;
}
- case 356 /* JSDocPropertyTag */:
+ case 359 /* JSDocPropertyTag */:
const propTag = node;
- const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 325 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
+ const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 328 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */);
- case 354 /* JSDocTypedefTag */:
- case 347 /* JSDocCallbackTag */:
- case 348 /* JSDocEnumTag */:
+ case 357 /* JSDocTypedefTag */:
+ case 350 /* JSDocCallbackTag */:
+ case 351 /* JSDocEnumTag */:
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
}
}
@@ -31824,8 +31980,8 @@ function createBinder() {
}
const thisContainer = getThisContainer(node, false);
switch (thisContainer.kind) {
- case 263 /* FunctionDeclaration */:
- case 218 /* FunctionExpression */:
+ case 265 /* FunctionDeclaration */:
+ case 220 /* FunctionExpression */:
let constructorSymbol = thisContainer.symbol;
if (isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 63 /* EqualsToken */) {
const l = thisContainer.parent.left;
@@ -31843,13 +31999,14 @@ function createBinder() {
addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */);
}
break;
- case 176 /* Constructor */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
- case 175 /* ClassStaticBlockDeclaration */:
+ case 178 /* Constructor */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 177 /* ClassStaticBlockDeclaration */:
const containingClass = thisContainer.parent;
const symbolTable = isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members;
if (hasDynamicName(node)) {
@@ -31858,7 +32015,7 @@ function createBinder() {
declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, true);
}
break;
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
if (hasDynamicName(node)) {
break;
} else if (thisContainer.commonJsModuleIndicator) {
@@ -31883,7 +32040,7 @@ function createBinder() {
function bindSpecialPropertyDeclaration(node) {
if (node.expression.kind === 109 /* ThisKeyword */) {
bindThisPropertyAssignment(node);
- } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 314 /* SourceFile */) {
+ } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 317 /* SourceFile */) {
if (isPrototypeAccess(node.expression)) {
bindPrototypePropertyAssignment(node, node.parent);
} else {
@@ -31913,7 +32070,7 @@ function createBinder() {
}
function bindObjectDefinePropertyAssignment(node) {
let namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]);
- const isToplevel = node.parent.parent.kind === 314 /* SourceFile */;
+ const isToplevel = node.parent.parent.kind === 317 /* SourceFile */;
namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, false, false);
bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, false);
}
@@ -31999,7 +32156,7 @@ function createBinder() {
declareSymbol(symbolTable, namespaceSymbol, declaration, includes | 67108864 /* Assignment */, excludes & ~67108864 /* Assignment */);
}
function isTopLevelNamespaceAssignment(propertyAccess) {
- return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 314 /* SourceFile */ : propertyAccess.parent.parent.kind === 314 /* SourceFile */;
+ return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 317 /* SourceFile */ : propertyAccess.parent.parent.kind === 317 /* SourceFile */;
}
function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) {
let namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer);
@@ -32057,7 +32214,7 @@ function createBinder() {
}
}
function bindClassLikeDeclaration(node) {
- if (node.kind === 264 /* ClassDeclaration */ || node.kind === 265 /* StructDeclaration */) {
+ if (node.kind === 266 /* ClassDeclaration */ || node.kind === 267 /* StructDeclaration */) {
bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */);
} else {
const bindingName = node.name ? node.name.escapedText : "__class" /* Class */;
@@ -32079,7 +32236,7 @@ function createBinder() {
prototypeSymbol.parent = symbol;
}
function bindAnnotationDeclaration(node) {
- Debug.assert(node.kind === 266 /* AnnotationDeclaration */);
+ Debug.assert(node.kind === 268 /* AnnotationDeclaration */);
bindBlockScopedDeclaration(node, 32 /* Class */ | 268435456 /* Annotation */, 899503 /* ClassExcludes */);
const { symbol } = node;
const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype");
@@ -32093,6 +32250,21 @@ function createBinder() {
symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);
prototypeSymbol.parent = symbol;
}
+ function bindOverloadDeclaration(node) {
+ Debug.assert(node.kind === 269 /* OverloadDeclaration */);
+ bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */);
+ const { symbol } = node;
+ const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype");
+ const symbolExport = symbol.exports.get(prototypeSymbol.escapedName);
+ if (symbolExport) {
+ if (node.name) {
+ setParent(node.name, node);
+ }
+ file.bindDiagnostics.push(createDiagnosticForNode2(symbolExport.declarations[0], Diagnostics.Duplicate_identifier_0, symbolName(prototypeSymbol)));
+ }
+ symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);
+ prototypeSymbol.parent = symbol;
+ }
function bindEnumDeclaration(node) {
return isEnumConst(node) ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */);
}
@@ -32101,7 +32273,7 @@ function createBinder() {
checkStrictModeEvalOrArguments(node, node.name);
}
if (!isBindingPattern(node.name)) {
- const possibleVariableDecl = node.kind === 261 /* VariableDeclaration */ ? node : node.parent.parent;
+ const possibleVariableDecl = node.kind === 263 /* VariableDeclaration */ ? node : node.parent.parent;
if (isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) {
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
} else if (isBlockOrCatchScoped(node)) {
@@ -32114,7 +32286,7 @@ function createBinder() {
}
}
function bindParameter(node) {
- if (node.kind === 349 /* JSDocParameterTag */ && container.kind !== 332 /* JSDocSignature */) {
+ if (node.kind === 352 /* JSDocParameterTag */ && container.kind !== 335 /* JSDocSignature */) {
return;
}
if (inStrictMode && !(node.flags & 16777216 /* Ambient */)) {
@@ -32181,7 +32353,7 @@ function createBinder() {
} else {
declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
}
- } else if (node.parent.kind === 195 /* InferType */) {
+ } else if (node.parent.kind === 197 /* InferType */) {
const container2 = getInferTypeContainer(node.parent);
if (container2) {
if (!container2.locals) {
@@ -32204,7 +32376,7 @@ function createBinder() {
return false;
}
if (currentFlow === unreachableFlow) {
- const reportError = isStatementButNotDeclaration(node) && node.kind !== 243 /* EmptyStatement */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 270 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
+ const reportError = isStatementButNotDeclaration(node) && node.kind !== 245 /* EmptyStatement */ || node.kind === 266 /* ClassDeclaration */ || node.kind === 273 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
if (reportError) {
currentFlow = reportedUnreachableFlow;
if (!options.allowUnreachableCode) {
@@ -32230,12 +32402,12 @@ function isExecutableStatement(s) {
}
function isPurelyTypeDeclaration(s) {
switch (s.kind) {
- case 267 /* InterfaceDeclaration */:
- case 268 /* TypeAliasDeclaration */:
+ case 270 /* InterfaceDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return true;
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return getModuleInstanceState(s) !== 1 /* Instantiated */;
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return hasSyntacticModifier(s, 2048 /* Const */);
default:
return false;
@@ -32412,7 +32584,7 @@ function isNotAccessor(declaration) {
return !isAccessor(declaration);
}
function isNotOverload(declaration) {
- return declaration.kind !== 263 /* FunctionDeclaration */ && declaration.kind !== 174 /* MethodDeclaration */ || !!declaration.body;
+ return declaration.kind !== 265 /* FunctionDeclaration */ && declaration.kind !== 176 /* MethodDeclaration */ || !!declaration.body;
}
var JsxNames;
((JsxNames2) => {
@@ -32650,20 +32822,20 @@ var visitEachChildTable = {
nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)
);
},
- [165 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [166 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateQualifiedName(
node,
nodeVisitor(node.left, visitor, isEntityName),
nodeVisitor(node.right, visitor, isIdentifier)
);
},
- [166 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [167 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateComputedPropertyName(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [167 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [168 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeParameterDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -32672,7 +32844,7 @@ var visitEachChildTable = {
nodeVisitor(node.default, visitor, isTypeNode)
);
},
- [168 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [169 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateParameterDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -32683,14 +32855,14 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [169 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [170 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDecorator(
node,
nodeVisitor(node.expression, visitor, isExpression),
node.annotationDeclaration
);
},
- [170 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [171 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updatePropertySignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -32699,7 +32871,16 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [171 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [174 /* OverloadPropertyDeclaration */]: function visitEachChildOfOverloadPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ return context.factory.updateOverloadPropertyDeclaration(
+ node,
+ nodesVisitor(node.modifiers, visitor, isModifier),
+ nodeVisitor(node.name, visitor, isPropertyName),
+ nodeVisitor(node.questionToken, tokenVisitor, isToken),
+ nodeVisitor(node.type, visitor, isTypeNode)
+ );
+ },
+ [172 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
var _a2;
return context.factory.updatePropertyDeclaration(
node,
@@ -32710,7 +32891,7 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [172 /* AnnotationPropertyDeclaration */]: function visitEachChildOfAnnotationPropertyDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [173 /* AnnotationPropertyDeclaration */]: function visitEachChildOfAnnotationPropertyDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAnnotationPropertyDeclaration(
node,
nodeVisitor(node.name, visitor, isPropertyName),
@@ -32718,7 +32899,7 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [173 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [175 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMethodSignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -32729,7 +32910,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [174 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [176 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMethodDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -32742,7 +32923,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [176 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [178 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructorDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -32750,7 +32931,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [177 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [179 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
if (context.isLexicalEnvironmentSuspended && context.isLexicalEnvironmentSuspended()) {
return context.factory.updateGetAccessorDeclaration(
node,
@@ -32771,7 +32952,7 @@ var visitEachChildTable = {
);
}
},
- [178 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [180 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
if (context.isLexicalEnvironmentSuspended && context.isLexicalEnvironmentSuspended()) {
return context.factory.updateSetAccessorDeclaration(
node,
@@ -32790,7 +32971,7 @@ var visitEachChildTable = {
);
}
},
- [175 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [177 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
context.startLexicalEnvironment();
context.suspendLexicalEnvironment();
return context.factory.updateClassStaticBlockDeclaration(
@@ -32798,7 +32979,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [179 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [181 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCallSignature(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -32806,7 +32987,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [180 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [182 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructSignature(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -32814,7 +32995,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [181 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [183 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIndexSignature(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -32822,7 +33003,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [182 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [184 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypePredicateNode(
node,
nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword),
@@ -32830,14 +33011,14 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [183 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [185 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeReferenceNode(
node,
nodeVisitor(node.typeName, visitor, isEntityName),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [184 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [186 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateFunctionTypeNode(
node,
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
@@ -32845,7 +33026,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [185 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [187 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConstructorTypeNode(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -32854,56 +33035,56 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [186 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [188 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeQueryNode(
node,
nodeVisitor(node.exprName, visitor, isEntityName),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [187 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [189 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeLiteralNode(
node,
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [188 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [190 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayTypeNode(
node,
nodeVisitor(node.elementType, visitor, isTypeNode)
);
},
- [189 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [191 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateTupleTypeNode(
node,
nodesVisitor(node.elements, visitor, isTypeNode)
);
},
- [190 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [192 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateOptionalTypeNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [191 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [193 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateRestTypeNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [192 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [194 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateUnionTypeNode(
node,
nodesVisitor(node.types, visitor, isTypeNode)
);
},
- [193 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [195 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateIntersectionTypeNode(
node,
nodesVisitor(node.types, visitor, isTypeNode)
);
},
- [194 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [196 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateConditionalTypeNode(
node,
nodeVisitor(node.checkType, visitor, isTypeNode),
@@ -32912,13 +33093,13 @@ var visitEachChildTable = {
nodeVisitor(node.falseType, visitor, isTypeNode)
);
},
- [195 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [197 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateInferTypeNode(
node,
nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)
);
},
- [205 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [207 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportTypeNode(
node,
nodeVisitor(node.argument, visitor, isTypeNode),
@@ -32928,14 +33109,14 @@ var visitEachChildTable = {
node.isTypeOf
);
},
- [304 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [307 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportTypeAssertionContainer(
node,
nodeVisitor(node.assertClause, visitor, isAssertClause),
node.multiLine
);
},
- [202 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [204 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateNamedTupleMember(
node,
nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken),
@@ -32944,26 +33125,26 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [196 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [198 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateParenthesizedType(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [198 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [200 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeOperatorNode(
node,
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [199 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [201 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIndexedAccessTypeNode(
node,
nodeVisitor(node.objectType, visitor, isTypeNode),
nodeVisitor(node.indexType, visitor, isTypeNode)
);
},
- [200 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [202 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateMappedTypeNode(
node,
nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken),
@@ -32974,39 +33155,39 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [201 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [203 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateLiteralTypeNode(
node,
nodeVisitor(node.literal, visitor, isExpression)
);
},
- [203 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [205 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateLiteralType(
node,
nodeVisitor(node.head, visitor, isTemplateHead),
nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan)
);
},
- [204 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [206 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateLiteralTypeSpan(
node,
nodeVisitor(node.type, visitor, isTypeNode),
nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)
);
},
- [206 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [208 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateObjectBindingPattern(
node,
nodesVisitor(node.elements, visitor, isBindingElement)
);
},
- [207 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [209 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayBindingPattern(
node,
nodesVisitor(node.elements, visitor, isArrayBindingElement)
);
},
- [208 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [210 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateBindingElement(
node,
nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken),
@@ -33015,19 +33196,19 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [209 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [211 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateArrayLiteralExpression(
node,
nodesVisitor(node.elements, visitor, isExpression)
);
},
- [210 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [212 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateObjectLiteralExpression(
node,
nodesVisitor(node.properties, visitor, isObjectLiteralElementLike)
);
},
- [211 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [213 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -33039,7 +33220,7 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isMemberName)
);
},
- [212 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [214 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return isElementAccessChain(node) ? context.factory.updateElementAccessChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -33051,7 +33232,7 @@ var visitEachChildTable = {
nodeVisitor(node.argumentExpression, visitor, isExpression)
);
},
- [213 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [215 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return isCallChain(node) ? context.factory.updateCallChain(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -33065,7 +33246,7 @@ var visitEachChildTable = {
nodesVisitor(node.arguments, visitor, isExpression)
);
},
- [220 /* EtsComponentExpression */]: function visitEachChildOfEtsComponentExpression(node, visitor, context, nodesVisitor, nodeVisitor) {
+ [222 /* EtsComponentExpression */]: function visitEachChildOfEtsComponentExpression(node, visitor, context, nodesVisitor, nodeVisitor) {
return context.factory.updateEtsComponentExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -33073,7 +33254,7 @@ var visitEachChildTable = {
nodeVisitor(node.body, visitor, isBlock)
);
},
- [214 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [216 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNewExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -33081,7 +33262,7 @@ var visitEachChildTable = {
nodesVisitor(node.arguments, visitor, isExpression)
);
},
- [215 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [217 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTaggedTemplateExpression(
node,
nodeVisitor(node.tag, visitor, isExpression),
@@ -33089,20 +33270,20 @@ var visitEachChildTable = {
nodeVisitor(node.template, visitor, isTemplateLiteral)
);
},
- [216 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [218 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeAssertion(
node,
nodeVisitor(node.type, visitor, isTypeNode),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [217 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [219 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateParenthesizedExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [218 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [220 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateFunctionExpression(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -33114,7 +33295,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [219 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [221 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateArrowFunction(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -33125,43 +33306,43 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [221 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [223 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDeleteExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [222 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [224 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeOfExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [223 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [225 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateVoidExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [224 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [226 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAwaitExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [225 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [227 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePrefixUnaryExpression(
node,
nodeVisitor(node.operand, visitor, isExpression)
);
},
- [226 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [228 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePostfixUnaryExpression(
node,
nodeVisitor(node.operand, visitor, isExpression)
);
},
- [227 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [229 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateBinaryExpression(
node,
nodeVisitor(node.left, visitor, isExpression),
@@ -33169,7 +33350,7 @@ var visitEachChildTable = {
nodeVisitor(node.right, visitor, isExpression)
);
},
- [228 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [230 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateConditionalExpression(
node,
nodeVisitor(node.condition, visitor, isExpression),
@@ -33179,27 +33360,27 @@ var visitEachChildTable = {
nodeVisitor(node.whenFalse, visitor, isExpression)
);
},
- [229 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [231 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateExpression(
node,
nodeVisitor(node.head, visitor, isTemplateHead),
nodesVisitor(node.templateSpans, visitor, isTemplateSpan)
);
},
- [230 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [232 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateYieldExpression(
node,
nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [231 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [233 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSpreadElement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [232 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [234 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateClassExpression(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -33209,28 +33390,28 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [234 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [236 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExpressionWithTypeArguments(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodesVisitor(node.typeArguments, visitor, isTypeNode)
);
},
- [235 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [237 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAsExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [239 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [241 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSatisfiesExpression(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [236 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [238 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return isOptionalChain(node) ? context.factory.updateNonNullChain(
node,
nodeVisitor(node.expression, visitor, isExpression)
@@ -33239,39 +33420,39 @@ var visitEachChildTable = {
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [237 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [239 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateMetaProperty(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [240 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [242 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTemplateSpan(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)
);
},
- [242 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [244 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateBlock(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [244 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [246 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateVariableStatement(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)
);
},
- [245 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [247 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExpressionStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [246 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [248 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateIfStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
@@ -33279,21 +33460,21 @@ var visitEachChildTable = {
nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [247 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [249 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateDoStatement(
node,
visitIterationBody(node.statement, visitor, context, nodeVisitor),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [248 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [250 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateWhileStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [249 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [251 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateForStatement(
node,
nodeVisitor(node.initializer, visitor, isForInitializer),
@@ -33302,7 +33483,7 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [250 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [252 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateForInStatement(
node,
nodeVisitor(node.initializer, visitor, isForInitializer),
@@ -33310,7 +33491,7 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [251 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [253 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateForOfStatement(
node,
nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword),
@@ -33319,52 +33500,52 @@ var visitEachChildTable = {
visitIterationBody(node.statement, visitor, context, nodeVisitor)
);
},
- [252 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [254 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateContinueStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier)
);
},
- [253 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [255 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateBreakStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier)
);
},
- [254 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [256 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateReturnStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [255 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [257 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateWithStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [256 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [258 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSwitchStatement(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodeVisitor(node.caseBlock, visitor, isCaseBlock)
);
},
- [257 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [259 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateLabeledStatement(
node,
nodeVisitor(node.label, visitor, isIdentifier),
nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)
);
},
- [258 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [260 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateThrowStatement(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [259 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [261 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTryStatement(
node,
nodeVisitor(node.tryBlock, visitor, isBlock),
@@ -33372,7 +33553,7 @@ var visitEachChildTable = {
nodeVisitor(node.finallyBlock, visitor, isBlock)
);
},
- [261 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
+ [263 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateVariableDeclaration(
node,
nodeVisitor(node.name, visitor, isBindingName),
@@ -33381,13 +33562,13 @@ var visitEachChildTable = {
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [262 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [264 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateVariableDeclarationList(
node,
nodesVisitor(node.declarations, visitor, isVariableDeclaration)
);
},
- [263 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ [265 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updateFunctionDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -33399,7 +33580,7 @@ var visitEachChildTable = {
visitFunctionBody(node.body, visitor, context, nodeVisitor)
);
},
- [264 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [266 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateClassDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -33409,7 +33590,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [265 /* StructDeclaration */]: function visitEachChildOfStructDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [267 /* StructDeclaration */]: function visitEachChildOfStructDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateStructDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -33419,7 +33600,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isClassElement)
);
},
- [266 /* AnnotationDeclaration */]: function visitEachChildOfAnnotationDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [268 /* AnnotationDeclaration */]: function visitEachChildOfAnnotationDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAnnotationDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -33427,7 +33608,15 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isAnnotationElement)
);
},
- [267 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [269 /* OverloadDeclaration */]: function visitEachChildOfOverloadDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ return context.factory.updateOverloadDeclaration(
+ node,
+ nodesVisitor(node.modifiers, visitor, isModifier),
+ nodeVisitor(node.name, visitor, isIdentifier),
+ nodesVisitor(node.members, visitor, isOverloadElement)
+ );
+ },
+ [270 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateInterfaceDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -33437,7 +33626,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isTypeElement)
);
},
- [268 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [271 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateTypeAliasDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -33446,7 +33635,7 @@ var visitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode)
);
},
- [269 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [272 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateEnumDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -33454,7 +33643,7 @@ var visitEachChildTable = {
nodesVisitor(node.members, visitor, isEnumMember)
);
},
- [270 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [273 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateModuleDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -33462,25 +33651,25 @@ var visitEachChildTable = {
nodeVisitor(node.body, visitor, isModuleBody)
);
},
- [271 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [274 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateModuleBlock(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [272 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [275 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateCaseBlock(
node,
nodesVisitor(node.clauses, visitor, isCaseOrDefaultClause)
);
},
- [273 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [276 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceExportDeclaration(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [274 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [277 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportEqualsDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -33489,7 +33678,7 @@ var visitEachChildTable = {
nodeVisitor(node.moduleReference, visitor, isModuleReference)
);
},
- [275 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [278 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -33498,21 +33687,21 @@ var visitEachChildTable = {
nodeVisitor(node.assertClause, visitor, isAssertClause)
);
},
- [302 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [305 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateAssertClause(
node,
nodesVisitor(node.elements, visitor, isAssertEntry),
node.multiLine
);
},
- [303 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [306 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateAssertEntry(
node,
nodeVisitor(node.name, visitor, isAssertionKey),
nodeVisitor(node.value, visitor, isExpression)
);
},
- [276 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [279 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportClause(
node,
node.isTypeOnly,
@@ -33520,25 +33709,25 @@ var visitEachChildTable = {
nodeVisitor(node.namedBindings, visitor, isNamedImportBindings)
);
},
- [277 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [280 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceImport(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [283 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [286 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateNamespaceExport(
node,
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [278 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [281 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateNamedImports(
node,
nodesVisitor(node.elements, visitor, isImportSpecifier)
);
},
- [279 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [282 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateImportSpecifier(
node,
node.isTypeOnly,
@@ -33546,14 +33735,14 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [280 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [283 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportAssignment(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [281 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [284 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportDeclaration(
node,
nodesVisitor(node.modifiers, visitor, isModifier),
@@ -33563,13 +33752,13 @@ var visitEachChildTable = {
nodeVisitor(node.assertClause, visitor, isAssertClause)
);
},
- [282 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [285 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateNamedExports(
node,
nodesVisitor(node.elements, visitor, isExportSpecifier)
);
},
- [284 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [287 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExportSpecifier(
node,
node.isTypeOnly,
@@ -33577,13 +33766,13 @@ var visitEachChildTable = {
nodeVisitor(node.name, visitor, isIdentifier)
);
},
- [286 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [289 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateExternalModuleReference(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [287 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [290 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxElement(
node,
nodeVisitor(node.openingElement, visitor, isJsxOpeningElement),
@@ -33591,7 +33780,7 @@ var visitEachChildTable = {
nodeVisitor(node.closingElement, visitor, isJsxClosingElement)
);
},
- [288 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [291 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxSelfClosingElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression),
@@ -33599,7 +33788,7 @@ var visitEachChildTable = {
nodeVisitor(node.attributes, visitor, isJsxAttributes)
);
},
- [289 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [292 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxOpeningElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression),
@@ -33607,13 +33796,13 @@ var visitEachChildTable = {
nodeVisitor(node.attributes, visitor, isJsxAttributes)
);
},
- [290 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [293 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxClosingElement(
node,
nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)
);
},
- [291 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [294 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxFragment(
node,
nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment),
@@ -33621,97 +33810,97 @@ var visitEachChildTable = {
nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)
);
},
- [294 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [297 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxAttribute(
node,
nodeVisitor(node.name, visitor, isIdentifier),
nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression)
);
},
- [295 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [298 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxAttributes(
node,
nodesVisitor(node.properties, visitor, isJsxAttributeLike)
);
},
- [296 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [299 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxSpreadAttribute(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [297 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [300 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateJsxExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [298 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [301 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCaseClause(
node,
nodeVisitor(node.expression, visitor, isExpression),
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [299 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [302 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateDefaultClause(
node,
nodesVisitor(node.statements, visitor, isStatement)
);
},
- [300 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [303 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateHeritageClause(
node,
nodesVisitor(node.types, visitor, isExpressionWithTypeArguments)
);
},
- [301 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [304 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateCatchClause(
node,
nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration),
nodeVisitor(node.block, visitor, isBlock)
);
},
- [305 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [308 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePropertyAssignment(
node,
nodeVisitor(node.name, visitor, isPropertyName),
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [306 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [309 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateShorthandPropertyAssignment(
node,
nodeVisitor(node.name, visitor, isIdentifier),
nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression)
);
},
- [307 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [310 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateSpreadAssignment(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [308 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [311 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateEnumMember(
node,
nodeVisitor(node.name, visitor, isPropertyName),
nodeVisitor(node.initializer, visitor, isExpression)
);
},
- [314 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [317 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateSourceFile(
node,
visitLexicalEnvironment(node.statements, visitor, context)
);
},
- [359 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
+ [362 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePartiallyEmittedExpression(
node,
nodeVisitor(node.expression, visitor, isExpression)
);
},
- [360 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
+ [363 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateCommaListExpression(
node,
nodesVisitor(node.elements, visitor, isExpression)
@@ -34005,7 +34194,7 @@ function hasInternalAnnotation(range, currentSourceFile) {
}
function isInternalDeclaration(node, currentSourceFile) {
const parseTreeNode = getParseTreeNode(node);
- if (parseTreeNode && parseTreeNode.kind === 168 /* Parameter */) {
+ if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
const text = currentSourceFile.text;
@@ -34140,11 +34329,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
break;
}
switch (node.kind) {
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return printFile(node);
- case 315 /* Bundle */:
+ case 318 /* Bundle */:
return printBundle(node);
- case 316 /* UnparsedSource */:
+ case 319 /* UnparsedSource */:
return printUnparsedSource(node);
}
writeNode(hint, node, sourceFile, beginPrint());
@@ -34458,300 +34647,304 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return emitIdentifier(node);
case 80 /* PrivateIdentifier */:
return emitPrivateIdentifier(node);
- case 165 /* QualifiedName */:
+ case 166 /* QualifiedName */:
return emitQualifiedName(node);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return emitComputedPropertyName(node);
- case 167 /* TypeParameter */:
+ case 168 /* TypeParameter */:
return emitTypeParameter(node);
- case 168 /* Parameter */:
+ case 169 /* Parameter */:
return emitParameter(node);
- case 169 /* Decorator */:
+ case 170 /* Decorator */:
return emitDecorator(node);
- case 170 /* PropertySignature */:
+ case 171 /* PropertySignature */:
return emitPropertySignature(node);
- case 171 /* PropertyDeclaration */:
+ case 172 /* PropertyDeclaration */:
return emitPropertyDeclaration(node);
- case 172 /* AnnotationPropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
return emitAnnotationPropertyDeclaration(node);
- case 173 /* MethodSignature */:
+ case 174 /* OverloadPropertyDeclaration */:
+ return emitOverloadPropertyDeclaration(node);
+ case 175 /* MethodSignature */:
return emitMethodSignature(node);
- case 174 /* MethodDeclaration */:
+ case 176 /* MethodDeclaration */:
return emitMethodDeclaration(node);
- case 175 /* ClassStaticBlockDeclaration */:
+ case 177 /* ClassStaticBlockDeclaration */:
return emitClassStaticBlockDeclaration(node);
- case 176 /* Constructor */:
+ case 178 /* Constructor */:
return emitConstructor(node);
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return emitAccessorDeclaration(node);
- case 179 /* CallSignature */:
+ case 181 /* CallSignature */:
return emitCallSignature(node);
- case 180 /* ConstructSignature */:
+ case 182 /* ConstructSignature */:
return emitConstructSignature(node);
- case 181 /* IndexSignature */:
+ case 183 /* IndexSignature */:
return emitIndexSignature(node);
- case 182 /* TypePredicate */:
+ case 184 /* TypePredicate */:
return emitTypePredicate(node);
- case 183 /* TypeReference */:
+ case 185 /* TypeReference */:
return emitTypeReference(node);
- case 184 /* FunctionType */:
+ case 186 /* FunctionType */:
return emitFunctionType(node);
- case 185 /* ConstructorType */:
+ case 187 /* ConstructorType */:
return emitConstructorType(node);
- case 186 /* TypeQuery */:
+ case 188 /* TypeQuery */:
return emitTypeQuery(node);
- case 187 /* TypeLiteral */:
+ case 189 /* TypeLiteral */:
return emitTypeLiteral(node);
- case 188 /* ArrayType */:
+ case 190 /* ArrayType */:
return emitArrayType(node);
- case 189 /* TupleType */:
+ case 191 /* TupleType */:
return emitTupleType(node);
- case 190 /* OptionalType */:
+ case 192 /* OptionalType */:
return emitOptionalType(node);
- case 192 /* UnionType */:
+ case 194 /* UnionType */:
return emitUnionType(node);
- case 193 /* IntersectionType */:
+ case 195 /* IntersectionType */:
return emitIntersectionType(node);
- case 194 /* ConditionalType */:
+ case 196 /* ConditionalType */:
return emitConditionalType(node);
- case 195 /* InferType */:
+ case 197 /* InferType */:
return emitInferType(node);
- case 196 /* ParenthesizedType */:
+ case 198 /* ParenthesizedType */:
return emitParenthesizedType(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return emitExpressionWithTypeArguments(node);
- case 197 /* ThisType */:
+ case 199 /* ThisType */:
return emitThisType();
- case 198 /* TypeOperator */:
+ case 200 /* TypeOperator */:
return emitTypeOperator(node);
- case 199 /* IndexedAccessType */:
+ case 201 /* IndexedAccessType */:
return emitIndexedAccessType(node);
- case 200 /* MappedType */:
+ case 202 /* MappedType */:
return emitMappedType(node);
- case 201 /* LiteralType */:
+ case 203 /* LiteralType */:
return emitLiteralType(node);
- case 202 /* NamedTupleMember */:
+ case 204 /* NamedTupleMember */:
return emitNamedTupleMember(node);
- case 203 /* TemplateLiteralType */:
+ case 205 /* TemplateLiteralType */:
return emitTemplateType(node);
- case 204 /* TemplateLiteralTypeSpan */:
+ case 206 /* TemplateLiteralTypeSpan */:
return emitTemplateTypeSpan(node);
- case 205 /* ImportType */:
+ case 207 /* ImportType */:
return emitImportTypeNode(node);
- case 206 /* ObjectBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
return emitObjectBindingPattern(node);
- case 207 /* ArrayBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
return emitArrayBindingPattern(node);
- case 208 /* BindingElement */:
+ case 210 /* BindingElement */:
return emitBindingElement(node);
- case 240 /* TemplateSpan */:
+ case 242 /* TemplateSpan */:
return emitTemplateSpan(node);
- case 241 /* SemicolonClassElement */:
+ case 243 /* SemicolonClassElement */:
return emitSemicolonClassElement();
- case 242 /* Block */:
+ case 244 /* Block */:
return emitBlock(node);
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
return emitVariableStatement(node);
- case 243 /* EmptyStatement */:
+ case 245 /* EmptyStatement */:
return emitEmptyStatement(false);
- case 245 /* ExpressionStatement */:
+ case 247 /* ExpressionStatement */:
return emitExpressionStatement(node);
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
return emitIfStatement(node);
- case 247 /* DoStatement */:
+ case 249 /* DoStatement */:
return emitDoStatement(node);
- case 248 /* WhileStatement */:
+ case 250 /* WhileStatement */:
return emitWhileStatement(node);
- case 249 /* ForStatement */:
+ case 251 /* ForStatement */:
return emitForStatement(node);
- case 250 /* ForInStatement */:
+ case 252 /* ForInStatement */:
return emitForInStatement(node);
- case 251 /* ForOfStatement */:
+ case 253 /* ForOfStatement */:
return emitForOfStatement(node);
- case 252 /* ContinueStatement */:
+ case 254 /* ContinueStatement */:
return emitContinueStatement(node);
- case 253 /* BreakStatement */:
+ case 255 /* BreakStatement */:
return emitBreakStatement(node);
- case 254 /* ReturnStatement */:
+ case 256 /* ReturnStatement */:
return emitReturnStatement(node);
- case 255 /* WithStatement */:
+ case 257 /* WithStatement */:
return emitWithStatement(node);
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
return emitSwitchStatement(node);
- case 257 /* LabeledStatement */:
+ case 259 /* LabeledStatement */:
return emitLabeledStatement(node);
- case 258 /* ThrowStatement */:
+ case 260 /* ThrowStatement */:
return emitThrowStatement(node);
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
return emitTryStatement(node);
- case 260 /* DebuggerStatement */:
+ case 262 /* DebuggerStatement */:
return emitDebuggerStatement(node);
- case 261 /* VariableDeclaration */:
+ case 263 /* VariableDeclaration */:
return emitVariableDeclaration(node);
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
return emitVariableDeclarationList(node);
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
return emitFunctionDeclaration(node);
- case 264 /* ClassDeclaration */:
+ case 266 /* ClassDeclaration */:
return emitClassOrStructDeclaration(node);
- case 265 /* StructDeclaration */:
+ case 267 /* StructDeclaration */:
return emitClassOrStructDeclaration(node);
- case 266 /* AnnotationDeclaration */:
+ case 268 /* AnnotationDeclaration */:
return emitAnnotationDeclaration(node);
- case 267 /* InterfaceDeclaration */:
+ case 269 /* OverloadDeclaration */:
+ return emitOverloadDeclaration(node);
+ case 270 /* InterfaceDeclaration */:
return emitInterfaceDeclaration(node);
- case 268 /* TypeAliasDeclaration */:
+ case 271 /* TypeAliasDeclaration */:
return emitTypeAliasDeclaration(node);
- case 269 /* EnumDeclaration */:
+ case 272 /* EnumDeclaration */:
return emitEnumDeclaration(node);
- case 270 /* ModuleDeclaration */:
+ case 273 /* ModuleDeclaration */:
return emitModuleDeclaration(node);
- case 271 /* ModuleBlock */:
+ case 274 /* ModuleBlock */:
return emitModuleBlock(node);
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
return emitCaseBlock(node);
- case 273 /* NamespaceExportDeclaration */:
+ case 276 /* NamespaceExportDeclaration */:
return emitNamespaceExportDeclaration(node);
- case 274 /* ImportEqualsDeclaration */:
+ case 277 /* ImportEqualsDeclaration */:
return emitImportEqualsDeclaration(node);
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
return emitImportDeclaration(node);
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
return emitImportClause(node);
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
return emitNamespaceImport(node);
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
return emitNamespaceExport(node);
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
return emitNamedImports(node);
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
return emitImportSpecifier(node);
- case 280 /* ExportAssignment */:
+ case 283 /* ExportAssignment */:
return emitExportAssignment(node);
- case 281 /* ExportDeclaration */:
+ case 284 /* ExportDeclaration */:
return emitExportDeclaration(node);
- case 282 /* NamedExports */:
+ case 285 /* NamedExports */:
return emitNamedExports(node);
- case 284 /* ExportSpecifier */:
+ case 287 /* ExportSpecifier */:
return emitExportSpecifier(node);
- case 302 /* AssertClause */:
+ case 305 /* AssertClause */:
return emitAssertClause(node);
- case 303 /* AssertEntry */:
+ case 306 /* AssertEntry */:
return emitAssertEntry(node);
- case 285 /* MissingDeclaration */:
+ case 288 /* MissingDeclaration */:
return;
- case 286 /* ExternalModuleReference */:
+ case 289 /* ExternalModuleReference */:
return emitExternalModuleReference(node);
case 11 /* JsxText */:
return emitJsxText(node);
- case 289 /* JsxOpeningElement */:
- case 292 /* JsxOpeningFragment */:
+ case 292 /* JsxOpeningElement */:
+ case 295 /* JsxOpeningFragment */:
return emitJsxOpeningElementOrFragment(node);
- case 290 /* JsxClosingElement */:
- case 293 /* JsxClosingFragment */:
+ case 293 /* JsxClosingElement */:
+ case 296 /* JsxClosingFragment */:
return emitJsxClosingElementOrFragment(node);
- case 294 /* JsxAttribute */:
+ case 297 /* JsxAttribute */:
return emitJsxAttribute(node);
- case 295 /* JsxAttributes */:
+ case 298 /* JsxAttributes */:
return emitJsxAttributes(node);
- case 296 /* JsxSpreadAttribute */:
+ case 299 /* JsxSpreadAttribute */:
return emitJsxSpreadAttribute(node);
- case 297 /* JsxExpression */:
+ case 300 /* JsxExpression */:
return emitJsxExpression(node);
- case 298 /* CaseClause */:
+ case 301 /* CaseClause */:
return emitCaseClause(node);
- case 299 /* DefaultClause */:
+ case 302 /* DefaultClause */:
return emitDefaultClause(node);
- case 300 /* HeritageClause */:
+ case 303 /* HeritageClause */:
return emitHeritageClause(node);
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
return emitCatchClause(node);
- case 305 /* PropertyAssignment */:
+ case 308 /* PropertyAssignment */:
return emitPropertyAssignment(node);
- case 306 /* ShorthandPropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
return emitShorthandPropertyAssignment(node);
- case 307 /* SpreadAssignment */:
+ case 310 /* SpreadAssignment */:
return emitSpreadAssignment(node);
- case 308 /* EnumMember */:
+ case 311 /* EnumMember */:
return emitEnumMember(node);
- case 309 /* UnparsedPrologue */:
+ case 312 /* UnparsedPrologue */:
return writeUnparsedNode(node);
- case 316 /* UnparsedSource */:
- case 310 /* UnparsedPrepend */:
+ case 319 /* UnparsedSource */:
+ case 313 /* UnparsedPrepend */:
return emitUnparsedSourceOrPrepend(node);
- case 311 /* UnparsedText */:
- case 312 /* UnparsedInternalText */:
+ case 314 /* UnparsedText */:
+ case 315 /* UnparsedInternalText */:
return emitUnparsedTextLike(node);
- case 313 /* UnparsedSyntheticReference */:
+ case 316 /* UnparsedSyntheticReference */:
return emitUnparsedSyntheticReference(node);
- case 314 /* SourceFile */:
+ case 317 /* SourceFile */:
return emitSourceFile(node);
- case 315 /* Bundle */:
+ case 318 /* Bundle */:
return Debug.fail("Bundles should be printed using printBundle");
- case 317 /* InputFiles */:
+ case 320 /* InputFiles */:
return Debug.fail("InputFiles should not be printed");
- case 318 /* JSDocTypeExpression */:
+ case 321 /* JSDocTypeExpression */:
return emitJSDocTypeExpression(node);
- case 319 /* JSDocNameReference */:
+ case 322 /* JSDocNameReference */:
return emitJSDocNameReference(node);
- case 321 /* JSDocAllType */:
+ case 324 /* JSDocAllType */:
return writePunctuation("*");
- case 322 /* JSDocUnknownType */:
+ case 325 /* JSDocUnknownType */:
return writePunctuation("?");
- case 323 /* JSDocNullableType */:
+ case 326 /* JSDocNullableType */:
return emitJSDocNullableType(node);
- case 324 /* JSDocNonNullableType */:
+ case 327 /* JSDocNonNullableType */:
return emitJSDocNonNullableType(node);
- case 325 /* JSDocOptionalType */:
+ case 328 /* JSDocOptionalType */:
return emitJSDocOptionalType(node);
- case 326 /* JSDocFunctionType */:
+ case 329 /* JSDocFunctionType */:
return emitJSDocFunctionType(node);
- case 191 /* RestType */:
- case 327 /* JSDocVariadicType */:
+ case 193 /* RestType */:
+ case 330 /* JSDocVariadicType */:
return emitRestOrJSDocVariadicType(node);
- case 328 /* JSDocNamepathType */:
+ case 331 /* JSDocNamepathType */:
return;
- case 329 /* JSDoc */:
+ case 332 /* JSDoc */:
return emitJSDoc(node);
- case 331 /* JSDocTypeLiteral */:
+ case 334 /* JSDocTypeLiteral */:
return emitJSDocTypeLiteral(node);
- case 332 /* JSDocSignature */:
+ case 335 /* JSDocSignature */:
return emitJSDocSignature(node);
- case 336 /* JSDocTag */:
- case 341 /* JSDocClassTag */:
- case 346 /* JSDocOverrideTag */:
+ case 339 /* JSDocTag */:
+ case 344 /* JSDocClassTag */:
+ case 349 /* JSDocOverrideTag */:
return emitJSDocSimpleTag(node);
- case 337 /* JSDocAugmentsTag */:
- case 338 /* JSDocImplementsTag */:
+ case 340 /* JSDocAugmentsTag */:
+ case 341 /* JSDocImplementsTag */:
return emitJSDocHeritageTag(node);
- case 339 /* JSDocAuthorTag */:
- case 340 /* JSDocDeprecatedTag */:
+ case 342 /* JSDocAuthorTag */:
+ case 343 /* JSDocDeprecatedTag */:
return;
- case 342 /* JSDocPublicTag */:
- case 343 /* JSDocPrivateTag */:
- case 344 /* JSDocProtectedTag */:
- case 345 /* JSDocReadonlyTag */:
+ case 345 /* JSDocPublicTag */:
+ case 346 /* JSDocPrivateTag */:
+ case 347 /* JSDocProtectedTag */:
+ case 348 /* JSDocReadonlyTag */:
return;
- case 347 /* JSDocCallbackTag */:
+ case 350 /* JSDocCallbackTag */:
return emitJSDocCallbackTag(node);
- case 349 /* JSDocParameterTag */:
- case 356 /* JSDocPropertyTag */:
+ case 352 /* JSDocParameterTag */:
+ case 359 /* JSDocPropertyTag */:
return emitJSDocPropertyLikeTag(node);
- case 348 /* JSDocEnumTag */:
- case 350 /* JSDocReturnTag */:
- case 351 /* JSDocThisTag */:
- case 352 /* JSDocTypeTag */:
+ case 351 /* JSDocEnumTag */:
+ case 353 /* JSDocReturnTag */:
+ case 354 /* JSDocThisTag */:
+ case 355 /* JSDocTypeTag */:
return emitJSDocSimpleTypedTag(node);
- case 353 /* JSDocTemplateTag */:
+ case 356 /* JSDocTemplateTag */:
return emitJSDocTemplateTag(node);
- case 354 /* JSDocTypedefTag */:
+ case 357 /* JSDocTypedefTag */:
return emitJSDocTypedefTag(node);
- case 355 /* JSDocSeeTag */:
+ case 358 /* JSDocSeeTag */:
return emitJSDocSeeTag(node);
- case 358 /* NotEmittedStatement */:
- case 362 /* EndOfDeclarationMarker */:
- case 361 /* MergeDeclarationMarker */:
+ case 361 /* NotEmittedStatement */:
+ case 365 /* EndOfDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
return;
}
if (isExpression(node)) {
@@ -34780,84 +34973,84 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return emitIdentifier(node);
case 80 /* PrivateIdentifier */:
return emitPrivateIdentifier(node);
- case 209 /* ArrayLiteralExpression */:
+ case 211 /* ArrayLiteralExpression */:
return emitArrayLiteralExpression(node);
- case 210 /* ObjectLiteralExpression */:
+ case 212 /* ObjectLiteralExpression */:
return emitObjectLiteralExpression(node);
- case 211 /* PropertyAccessExpression */:
+ case 213 /* PropertyAccessExpression */:
return emitPropertyAccessExpression(node);
- case 212 /* ElementAccessExpression */:
+ case 214 /* ElementAccessExpression */:
return emitElementAccessExpression(node);
- case 213 /* CallExpression */:
+ case 215 /* CallExpression */:
return emitCallExpression(node);
- case 214 /* NewExpression */:
+ case 216 /* NewExpression */:
return emitNewExpression(node);
- case 215 /* TaggedTemplateExpression */:
+ case 217 /* TaggedTemplateExpression */:
return emitTaggedTemplateExpression(node);
- case 216 /* TypeAssertionExpression */:
+ case 218 /* TypeAssertionExpression */:
return emitTypeAssertionExpression(node);
- case 217 /* ParenthesizedExpression */:
+ case 219 /* ParenthesizedExpression */:
return emitParenthesizedExpression(node);
- case 218 /* FunctionExpression */:
+ case 220 /* FunctionExpression */:
return emitFunctionExpression(node);
- case 219 /* ArrowFunction */:
+ case 221 /* ArrowFunction */:
return emitArrowFunction(node);
- case 221 /* DeleteExpression */:
+ case 223 /* DeleteExpression */:
return emitDeleteExpression(node);
- case 222 /* TypeOfExpression */:
+ case 224 /* TypeOfExpression */:
return emitTypeOfExpression(node);
- case 223 /* VoidExpression */:
+ case 225 /* VoidExpression */:
return emitVoidExpression(node);
- case 224 /* AwaitExpression */:
+ case 226 /* AwaitExpression */:
return emitAwaitExpression(node);
- case 225 /* PrefixUnaryExpression */:
+ case 227 /* PrefixUnaryExpression */:
return emitPrefixUnaryExpression(node);
- case 226 /* PostfixUnaryExpression */:
+ case 228 /* PostfixUnaryExpression */:
return emitPostfixUnaryExpression(node);
- case 227 /* BinaryExpression */:
+ case 229 /* BinaryExpression */:
return emitBinaryExpression(node);
- case 228 /* ConditionalExpression */:
+ case 230 /* ConditionalExpression */:
return emitConditionalExpression(node);
- case 229 /* TemplateExpression */:
+ case 231 /* TemplateExpression */:
return emitTemplateExpression(node);
- case 230 /* YieldExpression */:
+ case 232 /* YieldExpression */:
return emitYieldExpression(node);
- case 231 /* SpreadElement */:
+ case 233 /* SpreadElement */:
return emitSpreadElement(node);
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
return emitClassExpression(node);
- case 233 /* OmittedExpression */:
+ case 235 /* OmittedExpression */:
return;
- case 235 /* AsExpression */:
+ case 237 /* AsExpression */:
return emitAsExpression(node);
- case 236 /* NonNullExpression */:
+ case 238 /* NonNullExpression */:
return emitNonNullExpression(node);
- case 234 /* ExpressionWithTypeArguments */:
+ case 236 /* ExpressionWithTypeArguments */:
return emitExpressionWithTypeArguments(node);
- case 239 /* SatisfiesExpression */:
+ case 241 /* SatisfiesExpression */:
return emitSatisfiesExpression(node);
- case 237 /* MetaProperty */:
+ case 239 /* MetaProperty */:
return emitMetaProperty(node);
- case 238 /* SyntheticExpression */:
+ case 240 /* SyntheticExpression */:
return Debug.fail("SyntheticExpression should never be printed.");
- case 287 /* JsxElement */:
+ case 290 /* JsxElement */:
return emitJsxElement(node);
- case 288 /* JsxSelfClosingElement */:
+ case 291 /* JsxSelfClosingElement */:
return emitJsxSelfClosingElement(node);
- case 291 /* JsxFragment */:
+ case 294 /* JsxFragment */:
return emitJsxFragment(node);
- case 357 /* SyntaxList */:
+ case 360 /* SyntaxList */:
return Debug.fail("SyntaxList should not be printed");
- case 358 /* NotEmittedStatement */:
+ case 361 /* NotEmittedStatement */:
return;
- case 359 /* PartiallyEmittedExpression */:
+ case 362 /* PartiallyEmittedExpression */:
return emitPartiallyEmittedExpression(node);
- case 360 /* CommaListExpression */:
+ case 363 /* CommaListExpression */:
return emitCommaList(node);
- case 361 /* MergeDeclarationMarker */:
- case 362 /* EndOfDeclarationMarker */:
+ case 364 /* MergeDeclarationMarker */:
+ case 365 /* EndOfDeclarationMarker */:
return;
- case 363 /* SyntheticReferenceExpression */:
+ case 366 /* SyntheticReferenceExpression */:
return Debug.fail("SyntheticReferenceExpression should not be printed");
}
}
@@ -34908,7 +35101,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitHelpers(node) {
let helpersEmitted = false;
- const bundle = node.kind === 315 /* Bundle */ ? node : void 0;
+ const bundle = node.kind === 318 /* Bundle */ ? node : void 0;
if (bundle && moduleKind === 0 /* None */) {
return;
}
@@ -34979,7 +35172,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
updateOrPushBundleFileTextLike(
pos,
writer.getTextPos(),
- unparsed.kind === 311 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */
+ unparsed.kind === 314 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */
);
}
}
@@ -35010,7 +35203,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitTabStop(hint, node, snippet) {
Debug.assert(
- node.kind === 243 /* EmptyStatement */,
+ node.kind === 245 /* EmptyStatement */,
`A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`
);
Debug.assert(
@@ -35066,7 +35259,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(node.dotDotDotToken);
emitNodeWithWriter(node.name, writeParameter);
emit(node.questionToken);
- if (node.parent && node.parent.kind === 326 /* JSDocFunctionType */ && !node.name) {
+ if (node.parent && node.parent.kind === 329 /* JSDocFunctionType */ && !node.name) {
emit(node.type);
} else {
emitTypeAnnotation(node.type);
@@ -35084,6 +35277,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitTypeAnnotation(node.type);
writeTrailingSemicolon();
}
+ function emitOverloadPropertyDeclaration(node) {
+ emitModifiers(node, node.modifiers);
+ emitNodeWithWriter(node.name, writeProperty);
+ emit(node.questionToken);
+ }
function emitPropertyDeclaration(node) {
emitDecoratorsAndModifiers(node, node.modifiers);
emit(node.name);
@@ -35128,7 +35326,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitAccessorDeclaration(node) {
emitDecoratorsAndModifiers(node, node.modifiers);
- writeKeyword(node.kind === 177 /* GetAccessor */ ? "get" : "set");
+ writeKeyword(node.kind === 179 /* GetAccessor */ ? "get" : "set");
writeSpace();
emit(node.name);
emitSignatureAndBody(node, emitSignatureHead);
@@ -35557,7 +35755,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function shouldEmitWhitespaceBeforeOperand(node) {
const operand = node.operand;
- return operand.kind === 225 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */));
+ return operand.kind === 227 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */));
}
function emitPostfixUnaryExpression(node) {
emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary);
@@ -35753,7 +35951,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (node.elseStatement) {
writeLineOrSpace(node, node.thenStatement, node.elseStatement);
emitTokenWithComment(92 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node);
- if (node.elseStatement.kind === 246 /* IfStatement */) {
+ if (node.elseStatement.kind === 248 /* IfStatement */) {
writeSpace();
emit(node.elseStatement);
} else {
@@ -35814,7 +36012,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);
emitForBinding(node.initializer);
writeSpace();
- emitTokenWithComment(164 /* OfKeyword */, node.initializer.end, writeKeyword, node);
+ emitTokenWithComment(165 /* OfKeyword */, node.initializer.end, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);
@@ -35822,7 +36020,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitForBinding(node) {
if (node !== void 0) {
- if (node.kind === 262 /* VariableDeclarationList */) {
+ if (node.kind === 264 /* VariableDeclarationList */) {
emit(node);
} else {
emitExpression(node);
@@ -35858,7 +36056,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
pos = writeTokenText(token, writer2, pos);
if (isSimilarNode && contextNode.end !== pos) {
- const isJsxExprContext = contextNode.kind === 297 /* JsxExpression */;
+ const isJsxExprContext = contextNode.kind === 300 /* JsxExpression */;
emitTrailingCommentsOfPosition(pos, !isJsxExprContext, isJsxExprContext);
}
return pos;
@@ -36117,6 +36315,25 @@ function createPrinter(printerOptions = {}, handlers = {}) {
decreaseIndent();
}
}
+ function emitOverloadDeclaration(node) {
+ emitDecoratorsAndModifiers(node, node.modifiers);
+ writeKeyword("overload");
+ if (node.name) {
+ writeSpace();
+ emitIdentifierName(node.name);
+ }
+ const indentedFlag = getEmitFlags(node) & 65536 /* Indented */;
+ if (indentedFlag) {
+ increaseIndent();
+ }
+ writeSpace();
+ writePunctuation("{");
+ emitList(node, node.members, 145 /* EnumMembers */);
+ writePunctuation("}");
+ if (indentedFlag) {
+ decreaseIndent();
+ }
+ }
function emitTypeAliasDeclaration(node) {
if (isSendableFunctionOrType(node, true)) {
emitDecorators(node, node.illegalDecorators);
@@ -36514,7 +36731,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
}
if (node.tags) {
- if (node.tags.length === 1 && node.tags[0].kind === 352 /* JSDocTypeTag */ && !node.comment) {
+ if (node.tags.length === 1 && node.tags[0].kind === 355 /* JSDocTypeTag */ && !node.comment) {
writeSpace();
emit(node.tags[0]);
} else {
@@ -36558,7 +36775,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitJSDocTypedefTag(tag) {
emitJSDocTagName(tag.tagName);
if (tag.typeExpression) {
- if (tag.typeExpression.kind === 318 /* JSDocTypeExpression */) {
+ if (tag.typeExpression.kind === 321 /* JSDocTypeExpression */) {
emitJSDocTypeExpression(tag.typeExpression);
} else {
writeSpace();
@@ -36576,7 +36793,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(tag.fullName);
}
emitJSDocComment(tag.comment);
- if (tag.typeExpression && tag.typeExpression.kind === 331 /* JSDocTypeLiteral */) {
+ if (tag.typeExpression && tag.typeExpression.kind === 334 /* JSDocTypeLiteral */) {
emitJSDocTypeLiteral(tag.typeExpression);
}
}
@@ -37392,7 +37609,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile));
}
function skipSynthesizedParentheses(node) {
- while (node.kind === 217 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) {
+ while (node.kind === 219 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) {
node = node.expression;
}
return node;
@@ -37462,84 +37679,84 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (!node)
return;
switch (node.kind) {
- case 242 /* Block */:
+ case 244 /* Block */:
forEach(node.statements, generateNames);
break;
- case 257 /* LabeledStatement */:
- case 255 /* WithStatement */:
- case 247 /* DoStatement */:
- case 248 /* WhileStatement */:
+ case 259 /* LabeledStatement */:
+ case 257 /* WithStatement */:
+ case 249 /* DoStatement */:
+ case 250 /* WhileStatement */:
generateNames(node.statement);
break;
- case 246 /* IfStatement */:
+ case 248 /* IfStatement */:
generateNames(node.thenStatement);
generateNames(node.elseStatement);
break;
- case 249 /* ForStatement */:
- case 251 /* ForOfStatement */:
- case 250 /* ForInStatement */:
+ case 251 /* ForStatement */:
+ case 253 /* ForOfStatement */:
+ case 252 /* ForInStatement */:
generateNames(node.initializer);
generateNames(node.statement);
break;
- case 256 /* SwitchStatement */:
+ case 258 /* SwitchStatement */:
generateNames(node.caseBlock);
break;
- case 272 /* CaseBlock */:
+ case 275 /* CaseBlock */:
forEach(node.clauses, generateNames);
break;
- case 298 /* CaseClause */:
- case 299 /* DefaultClause */:
+ case 301 /* CaseClause */:
+ case 302 /* DefaultClause */:
forEach(node.statements, generateNames);
break;
- case 259 /* TryStatement */:
+ case 261 /* TryStatement */:
generateNames(node.tryBlock);
generateNames(node.catchClause);
generateNames(node.finallyBlock);
break;
- case 301 /* CatchClause */:
+ case 304 /* CatchClause */:
generateNames(node.variableDeclaration);
generateNames(node.block);
break;
- case 244 /* VariableStatement */:
+ case 246 /* VariableStatement */:
generateNames(node.declarationList);
break;
- case 262 /* VariableDeclarationList */:
+ case 264 /* VariableDeclarationList */:
forEach(node.declarations, generateNames);
break;
- case 261 /* VariableDeclaration */:
- case 168 /* Parameter */:
- case 208 /* BindingElement */:
- case 264 /* ClassDeclaration */:
+ case 263 /* VariableDeclaration */:
+ case 169 /* Parameter */:
+ case 210 /* BindingElement */:
+ case 266 /* ClassDeclaration */:
generateNameIfNeeded(node.name);
break;
- case 263 /* FunctionDeclaration */:
+ case 265 /* FunctionDeclaration */:
generateNameIfNeeded(node.name);
if (getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) {
forEach(node.parameters, generateNames);
generateNames(node.body);
}
break;
- case 206 /* ObjectBindingPattern */:
- case 207 /* ArrayBindingPattern */:
+ case 208 /* ObjectBindingPattern */:
+ case 209 /* ArrayBindingPattern */:
forEach(node.elements, generateNames);
break;
- case 275 /* ImportDeclaration */:
+ case 278 /* ImportDeclaration */:
generateNames(node.importClause);
break;
- case 276 /* ImportClause */:
+ case 279 /* ImportClause */:
generateNameIfNeeded(node.name);
generateNames(node.namedBindings);
break;
- case 277 /* NamespaceImport */:
+ case 280 /* NamespaceImport */:
generateNameIfNeeded(node.name);
break;
- case 283 /* NamespaceExport */:
+ case 286 /* NamespaceExport */:
generateNameIfNeeded(node.name);
break;
- case 278 /* NamedImports */:
+ case 281 /* NamedImports */:
forEach(node.elements, generateNames);
break;
- case 279 /* ImportSpecifier */:
+ case 282 /* ImportSpecifier */:
generateNameIfNeeded(node.propertyName || node.name);
break;
}
@@ -37548,13 +37765,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (!node)
return;
switch (node.kind) {
- case 305 /* PropertyAssignment */:
- case 306 /* ShorthandPropertyAssignment */:
- case 171 /* PropertyDeclaration */:
- case 172 /* AnnotationPropertyDeclaration */:
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 308 /* PropertyAssignment */:
+ case 309 /* ShorthandPropertyAssignment */:
+ case 172 /* PropertyDeclaration */:
+ case 173 /* AnnotationPropertyDeclaration */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
generateNameIfNeeded(node.name);
break;
}
@@ -37728,27 +37945,27 @@ function createPrinter(printerOptions = {}, handlers = {}) {
prefix,
suffix
);
- case 270 /* ModuleDeclaration */:
- case 269 /* EnumDeclaration */:
+ case 273 /* ModuleDeclaration */:
+ case 272 /* EnumDeclaration */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForModuleOrEnum(node);
- case 275 /* ImportDeclaration */:
- case 281 /* ExportDeclaration */:
+ case 278 /* ImportDeclaration */:
+ case 284 /* ExportDeclaration */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForImportOrExportDeclaration(node);
- case 263 /* FunctionDeclaration */:
- case 264 /* ClassDeclaration */:
- case 280 /* ExportAssignment */:
+ case 265 /* FunctionDeclaration */:
+ case 266 /* ClassDeclaration */:
+ case 283 /* ExportAssignment */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForExportDefault();
- case 232 /* ClassExpression */:
+ case 234 /* ClassExpression */:
Debug.assert(!prefix && !suffix && !privateName);
return generateNameForClassExpression();
- case 174 /* MethodDeclaration */:
- case 177 /* GetAccessor */:
- case 178 /* SetAccessor */:
+ case 176 /* MethodDeclaration */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
return generateNameForMethodOrAccessor(node, privateName, prefix, suffix);
- case 166 /* ComputedPropertyName */:
+ case 167 /* ComputedPropertyName */:
return makeTempVariableName(TempFlags.Auto, true, privateName, prefix, suffix);
default:
return makeTempVariableName(TempFlags.Auto, false, privateName, prefix, suffix);
@@ -37839,14 +38056,14 @@ function createPrinter(printerOptions = {}, handlers = {}) {
const skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;
if ((pos > 0 || end > 0) && pos !== end) {
if (!skipLeadingComments) {
- emitLeadingComments(pos, node.kind !== 358 /* NotEmittedStatement */);
+ emitLeadingComments(pos, node.kind !== 361 /* NotEmittedStatement */);
}
if (!skipLeadingComments || pos >= 0 && (emitFlags & 512 /* NoLeadingComments */) !== 0) {
containerPos = pos;
}
if (!skipTrailingComments || end >= 0 && (emitFlags & 1024 /* NoTrailingComments */) !== 0) {
containerEnd = end;
- if (node.kind === 262 /* VariableDeclarationList */) {
+ if (node.kind === 264 /* VariableDeclarationList */) {
declarationListContainerEnd = end;
}
}
@@ -37862,7 +38079,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
containerPos = savedContainerPos;
containerEnd = savedContainerEnd;
declarationListContainerEnd = savedDeclarationListContainerEnd;
- if (!skipTrailingComments && node.kind !== 358 /* NotEmittedStatement */) {
+ if (!skipTrailingComments && node.kind !== 361 /* NotEmittedStatement */) {
emitTrailingComments(end);
}
}
@@ -38114,7 +38331,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
} else {
const source = sourceMapRange.source || sourceMapSource;
- if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
+ if (node.kind !== 361 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
}
if (emitFlags & 64 /* NoNestedSourceMaps */) {
@@ -38129,7 +38346,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
if (emitFlags & 64 /* NoNestedSourceMaps */) {
sourceMapsDisabled = false;
}
- if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
+ if (node.kind !== 361 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
}
}
diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts
index 3ad1f6e13e..ffc0eb264d 100644
--- a/src/compiler/binder.ts
+++ b/src/compiler/binder.ts
@@ -57,6 +57,8 @@ import {
SyntaxKind, TextRange, ThrowStatement, TokenFlags, tokenToString, tracing, TracingNode, tryCast, tryParsePattern,
TryStatement, TypeLiteralNode, TypeOfExpression, TypeParameterDeclaration, unescapeLeadingUnderscores,
unreachableCodeIsError, unusedLabelIsError, VariableDeclaration, WhileStatement, WithStatement,
+ OverloadDeclaration,
+ OverloadPropertyDeclaration
} from "./_namespaces/ts";
import * as performance from "./_namespaces/ts.performance";
@@ -1895,6 +1897,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
case SyntaxKind.ClassDeclaration:
case SyntaxKind.StructDeclaration:
case SyntaxKind.AnnotationDeclaration:
+ case SyntaxKind.OverloadDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.ObjectLiteralExpression:
case SyntaxKind.TypeLiteral:
@@ -1942,6 +1945,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
case SyntaxKind.PropertyDeclaration:
return (node as PropertyDeclaration).initializer ? ContainerFlags.IsControlFlowContainer : 0;
case SyntaxKind.AnnotationPropertyDeclaration:
+ case SyntaxKind.OverloadPropertyDeclaration:
return (node as AnnotationPropertyDeclaration).initializer ? ContainerFlags.IsControlFlowContainer : 0;
@@ -1999,6 +2003,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
case SyntaxKind.ClassDeclaration:
case SyntaxKind.StructDeclaration:
case SyntaxKind.AnnotationDeclaration:
+ case SyntaxKind.OverloadDeclaration:
return declareClassMember(node, symbolFlags, symbolExcludes);
case SyntaxKind.EnumDeclaration:
@@ -2677,7 +2682,8 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.AnnotationPropertyDeclaration:
case SyntaxKind.PropertySignature:
- return bindPropertyWorker(node as PropertyDeclaration | PropertySignature | AnnotationPropertyDeclaration);
+ case SyntaxKind.OverloadPropertyDeclaration:
+ return bindPropertyWorker(node as PropertyDeclaration | PropertySignature | AnnotationPropertyDeclaration | OverloadPropertyDeclaration);
case SyntaxKind.PropertyAssignment:
case SyntaxKind.ShorthandPropertyAssignment:
return bindPropertyOrMethodOrAccessor(node as Declaration, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
@@ -2749,6 +2755,8 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
return bindClassLikeDeclaration(node as ClassLikeDeclaration);
case SyntaxKind.AnnotationDeclaration:
return bindAnnotationDeclaration(node as AnnotationDeclaration);
+ case SyntaxKind.OverloadDeclaration:
+ return bindOverloadDeclaration(node as OverloadDeclaration);
case SyntaxKind.InterfaceDeclaration:
return bindBlockScopedDeclaration(node as Declaration, SymbolFlags.Interface, SymbolFlags.InterfaceExcludes);
case SyntaxKind.TypeAliasDeclaration:
@@ -2809,7 +2817,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
}
}
- function bindPropertyWorker(node: PropertyDeclaration | PropertySignature | AnnotationPropertyDeclaration) {
+ function bindPropertyWorker(node: PropertyDeclaration | PropertySignature | AnnotationPropertyDeclaration | OverloadPropertyDeclaration) {
const isAutoAccessor = isAutoAccessorPropertyDeclaration(node);
const includes = isAutoAccessor ? SymbolFlags.Accessor : SymbolFlags.Property;
const excludes = isAutoAccessor ? SymbolFlags.AccessorExcludes : SymbolFlags.PropertyExcludes;
@@ -3020,6 +3028,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
case SyntaxKind.Constructor:
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.AnnotationPropertyDeclaration:
+ case SyntaxKind.OverloadPropertyDeclaration:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
@@ -3369,6 +3378,23 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
prototypeSymbol.parent = symbol;
}
+ function bindOverloadDeclaration(node: OverloadDeclaration): void {
+ Debug.assert(node.kind === SyntaxKind.OverloadDeclaration);
+
+ bindBlockScopedDeclaration(node, SymbolFlags.Class, SymbolFlags.ClassExcludes);
+ const { symbol } = node;
+ const prototypeSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Prototype, "prototype" as __String);
+ const symbolExport = symbol.exports!.get(prototypeSymbol.escapedName);
+ if (symbolExport) {
+ if (node.name) {
+ setParent(node.name, node);
+ }
+ file.bindDiagnostics.push(createDiagnosticForNode(symbolExport.declarations![0], Diagnostics.Duplicate_identifier_0, symbolName(prototypeSymbol)));
+ }
+ symbol.exports!.set(prototypeSymbol.escapedName, prototypeSymbol);
+ prototypeSymbol.parent = symbol;
+ }
+
function bindEnumDeclaration(node: EnumDeclaration) {
return isEnumConst(node)
? bindBlockScopedDeclaration(node, SymbolFlags.ConstEnum, SymbolFlags.ConstEnumExcludes)
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index af06e0494f..f6984cc355 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -1066,6 +1066,7 @@ import {
WideningContext,
WithStatement,
YieldExpression,
+ isOverloadPropertyDeclaration, OverloadPropertyDeclaration
} from "./_namespaces/ts";
import * as performance from "./_namespaces/ts.performance";
import * as moduleSpecifiers from "./_namespaces/ts.moduleSpecifiers";
@@ -10359,7 +10360,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
// Return the inferred type for a variable, parameter, or property declaration
function getTypeForVariableLikeDeclaration(
declaration: ParameterDeclaration | PropertyDeclaration | PropertySignature | AnnotationPropertyDeclaration | VariableDeclaration |
- BindingElement | JSDocPropertyLikeTag,
+ BindingElement | JSDocPropertyLikeTag | OverloadPropertyDeclaration,
includeOptionality: boolean,
checkMode: CheckMode,
): Type | undefined {
@@ -10943,7 +10944,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
// Here, the array literal [1, "one"] is contextually typed by the type [any, string], which is the implied type of the
// binding pattern [x, s = ""]. Because the contextual type is a tuple type, the resulting type of [1, "one"] is the
// tuple type [number, string]. Thus, the type inferred for 'x' is number and the type inferred for 's' is string.
- function getWidenedTypeForVariableLikeDeclaration(declaration: ParameterDeclaration | PropertyDeclaration | PropertySignature | AnnotationPropertyDeclaration | VariableDeclaration | BindingElement | JSDocPropertyLikeTag, reportErrors?: boolean): Type {
+ function getWidenedTypeForVariableLikeDeclaration(declaration: ParameterDeclaration | PropertyDeclaration | PropertySignature | AnnotationPropertyDeclaration | VariableDeclaration | BindingElement | JSDocPropertyLikeTag | OverloadPropertyDeclaration, reportErrors?: boolean): Type {
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true, CheckMode.Normal), declaration, reportErrors);
}
@@ -11111,6 +11112,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
|| isAnnotationPropertyDeclaration(declaration)
|| isVariableDeclaration(declaration)
|| isBindingElement(declaration)
+ || isOverloadPropertyDeclaration(declaration)
|| isJSDocPropertyLikeTag(declaration)) {
type = getWidenedTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true);
}
@@ -44875,8 +44877,10 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
return checkClassDeclaration(node as ClassDeclaration);
case SyntaxKind.StructDeclaration:
return checkStructDeclaration(node as StructDeclaration);
- case SyntaxKind.AnnotationDeclaration:
- return checkAnnotationDeclaration(node as AnnotationDeclaration);
+ case SyntaxKind.AnnotationDeclaration:
+ return checkAnnotationDeclaration(node as AnnotationDeclaration);
+ case SyntaxKind.OverloadDeclaration:
+ return;
case SyntaxKind.InterfaceDeclaration:
return checkInterfaceDeclaration(node as InterfaceDeclaration);
case SyntaxKind.TypeAliasDeclaration:
@@ -47615,6 +47619,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
case SyntaxKind.Constructor:
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.PropertySignature:
+ case SyntaxKind.OverloadPropertyDeclaration:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.MethodSignature:
case SyntaxKind.IndexSignature:
@@ -47645,6 +47650,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
case SyntaxKind.ClassDeclaration:
case SyntaxKind.StructDeclaration:
case SyntaxKind.AnnotationDeclaration:
+ case SyntaxKind.OverloadDeclaration:
case SyntaxKind.ConstructorType:
return nodeHasAnyModifiersExcept(node, SyntaxKind.AbstractKeyword);
case SyntaxKind.ClassExpression:
diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts
index 28139e8c54..32a32be4f4 100644
--- a/src/compiler/emitter.ts
+++ b/src/compiler/emitter.ts
@@ -77,7 +77,7 @@ import {
TypeOperatorNode, TypeParameterDeclaration, TypePredicateNode, TypeQueryNode, TypeReferenceNode, UnionTypeNode,
UnparsedNode, UnparsedPrepend, UnparsedPrologue, UnparsedSource, UnparsedSyntheticReference, UnparsedTextLike,
VariableDeclaration, VariableDeclarationList, VariableStatement, VoidExpression, WhileStatement, WithStatement,
- writeCommentRange, writeFile, WriteFileCallbackData, YieldExpression,
+ writeCommentRange, writeFile, WriteFileCallbackData, YieldExpression, OverloadDeclaration, OverloadPropertyDeclaration
} from "./_namespaces/ts";
import * as performance from "./_namespaces/ts.performance";
@@ -1522,6 +1522,8 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
return emitPropertyDeclaration(node as PropertyDeclaration);
case SyntaxKind.AnnotationPropertyDeclaration:
return emitAnnotationPropertyDeclaration(node as AnnotationPropertyDeclaration);
+ case SyntaxKind.OverloadPropertyDeclaration:
+ return emitOverloadPropertyDeclaration(node as OverloadPropertyDeclaration);
case SyntaxKind.MethodSignature:
return emitMethodSignature(node as MethodSignature);
case SyntaxKind.MethodDeclaration:
@@ -1658,6 +1660,8 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
return emitClassOrStructDeclaration(node);
case SyntaxKind.AnnotationDeclaration:
return emitAnnotationDeclaration(node as AnnotationDeclaration);
+ case SyntaxKind.OverloadDeclaration:
+ return emitOverloadDeclaration(node as OverloadDeclaration);
case SyntaxKind.InterfaceDeclaration:
return emitInterfaceDeclaration(node as InterfaceDeclaration);
case SyntaxKind.TypeAliasDeclaration:
@@ -2257,6 +2261,12 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
writeTrailingSemicolon();
}
+ function emitOverloadPropertyDeclaration(node: OverloadPropertyDeclaration) {
+ emitModifiers(node, node.modifiers);
+ emitNodeWithWriter(node.name, writeProperty);
+ emit(node.questionToken);
+ }
+
function emitPropertyDeclaration(node: PropertyDeclaration) {
emitDecoratorsAndModifiers(node, node.modifiers);
emit(node.name);
@@ -3541,6 +3551,30 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
}
}
+ function emitOverloadDeclaration(node: OverloadDeclaration): void {
+ emitDecoratorsAndModifiers(node, node.modifiers);
+ writeKeyword("overload");
+
+ if (node.name) {
+ writeSpace();
+ emitIdentifierName(node.name);
+ }
+
+ const indentedFlag = getEmitFlags(node) & EmitFlags.Indented;
+ if (indentedFlag) {
+ increaseIndent();
+ }
+
+ writeSpace();
+ writePunctuation("{");
+ emitList(node, node.members, ListFormat.EnumMembers);
+ writePunctuation("}");
+
+ if (indentedFlag) {
+ decreaseIndent();
+ }
+ }
+
function emitTypeAliasDeclaration(node: TypeAliasDeclaration) {
if (isSendableFunctionOrType(node, /*maybeNotOriginalNode*/ true)) {
emitDecorators(node, node.illegalDecorators);
diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts
index d0113c662c..d5780c51d9 100644
--- a/src/compiler/factory/nodeFactory.ts
+++ b/src/compiler/factory/nodeFactory.ts
@@ -79,7 +79,8 @@ import {
UnionOrIntersectionTypeNode, UnionTypeNode, UnparsedNode, UnparsedPrepend, UnparsedPrologue, UnparsedSource,
UnparsedSourceText, UnparsedSyntheticReference, UnparsedTextLike, UnscopedEmitHelper, VariableDeclaration,
VariableDeclarationList, VariableStatement, visitNode, VisitResult, VoidExpression, WhileStatement, WithStatement,
- YieldExpression,
+ YieldExpression, OverloadDeclaration, isOverloadDeclaration, OverloadPropertyDeclaration, isOverloadPropertyDeclaration,
+ OverloadElement
} from "../_namespaces/ts";
let nextAutoGenerateId = 0;
@@ -177,6 +178,8 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
updatePropertyDeclaration,
createAnnotationPropertyDeclaration,
updateAnnotationPropertyDeclaration,
+ createOverloadPropertyDeclaration,
+ updateOverloadPropertyDeclaration,
createMethodSignature,
updateMethodSignature,
createMethodDeclaration,
@@ -376,6 +379,8 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
updateStructDeclaration,
createAnnotationDeclaration,
updateAnnotationDeclaration,
+ createOverloadDeclaration,
+ updateOverloadDeclaration,
createInterfaceDeclaration,
updateInterfaceDeclaration,
createTypeAliasDeclaration,
@@ -719,6 +724,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
case SyntaxKind.SetAccessor:
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.AnnotationPropertyDeclaration:
+ case SyntaxKind.OverloadPropertyDeclaration:
case SyntaxKind.PropertyAssignment:
if (isIdentifier(name)) {
node.transformFlags |= propagateIdentifierNameFlags(name);
@@ -846,7 +852,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
}
function createBaseBindingLikeDeclaration(
+ BindingElement | AnnotationPropertyDeclaration | OverloadPropertyDeclaration>(
kind: T["kind"],
modifiers: readonly ModifierLike[] | undefined,
name: string | T["name"] | undefined,
@@ -862,7 +868,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
return node;
}
- function createBaseVariableLikeDeclaration(
+ function createBaseVariableLikeDeclaration(
kind: T["kind"],
modifiers: readonly ModifierLike[] | undefined,
name: string | T["name"] | undefined,
@@ -1400,6 +1406,43 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
: node;
}
+ // @api
+ function createOverloadPropertyDeclaration(
+ modifiers: readonly ModifierLike[] | undefined,
+ name: PropertyName | string,
+ questionToken: QuestionToken | undefined,
+ type: TypeNode | undefined
+ ): OverloadPropertyDeclaration {
+ const node = createBaseNamedDeclaration(
+ SyntaxKind.OverloadPropertyDeclaration,
+ modifiers,
+ name
+ );
+ node.type = type;
+ node.questionToken = questionToken;
+ node.transformFlags = TransformFlags.ContainsTypeScript;
+
+ // The following properties are used only to report grammar errors
+ node.initializer = undefined;
+ return node;
+ }
+
+ // @api
+ function updateOverloadPropertyDeclaration(
+ node: OverloadPropertyDeclaration,
+ modifiers: readonly ModifierLike[] | undefined,
+ name: PropertyName,
+ questionToken: QuestionToken | undefined,
+ type: TypeNode | undefined
+ ) {
+ return node.modifiers !== modifiers
+ || node.name !== name
+ || node.questionToken !== questionToken
+ || node.type !== type
+ ? update(createOverloadPropertyDeclaration(modifiers, name, questionToken, type), node)
+ : node;
+ }
+
function finishUpdatePropertySignature(updated: Mutable, original: PropertySignature) {
if (updated !== original) {
// copy children used only for error reporting
@@ -4053,6 +4096,43 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
: node;
}
+ // @api
+ function createOverloadDeclaration(
+ modifiers: readonly Modifier[] | undefined,
+ name: string | Identifier | undefined,
+ members: readonly OverloadElement[]
+ ) {
+ const node = createBaseNamedDeclaration(
+ SyntaxKind.OverloadDeclaration,
+ modifiers,
+ name
+ );
+ node.members = createNodeArray(members);
+ node.transformFlags |= propagateChildrenFlags(node.members);
+ if (modifiersToFlags(node.modifiers) & ModifierFlags.Ambient) {
+ node.transformFlags = TransformFlags.ContainsTypeScript;
+ }
+ else {
+ node.transformFlags |= TransformFlags.ContainsES2015;
+ node.transformFlags |= TransformFlags.ContainsTypeScript;
+ }
+ return node;
+ }
+
+ // @api
+ function updateOverloadDeclaration(
+ node: OverloadDeclaration,
+ modifiers: readonly Modifier[] | undefined,
+ name: Identifier | undefined,
+ members: readonly OverloadElement[]
+ ) {
+ return node.modifiers !== modifiers
+ || node.name !== name
+ || node.members !== members
+ ? update(createOverloadDeclaration(modifiers, name, members), node)
+ : node;
+ }
+
// @api
function createInterfaceDeclaration(
modifiers: readonly Modifier[] | undefined,
@@ -6556,6 +6636,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) :
isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) :
isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) :
+ isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) :
isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) :
isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) :
isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) :
@@ -6568,6 +6649,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) :
+ isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) :
isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) :
isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
diff --git a/src/compiler/factory/nodeTests.ts b/src/compiler/factory/nodeTests.ts
index a18b382396..6c8724ad54 100644
--- a/src/compiler/factory/nodeTests.ts
+++ b/src/compiler/factory/nodeTests.ts
@@ -36,7 +36,7 @@ import {
TryStatement, TupleTypeNode, TypeAliasDeclaration, TypeAssertion, TypeLiteralNode, TypeOfExpression,
TypeOperatorNode, TypeParameterDeclaration, TypePredicateNode, TypeQueryNode, TypeReferenceNode, UnionTypeNode,
UnparsedPrepend, UnparsedSource, VariableDeclaration, VariableDeclarationList, VariableStatement, VoidExpression,
- WhileStatement, WithStatement, YieldExpression,
+ WhileStatement, WithStatement, YieldExpression, OverloadDeclaration, OverloadPropertyDeclaration
} from "../_namespaces/ts";
// Literals
@@ -233,6 +233,10 @@ export function isPropertySignature(node: Node): node is PropertySignature {
return node.kind === SyntaxKind.PropertySignature;
}
+export function isOverloadPropertyDeclaration(node: Node): node is OverloadPropertyDeclaration {
+ return node.kind === SyntaxKind.OverloadPropertyDeclaration;
+}
+
export function isPropertyDeclaration(node: Node): node is PropertyDeclaration {
return node.kind === SyntaxKind.PropertyDeclaration;
}
@@ -635,6 +639,10 @@ export function isAnnotationDeclaration(node: Node): node is AnnotationDeclarati
return node.kind === SyntaxKind.AnnotationDeclaration;
}
+export function isOverloadDeclaration(node: Node): node is OverloadDeclaration {
+ return node.kind === SyntaxKind.OverloadDeclaration;
+}
+
export function isInterfaceDeclaration(node: Node): node is InterfaceDeclaration {
return node.kind === SyntaxKind.InterfaceDeclaration;
}
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index 9dbecc13d2..104111f4e1 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -410,7 +410,8 @@ import {
VoidExpression,
WhileStatement,
WithStatement,
- YieldExpression,
+ YieldExpression, OverloadDeclaration,
+ OverloadElement, OverloadPropertyDeclaration
} from "./_namespaces/ts";
import * as performance from "./_namespaces/ts.performance";
@@ -566,6 +567,13 @@ const forEachChildTable: ForEachChildTable = {
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
},
+ [SyntaxKind.OverloadPropertyDeclaration]: function forEachChildInOverloadPropertyDeclaration(node: OverloadPropertyDeclaration, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray) => T | undefined): T | undefined {
+ return visitNodes(cbNode, cbNodes, node.modifiers) ||
+ visitNode(cbNode, node.name) ||
+ visitNode(cbNode, node.questionToken) ||
+ visitNode(cbNode, node.type) ||
+ visitNode(cbNode, node.initializer);
+ },
[SyntaxKind.PropertyAssignment]: function forEachChildInPropertyAssignment(node: PropertyAssignment, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray) => T | undefined): T | undefined {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
@@ -929,6 +937,7 @@ const forEachChildTable: ForEachChildTable = {
[SyntaxKind.ClassExpression]: forEachChildInClassDeclarationOrExpression,
[SyntaxKind.StructDeclaration]: forEachChildInClassDeclarationOrExpression,
[SyntaxKind.AnnotationDeclaration]: forEachChildInAnnotationDeclaration,
+ [SyntaxKind.OverloadDeclaration]: forEachChildInOverloadDeclaration,
[SyntaxKind.InterfaceDeclaration]: function forEachChildInInterfaceDeclaration(node: InterfaceDeclaration, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray) => T | undefined): T | undefined {
return visitNodes(cbNode, cbNodes, node.illegalDecorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
@@ -1218,6 +1227,13 @@ function forEachChildInAnnotationDeclaration(node: AnnotationDeclaration, cbN
visitNodes(cbNode, cbNodes, node.members);
}
+function forEachChildInOverloadDeclaration(node: OverloadDeclaration, cbNode: (node: Node) => T | undefined,
+ cbNodes?: (nodes: NodeArray) => T | undefined): T | undefined {
+ return visitNodes(cbNode, cbNodes, node.modifiers) ||
+ visitNode(cbNode, node.name) ||
+ visitNodes(cbNode, cbNodes, node.members);
+}
+
function forEachChildInNamedImportsOrExports(node: NamedImports | NamedExports, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray) => T | undefined): T | undefined {
return visitNodes(cbNode, cbNodes, node.elements);
}
@@ -2972,6 +2988,9 @@ namespace Parser {
if (inAllowAnnotationContext() && token() === SyntaxKind.AtToken) {
return lookAhead(() => nextToken() === SyntaxKind.InterfaceKeyword);
}
+ if (token() === SyntaxKind.OverloadKeyword) {
+ return true;
+ }
return canFollowExportModifier();
case SyntaxKind.DefaultKeyword:
return nextTokenCanFollowDefaultKeyword();
@@ -3008,6 +3027,7 @@ namespace Parser {
|| token() === SyntaxKind.AsteriskToken
|| token() === SyntaxKind.DotDotDotToken
|| token() === SyntaxKind.AtToken && inAllowAnnotationContext() && lookAhead(() => nextToken() === SyntaxKind.InterfaceKeyword)
+ || token() === SyntaxKind.OverloadKeyword
|| isLiteralPropertyName();
}
@@ -4425,6 +4445,20 @@ namespace Parser {
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+ function parseOverloadPropertyDeclaration(pos: number, hasJSDoc: boolean, modifiers: NodeArray | undefined): OverloadPropertyDeclaration {
+ const name = parsePropertyName();
+ const questionToken = parseOptionalToken(SyntaxKind.QuestionToken);
+ let node: OverloadPropertyDeclaration;
+ const type = parseTypeAnnotation();
+ node = factory.createOverloadPropertyDeclaration(modifiers, name, questionToken, type);
+ // Although type literal properties cannot not have initializers, we attempt
+ // to parse an initializer so we can report in the checker that an interface
+ // property or type literal property cannot have an initializer.
+ if (token() === SyntaxKind.EqualsToken) (node as Mutable).initializer = parseInitializer();
+ parseTypeMemberSemicolon();
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
+ }
+
function parsePropertyOrMethodSignature(pos: number, hasJSDoc: boolean, modifiers: NodeArray | undefined): PropertySignature | MethodSignature {
const name = parsePropertyName();
const questionToken = parseOptionalToken(SyntaxKind.QuestionToken);
@@ -7451,6 +7485,8 @@ namespace Parser {
return inEtsContext();
case SyntaxKind.AtToken:
return inAllowAnnotationContext() && nextToken() === SyntaxKind.InterfaceKeyword;
+ case SyntaxKind.OverloadKeyword:
+ return nextTokenIsIdentifierOnSameLine();
// 'declare', 'module', 'namespace', 'interface'* and 'type' are all legal JavaScript identifiers;
// however, an identifier cannot be followed by another identifier on the same line. This is what we
// count on to parse out the respective declarations. For instance, we exploit this to say that
@@ -7651,6 +7687,7 @@ namespace Parser {
case SyntaxKind.DebuggerKeyword:
return parseDebuggerStatement();
case SyntaxKind.AtToken:
+ case SyntaxKind.OverloadKeyword:
return parseDeclaration();
case SyntaxKind.AsyncKeyword:
case SyntaxKind.InterfaceKeyword:
@@ -7707,6 +7744,23 @@ namespace Parser {
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+ function parseOverloadDeclaration(pos: number, hasJSDoc: boolean, decorators: NodeArray | undefined,
+ modifiers: NodeArray | undefined): OverloadDeclaration {
+ parseExpected(SyntaxKind.OverloadKeyword);
+
+ const name = createIdentifier(isBindingIdentifier());
+ let members;
+ if (parseExpected(SyntaxKind.OpenBraceToken)) {
+ members = parseOverloadMembers();
+ parseExpected(SyntaxKind.CloseBraceToken);
+ }
+ else {
+ members = createMissingList();
+ }
+ const node = factory.createOverloadDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
+ }
+
function parseDeclaration(): Statement {
// `parseListElement` attempted to get the reused node at this position,
// but the ambient context flag was not yet set, so the node appeared
@@ -7787,6 +7841,8 @@ namespace Parser {
return parseAnnotationDeclaration(pos, hasJSDoc, decorators, modifiers);
}
return parseDeclarationDefault(pos, decorators, modifiers);
+ case SyntaxKind.OverloadKeyword:
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
case SyntaxKind.InterfaceKeyword:
return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
case SyntaxKind.TypeKeyword:
@@ -8611,6 +8667,52 @@ namespace Parser {
return Debug.fail("Should not have attempted to parse annotation member declaration.");
}
+ function parseOverloadElement(): OverloadPropertyDeclaration {
+ const pos = getNodePos();
+ if (token() === SyntaxKind.SemicolonToken) {
+ parseErrorAt(pos, pos, Diagnostics.Unexpected_keyword_or_identifier);
+ }
+
+ const hasJSDoc = hasPrecedingJSDocComment();
+ if (token() === SyntaxKind.StaticKeyword && lookAhead(nextTokenIsOpenBrace)) {
+ return createMissingNode(SyntaxKind.OverloadPropertyDeclaration, /*reportAtCurrentPosition*/ true,
+ Diagnostics.Unexpected_keyword_or_identifier);
+ }
+
+ if (parseContextualModifier(SyntaxKind.GetKeyword)) {
+ return createMissingNode(SyntaxKind.OverloadPropertyDeclaration, /*reportAtCurrentPosition*/ true,
+ Diagnostics.Unexpected_keyword_or_identifier);
+ }
+
+ if (parseContextualModifier(SyntaxKind.SetKeyword)) {
+ return createMissingNode(SyntaxKind.OverloadPropertyDeclaration, /*reportAtCurrentPosition*/ true,
+ Diagnostics.Unexpected_keyword_or_identifier);
+ }
+
+ if (token() === SyntaxKind.ConstructorKeyword || token() === SyntaxKind.StringLiteral) {
+ return createMissingNode(SyntaxKind.OverloadPropertyDeclaration, /*reportAtCurrentPosition*/ true,
+ Diagnostics.Unexpected_keyword_or_identifier);
+ }
+
+ if (isIndexSignature()) {
+ return createMissingNode(SyntaxKind.OverloadPropertyDeclaration, /*reportAtCurrentPosition*/ true,
+ Diagnostics.Unexpected_keyword_or_identifier);
+ }
+
+ if (tokenIsIdentifierOrKeyword(token())) {
+ const modifiers = parseModifiers();
+ let overloadPropertyDeclaration: OverloadPropertyDeclaration = parseOverloadPropertyDeclaration(pos, hasJSDoc, modifiers);
+ if (overloadPropertyDeclaration.kind === SyntaxKind.OverloadPropertyDeclaration) {
+ return overloadPropertyDeclaration;
+ }
+ return createMissingNode(SyntaxKind.OverloadPropertyDeclaration, /*reportAtCurrentPosition*/ true,
+ Diagnostics.Unexpected_keyword_or_identifier);
+ }
+
+ // 'isAnnotationMemberStart' should have hinted not to attempt parsing.
+ return Debug.fail("Should not have attempted to parse annotation member declaration.");
+ }
+
function parseClassExpression(): ClassExpression {
return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, SyntaxKind.ClassExpression) as ClassExpression;
}
@@ -8755,6 +8857,10 @@ namespace Parser {
return parseList(ParsingContext.AnnotationMembers, parseAnnotationElement);
}
+ function parseOverloadMembers(): NodeArray {
+ return parseList(ParsingContext.TypeMembers, parseOverloadElement);
+ }
+
function parseStructMembers(pos: number): NodeArray {
const structMembers = parseList(ParsingContext.ClassMembers, parseClassElement);
diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts
index d8e97f1904..0ba1f75854 100644
--- a/src/compiler/scanner.ts
+++ b/src/compiler/scanner.ts
@@ -139,6 +139,7 @@ export const textToKeywordObj: MapLike = {
protected: SyntaxKind.ProtectedKeyword,
public: SyntaxKind.PublicKeyword,
override: SyntaxKind.OverrideKeyword,
+ overload: SyntaxKind.OverloadKeyword,
out: SyntaxKind.OutKeyword,
readonly: SyntaxKind.ReadonlyKeyword,
require: SyntaxKind.RequireKeyword,
diff --git a/src/compiler/transformers/classFields.ts b/src/compiler/transformers/classFields.ts
index 0eedde992b..51fb30f321 100644
--- a/src/compiler/transformers/classFields.ts
+++ b/src/compiler/transformers/classFields.ts
@@ -263,6 +263,8 @@ export function transformClassFields(context: TransformationContext): (x: Source
return visitClassDeclaration(node as ClassDeclaration);
case SyntaxKind.AnnotationDeclaration:
return undefined;
+ case SyntaxKind.OverloadDeclaration:
+ return undefined;
case SyntaxKind.ClassExpression:
return visitClassExpression(node as ClassExpression);
case SyntaxKind.ClassStaticBlockDeclaration:
@@ -271,6 +273,8 @@ export function transformClassFields(context: TransformationContext): (x: Source
return visitPropertyDeclaration(node as PropertyDeclaration);
case SyntaxKind.AnnotationPropertyDeclaration:
return undefined;
+ case SyntaxKind.OverloadPropertyDeclaration:
+ return undefined;
case SyntaxKind.VariableStatement:
return visitVariableStatement(node as VariableStatement);
case SyntaxKind.PrivateIdentifier:
diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts
index 64ab5ba77f..d2118813fd 100644
--- a/src/compiler/transformers/declarations.ts
+++ b/src/compiler/transformers/declarations.ts
@@ -40,7 +40,8 @@ import {
SymbolAccessibilityResult, SymbolFlags, SymbolTracker, SyntaxKind, toFileNameLowerCase, toPath,
TransformationContext, transformNodes, tryCast, TypeAliasDeclaration, TypeNode, TypeParameterDeclaration,
TypeReferenceNode, unescapeLeadingUnderscores, UnparsedSource, VariableDeclaration, VariableStatement, visitArray,
- visitEachChild, visitNode, visitNodes, VisitResult,
+ visitEachChild, visitNode, visitNodes, VisitResult, isOverloadDeclaration,
+ OverloadPropertyDeclaration
} from "../_namespaces/ts";
import * as moduleSpecifiers from "../_namespaces/ts.moduleSpecifiers";
@@ -588,6 +589,7 @@ export function transformDeclarations(context: TransformationContext) {
| ParameterDeclaration
| PropertyDeclaration
| AnnotationPropertyDeclaration
+ | OverloadPropertyDeclaration
| PropertySignature;
function ensureType(node: HasInferredType, type: TypeNode | undefined, ignorePrivate?: boolean): TypeNode | undefined {
@@ -628,7 +630,9 @@ export function transformDeclarations(context: TransformationContext) {
if (node.kind === SyntaxKind.Parameter
|| node.kind === SyntaxKind.PropertyDeclaration
|| node.kind === SyntaxKind.PropertySignature
- || node.kind === SyntaxKind.AnnotationPropertyDeclaration) {
+ || node.kind === SyntaxKind.AnnotationPropertyDeclaration
+ || node.kind === SyntaxKind.OverloadPropertyDeclaration
+ ) {
if (isPropertySignature(node) || !node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType));
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
}
@@ -743,6 +747,7 @@ export function transformDeclarations(context: TransformationContext) {
|| isClassDeclaration(node)
|| isStructDeclaration(node)
|| isAnnotationDeclaration(node)
+ || isOverloadDeclaration(node)
|| isInterfaceDeclaration(node)
|| isFunctionLike(node)
|| isIndexSignatureDeclaration(node)
@@ -1097,6 +1102,17 @@ export function transformDeclarations(context: TransformationContext) {
input.questionToken,
ensureType(input, input.type)
));
+ case SyntaxKind.OverloadPropertyDeclaration:
+ if (isPrivateIdentifier(input.name)) {
+ return cleanup(/*returnValue*/ undefined);
+ }
+ return cleanup(factory.updateOverloadPropertyDeclaration(
+ input,
+ ensureModifiers(input),
+ input.name,
+ input.questionToken,
+ ensureType(input, input.type)
+ ));
case SyntaxKind.MethodSignature: {
if (isPrivateIdentifier(input.name)) {
return cleanup(/*returnValue*/ undefined);
@@ -1518,6 +1534,21 @@ export function transformDeclarations(context: TransformationContext) {
members
));
}
+ case SyntaxKind.OverloadDeclaration: {
+ errorNameNode = input.name;
+ errorFallbackNode = input;
+
+ const modifiers = factory.createNodeArray(ensureModifiers(input));
+ const memberNodes = visitNodes(input.members, visitDeclarationSubtree);
+ const members = factory.createNodeArray(memberNodes);
+
+ return cleanup(factory.updateOverloadDeclaration(
+ input,
+ modifiers,
+ input.name,
+ members
+ ));
+ }
case SyntaxKind.ClassDeclaration: {
errorNameNode = input.name;
errorFallbackNode = input;
@@ -1828,6 +1859,7 @@ function isPreservedDeclarationStatement(node: Node): node is ProcessedDeclarati
case SyntaxKind.ClassDeclaration:
case SyntaxKind.StructDeclaration:
case SyntaxKind.AnnotationDeclaration:
+ case SyntaxKind.OverloadDeclaration:
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.VariableStatement:
@@ -1847,6 +1879,7 @@ type ProcessedComponent =
| SetAccessorDeclaration
| PropertyDeclaration
| AnnotationPropertyDeclaration
+ | OverloadPropertyDeclaration
| PropertySignature
| MethodSignature
| CallSignatureDeclaration
@@ -1869,6 +1902,7 @@ function isProcessedComponent(node: Node): node is ProcessedComponent {
case SyntaxKind.SetAccessor:
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.AnnotationPropertyDeclaration:
+ case SyntaxKind.OverloadPropertyDeclaration:
case SyntaxKind.PropertySignature:
case SyntaxKind.MethodSignature:
case SyntaxKind.CallSignature:
diff --git a/src/compiler/transformers/declarations/diagnostics.ts b/src/compiler/transformers/declarations/diagnostics.ts
index 5a5c280ae3..beb1ebae78 100644
--- a/src/compiler/transformers/declarations/diagnostics.ts
+++ b/src/compiler/transformers/declarations/diagnostics.ts
@@ -5,10 +5,10 @@ import {
IndexSignatureDeclaration, isAnnotationPropertyDeclaration, isBindingElement, isCallSignatureDeclaration, isClassDeclaration,
isConstructorDeclaration, isConstructSignatureDeclaration, isExpressionWithTypeArguments, isFunctionDeclaration,
isGetAccessor, isHeritageClause, isImportEqualsDeclaration, isIndexSignatureDeclaration, isJSDocTypeAlias,
- isMethodDeclaration, isMethodSignature, isParameter, isParameterPropertyDeclaration, isPropertyAccessExpression,
+ isMethodDeclaration, isMethodSignature, isOverloadPropertyDeclaration, isParameter, isParameterPropertyDeclaration, isPropertyAccessExpression,
isPropertyDeclaration, isPropertySignature, isSetAccessor, isStatic, isTypeAliasDeclaration,
isTypeParameterDeclaration, isVariableDeclaration, JSDocCallbackTag, JSDocEnumTag, JSDocTypedefTag,
- MethodDeclaration, MethodSignature, ModifierFlags, NamedDeclaration, Node, ParameterDeclaration,
+ MethodDeclaration, MethodSignature, ModifierFlags, NamedDeclaration, Node, OverloadPropertyDeclaration, ParameterDeclaration,
PropertyAccessExpression, PropertyDeclaration, PropertySignature, QualifiedName, SetAccessorDeclaration,
SymbolAccessibility, SymbolAccessibilityResult, SyntaxKind, TypeAliasDeclaration, TypeParameterDeclaration,
VariableDeclaration,
@@ -30,6 +30,7 @@ export type DeclarationDiagnosticProducing =
| PropertyDeclaration
| AnnotationPropertyDeclaration
| PropertySignature
+ | OverloadPropertyDeclaration
| BindingElement
| SetAccessorDeclaration
| GetAccessorDeclaration
@@ -152,7 +153,7 @@ export function createGetSymbolAccessibilityDiagnosticForNodeName(node: Declarat
/** @internal */
export function createGetSymbolAccessibilityDiagnosticForNode(node: DeclarationDiagnosticProducing): GetSymbolAccessibilityDiagnostic {
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isAnnotationPropertyDeclaration(node) ||
- isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
+ isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node) || isOverloadPropertyDeclaration(node)) {
return getVariableDeclarationTypeVisibilityError;
}
else if (isSetAccessor(node) || isGetAccessor(node)) {
diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts
index 58e71759fb..33f9bc99b2 100644
--- a/src/compiler/transformers/ts.ts
+++ b/src/compiler/transformers/ts.ts
@@ -519,6 +519,9 @@ export function transformTypeScript(context: TransformationContext) {
case SyntaxKind.AnnotationDeclaration:
return factory.createNotEmittedStatement(node);
+
+ case SyntaxKind.OverloadDeclaration:
+ return factory.createNotEmittedStatement(node);
case SyntaxKind.HeritageClause:
// This may be a heritage clause with TypeScript syntax extensions.
@@ -537,6 +540,7 @@ export function transformTypeScript(context: TransformationContext) {
case SyntaxKind.Constructor:
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.AnnotationPropertyDeclaration:
+ case SyntaxKind.OverloadPropertyDeclaration:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index 8a2b325090..765de57274 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -201,6 +201,7 @@ export const enum SyntaxKind {
GlobalKeyword,
BigIntKeyword,
OverrideKeyword,
+ OverloadKeyword,
OfKeyword, // LastKeyword and LastToken and LastContextualKeyword
// Parse tree nodes
@@ -216,6 +217,7 @@ export const enum SyntaxKind {
PropertySignature,
PropertyDeclaration,
AnnotationPropertyDeclaration,
+ OverloadPropertyDeclaration,
MethodSignature,
MethodDeclaration,
ClassStaticBlockDeclaration,
@@ -316,6 +318,7 @@ export const enum SyntaxKind {
ClassDeclaration,
StructDeclaration,
AnnotationDeclaration,
+ OverloadDeclaration,
InterfaceDeclaration,
TypeAliasDeclaration,
EnumDeclaration,
@@ -621,6 +624,7 @@ export type KeywordSyntaxKind =
| SyntaxKind.ReadonlyKeyword
| SyntaxKind.OutKeyword
| SyntaxKind.OverrideKeyword
+ | SyntaxKind.OverloadKeyword
| SyntaxKind.RequireKeyword
| SyntaxKind.ReturnKeyword
| SyntaxKind.SatisfiesKeyword
@@ -988,6 +992,7 @@ export type HasChildren =
| PropertySignature
| PropertyDeclaration
| AnnotationPropertyDeclaration
+ | OverloadPropertyDeclaration
| MethodSignature
| MethodDeclaration
| ConstructorDeclaration
@@ -1077,6 +1082,7 @@ export type HasChildren =
| ClassDeclaration
| StructDeclaration
| AnnotationDeclaration
+ | OverloadDeclaration
| InterfaceDeclaration
| TypeAliasDeclaration
| EnumDeclaration
@@ -1158,7 +1164,9 @@ export type HasJSDoc =
| VariableDeclaration
| PropertyDeclaration
| AnnotationPropertyDeclaration
+ | OverloadPropertyDeclaration
| AnnotationDeclaration
+ | OverloadDeclaration
| AccessorDeclaration
| ClassLikeDeclaration
| InterfaceDeclaration
@@ -1188,6 +1196,7 @@ export type HasType =
| PropertySignature
| PropertyDeclaration
| AnnotationPropertyDeclaration
+ | OverloadPropertyDeclaration
| TypePredicateNode
| ParenthesizedTypeNode
| TypeOperatorNode
@@ -1308,6 +1317,7 @@ export type HasModifiers =
| ClassDeclaration
| StructDeclaration
| AnnotationDeclaration
+ | OverloadDeclaration
| InterfaceDeclaration
| TypeAliasDeclaration
| EnumDeclaration
@@ -1316,6 +1326,7 @@ export type HasModifiers =
| ImportDeclaration
| ExportAssignment
| ExportDeclaration
+ | OverloadPropertyDeclaration
;
// NOTE: Changing the following list requires changes to:
@@ -1794,6 +1805,7 @@ export type VariableLikeDeclaration =
| BindingElement
| PropertyDeclaration
| AnnotationPropertyDeclaration
+ | OverloadPropertyDeclaration
| PropertyAssignment
| PropertySignature
| JsxAttribute
@@ -3315,7 +3327,7 @@ export type DeclarationWithTypeParameterChildren =
;
export interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer {
- readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression | SyntaxKind.StructDeclaration | SyntaxKind.AnnotationDeclaration;
+ readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression | SyntaxKind.StructDeclaration | SyntaxKind.AnnotationDeclaration | SyntaxKind.OverloadDeclaration;
readonly name?: Identifier;
readonly typeParameters?: NodeArray;
readonly heritageClauses?: NodeArray;
@@ -3343,6 +3355,13 @@ export interface AnnotationDeclaration extends DeclarationStatement {
readonly members: NodeArray;
}
+export interface OverloadDeclaration extends DeclarationStatement {
+ readonly kind: SyntaxKind.OverloadDeclaration;
+ readonly modifiers?: NodeArray;
+ readonly name: Identifier;
+ readonly members: NodeArray;
+}
+
export interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression {
readonly kind: SyntaxKind.ClassExpression;
readonly modifiers?: NodeArray;
@@ -3364,6 +3383,21 @@ export interface AnnotationElement extends NamedDeclaration {
readonly name: PropertyName;
}
+export interface OverloadElement extends NamedDeclaration {
+ readonly name: PropertyName; // Optional initializer
+}
+
+export interface OverloadPropertyDeclaration extends OverloadElement, JSDocContainer {
+ readonly kind: SyntaxKind.OverloadPropertyDeclaration;
+ readonly modifiers?: NodeArray;
+ readonly name: PropertyName; // Declared property name
+ readonly questionToken?: QuestionToken; // Present on optional property
+ readonly type?: TypeNode; // Optional type annotation
+
+ // The following properties are used only to report grammar errors
+ /** @internal */ readonly initializer?: Expression | undefined; // A property signature cannot have an initializer
+}
+
export interface TypeElement extends NamedDeclaration {
_typeElementBrand: any;
readonly name?: PropertyName;
@@ -5336,7 +5370,9 @@ export type LateVisibilityPaintedStatement =
| InterfaceDeclaration
| EnumDeclaration
| StructDeclaration
- | AnnotationDeclaration;
+ | AnnotationDeclaration
+ | OverloadDeclaration
+ ;
/** @internal */
export interface SymbolVisibilityResult {
@@ -8103,8 +8139,13 @@ export interface NodeFactory {
updatePropertySignature(node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
createPropertyDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
updatePropertyDeclaration(node: PropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
+
createAnnotationPropertyDeclaration(name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
updateAnnotationPropertyDeclaration(node: AnnotationPropertyDeclaration, name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
+
+ createOverloadPropertyDeclaration(modifiers: readonly ModifierLike[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
+ updateOverloadPropertyDeclaration(node: OverloadPropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
+
createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature;
createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
@@ -8335,6 +8376,9 @@ export interface NodeFactory {
createAnnotationDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, members: readonly AnnotationElement[]): AnnotationDeclaration;
updateAnnotationDeclaration(node: AnnotationDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly AnnotationElement[]): AnnotationDeclaration;
+ createOverloadDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
+ updateOverloadDeclaration(node: OverloadDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
+
createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts
index 0737e538d2..f3c49f182d 100644
--- a/src/compiler/utilities.ts
+++ b/src/compiler/utilities.ts
@@ -1188,6 +1188,7 @@ export function isLateVisibilityPaintedStatement(node: Node): node is LateVisibi
case SyntaxKind.ClassDeclaration:
case SyntaxKind.StructDeclaration:
case SyntaxKind.AnnotationDeclaration:
+ case SyntaxKind.OverloadDeclaration:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.ModuleDeclaration:
case SyntaxKind.TypeAliasDeclaration:
diff --git a/src/compiler/utilitiesPublic.ts b/src/compiler/utilitiesPublic.ts
index 6531d918d1..5abe1562fc 100644
--- a/src/compiler/utilitiesPublic.ts
+++ b/src/compiler/utilitiesPublic.ts
@@ -45,7 +45,7 @@ import {
some, sortAndDeduplicate, SortedReadonlyArray, SourceFile, Statement, StringLiteral, StringLiteralLike, StructDeclaration,
Symbol, SyntaxKind, TemplateLiteral, TemplateLiteralToken, TemplateMiddle, TemplateTail, TextChangeRange, TextRange,
TextSpan, TypeElement, TypeNode, TypeOnlyAliasDeclaration, TypeParameterDeclaration, TypeReferenceType,
- UnaryExpression, UnparsedNode, UnparsedTextLike, VariableDeclaration,
+ UnaryExpression, UnparsedNode, UnparsedTextLike, VariableDeclaration, OverloadElement
} from "./_namespaces/ts";
export function isExternalModuleNameRelative(moduleName: string): boolean {
@@ -1424,6 +1424,11 @@ export function isAnnotationElement(node: Node): node is AnnotationElement {
return kind === SyntaxKind.AnnotationPropertyDeclaration;
}
+export function isOverloadElement(node: Node): node is OverloadElement {
+ const kind = node.kind;
+ return kind === SyntaxKind.OverloadPropertyDeclaration;
+}
+
// Classes
export function isClassElement(node: Node): node is ClassElement {
const kind = node.kind;
@@ -1961,6 +1966,7 @@ function isDeclarationKind(kind: SyntaxKind) {
|| kind === SyntaxKind.ClassStaticBlockDeclaration
|| kind === SyntaxKind.StructDeclaration
|| kind === SyntaxKind.AnnotationDeclaration
+ || kind === SyntaxKind.OverloadPropertyDeclaration
|| kind === SyntaxKind.Constructor
|| kind === SyntaxKind.EnumDeclaration
|| kind === SyntaxKind.EnumMember
@@ -2000,6 +2006,7 @@ function isDeclarationStatementKind(kind: SyntaxKind) {
|| kind === SyntaxKind.ClassDeclaration
|| kind === SyntaxKind.StructDeclaration
|| kind === SyntaxKind.AnnotationDeclaration
+ || kind === SyntaxKind.OverloadDeclaration
|| kind === SyntaxKind.InterfaceDeclaration
|| kind === SyntaxKind.TypeAliasDeclaration
|| kind === SyntaxKind.EnumDeclaration
diff --git a/src/compiler/visitorPublic.ts b/src/compiler/visitorPublic.ts
index b711d7ec6d..c524691747 100644
--- a/src/compiler/visitorPublic.ts
+++ b/src/compiler/visitorPublic.ts
@@ -15,7 +15,7 @@ import {
isTemplateMiddleOrTemplateTail, isTemplateSpan, isToken, isTypeElement, isTypeNode, isTypeNodeOrTypeParameterDeclaration, isTypeParameterDeclaration, isVariableDeclaration,
isVariableDeclarationList, LexicalEnvironmentFlags, Node, NodeArray, NodesVisitor, NodeVisitor, ParameterDeclaration, ScriptTarget,
setEmitFlags, setTextRange, setTextRangePosEnd, singleOrUndefined, some, Statement, SyntaxKind,
- TransformationContext, Visitor, VisitEachChildNodes
+ TransformationContext, Visitor, VisitEachChildNodes, isOverloadElement
} from "./_namespaces/ts";
/**
@@ -489,6 +489,14 @@ const visitEachChildTable: VisitEachChildTable = {
nodeVisitor(node.type, visitor, isTypeNode));
},
+ [SyntaxKind.OverloadPropertyDeclaration]: function visitEachChildOfOverloadPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
+ return context.factory.updateOverloadPropertyDeclaration(node,
+ nodesVisitor(node.modifiers, visitor, isModifier),
+ nodeVisitor(node.name, visitor, isPropertyName),
+ nodeVisitor(node.questionToken, tokenVisitor, isToken),
+ nodeVisitor(node.type, visitor, isTypeNode));
+ },
+
[SyntaxKind.PropertyDeclaration]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
return context.factory.updatePropertyDeclaration(node,
nodesVisitor(node.modifiers, visitor, isModifierLike),
@@ -1134,6 +1142,13 @@ const visitEachChildTable: VisitEachChildTable = {
nodesVisitor(node.members, visitor, isAnnotationElement));
},
+ [SyntaxKind.OverloadDeclaration]: function visitEachChildOfOverloadDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
+ return context.factory.updateOverloadDeclaration(node,
+ nodesVisitor(node.modifiers, visitor, isModifier),
+ nodeVisitor(node.name, visitor, isIdentifier),
+ nodesVisitor(node.members, visitor, isOverloadElement));
+ },
+
[SyntaxKind.InterfaceDeclaration]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateInterfaceDeclaration(node,
nodesVisitor(node.modifiers, visitor, isModifier),
--
Gitee
From e6c60cdf2b5a79936fae024b46dd6d4d8977fe30 Mon Sep 17 00:00:00 2001
From: zju_wyx <22125041@zju.edu.cn>
Date: Wed, 16 Jul 2025 15:03:47 +0800
Subject: [PATCH 02/10] support overlod --stage2 Signed-off-by: zju_wyx
<22125041@zju.edu.cn> Change-Id: Ib11879b27f2fbdb50cb7a66acbc7f339ad9f5e8a
Change-Id: I5785c8a3725a3c5bc2f5a107d996279710b06f08
---
lib/tsc.js | 53 +-
lib/tsserver.js | 53 +-
lib/tsserverlibrary.d.ts | 2 +-
lib/tsserverlibrary.js | 53 +-
lib/typescript.d.ts | 2 +-
lib/typescript.js | 53 +-
lib/typingsInstaller.js | 33 +-
src/compiler/checker.ts | 1 +
src/compiler/factory/utilitiesPublic.ts | 3 +-
src/compiler/parser.ts | 31 +-
src/compiler/transformers/declarations.ts | 23 +-
src/compiler/transformers/ts.ts | 1 +
src/compiler/types.ts | 4 +-
src/compiler/utilitiesPublic.ts | 9 +-
.../OverloadDeclarationInNameSpace1.js | 22 +
.../OverloadDeclarationInNameSpace1.symbols | 16 +
.../OverloadDeclarationInNameSpace1.types | 17 +
.../OverloadDeclarationInNameSpace2.js | 25 +
.../OverloadDeclarationInNameSpace2.symbols | 20 +
.../OverloadDeclarationInNameSpace2.types | 17 +
.../OverloadDeclarationInNameSpace3.js | 25 +
.../OverloadDeclarationInNameSpace3.symbols | 21 +
.../OverloadDeclarationInNameSpace3.types | 22 +
.../OverloadDeclarationInTopLevel1.js | 18 +
.../OverloadDeclarationInTopLevel1.symbols | 12 +
.../OverloadDeclarationInTopLevel1.types | 13 +
.../OverloadDeclarationInTopLevel2.js | 22 +
.../OverloadDeclarationInTopLevel2.symbols | 17 +
.../OverloadDeclarationInTopLevel2.types | 16 +
.../OverloadDeclarationInTopLevel3.js | 21 +
.../OverloadDeclarationInTopLevel3.symbols | 17 +
.../OverloadDeclarationInTopLevel3.types | 18 +
.../OverloadDeclarationWithExport.js | 19 +
.../OverloadDeclarationWithExport.symbols | 12 +
.../OverloadDeclarationWithExport.types | 13 +
.../OverloadDeclarationWithModifier.js | 30 ++
.../OverloadDeclarationWithModifier.symbols | 28 ++
.../OverloadDeclarationWithModifier.types | 30 ++
.../reference/api/tsserverlibrary.d.ts | 464 +++++++++---------
tests/baselines/reference/api/typescript.d.ts | 464 +++++++++---------
.../OverloadDeclarationInNameSpace1.ets | 7 +
.../OverloadDeclarationInNameSpace2.ets | 9 +
.../OverloadDeclarationInNameSpace3.ets | 9 +
.../OverloadDeclarationInTopLevel1.ets | 5 +
.../OverloadDeclarationInTopLevel2.ets | 7 +
.../OverloadDeclarationInTopLevel3.ets | 7 +
.../OverloadDeclarationWithExport.ets | 5 +
.../OverloadDeclarationWithModifier.ets | 10 +
48 files changed, 1284 insertions(+), 495 deletions(-)
create mode 100644 tests/baselines/reference/OverloadDeclarationInNameSpace1.js
create mode 100644 tests/baselines/reference/OverloadDeclarationInNameSpace1.symbols
create mode 100644 tests/baselines/reference/OverloadDeclarationInNameSpace1.types
create mode 100644 tests/baselines/reference/OverloadDeclarationInNameSpace2.js
create mode 100644 tests/baselines/reference/OverloadDeclarationInNameSpace2.symbols
create mode 100644 tests/baselines/reference/OverloadDeclarationInNameSpace2.types
create mode 100644 tests/baselines/reference/OverloadDeclarationInNameSpace3.js
create mode 100644 tests/baselines/reference/OverloadDeclarationInNameSpace3.symbols
create mode 100644 tests/baselines/reference/OverloadDeclarationInNameSpace3.types
create mode 100644 tests/baselines/reference/OverloadDeclarationInTopLevel1.js
create mode 100644 tests/baselines/reference/OverloadDeclarationInTopLevel1.symbols
create mode 100644 tests/baselines/reference/OverloadDeclarationInTopLevel1.types
create mode 100644 tests/baselines/reference/OverloadDeclarationInTopLevel2.js
create mode 100644 tests/baselines/reference/OverloadDeclarationInTopLevel2.symbols
create mode 100644 tests/baselines/reference/OverloadDeclarationInTopLevel2.types
create mode 100644 tests/baselines/reference/OverloadDeclarationInTopLevel3.js
create mode 100644 tests/baselines/reference/OverloadDeclarationInTopLevel3.symbols
create mode 100644 tests/baselines/reference/OverloadDeclarationInTopLevel3.types
create mode 100644 tests/baselines/reference/OverloadDeclarationWithExport.js
create mode 100644 tests/baselines/reference/OverloadDeclarationWithExport.symbols
create mode 100644 tests/baselines/reference/OverloadDeclarationWithExport.types
create mode 100644 tests/baselines/reference/OverloadDeclarationWithModifier.js
create mode 100644 tests/baselines/reference/OverloadDeclarationWithModifier.symbols
create mode 100644 tests/baselines/reference/OverloadDeclarationWithModifier.types
create mode 100644 tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace1.ets
create mode 100644 tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace2.ets
create mode 100644 tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace3.ets
create mode 100644 tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel1.ets
create mode 100644 tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel2.ets
create mode 100644 tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel3.ets
create mode 100644 tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets
create mode 100644 tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithModifier.ets
diff --git a/lib/tsc.js b/lib/tsc.js
index 23c50d749b..63be854d0b 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -11895,7 +11895,7 @@ function isParameterPropertyModifier(kind) {
return !!(modifierToFlag(kind) & 16476 /* ParameterPropertyModifier */);
}
function isClassMemberModifier(idToken) {
- return isParameterPropertyModifier(idToken) || idToken === 125 /* StaticKeyword */ || idToken === 163 /* OverrideKeyword */ || idToken === 128 /* AccessorKeyword */;
+ return isParameterPropertyModifier(idToken) || idToken === 125 /* StaticKeyword */ || idToken === 163 /* OverrideKeyword */ || idToken === 128 /* AccessorKeyword */ || idToken === 133 /* AsyncKeyword */;
}
function isModifier(node) {
return isModifierKind(node.kind);
@@ -11966,7 +11966,7 @@ function isOverloadElement(node) {
}
function isClassElement(node) {
const kind = node.kind;
- return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */;
+ return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */ || kind === 269 /* OverloadDeclaration */;
}
function isClassLike(node) {
return node && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 267 /* StructDeclaration */);
@@ -12006,7 +12006,7 @@ function isModifierLike(node) {
}
function isTypeElement(node) {
const kind = node.kind;
- return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
+ return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 269 /* OverloadDeclaration */;
}
function isClassOrTypeElement(node) {
return isTypeElement(node) || isClassElement(node);
@@ -25574,7 +25574,7 @@ function setTextRange(range, location) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
@@ -27271,7 +27271,7 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
- if (token() === 164 /* OverloadKeyword */) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
return canFollowExportModifier();
@@ -27298,7 +27298,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine()) || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -28257,6 +28257,9 @@ var Parser;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
+ if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
+ parseTokenNode();
+ }
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
let node;
@@ -28278,6 +28281,9 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return true;
+ }
let idToken = false;
while (isModifierKind(token())) {
idToken = true;
@@ -28314,6 +28320,9 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
+ }
return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
}
function nextTokenIsOpenParenOrLessThan() {
@@ -30462,6 +30471,7 @@ var Parser;
case 94 /* ExportKeyword */:
return isStartOfDeclaration();
case 133 /* AsyncKeyword */:
+ case 164 /* OverloadKeyword */:
case 137 /* DeclareKeyword */:
case 119 /* InterfaceKeyword */:
case 143 /* ModuleKeyword */:
@@ -30668,7 +30678,10 @@ var Parser;
}
return parseDeclarationDefault(pos, decorators, modifiers);
case 164 /* OverloadKeyword */:
- return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ if (lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ }
+ return parseDeclarationDefault(pos, decorators, modifiers);
case 119 /* InterfaceKeyword */:
return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
case 155 /* TypeKeyword */:
@@ -31077,6 +31090,9 @@ var Parser;
}
return true;
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return true;
+ }
while (isModifierKind(token())) {
idToken = token();
if (isClassMemberModifier(idToken)) {
@@ -31257,6 +31273,9 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ }
if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) {
const isAmbient = some(modifiers, isDeclareModifier);
if (isAmbient) {
@@ -76376,6 +76395,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 268 /* AnnotationDeclaration */:
return checkAnnotationDeclaration(node);
case 269 /* OverloadDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
return;
case 270 /* InterfaceDeclaration */:
return checkInterfaceDeclaration(node);
@@ -82516,6 +82536,7 @@ function transformTypeScript(context) {
return visitEachChild(node, visitor, context);
case 243 /* SemicolonClassElement */:
return node;
+ case 269 /* OverloadDeclaration */:
case 183 /* IndexSignature */:
return;
default:
@@ -97893,6 +97914,16 @@ function transformDeclarations(context) {
input.questionToken,
ensureType(input, input.type)
));
+ case 269 /* OverloadDeclaration */:
+ const modifiers = factory2.createNodeArray(ensureModifiers(input));
+ const memberNodes = visitNodes2(input.members, visitDeclarationSubtree);
+ const members = factory2.createNodeArray(memberNodes);
+ return cleanup(factory2.updateOverloadDeclaration(
+ input,
+ modifiers,
+ input.name,
+ members
+ ));
case 174 /* OverloadPropertyDeclaration */:
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
@@ -98489,10 +98520,13 @@ function transformDeclarations(context) {
return factory2.createModifiersFromModifierFlags(newFlags);
}
function ensureModifierFlags(node) {
- let mask = 258047 /* All */ ^ (4 /* Public */ | 512 /* Async */ | 16384 /* Override */);
+ let mask = 258047 /* All */ ^ (4 /* Public */ | 16384 /* Override */);
+ if (node.kind !== 269 /* OverloadDeclaration */) {
+ mask = mask ^ 512 /* Async */;
+ }
let additions = needsDeclare && !isAlwaysType(node) ? 2 /* Ambient */ : 0 /* None */;
const parentIsFile = node.parent.kind === 317 /* SourceFile */;
- if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) {
+ if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent) || node.kind === 269 /* OverloadDeclaration */) {
mask ^= 2 /* Ambient */;
additions = 0 /* None */;
}
@@ -98580,6 +98614,7 @@ function isProcessedComponent(node) {
case 180 /* SetAccessor */:
case 172 /* PropertyDeclaration */:
case 173 /* AnnotationPropertyDeclaration */:
+ case 269 /* OverloadDeclaration */:
case 174 /* OverloadPropertyDeclaration */:
case 171 /* PropertySignature */:
case 175 /* MethodSignature */:
diff --git a/lib/tsserver.js b/lib/tsserver.js
index c6a316a606..7f0d91c303 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -14589,7 +14589,7 @@ function isParameterPropertyModifier(kind) {
return !!(modifierToFlag(kind) & 16476 /* ParameterPropertyModifier */);
}
function isClassMemberModifier(idToken) {
- return isParameterPropertyModifier(idToken) || idToken === 125 /* StaticKeyword */ || idToken === 163 /* OverrideKeyword */ || idToken === 128 /* AccessorKeyword */;
+ return isParameterPropertyModifier(idToken) || idToken === 125 /* StaticKeyword */ || idToken === 163 /* OverrideKeyword */ || idToken === 128 /* AccessorKeyword */ || idToken === 133 /* AsyncKeyword */;
}
function isModifier(node) {
return isModifierKind(node.kind);
@@ -14660,7 +14660,7 @@ function isOverloadElement(node) {
}
function isClassElement(node) {
const kind = node.kind;
- return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */;
+ return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */ || kind === 269 /* OverloadDeclaration */;
}
function isClassLike(node) {
return node && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 267 /* StructDeclaration */);
@@ -14700,7 +14700,7 @@ function isModifierLike(node) {
}
function isTypeElement(node) {
const kind = node.kind;
- return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
+ return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 269 /* OverloadDeclaration */;
}
function isClassOrTypeElement(node) {
return isTypeElement(node) || isClassElement(node);
@@ -28268,7 +28268,7 @@ function setTextRange(range, location2) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
@@ -29950,7 +29950,7 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
- if (token() === 164 /* OverloadKeyword */) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
return canFollowExportModifier();
@@ -29977,7 +29977,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine()) || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -30936,6 +30936,9 @@ var Parser;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
+ if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
+ parseTokenNode();
+ }
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
let node;
@@ -30957,6 +30960,9 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return true;
+ }
let idToken = false;
while (isModifierKind(token())) {
idToken = true;
@@ -30993,6 +30999,9 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
+ }
return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
}
function nextTokenIsOpenParenOrLessThan() {
@@ -33141,6 +33150,7 @@ var Parser;
case 94 /* ExportKeyword */:
return isStartOfDeclaration();
case 133 /* AsyncKeyword */:
+ case 164 /* OverloadKeyword */:
case 137 /* DeclareKeyword */:
case 119 /* InterfaceKeyword */:
case 143 /* ModuleKeyword */:
@@ -33347,7 +33357,10 @@ var Parser;
}
return parseDeclarationDefault(pos, decorators, modifiers);
case 164 /* OverloadKeyword */:
- return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ if (lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ }
+ return parseDeclarationDefault(pos, decorators, modifiers);
case 119 /* InterfaceKeyword */:
return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
case 155 /* TypeKeyword */:
@@ -33756,6 +33769,9 @@ var Parser;
}
return true;
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return true;
+ }
while (isModifierKind(token())) {
idToken = token();
if (isClassMemberModifier(idToken)) {
@@ -33936,6 +33952,9 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ }
if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) {
const isAmbient = some(modifiers, isDeclareModifier);
if (isAmbient) {
@@ -78912,6 +78931,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 268 /* AnnotationDeclaration */:
return checkAnnotationDeclaration(node);
case 269 /* OverloadDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
return;
case 270 /* InterfaceDeclaration */:
return checkInterfaceDeclaration(node);
@@ -85031,6 +85051,7 @@ function transformTypeScript(context) {
return visitEachChild(node, visitor, context);
case 243 /* SemicolonClassElement */:
return node;
+ case 269 /* OverloadDeclaration */:
case 183 /* IndexSignature */:
return;
default:
@@ -100245,6 +100266,16 @@ function transformDeclarations(context) {
input.questionToken,
ensureType(input, input.type)
));
+ case 269 /* OverloadDeclaration */:
+ const modifiers = factory2.createNodeArray(ensureModifiers(input));
+ const memberNodes = visitNodes2(input.members, visitDeclarationSubtree);
+ const members = factory2.createNodeArray(memberNodes);
+ return cleanup(factory2.updateOverloadDeclaration(
+ input,
+ modifiers,
+ input.name,
+ members
+ ));
case 174 /* OverloadPropertyDeclaration */:
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
@@ -100841,10 +100872,13 @@ function transformDeclarations(context) {
return factory2.createModifiersFromModifierFlags(newFlags);
}
function ensureModifierFlags(node) {
- let mask2 = 258047 /* All */ ^ (4 /* Public */ | 512 /* Async */ | 16384 /* Override */);
+ let mask2 = 258047 /* All */ ^ (4 /* Public */ | 16384 /* Override */);
+ if (node.kind !== 269 /* OverloadDeclaration */) {
+ mask2 = mask2 ^ 512 /* Async */;
+ }
let additions = needsDeclare && !isAlwaysType(node) ? 2 /* Ambient */ : 0 /* None */;
const parentIsFile = node.parent.kind === 317 /* SourceFile */;
- if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) {
+ if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent) || node.kind === 269 /* OverloadDeclaration */) {
mask2 ^= 2 /* Ambient */;
additions = 0 /* None */;
}
@@ -100932,6 +100966,7 @@ function isProcessedComponent(node) {
case 180 /* SetAccessor */:
case 172 /* PropertyDeclaration */:
case 173 /* AnnotationPropertyDeclaration */:
+ case 269 /* OverloadDeclaration */:
case 174 /* OverloadPropertyDeclaration */:
case 171 /* PropertySignature */:
case 175 /* MethodSignature */:
diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts
index 075460b20c..99f934254c 100644
--- a/lib/tsserverlibrary.d.ts
+++ b/lib/tsserverlibrary.d.ts
@@ -5760,7 +5760,7 @@ declare namespace ts {
readonly name: Identifier;
readonly members: NodeArray;
}
- interface OverloadDeclaration extends DeclarationStatement {
+ interface OverloadDeclaration extends DeclarationStatement, ClassElement, TypeElement {
readonly kind: SyntaxKind.OverloadDeclaration;
readonly modifiers?: NodeArray;
readonly name: Identifier;
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index 20404e72bb..0f98a88f76 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -14491,7 +14491,7 @@ function isParameterPropertyModifier(kind) {
return !!(modifierToFlag(kind) & 16476 /* ParameterPropertyModifier */);
}
function isClassMemberModifier(idToken) {
- return isParameterPropertyModifier(idToken) || idToken === 125 /* StaticKeyword */ || idToken === 163 /* OverrideKeyword */ || idToken === 128 /* AccessorKeyword */;
+ return isParameterPropertyModifier(idToken) || idToken === 125 /* StaticKeyword */ || idToken === 163 /* OverrideKeyword */ || idToken === 128 /* AccessorKeyword */ || idToken === 133 /* AsyncKeyword */;
}
function isModifier(node) {
return isModifierKind(node.kind);
@@ -14562,7 +14562,7 @@ function isOverloadElement(node) {
}
function isClassElement(node) {
const kind = node.kind;
- return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */;
+ return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */ || kind === 269 /* OverloadDeclaration */;
}
function isClassLike(node) {
return node && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 267 /* StructDeclaration */);
@@ -14602,7 +14602,7 @@ function isModifierLike(node) {
}
function isTypeElement(node) {
const kind = node.kind;
- return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
+ return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 269 /* OverloadDeclaration */;
}
function isClassOrTypeElement(node) {
return isTypeElement(node) || isClassElement(node);
@@ -28170,7 +28170,7 @@ function setTextRange(range, location) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
@@ -29852,7 +29852,7 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
- if (token() === 164 /* OverloadKeyword */) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
return canFollowExportModifier();
@@ -29879,7 +29879,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine()) || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -30838,6 +30838,9 @@ var Parser;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
+ if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
+ parseTokenNode();
+ }
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
let node;
@@ -30859,6 +30862,9 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return true;
+ }
let idToken = false;
while (isModifierKind(token())) {
idToken = true;
@@ -30895,6 +30901,9 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
+ }
return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
}
function nextTokenIsOpenParenOrLessThan() {
@@ -33043,6 +33052,7 @@ var Parser;
case 94 /* ExportKeyword */:
return isStartOfDeclaration();
case 133 /* AsyncKeyword */:
+ case 164 /* OverloadKeyword */:
case 137 /* DeclareKeyword */:
case 119 /* InterfaceKeyword */:
case 143 /* ModuleKeyword */:
@@ -33249,7 +33259,10 @@ var Parser;
}
return parseDeclarationDefault(pos, decorators, modifiers);
case 164 /* OverloadKeyword */:
- return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ if (lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ }
+ return parseDeclarationDefault(pos, decorators, modifiers);
case 119 /* InterfaceKeyword */:
return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
case 155 /* TypeKeyword */:
@@ -33658,6 +33671,9 @@ var Parser;
}
return true;
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return true;
+ }
while (isModifierKind(token())) {
idToken = token();
if (isClassMemberModifier(idToken)) {
@@ -33838,6 +33854,9 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ }
if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) {
const isAmbient = some(modifiers, isDeclareModifier);
if (isAmbient) {
@@ -78814,6 +78833,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 268 /* AnnotationDeclaration */:
return checkAnnotationDeclaration(node);
case 269 /* OverloadDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
return;
case 270 /* InterfaceDeclaration */:
return checkInterfaceDeclaration(node);
@@ -84933,6 +84953,7 @@ function transformTypeScript(context) {
return visitEachChild(node, visitor, context);
case 243 /* SemicolonClassElement */:
return node;
+ case 269 /* OverloadDeclaration */:
case 183 /* IndexSignature */:
return;
default:
@@ -100147,6 +100168,16 @@ function transformDeclarations(context) {
input.questionToken,
ensureType(input, input.type)
));
+ case 269 /* OverloadDeclaration */:
+ const modifiers = factory2.createNodeArray(ensureModifiers(input));
+ const memberNodes = visitNodes2(input.members, visitDeclarationSubtree);
+ const members = factory2.createNodeArray(memberNodes);
+ return cleanup(factory2.updateOverloadDeclaration(
+ input,
+ modifiers,
+ input.name,
+ members
+ ));
case 174 /* OverloadPropertyDeclaration */:
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
@@ -100743,10 +100774,13 @@ function transformDeclarations(context) {
return factory2.createModifiersFromModifierFlags(newFlags);
}
function ensureModifierFlags(node) {
- let mask2 = 258047 /* All */ ^ (4 /* Public */ | 512 /* Async */ | 16384 /* Override */);
+ let mask2 = 258047 /* All */ ^ (4 /* Public */ | 16384 /* Override */);
+ if (node.kind !== 269 /* OverloadDeclaration */) {
+ mask2 = mask2 ^ 512 /* Async */;
+ }
let additions = needsDeclare && !isAlwaysType(node) ? 2 /* Ambient */ : 0 /* None */;
const parentIsFile = node.parent.kind === 317 /* SourceFile */;
- if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) {
+ if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent) || node.kind === 269 /* OverloadDeclaration */) {
mask2 ^= 2 /* Ambient */;
additions = 0 /* None */;
}
@@ -100834,6 +100868,7 @@ function isProcessedComponent(node) {
case 180 /* SetAccessor */:
case 172 /* PropertyDeclaration */:
case 173 /* AnnotationPropertyDeclaration */:
+ case 269 /* OverloadDeclaration */:
case 174 /* OverloadPropertyDeclaration */:
case 171 /* PropertySignature */:
case 175 /* MethodSignature */:
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
index 5022a4ba2c..4d30f91028 100644
--- a/lib/typescript.d.ts
+++ b/lib/typescript.d.ts
@@ -1757,7 +1757,7 @@ declare namespace ts {
readonly name: Identifier;
readonly members: NodeArray;
}
- interface OverloadDeclaration extends DeclarationStatement {
+ interface OverloadDeclaration extends DeclarationStatement, ClassElement, TypeElement {
readonly kind: SyntaxKind.OverloadDeclaration;
readonly modifiers?: NodeArray;
readonly name: Identifier;
diff --git a/lib/typescript.js b/lib/typescript.js
index a2b6e59397..54768fecb9 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -14491,7 +14491,7 @@ function isParameterPropertyModifier(kind) {
return !!(modifierToFlag(kind) & 16476 /* ParameterPropertyModifier */);
}
function isClassMemberModifier(idToken) {
- return isParameterPropertyModifier(idToken) || idToken === 125 /* StaticKeyword */ || idToken === 163 /* OverrideKeyword */ || idToken === 128 /* AccessorKeyword */;
+ return isParameterPropertyModifier(idToken) || idToken === 125 /* StaticKeyword */ || idToken === 163 /* OverrideKeyword */ || idToken === 128 /* AccessorKeyword */ || idToken === 133 /* AsyncKeyword */;
}
function isModifier(node) {
return isModifierKind(node.kind);
@@ -14562,7 +14562,7 @@ function isOverloadElement(node) {
}
function isClassElement(node) {
const kind = node.kind;
- return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */;
+ return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */ || kind === 269 /* OverloadDeclaration */;
}
function isClassLike(node) {
return node && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 267 /* StructDeclaration */);
@@ -14602,7 +14602,7 @@ function isModifierLike(node) {
}
function isTypeElement(node) {
const kind = node.kind;
- return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
+ return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 269 /* OverloadDeclaration */;
}
function isClassOrTypeElement(node) {
return isTypeElement(node) || isClassElement(node);
@@ -28170,7 +28170,7 @@ function setTextRange(range, location) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
@@ -29867,7 +29867,7 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
- if (token() === 164 /* OverloadKeyword */) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
return canFollowExportModifier();
@@ -29894,7 +29894,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine()) || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -30853,6 +30853,9 @@ var Parser;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
+ if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
+ parseTokenNode();
+ }
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
let node;
@@ -30874,6 +30877,9 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return true;
+ }
let idToken = false;
while (isModifierKind(token())) {
idToken = true;
@@ -30910,6 +30916,9 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
+ }
return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
}
function nextTokenIsOpenParenOrLessThan() {
@@ -33058,6 +33067,7 @@ var Parser;
case 94 /* ExportKeyword */:
return isStartOfDeclaration();
case 133 /* AsyncKeyword */:
+ case 164 /* OverloadKeyword */:
case 137 /* DeclareKeyword */:
case 119 /* InterfaceKeyword */:
case 143 /* ModuleKeyword */:
@@ -33264,7 +33274,10 @@ var Parser;
}
return parseDeclarationDefault(pos, decorators, modifiers);
case 164 /* OverloadKeyword */:
- return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ if (lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ }
+ return parseDeclarationDefault(pos, decorators, modifiers);
case 119 /* InterfaceKeyword */:
return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
case 155 /* TypeKeyword */:
@@ -33673,6 +33686,9 @@ var Parser;
}
return true;
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return true;
+ }
while (isModifierKind(token())) {
idToken = token();
if (isClassMemberModifier(idToken)) {
@@ -33853,6 +33869,9 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ }
if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) {
const isAmbient = some(modifiers, isDeclareModifier);
if (isAmbient) {
@@ -78972,6 +78991,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 268 /* AnnotationDeclaration */:
return checkAnnotationDeclaration(node);
case 269 /* OverloadDeclaration */:
+ case 174 /* OverloadPropertyDeclaration */:
return;
case 270 /* InterfaceDeclaration */:
return checkInterfaceDeclaration(node);
@@ -85112,6 +85132,7 @@ function transformTypeScript(context) {
return visitEachChild(node, visitor, context);
case 243 /* SemicolonClassElement */:
return node;
+ case 269 /* OverloadDeclaration */:
case 183 /* IndexSignature */:
return;
default:
@@ -100489,6 +100510,16 @@ function transformDeclarations(context) {
input.questionToken,
ensureType(input, input.type)
));
+ case 269 /* OverloadDeclaration */:
+ const modifiers = factory2.createNodeArray(ensureModifiers(input));
+ const memberNodes = visitNodes2(input.members, visitDeclarationSubtree);
+ const members = factory2.createNodeArray(memberNodes);
+ return cleanup(factory2.updateOverloadDeclaration(
+ input,
+ modifiers,
+ input.name,
+ members
+ ));
case 174 /* OverloadPropertyDeclaration */:
if (isPrivateIdentifier(input.name)) {
return cleanup(void 0);
@@ -101085,10 +101116,13 @@ function transformDeclarations(context) {
return factory2.createModifiersFromModifierFlags(newFlags);
}
function ensureModifierFlags(node) {
- let mask2 = 258047 /* All */ ^ (4 /* Public */ | 512 /* Async */ | 16384 /* Override */);
+ let mask2 = 258047 /* All */ ^ (4 /* Public */ | 16384 /* Override */);
+ if (node.kind !== 269 /* OverloadDeclaration */) {
+ mask2 = mask2 ^ 512 /* Async */;
+ }
let additions = needsDeclare && !isAlwaysType(node) ? 2 /* Ambient */ : 0 /* None */;
const parentIsFile = node.parent.kind === 317 /* SourceFile */;
- if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) {
+ if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent) || node.kind === 269 /* OverloadDeclaration */) {
mask2 ^= 2 /* Ambient */;
additions = 0 /* None */;
}
@@ -101176,6 +101210,7 @@ function isProcessedComponent(node) {
case 180 /* SetAccessor */:
case 172 /* PropertyDeclaration */:
case 173 /* AnnotationPropertyDeclaration */:
+ case 269 /* OverloadDeclaration */:
case 174 /* OverloadPropertyDeclaration */:
case 171 /* PropertySignature */:
case 175 /* MethodSignature */:
diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js
index 60e528a610..c187443840 100644
--- a/lib/typingsInstaller.js
+++ b/lib/typingsInstaller.js
@@ -9738,7 +9738,7 @@ function isParameterPropertyModifier(kind) {
return !!(modifierToFlag(kind) & 16476 /* ParameterPropertyModifier */);
}
function isClassMemberModifier(idToken) {
- return isParameterPropertyModifier(idToken) || idToken === 125 /* StaticKeyword */ || idToken === 163 /* OverrideKeyword */ || idToken === 128 /* AccessorKeyword */;
+ return isParameterPropertyModifier(idToken) || idToken === 125 /* StaticKeyword */ || idToken === 163 /* OverrideKeyword */ || idToken === 128 /* AccessorKeyword */ || idToken === 133 /* AsyncKeyword */;
}
function isModifier(node) {
return isModifierKind(node.kind);
@@ -9803,7 +9803,7 @@ function isOverloadElement(node) {
}
function isClassElement(node) {
const kind = node.kind;
- return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */;
+ return kind === 178 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 177 /* ClassStaticBlockDeclaration */ || kind === 243 /* SemicolonClassElement */ || kind === 269 /* OverloadDeclaration */;
}
function isClassLike(node) {
return node && (node.kind === 266 /* ClassDeclaration */ || node.kind === 234 /* ClassExpression */ || node.kind === 267 /* StructDeclaration */);
@@ -9829,7 +9829,7 @@ function isModifierLike(node) {
}
function isTypeElement(node) {
const kind = node.kind;
- return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */;
+ return kind === 182 /* ConstructSignature */ || kind === 181 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */ || kind === 183 /* IndexSignature */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 269 /* OverloadDeclaration */;
}
function isObjectLiteralElementLike(node) {
const kind = node.kind;
@@ -18472,7 +18472,7 @@ function setTextRange(range, location) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
@@ -20102,7 +20102,7 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
- if (token() === 164 /* OverloadKeyword */) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
return canFollowExportModifier();
@@ -20129,7 +20129,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine()) || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -21088,6 +21088,9 @@ var Parser;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
+ if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
+ parseTokenNode();
+ }
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
let node;
@@ -21109,6 +21112,9 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return true;
+ }
let idToken = false;
while (isModifierKind(token())) {
idToken = true;
@@ -21145,6 +21151,9 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
+ }
return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
}
function nextTokenIsOpenParenOrLessThan() {
@@ -23293,6 +23302,7 @@ var Parser;
case 94 /* ExportKeyword */:
return isStartOfDeclaration();
case 133 /* AsyncKeyword */:
+ case 164 /* OverloadKeyword */:
case 137 /* DeclareKeyword */:
case 119 /* InterfaceKeyword */:
case 143 /* ModuleKeyword */:
@@ -23499,7 +23509,10 @@ var Parser;
}
return parseDeclarationDefault(pos, decorators, modifiers);
case 164 /* OverloadKeyword */:
- return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ if (lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ }
+ return parseDeclarationDefault(pos, decorators, modifiers);
case 119 /* InterfaceKeyword */:
return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
case 155 /* TypeKeyword */:
@@ -23908,6 +23921,9 @@ var Parser;
}
return true;
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return true;
+ }
while (isModifierKind(token())) {
idToken = token();
if (isClassMemberModifier(idToken)) {
@@ -24088,6 +24104,9 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ }
if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) {
const isAmbient = some(modifiers, isDeclareModifier);
if (isAmbient) {
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index f6984cc355..d0f51eac2d 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -44880,6 +44880,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
case SyntaxKind.AnnotationDeclaration:
return checkAnnotationDeclaration(node as AnnotationDeclaration);
case SyntaxKind.OverloadDeclaration:
+ case SyntaxKind.OverloadPropertyDeclaration:
return;
case SyntaxKind.InterfaceDeclaration:
return checkInterfaceDeclaration(node as InterfaceDeclaration);
diff --git a/src/compiler/factory/utilitiesPublic.ts b/src/compiler/factory/utilitiesPublic.ts
index 64da550365..0db356a68d 100644
--- a/src/compiler/factory/utilitiesPublic.ts
+++ b/src/compiler/factory/utilitiesPublic.ts
@@ -32,7 +32,8 @@ export function canHaveModifiers(node: Node): node is HasModifiers {
|| kind === SyntaxKind.ImportEqualsDeclaration
|| kind === SyntaxKind.ImportDeclaration
|| kind === SyntaxKind.ExportAssignment
- || kind === SyntaxKind.ExportDeclaration;
+ || kind === SyntaxKind.ExportDeclaration
+ || kind === SyntaxKind.OverloadDeclaration;
}
export function canHaveDecorators(node: Node): node is HasDecorators {
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index 104111f4e1..1d7283b8b9 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -2988,7 +2988,7 @@ namespace Parser {
if (inAllowAnnotationContext() && token() === SyntaxKind.AtToken) {
return lookAhead(() => nextToken() === SyntaxKind.InterfaceKeyword);
}
- if (token() === SyntaxKind.OverloadKeyword) {
+ if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
return canFollowExportModifier();
@@ -3027,7 +3027,7 @@ namespace Parser {
|| token() === SyntaxKind.AsteriskToken
|| token() === SyntaxKind.DotDotDotToken
|| token() === SyntaxKind.AtToken && inAllowAnnotationContext() && lookAhead(() => nextToken() === SyntaxKind.InterfaceKeyword)
- || token() === SyntaxKind.OverloadKeyword
+ || token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOnSameLine())
|| isLiteralPropertyName();
}
@@ -4460,6 +4460,9 @@ namespace Parser {
}
function parsePropertyOrMethodSignature(pos: number, hasJSDoc: boolean, modifiers: NodeArray | undefined): PropertySignature | MethodSignature {
+ if (token() === SyntaxKind.DefaultKeyword && lookAhead(() => nextTokenIsIdentifier())) {
+ parseTokenNode();
+ }
const name = parsePropertyName();
const questionToken = parseOptionalToken(SyntaxKind.QuestionToken);
let node: PropertySignature | MethodSignature;
@@ -4491,6 +4494,11 @@ namespace Parser {
token() === SyntaxKind.SetKeyword) {
return true;
}
+
+ if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return true;
+ }
+
let idToken = false;
// Eat up all modifiers, but hold on to the last one in case it is actually an identifier
while (isModifierKind(token())) {
@@ -4540,6 +4548,11 @@ namespace Parser {
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, /*decorators*/ undefined, modifiers);
}
+
+ if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, /*decorators*/ undefined, modifiers);
+ }
+
return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
}
@@ -7601,6 +7614,7 @@ namespace Parser {
return isStartOfDeclaration();
case SyntaxKind.AsyncKeyword:
+ case SyntaxKind.OverloadKeyword:
case SyntaxKind.DeclareKeyword:
case SyntaxKind.InterfaceKeyword:
case SyntaxKind.ModuleKeyword:
@@ -7842,7 +7856,10 @@ namespace Parser {
}
return parseDeclarationDefault(pos, decorators, modifiers);
case SyntaxKind.OverloadKeyword:
- return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ if (lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ }
+ return parseDeclarationDefault(pos, decorators, modifiers);
case SyntaxKind.InterfaceKeyword:
return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);
case SyntaxKind.TypeKeyword:
@@ -8350,6 +8367,10 @@ namespace Parser {
return true;
}
+ if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return true;
+ }
+
// Eat up all modifiers, but hold on to the last one in case it is actually an identifier.
while (isModifierKind(token())) {
idToken = token();
@@ -8597,6 +8618,10 @@ namespace Parser {
return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
+ if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
+ }
+
// It is very important that we check this *after* checking indexers because
// the [ token can start an index signature or a computed property name
if (tokenIsIdentifierOrKeyword(token()) ||
diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts
index d2118813fd..1f707ace07 100644
--- a/src/compiler/transformers/declarations.ts
+++ b/src/compiler/transformers/declarations.ts
@@ -41,7 +41,8 @@ import {
TransformationContext, transformNodes, tryCast, TypeAliasDeclaration, TypeNode, TypeParameterDeclaration,
TypeReferenceNode, unescapeLeadingUnderscores, UnparsedSource, VariableDeclaration, VariableStatement, visitArray,
visitEachChild, visitNode, visitNodes, VisitResult, isOverloadDeclaration,
- OverloadPropertyDeclaration
+ OverloadPropertyDeclaration,
+ OverloadDeclaration
} from "../_namespaces/ts";
import * as moduleSpecifiers from "../_namespaces/ts.moduleSpecifiers";
@@ -1102,6 +1103,17 @@ export function transformDeclarations(context: TransformationContext) {
input.questionToken,
ensureType(input, input.type)
));
+ case SyntaxKind.OverloadDeclaration:
+ const modifiers = factory.createNodeArray(ensureModifiers(input));
+ const memberNodes = visitNodes(input.members, visitDeclarationSubtree);
+ const members = factory.createNodeArray(memberNodes);
+
+ return cleanup(factory.updateOverloadDeclaration(
+ input,
+ modifiers,
+ input.name,
+ members
+ ));
case SyntaxKind.OverloadPropertyDeclaration:
if (isPrivateIdentifier(input.name)) {
return cleanup(/*returnValue*/ undefined);
@@ -1757,10 +1769,13 @@ export function transformDeclarations(context: TransformationContext) {
}
function ensureModifierFlags(node: Node): ModifierFlags {
- let mask = ModifierFlags.All ^ (ModifierFlags.Public | ModifierFlags.Async | ModifierFlags.Override); // No async and override modifiers in declaration files
+ let mask = ModifierFlags.All ^ (ModifierFlags.Public | ModifierFlags.Override); // No async and override modifiers in declaration files
+ if (node.kind !== SyntaxKind.OverloadDeclaration) {
+ mask = mask ^ ModifierFlags.Async;
+ }
let additions = (needsDeclare && !isAlwaysType(node)) ? ModifierFlags.Ambient : ModifierFlags.None;
const parentIsFile = node.parent.kind === SyntaxKind.SourceFile;
- if (!parentIsFile || (isBundledEmit && parentIsFile && isExternalModule(node.parent as SourceFile))) {
+ if (!parentIsFile || (isBundledEmit && parentIsFile && isExternalModule(node.parent as SourceFile)) || node.kind === SyntaxKind.OverloadDeclaration) {
mask ^= ModifierFlags.Ambient;
additions = ModifierFlags.None;
}
@@ -1879,6 +1894,7 @@ type ProcessedComponent =
| SetAccessorDeclaration
| PropertyDeclaration
| AnnotationPropertyDeclaration
+ | OverloadDeclaration
| OverloadPropertyDeclaration
| PropertySignature
| MethodSignature
@@ -1902,6 +1918,7 @@ function isProcessedComponent(node: Node): node is ProcessedComponent {
case SyntaxKind.SetAccessor:
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.AnnotationPropertyDeclaration:
+ case SyntaxKind.OverloadDeclaration:
case SyntaxKind.OverloadPropertyDeclaration:
case SyntaxKind.PropertySignature:
case SyntaxKind.MethodSignature:
diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts
index 33f9bc99b2..5b22bbd070 100644
--- a/src/compiler/transformers/ts.ts
+++ b/src/compiler/transformers/ts.ts
@@ -365,6 +365,7 @@ export function transformTypeScript(context: TransformationContext) {
case SyntaxKind.SemicolonClassElement:
return node;
+ case SyntaxKind.OverloadDeclaration:
case SyntaxKind.IndexSignature:
// Index signatures are elided
return;
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index 765de57274..2f129ef32c 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -3355,7 +3355,7 @@ export interface AnnotationDeclaration extends DeclarationStatement {
readonly members: NodeArray;
}
-export interface OverloadDeclaration extends DeclarationStatement {
+export interface OverloadDeclaration extends DeclarationStatement, ClassElement, TypeElement {
readonly kind: SyntaxKind.OverloadDeclaration;
readonly modifiers?: NodeArray;
readonly name: Identifier;
@@ -3384,7 +3384,7 @@ export interface AnnotationElement extends NamedDeclaration {
}
export interface OverloadElement extends NamedDeclaration {
- readonly name: PropertyName; // Optional initializer
+ readonly name: PropertyName;
}
export interface OverloadPropertyDeclaration extends OverloadElement, JSDocContainer {
diff --git a/src/compiler/utilitiesPublic.ts b/src/compiler/utilitiesPublic.ts
index 5abe1562fc..292ddb6e85 100644
--- a/src/compiler/utilitiesPublic.ts
+++ b/src/compiler/utilitiesPublic.ts
@@ -1332,7 +1332,8 @@ export function isClassMemberModifier(idToken: SyntaxKind): boolean {
return isParameterPropertyModifier(idToken) ||
idToken === SyntaxKind.StaticKeyword ||
idToken === SyntaxKind.OverrideKeyword ||
- idToken === SyntaxKind.AccessorKeyword;
+ idToken === SyntaxKind.AccessorKeyword ||
+ idToken === SyntaxKind.AsyncKeyword;
}
export function isModifier(node: Node): node is Modifier {
@@ -1439,7 +1440,8 @@ export function isClassElement(node: Node): node is ClassElement {
|| kind === SyntaxKind.SetAccessor
|| kind === SyntaxKind.IndexSignature
|| kind === SyntaxKind.ClassStaticBlockDeclaration
- || kind === SyntaxKind.SemicolonClassElement;
+ || kind === SyntaxKind.SemicolonClassElement
+ || kind === SyntaxKind.OverloadDeclaration;
}
export function isClassLike(node: Node): node is ClassLikeDeclaration {
@@ -1497,7 +1499,8 @@ export function isTypeElement(node: Node): node is TypeElement {
|| kind === SyntaxKind.MethodSignature
|| kind === SyntaxKind.IndexSignature
|| kind === SyntaxKind.GetAccessor
- || kind === SyntaxKind.SetAccessor;
+ || kind === SyntaxKind.SetAccessor
+ || kind === SyntaxKind.OverloadDeclaration;
}
export function isClassOrTypeElement(node: Node): node is ClassElement | TypeElement {
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace1.js b/tests/baselines/reference/OverloadDeclarationInNameSpace1.js
new file mode 100644
index 0000000000..514b841ab1
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace1.js
@@ -0,0 +1,22 @@
+//// [OverloadDeclarationInNameSpace1.ets]
+declare namespace myNS {
+ function foo1(): void;
+ function foo2(): void;
+ /** @overload testJSdoc */
+ overload foo {foo1, foo2}
+}
+
+
+//// [OverloadDeclarationInNameSpace1.js]
+
+
+//// [OverloadDeclarationInNameSpace1.d.ets]
+declare namespace myNS {
+ function foo1(): void;
+ function foo2(): void;
+ /** @overload testJSdoc */
+ overload foo {
+ foo1,
+ foo2
+ }
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace1.symbols b/tests/baselines/reference/OverloadDeclarationInNameSpace1.symbols
new file mode 100644
index 0000000000..adfb76dd40
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace1.symbols
@@ -0,0 +1,16 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace1.ets ===
+declare namespace myNS {
+>myNS : Symbol(myNS, Decl(OverloadDeclarationInNameSpace1.ets, 0, 0))
+
+ function foo1(): void;
+>foo1 : Symbol(foo1, Decl(OverloadDeclarationInNameSpace1.ets, 0, 24))
+
+ function foo2(): void;
+>foo2 : Symbol(foo2, Decl(OverloadDeclarationInNameSpace1.ets, 1, 26))
+
+ /** @overload testJSdoc */
+ overload foo {foo1, foo2}
+>foo1 : Symbol(foo.foo1, Decl(OverloadDeclarationInNameSpace1.ets, 4, 18))
+>foo2 : Symbol(foo.foo2, Decl(OverloadDeclarationInNameSpace1.ets, 4, 23))
+}
+
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace1.types b/tests/baselines/reference/OverloadDeclarationInNameSpace1.types
new file mode 100644
index 0000000000..e0955b3f94
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace1.types
@@ -0,0 +1,17 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace1.ets ===
+declare namespace myNS {
+>myNS : typeof myNS
+
+ function foo1(): void;
+>foo1 : () => void
+
+ function foo2(): void;
+>foo2 : () => void
+
+ /** @overload testJSdoc */
+ overload foo {foo1, foo2}
+>foo : error
+>foo1 : any
+>foo2 : any
+}
+
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace2.js b/tests/baselines/reference/OverloadDeclarationInNameSpace2.js
new file mode 100644
index 0000000000..6a038b247c
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace2.js
@@ -0,0 +1,25 @@
+//// [OverloadDeclarationInNameSpace2.ets]
+declare namespace myNS {
+ interface I {
+ foo(): void;
+ bar(n?: string): void;
+ /** @overload testJSdoc */
+ overload goo {foo, bar}
+ }
+}
+
+//// [OverloadDeclarationInNameSpace2.js]
+
+
+//// [OverloadDeclarationInNameSpace2.d.ets]
+declare namespace myNS {
+ interface I {
+ foo(): void;
+ bar(n?: string): void;
+ /** @overload testJSdoc */
+ overload goo {
+ foo,
+ bar
+ }
+ }
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace2.symbols b/tests/baselines/reference/OverloadDeclarationInNameSpace2.symbols
new file mode 100644
index 0000000000..c94649bd63
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace2.symbols
@@ -0,0 +1,20 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace2.ets ===
+declare namespace myNS {
+>myNS : Symbol(myNS, Decl(OverloadDeclarationInNameSpace2.ets, 0, 0))
+
+ interface I {
+>I : Symbol(I, Decl(OverloadDeclarationInNameSpace2.ets, 0, 24))
+
+ foo(): void;
+>foo : Symbol(I.foo, Decl(OverloadDeclarationInNameSpace2.ets, 1, 17))
+
+ bar(n?: string): void;
+>bar : Symbol(I.bar, Decl(OverloadDeclarationInNameSpace2.ets, 2, 20))
+>n : Symbol(n, Decl(OverloadDeclarationInNameSpace2.ets, 3, 12))
+
+ /** @overload testJSdoc */
+ overload goo {foo, bar}
+>foo : Symbol(goo.foo, Decl(OverloadDeclarationInNameSpace2.ets, 5, 22))
+>bar : Symbol(goo.bar, Decl(OverloadDeclarationInNameSpace2.ets, 5, 26))
+ }
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace2.types b/tests/baselines/reference/OverloadDeclarationInNameSpace2.types
new file mode 100644
index 0000000000..d6506c892d
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace2.types
@@ -0,0 +1,17 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace2.ets ===
+declare namespace myNS {
+ interface I {
+ foo(): void;
+>foo : () => void
+
+ bar(n?: string): void;
+>bar : (n?: string) => void
+>n : string
+
+ /** @overload testJSdoc */
+ overload goo {foo, bar}
+>goo : error
+>foo : any
+>bar : any
+ }
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace3.js b/tests/baselines/reference/OverloadDeclarationInNameSpace3.js
new file mode 100644
index 0000000000..0d8b22097a
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace3.js
@@ -0,0 +1,25 @@
+//// [OverloadDeclarationInNameSpace3.ets]
+declare namespace myNS {
+ class Processor {
+ /** @overload testJSdoc */
+ overload process {process1, process2}
+ process1(n: number): void;
+ process2(s: string): void;
+ }
+}
+
+//// [OverloadDeclarationInNameSpace3.js]
+
+
+//// [OverloadDeclarationInNameSpace3.d.ets]
+declare namespace myNS {
+ class Processor {
+ /** @overload testJSdoc */
+ overload process {
+ process1,
+ process2
+ }
+ process1(n: number): void;
+ process2(s: string): void;
+ }
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace3.symbols b/tests/baselines/reference/OverloadDeclarationInNameSpace3.symbols
new file mode 100644
index 0000000000..a8e10c4f62
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace3.symbols
@@ -0,0 +1,21 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace3.ets ===
+declare namespace myNS {
+>myNS : Symbol(myNS, Decl(OverloadDeclarationInNameSpace3.ets, 0, 0))
+
+ class Processor {
+>Processor : Symbol(Processor, Decl(OverloadDeclarationInNameSpace3.ets, 0, 24))
+
+ /** @overload testJSdoc */
+ overload process {process1, process2}
+>process1 : Symbol(process.process1, Decl(OverloadDeclarationInNameSpace3.ets, 3, 26))
+>process2 : Symbol(process.process2, Decl(OverloadDeclarationInNameSpace3.ets, 3, 35))
+
+ process1(n: number): void;
+>process1 : Symbol(Processor.process1, Decl(OverloadDeclarationInNameSpace3.ets, 3, 45))
+>n : Symbol(n, Decl(OverloadDeclarationInNameSpace3.ets, 4, 17))
+
+ process2(s: string): void;
+>process2 : Symbol(Processor.process2, Decl(OverloadDeclarationInNameSpace3.ets, 4, 34))
+>s : Symbol(s, Decl(OverloadDeclarationInNameSpace3.ets, 5, 17))
+ }
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace3.types b/tests/baselines/reference/OverloadDeclarationInNameSpace3.types
new file mode 100644
index 0000000000..7675f2b52a
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace3.types
@@ -0,0 +1,22 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace3.ets ===
+declare namespace myNS {
+>myNS : typeof myNS
+
+ class Processor {
+>Processor : Processor
+
+ /** @overload testJSdoc */
+ overload process {process1, process2}
+>process : error
+>process1 : any
+>process2 : any
+
+ process1(n: number): void;
+>process1 : (n: number) => void
+>n : number
+
+ process2(s: string): void;
+>process2 : (s: string) => void
+>s : string
+ }
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel1.js b/tests/baselines/reference/OverloadDeclarationInTopLevel1.js
new file mode 100644
index 0000000000..7378187858
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel1.js
@@ -0,0 +1,18 @@
+//// [OverloadDeclarationInTopLevel1.ets]
+declare function foo1(): void;
+declare function foo2(): void;
+/** @overload testJSdoc */
+overload foo {foo1, foo2}
+
+
+//// [OverloadDeclarationInTopLevel1.js]
+
+
+//// [OverloadDeclarationInTopLevel1.d.ets]
+declare function foo1(): void;
+declare function foo2(): void;
+/** @overload testJSdoc */
+overload foo {
+ foo1,
+ foo2
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel1.symbols b/tests/baselines/reference/OverloadDeclarationInTopLevel1.symbols
new file mode 100644
index 0000000000..4378dc3a93
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel1.symbols
@@ -0,0 +1,12 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel1.ets ===
+declare function foo1(): void;
+>foo1 : Symbol(foo1, Decl(OverloadDeclarationInTopLevel1.ets, 0, 0))
+
+declare function foo2(): void;
+>foo2 : Symbol(foo2, Decl(OverloadDeclarationInTopLevel1.ets, 0, 30))
+
+/** @overload testJSdoc */
+overload foo {foo1, foo2}
+>foo1 : Symbol(foo.foo1, Decl(OverloadDeclarationInTopLevel1.ets, 3, 14))
+>foo2 : Symbol(foo.foo2, Decl(OverloadDeclarationInTopLevel1.ets, 3, 19))
+
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel1.types b/tests/baselines/reference/OverloadDeclarationInTopLevel1.types
new file mode 100644
index 0000000000..f7a763156c
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel1.types
@@ -0,0 +1,13 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel1.ets ===
+declare function foo1(): void;
+>foo1 : () => void
+
+declare function foo2(): void;
+>foo2 : () => void
+
+/** @overload testJSdoc */
+overload foo {foo1, foo2}
+>foo : error
+>foo1 : any
+>foo2 : any
+
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel2.js b/tests/baselines/reference/OverloadDeclarationInTopLevel2.js
new file mode 100644
index 0000000000..f144d0bef5
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel2.js
@@ -0,0 +1,22 @@
+//// [OverloadDeclarationInTopLevel2.ets]
+declare interface I {
+ foo(): void;
+ bar(n?: string): void;
+ /** @overload testJSdoc */
+ overload goo {foo, bar}
+}
+
+
+//// [OverloadDeclarationInTopLevel2.js]
+
+
+//// [OverloadDeclarationInTopLevel2.d.ets]
+declare interface I {
+ foo(): void;
+ bar(n?: string): void;
+ /** @overload testJSdoc */
+ overload goo {
+ foo,
+ bar
+ }
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel2.symbols b/tests/baselines/reference/OverloadDeclarationInTopLevel2.symbols
new file mode 100644
index 0000000000..954e728fd1
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel2.symbols
@@ -0,0 +1,17 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel2.ets ===
+declare interface I {
+>I : Symbol(I, Decl(OverloadDeclarationInTopLevel2.ets, 0, 0))
+
+ foo(): void;
+>foo : Symbol(I.foo, Decl(OverloadDeclarationInTopLevel2.ets, 0, 21))
+
+ bar(n?: string): void;
+>bar : Symbol(I.bar, Decl(OverloadDeclarationInTopLevel2.ets, 1, 16))
+>n : Symbol(n, Decl(OverloadDeclarationInTopLevel2.ets, 2, 8))
+
+ /** @overload testJSdoc */
+ overload goo {foo, bar}
+>foo : Symbol(goo.foo, Decl(OverloadDeclarationInTopLevel2.ets, 4, 18))
+>bar : Symbol(goo.bar, Decl(OverloadDeclarationInTopLevel2.ets, 4, 22))
+}
+
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel2.types b/tests/baselines/reference/OverloadDeclarationInTopLevel2.types
new file mode 100644
index 0000000000..197c21311a
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel2.types
@@ -0,0 +1,16 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel2.ets ===
+declare interface I {
+ foo(): void;
+>foo : () => void
+
+ bar(n?: string): void;
+>bar : (n?: string) => void
+>n : string
+
+ /** @overload testJSdoc */
+ overload goo {foo, bar}
+>goo : error
+>foo : any
+>bar : any
+}
+
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel3.js b/tests/baselines/reference/OverloadDeclarationInTopLevel3.js
new file mode 100644
index 0000000000..b42cac7a0b
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel3.js
@@ -0,0 +1,21 @@
+//// [OverloadDeclarationInTopLevel3.ets]
+declare class Processor {
+ /** @overload testJSdoc */
+ overload process {process1, process2}
+ process1(n: number): void;
+ process2(s: string): void;
+}
+
+//// [OverloadDeclarationInTopLevel3.js]
+
+
+//// [OverloadDeclarationInTopLevel3.d.ets]
+declare class Processor {
+ /** @overload testJSdoc */
+ overload process {
+ process1,
+ process2
+ }
+ process1(n: number): void;
+ process2(s: string): void;
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel3.symbols b/tests/baselines/reference/OverloadDeclarationInTopLevel3.symbols
new file mode 100644
index 0000000000..2ddc4cb68a
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel3.symbols
@@ -0,0 +1,17 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel3.ets ===
+declare class Processor {
+>Processor : Symbol(Processor, Decl(OverloadDeclarationInTopLevel3.ets, 0, 0))
+
+ /** @overload testJSdoc */
+ overload process {process1, process2}
+>process1 : Symbol(process.process1, Decl(OverloadDeclarationInTopLevel3.ets, 2, 22))
+>process2 : Symbol(process.process2, Decl(OverloadDeclarationInTopLevel3.ets, 2, 31))
+
+ process1(n: number): void;
+>process1 : Symbol(Processor.process1, Decl(OverloadDeclarationInTopLevel3.ets, 2, 41))
+>n : Symbol(n, Decl(OverloadDeclarationInTopLevel3.ets, 3, 13))
+
+ process2(s: string): void;
+>process2 : Symbol(Processor.process2, Decl(OverloadDeclarationInTopLevel3.ets, 3, 30))
+>s : Symbol(s, Decl(OverloadDeclarationInTopLevel3.ets, 4, 13))
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel3.types b/tests/baselines/reference/OverloadDeclarationInTopLevel3.types
new file mode 100644
index 0000000000..d95cd9a86e
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel3.types
@@ -0,0 +1,18 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel3.ets ===
+declare class Processor {
+>Processor : Processor
+
+ /** @overload testJSdoc */
+ overload process {process1, process2}
+>process : error
+>process1 : any
+>process2 : any
+
+ process1(n: number): void;
+>process1 : (n: number) => void
+>n : number
+
+ process2(s: string): void;
+>process2 : (s: string) => void
+>s : string
+}
diff --git a/tests/baselines/reference/OverloadDeclarationWithExport.js b/tests/baselines/reference/OverloadDeclarationWithExport.js
new file mode 100644
index 0000000000..73bd19a1e7
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationWithExport.js
@@ -0,0 +1,19 @@
+//// [OverloadDeclarationWithExport.ets]
+export declare function foo1(): void;
+export declare function foo2(): void;
+/** @overload testJSdoc */
+export overload foo {foo1, foo2}
+
+//// [OverloadDeclarationWithExport.js]
+"use strict";
+exports.__esModule = true;
+
+
+//// [OverloadDeclarationWithExport.d.ets]
+export declare function foo1(): void;
+export declare function foo2(): void;
+/** @overload testJSdoc */
+export overload foo {
+ foo1,
+ foo2
+}
diff --git a/tests/baselines/reference/OverloadDeclarationWithExport.symbols b/tests/baselines/reference/OverloadDeclarationWithExport.symbols
new file mode 100644
index 0000000000..b10f499be7
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationWithExport.symbols
@@ -0,0 +1,12 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets ===
+export declare function foo1(): void;
+>foo1 : Symbol(foo1, Decl(OverloadDeclarationWithExport.ets, 0, 0))
+
+export declare function foo2(): void;
+>foo2 : Symbol(foo2, Decl(OverloadDeclarationWithExport.ets, 0, 37))
+
+/** @overload testJSdoc */
+export overload foo {foo1, foo2}
+>foo1 : Symbol(foo.foo1, Decl(OverloadDeclarationWithExport.ets, 3, 21))
+>foo2 : Symbol(foo.foo2, Decl(OverloadDeclarationWithExport.ets, 3, 26))
+
diff --git a/tests/baselines/reference/OverloadDeclarationWithExport.types b/tests/baselines/reference/OverloadDeclarationWithExport.types
new file mode 100644
index 0000000000..42465783fb
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationWithExport.types
@@ -0,0 +1,13 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets ===
+export declare function foo1(): void;
+>foo1 : () => void
+
+export declare function foo2(): void;
+>foo2 : () => void
+
+/** @overload testJSdoc */
+export overload foo {foo1, foo2}
+>foo : error
+>foo1 : any
+>foo2 : any
+
diff --git a/tests/baselines/reference/OverloadDeclarationWithModifier.js b/tests/baselines/reference/OverloadDeclarationWithModifier.js
new file mode 100644
index 0000000000..0c3b53d22d
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationWithModifier.js
@@ -0,0 +1,30 @@
+//// [OverloadDeclarationWithModifier.ets]
+declare class Processor {
+ /** @overload testJSdoc */
+ static overload processOne {process1, process2}
+ async overload processTwo {process3, process4}
+ process1(n: number): void;
+ process2(s: string): void;
+ process3(): void;
+ process4(b: boolean): void;
+}
+
+//// [OverloadDeclarationWithModifier.js]
+
+
+//// [OverloadDeclarationWithModifier.d.ets]
+declare class Processor {
+ /** @overload testJSdoc */
+ static overload processOne {
+ process1,
+ process2
+ }
+ async overload processTwo {
+ process3,
+ process4
+ }
+ process1(n: number): void;
+ process2(s: string): void;
+ process3(): void;
+ process4(b: boolean): void;
+}
diff --git a/tests/baselines/reference/OverloadDeclarationWithModifier.symbols b/tests/baselines/reference/OverloadDeclarationWithModifier.symbols
new file mode 100644
index 0000000000..9aec569c47
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationWithModifier.symbols
@@ -0,0 +1,28 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithModifier.ets ===
+declare class Processor {
+>Processor : Symbol(Processor, Decl(OverloadDeclarationWithModifier.ets, 0, 0))
+
+ /** @overload testJSdoc */
+ static overload processOne {process1, process2}
+>process1 : Symbol(processOne.process1, Decl(OverloadDeclarationWithModifier.ets, 2, 32))
+>process2 : Symbol(processOne.process2, Decl(OverloadDeclarationWithModifier.ets, 2, 41))
+
+ async overload processTwo {process3, process4}
+>process3 : Symbol(processTwo.process3, Decl(OverloadDeclarationWithModifier.ets, 3, 31))
+>process4 : Symbol(processTwo.process4, Decl(OverloadDeclarationWithModifier.ets, 3, 40))
+
+ process1(n: number): void;
+>process1 : Symbol(Processor.process1, Decl(OverloadDeclarationWithModifier.ets, 3, 50))
+>n : Symbol(n, Decl(OverloadDeclarationWithModifier.ets, 4, 13))
+
+ process2(s: string): void;
+>process2 : Symbol(Processor.process2, Decl(OverloadDeclarationWithModifier.ets, 4, 30))
+>s : Symbol(s, Decl(OverloadDeclarationWithModifier.ets, 5, 13))
+
+ process3(): void;
+>process3 : Symbol(Processor.process3, Decl(OverloadDeclarationWithModifier.ets, 5, 30))
+
+ process4(b: boolean): void;
+>process4 : Symbol(Processor.process4, Decl(OverloadDeclarationWithModifier.ets, 6, 21))
+>b : Symbol(b, Decl(OverloadDeclarationWithModifier.ets, 7, 13))
+}
diff --git a/tests/baselines/reference/OverloadDeclarationWithModifier.types b/tests/baselines/reference/OverloadDeclarationWithModifier.types
new file mode 100644
index 0000000000..937e46a050
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationWithModifier.types
@@ -0,0 +1,30 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithModifier.ets ===
+declare class Processor {
+>Processor : Processor
+
+ /** @overload testJSdoc */
+ static overload processOne {process1, process2}
+>processOne : error
+>process1 : any
+>process2 : any
+
+ async overload processTwo {process3, process4}
+>processTwo : error
+>process3 : any
+>process4 : any
+
+ process1(n: number): void;
+>process1 : (n: number) => void
+>n : number
+
+ process2(s: string): void;
+>process2 : (s: string) => void
+>s : string
+
+ process3(): void;
+>process3 : () => void
+
+ process4(b: boolean): void;
+>process4 : (b: boolean) => void
+>b : boolean
+}
diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts
index 5711cdb107..99f934254c 100644
--- a/tests/baselines/reference/api/tsserverlibrary.d.ts
+++ b/tests/baselines/reference/api/tsserverlibrary.d.ts
@@ -4313,209 +4313,212 @@ declare namespace ts {
GlobalKeyword = 161,
BigIntKeyword = 162,
OverrideKeyword = 163,
- OfKeyword = 164,
- QualifiedName = 165,
- ComputedPropertyName = 166,
- TypeParameter = 167,
- Parameter = 168,
- Decorator = 169,
- PropertySignature = 170,
- PropertyDeclaration = 171,
- AnnotationPropertyDeclaration = 172,
- MethodSignature = 173,
- MethodDeclaration = 174,
- ClassStaticBlockDeclaration = 175,
- Constructor = 176,
- GetAccessor = 177,
- SetAccessor = 178,
- CallSignature = 179,
- ConstructSignature = 180,
- IndexSignature = 181,
- TypePredicate = 182,
- TypeReference = 183,
- FunctionType = 184,
- ConstructorType = 185,
- TypeQuery = 186,
- TypeLiteral = 187,
- ArrayType = 188,
- TupleType = 189,
- OptionalType = 190,
- RestType = 191,
- UnionType = 192,
- IntersectionType = 193,
- ConditionalType = 194,
- InferType = 195,
- ParenthesizedType = 196,
- ThisType = 197,
- TypeOperator = 198,
- IndexedAccessType = 199,
- MappedType = 200,
- LiteralType = 201,
- NamedTupleMember = 202,
- TemplateLiteralType = 203,
- TemplateLiteralTypeSpan = 204,
- ImportType = 205,
- ObjectBindingPattern = 206,
- ArrayBindingPattern = 207,
- BindingElement = 208,
- ArrayLiteralExpression = 209,
- ObjectLiteralExpression = 210,
- PropertyAccessExpression = 211,
- ElementAccessExpression = 212,
- CallExpression = 213,
- NewExpression = 214,
- TaggedTemplateExpression = 215,
- TypeAssertionExpression = 216,
- ParenthesizedExpression = 217,
- FunctionExpression = 218,
- ArrowFunction = 219,
- EtsComponentExpression = 220,
- DeleteExpression = 221,
- TypeOfExpression = 222,
- VoidExpression = 223,
- AwaitExpression = 224,
- PrefixUnaryExpression = 225,
- PostfixUnaryExpression = 226,
- BinaryExpression = 227,
- ConditionalExpression = 228,
- TemplateExpression = 229,
- YieldExpression = 230,
- SpreadElement = 231,
- ClassExpression = 232,
- OmittedExpression = 233,
- ExpressionWithTypeArguments = 234,
- AsExpression = 235,
- NonNullExpression = 236,
- MetaProperty = 237,
- SyntheticExpression = 238,
- SatisfiesExpression = 239,
- TemplateSpan = 240,
- SemicolonClassElement = 241,
- Block = 242,
- EmptyStatement = 243,
- VariableStatement = 244,
- ExpressionStatement = 245,
- IfStatement = 246,
- DoStatement = 247,
- WhileStatement = 248,
- ForStatement = 249,
- ForInStatement = 250,
- ForOfStatement = 251,
- ContinueStatement = 252,
- BreakStatement = 253,
- ReturnStatement = 254,
- WithStatement = 255,
- SwitchStatement = 256,
- LabeledStatement = 257,
- ThrowStatement = 258,
- TryStatement = 259,
- DebuggerStatement = 260,
- VariableDeclaration = 261,
- VariableDeclarationList = 262,
- FunctionDeclaration = 263,
- ClassDeclaration = 264,
- StructDeclaration = 265,
- AnnotationDeclaration = 266,
- InterfaceDeclaration = 267,
- TypeAliasDeclaration = 268,
- EnumDeclaration = 269,
- ModuleDeclaration = 270,
- ModuleBlock = 271,
- CaseBlock = 272,
- NamespaceExportDeclaration = 273,
- ImportEqualsDeclaration = 274,
- ImportDeclaration = 275,
- ImportClause = 276,
- NamespaceImport = 277,
- NamedImports = 278,
- ImportSpecifier = 279,
- ExportAssignment = 280,
- ExportDeclaration = 281,
- NamedExports = 282,
- NamespaceExport = 283,
- ExportSpecifier = 284,
- MissingDeclaration = 285,
- ExternalModuleReference = 286,
- JsxElement = 287,
- JsxSelfClosingElement = 288,
- JsxOpeningElement = 289,
- JsxClosingElement = 290,
- JsxFragment = 291,
- JsxOpeningFragment = 292,
- JsxClosingFragment = 293,
- JsxAttribute = 294,
- JsxAttributes = 295,
- JsxSpreadAttribute = 296,
- JsxExpression = 297,
- CaseClause = 298,
- DefaultClause = 299,
- HeritageClause = 300,
- CatchClause = 301,
- AssertClause = 302,
- AssertEntry = 303,
- ImportTypeAssertionContainer = 304,
- PropertyAssignment = 305,
- ShorthandPropertyAssignment = 306,
- SpreadAssignment = 307,
- EnumMember = 308,
- UnparsedPrologue = 309,
- UnparsedPrepend = 310,
- UnparsedText = 311,
- UnparsedInternalText = 312,
- UnparsedSyntheticReference = 313,
- SourceFile = 314,
- Bundle = 315,
- UnparsedSource = 316,
- InputFiles = 317,
- JSDocTypeExpression = 318,
- JSDocNameReference = 319,
- JSDocMemberName = 320,
- JSDocAllType = 321,
- JSDocUnknownType = 322,
- JSDocNullableType = 323,
- JSDocNonNullableType = 324,
- JSDocOptionalType = 325,
- JSDocFunctionType = 326,
- JSDocVariadicType = 327,
- JSDocNamepathType = 328,
- JSDoc = 329,
+ OverloadKeyword = 164,
+ OfKeyword = 165,
+ QualifiedName = 166,
+ ComputedPropertyName = 167,
+ TypeParameter = 168,
+ Parameter = 169,
+ Decorator = 170,
+ PropertySignature = 171,
+ PropertyDeclaration = 172,
+ AnnotationPropertyDeclaration = 173,
+ OverloadPropertyDeclaration = 174,
+ MethodSignature = 175,
+ MethodDeclaration = 176,
+ ClassStaticBlockDeclaration = 177,
+ Constructor = 178,
+ GetAccessor = 179,
+ SetAccessor = 180,
+ CallSignature = 181,
+ ConstructSignature = 182,
+ IndexSignature = 183,
+ TypePredicate = 184,
+ TypeReference = 185,
+ FunctionType = 186,
+ ConstructorType = 187,
+ TypeQuery = 188,
+ TypeLiteral = 189,
+ ArrayType = 190,
+ TupleType = 191,
+ OptionalType = 192,
+ RestType = 193,
+ UnionType = 194,
+ IntersectionType = 195,
+ ConditionalType = 196,
+ InferType = 197,
+ ParenthesizedType = 198,
+ ThisType = 199,
+ TypeOperator = 200,
+ IndexedAccessType = 201,
+ MappedType = 202,
+ LiteralType = 203,
+ NamedTupleMember = 204,
+ TemplateLiteralType = 205,
+ TemplateLiteralTypeSpan = 206,
+ ImportType = 207,
+ ObjectBindingPattern = 208,
+ ArrayBindingPattern = 209,
+ BindingElement = 210,
+ ArrayLiteralExpression = 211,
+ ObjectLiteralExpression = 212,
+ PropertyAccessExpression = 213,
+ ElementAccessExpression = 214,
+ CallExpression = 215,
+ NewExpression = 216,
+ TaggedTemplateExpression = 217,
+ TypeAssertionExpression = 218,
+ ParenthesizedExpression = 219,
+ FunctionExpression = 220,
+ ArrowFunction = 221,
+ EtsComponentExpression = 222,
+ DeleteExpression = 223,
+ TypeOfExpression = 224,
+ VoidExpression = 225,
+ AwaitExpression = 226,
+ PrefixUnaryExpression = 227,
+ PostfixUnaryExpression = 228,
+ BinaryExpression = 229,
+ ConditionalExpression = 230,
+ TemplateExpression = 231,
+ YieldExpression = 232,
+ SpreadElement = 233,
+ ClassExpression = 234,
+ OmittedExpression = 235,
+ ExpressionWithTypeArguments = 236,
+ AsExpression = 237,
+ NonNullExpression = 238,
+ MetaProperty = 239,
+ SyntheticExpression = 240,
+ SatisfiesExpression = 241,
+ TemplateSpan = 242,
+ SemicolonClassElement = 243,
+ Block = 244,
+ EmptyStatement = 245,
+ VariableStatement = 246,
+ ExpressionStatement = 247,
+ IfStatement = 248,
+ DoStatement = 249,
+ WhileStatement = 250,
+ ForStatement = 251,
+ ForInStatement = 252,
+ ForOfStatement = 253,
+ ContinueStatement = 254,
+ BreakStatement = 255,
+ ReturnStatement = 256,
+ WithStatement = 257,
+ SwitchStatement = 258,
+ LabeledStatement = 259,
+ ThrowStatement = 260,
+ TryStatement = 261,
+ DebuggerStatement = 262,
+ VariableDeclaration = 263,
+ VariableDeclarationList = 264,
+ FunctionDeclaration = 265,
+ ClassDeclaration = 266,
+ StructDeclaration = 267,
+ AnnotationDeclaration = 268,
+ OverloadDeclaration = 269,
+ InterfaceDeclaration = 270,
+ TypeAliasDeclaration = 271,
+ EnumDeclaration = 272,
+ ModuleDeclaration = 273,
+ ModuleBlock = 274,
+ CaseBlock = 275,
+ NamespaceExportDeclaration = 276,
+ ImportEqualsDeclaration = 277,
+ ImportDeclaration = 278,
+ ImportClause = 279,
+ NamespaceImport = 280,
+ NamedImports = 281,
+ ImportSpecifier = 282,
+ ExportAssignment = 283,
+ ExportDeclaration = 284,
+ NamedExports = 285,
+ NamespaceExport = 286,
+ ExportSpecifier = 287,
+ MissingDeclaration = 288,
+ ExternalModuleReference = 289,
+ JsxElement = 290,
+ JsxSelfClosingElement = 291,
+ JsxOpeningElement = 292,
+ JsxClosingElement = 293,
+ JsxFragment = 294,
+ JsxOpeningFragment = 295,
+ JsxClosingFragment = 296,
+ JsxAttribute = 297,
+ JsxAttributes = 298,
+ JsxSpreadAttribute = 299,
+ JsxExpression = 300,
+ CaseClause = 301,
+ DefaultClause = 302,
+ HeritageClause = 303,
+ CatchClause = 304,
+ AssertClause = 305,
+ AssertEntry = 306,
+ ImportTypeAssertionContainer = 307,
+ PropertyAssignment = 308,
+ ShorthandPropertyAssignment = 309,
+ SpreadAssignment = 310,
+ EnumMember = 311,
+ UnparsedPrologue = 312,
+ UnparsedPrepend = 313,
+ UnparsedText = 314,
+ UnparsedInternalText = 315,
+ UnparsedSyntheticReference = 316,
+ SourceFile = 317,
+ Bundle = 318,
+ UnparsedSource = 319,
+ InputFiles = 320,
+ JSDocTypeExpression = 321,
+ JSDocNameReference = 322,
+ JSDocMemberName = 323,
+ JSDocAllType = 324,
+ JSDocUnknownType = 325,
+ JSDocNullableType = 326,
+ JSDocNonNullableType = 327,
+ JSDocOptionalType = 328,
+ JSDocFunctionType = 329,
+ JSDocVariadicType = 330,
+ JSDocNamepathType = 331,
+ JSDoc = 332,
/** @deprecated Use SyntaxKind.JSDoc */
- JSDocComment = 329,
- JSDocText = 330,
- JSDocTypeLiteral = 331,
- JSDocSignature = 332,
- JSDocLink = 333,
- JSDocLinkCode = 334,
- JSDocLinkPlain = 335,
- JSDocTag = 336,
- JSDocAugmentsTag = 337,
- JSDocImplementsTag = 338,
- JSDocAuthorTag = 339,
- JSDocDeprecatedTag = 340,
- JSDocClassTag = 341,
- JSDocPublicTag = 342,
- JSDocPrivateTag = 343,
- JSDocProtectedTag = 344,
- JSDocReadonlyTag = 345,
- JSDocOverrideTag = 346,
- JSDocCallbackTag = 347,
- JSDocEnumTag = 348,
- JSDocParameterTag = 349,
- JSDocReturnTag = 350,
- JSDocThisTag = 351,
- JSDocTypeTag = 352,
- JSDocTemplateTag = 353,
- JSDocTypedefTag = 354,
- JSDocSeeTag = 355,
- JSDocPropertyTag = 356,
- SyntaxList = 357,
- NotEmittedStatement = 358,
- PartiallyEmittedExpression = 359,
- CommaListExpression = 360,
- MergeDeclarationMarker = 361,
- EndOfDeclarationMarker = 362,
- SyntheticReferenceExpression = 363,
- Count = 364,
+ JSDocComment = 332,
+ JSDocText = 333,
+ JSDocTypeLiteral = 334,
+ JSDocSignature = 335,
+ JSDocLink = 336,
+ JSDocLinkCode = 337,
+ JSDocLinkPlain = 338,
+ JSDocTag = 339,
+ JSDocAugmentsTag = 340,
+ JSDocImplementsTag = 341,
+ JSDocAuthorTag = 342,
+ JSDocDeprecatedTag = 343,
+ JSDocClassTag = 344,
+ JSDocPublicTag = 345,
+ JSDocPrivateTag = 346,
+ JSDocProtectedTag = 347,
+ JSDocReadonlyTag = 348,
+ JSDocOverrideTag = 349,
+ JSDocCallbackTag = 350,
+ JSDocEnumTag = 351,
+ JSDocParameterTag = 352,
+ JSDocReturnTag = 353,
+ JSDocThisTag = 354,
+ JSDocTypeTag = 355,
+ JSDocTemplateTag = 356,
+ JSDocTypedefTag = 357,
+ JSDocSeeTag = 358,
+ JSDocPropertyTag = 359,
+ SyntaxList = 360,
+ NotEmittedStatement = 361,
+ PartiallyEmittedExpression = 362,
+ CommaListExpression = 363,
+ MergeDeclarationMarker = 364,
+ EndOfDeclarationMarker = 365,
+ SyntheticReferenceExpression = 366,
+ Count = 367,
FirstAssignment = 63,
LastAssignment = 78,
FirstCompoundAssignment = 64,
@@ -4523,15 +4526,15 @@ declare namespace ts {
FirstReservedWord = 81,
LastReservedWord = 117,
FirstKeyword = 81,
- LastKeyword = 164,
+ LastKeyword = 165,
FirstFutureReservedWord = 118,
LastFutureReservedWord = 126,
- FirstTypeNode = 182,
- LastTypeNode = 205,
+ FirstTypeNode = 184,
+ LastTypeNode = 207,
FirstPunctuation = 18,
LastPunctuation = 78,
FirstToken = 0,
- LastToken = 164,
+ LastToken = 165,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 8,
@@ -4540,19 +4543,19 @@ declare namespace ts {
LastTemplateToken = 17,
FirstBinaryOperator = 29,
LastBinaryOperator = 78,
- FirstStatement = 244,
- LastStatement = 260,
- FirstNode = 165,
- FirstJSDocNode = 318,
- LastJSDocNode = 356,
- FirstJSDocTagNode = 336,
- LastJSDocTagNode = 356
+ FirstStatement = 246,
+ LastStatement = 262,
+ FirstNode = 166,
+ FirstJSDocNode = 321,
+ LastJSDocNode = 359,
+ FirstJSDocTagNode = 339,
+ LastJSDocTagNode = 359
}
type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia;
type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;
type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail;
type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken;
- type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.StructKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.LazyKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
+ type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.StructKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.OverloadKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.LazyKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword;
type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword;
type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
@@ -4693,14 +4696,14 @@ declare namespace ts {
}
interface JSDocContainer {
}
- type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AnnotationPropertyDeclaration | AnnotationDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | CaseClause | EndOfFileToken;
- type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | AnnotationPropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
+ type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AnnotationPropertyDeclaration | OverloadPropertyDeclaration | AnnotationDeclaration | OverloadDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | CaseClause | EndOfFileToken;
+ type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | AnnotationPropertyDeclaration | OverloadPropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | EnumMember;
type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration;
type HasIllegalDecorators = PropertyAssignment | ShorthandPropertyAssignment | FunctionDeclaration | ConstructorDeclaration | IndexSignatureDeclaration | ClassStaticBlockDeclaration | MissingDeclaration | VariableStatement | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportDeclaration | ExportAssignment;
- type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration;
+ type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
interface NodeArray extends ReadonlyArray, ReadonlyTextRange {
readonly hasTrailingComma: boolean;
}
@@ -4941,7 +4944,7 @@ declare namespace ts {
readonly parent: ObjectLiteralExpression;
readonly expression: Expression;
}
- type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
+ type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | OverloadPropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
interface PropertyLikeDeclaration extends NamedDeclaration {
readonly name: PropertyName;
}
@@ -5733,7 +5736,7 @@ declare namespace ts {
type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer {
- readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression | SyntaxKind.StructDeclaration | SyntaxKind.AnnotationDeclaration;
+ readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression | SyntaxKind.StructDeclaration | SyntaxKind.AnnotationDeclaration | SyntaxKind.OverloadDeclaration;
readonly name?: Identifier;
readonly typeParameters?: NodeArray;
readonly heritageClauses?: NodeArray;
@@ -5757,6 +5760,12 @@ declare namespace ts {
readonly name: Identifier;
readonly members: NodeArray;
}
+ interface OverloadDeclaration extends DeclarationStatement, ClassElement, TypeElement {
+ readonly kind: SyntaxKind.OverloadDeclaration;
+ readonly modifiers?: NodeArray;
+ readonly name: Identifier;
+ readonly members: NodeArray;
+ }
interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression {
readonly kind: SyntaxKind.ClassExpression;
readonly modifiers?: NodeArray;
@@ -5770,6 +5779,16 @@ declare namespace ts {
_annnotationElementBrand: any;
readonly name: PropertyName;
}
+ interface OverloadElement extends NamedDeclaration {
+ readonly name: PropertyName;
+ }
+ interface OverloadPropertyDeclaration extends OverloadElement, JSDocContainer {
+ readonly kind: SyntaxKind.OverloadPropertyDeclaration;
+ readonly modifiers?: NodeArray;
+ readonly name: PropertyName;
+ readonly questionToken?: QuestionToken;
+ readonly type?: TypeNode;
+ }
interface TypeElement extends NamedDeclaration {
_typeElementBrand: any;
readonly name?: PropertyName;
@@ -7895,6 +7914,8 @@ declare namespace ts {
updatePropertyDeclaration(node: PropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
createAnnotationPropertyDeclaration(name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
updateAnnotationPropertyDeclaration(node: AnnotationPropertyDeclaration, name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
+ createOverloadPropertyDeclaration(modifiers: readonly ModifierLike[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
+ updateOverloadPropertyDeclaration(node: OverloadPropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature;
createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
@@ -8094,6 +8115,8 @@ declare namespace ts {
updateStructDeclaration(node: StructDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): StructDeclaration;
createAnnotationDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, members: readonly AnnotationElement[]): AnnotationDeclaration;
updateAnnotationDeclaration(node: AnnotationDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly AnnotationElement[]): AnnotationDeclaration;
+ createOverloadDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
+ updateOverloadDeclaration(node: OverloadDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
@@ -9274,6 +9297,7 @@ declare namespace ts {
function isBindingName(node: Node): node is BindingName;
function isFunctionLike(node: Node | undefined): node is SignatureDeclaration;
function isAnnotationElement(node: Node): node is AnnotationElement;
+ function isOverloadElement(node: Node): node is OverloadElement;
function isClassElement(node: Node): node is ClassElement;
function isClassLike(node: Node): node is ClassLikeDeclaration;
function isStruct(node: Node): node is StructDeclaration;
@@ -9444,6 +9468,7 @@ declare namespace ts {
function isDecorator(node: Node): node is Decorator;
function isAnnotation(node: Node): node is Annotation;
function isPropertySignature(node: Node): node is PropertySignature;
+ function isOverloadPropertyDeclaration(node: Node): node is OverloadPropertyDeclaration;
function isPropertyDeclaration(node: Node): node is PropertyDeclaration;
function isAnnotationPropertyDeclaration(node: Node): node is AnnotationPropertyDeclaration;
function isMethodSignature(node: Node): node is MethodSignature;
@@ -9542,6 +9567,7 @@ declare namespace ts {
function isClassDeclaration(node: Node): node is ClassDeclaration;
function isStructDeclaration(node: Node): node is StructDeclaration;
function isAnnotationDeclaration(node: Node): node is AnnotationDeclaration;
+ function isOverloadDeclaration(node: Node): node is OverloadDeclaration;
function isInterfaceDeclaration(node: Node): node is InterfaceDeclaration;
function isTypeAliasDeclaration(node: Node): node is TypeAliasDeclaration;
function isEnumDeclaration(node: Node): node is EnumDeclaration;
diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts
index c912487c4a..4d30f91028 100644
--- a/tests/baselines/reference/api/typescript.d.ts
+++ b/tests/baselines/reference/api/typescript.d.ts
@@ -310,209 +310,212 @@ declare namespace ts {
GlobalKeyword = 161,
BigIntKeyword = 162,
OverrideKeyword = 163,
- OfKeyword = 164,
- QualifiedName = 165,
- ComputedPropertyName = 166,
- TypeParameter = 167,
- Parameter = 168,
- Decorator = 169,
- PropertySignature = 170,
- PropertyDeclaration = 171,
- AnnotationPropertyDeclaration = 172,
- MethodSignature = 173,
- MethodDeclaration = 174,
- ClassStaticBlockDeclaration = 175,
- Constructor = 176,
- GetAccessor = 177,
- SetAccessor = 178,
- CallSignature = 179,
- ConstructSignature = 180,
- IndexSignature = 181,
- TypePredicate = 182,
- TypeReference = 183,
- FunctionType = 184,
- ConstructorType = 185,
- TypeQuery = 186,
- TypeLiteral = 187,
- ArrayType = 188,
- TupleType = 189,
- OptionalType = 190,
- RestType = 191,
- UnionType = 192,
- IntersectionType = 193,
- ConditionalType = 194,
- InferType = 195,
- ParenthesizedType = 196,
- ThisType = 197,
- TypeOperator = 198,
- IndexedAccessType = 199,
- MappedType = 200,
- LiteralType = 201,
- NamedTupleMember = 202,
- TemplateLiteralType = 203,
- TemplateLiteralTypeSpan = 204,
- ImportType = 205,
- ObjectBindingPattern = 206,
- ArrayBindingPattern = 207,
- BindingElement = 208,
- ArrayLiteralExpression = 209,
- ObjectLiteralExpression = 210,
- PropertyAccessExpression = 211,
- ElementAccessExpression = 212,
- CallExpression = 213,
- NewExpression = 214,
- TaggedTemplateExpression = 215,
- TypeAssertionExpression = 216,
- ParenthesizedExpression = 217,
- FunctionExpression = 218,
- ArrowFunction = 219,
- EtsComponentExpression = 220,
- DeleteExpression = 221,
- TypeOfExpression = 222,
- VoidExpression = 223,
- AwaitExpression = 224,
- PrefixUnaryExpression = 225,
- PostfixUnaryExpression = 226,
- BinaryExpression = 227,
- ConditionalExpression = 228,
- TemplateExpression = 229,
- YieldExpression = 230,
- SpreadElement = 231,
- ClassExpression = 232,
- OmittedExpression = 233,
- ExpressionWithTypeArguments = 234,
- AsExpression = 235,
- NonNullExpression = 236,
- MetaProperty = 237,
- SyntheticExpression = 238,
- SatisfiesExpression = 239,
- TemplateSpan = 240,
- SemicolonClassElement = 241,
- Block = 242,
- EmptyStatement = 243,
- VariableStatement = 244,
- ExpressionStatement = 245,
- IfStatement = 246,
- DoStatement = 247,
- WhileStatement = 248,
- ForStatement = 249,
- ForInStatement = 250,
- ForOfStatement = 251,
- ContinueStatement = 252,
- BreakStatement = 253,
- ReturnStatement = 254,
- WithStatement = 255,
- SwitchStatement = 256,
- LabeledStatement = 257,
- ThrowStatement = 258,
- TryStatement = 259,
- DebuggerStatement = 260,
- VariableDeclaration = 261,
- VariableDeclarationList = 262,
- FunctionDeclaration = 263,
- ClassDeclaration = 264,
- StructDeclaration = 265,
- AnnotationDeclaration = 266,
- InterfaceDeclaration = 267,
- TypeAliasDeclaration = 268,
- EnumDeclaration = 269,
- ModuleDeclaration = 270,
- ModuleBlock = 271,
- CaseBlock = 272,
- NamespaceExportDeclaration = 273,
- ImportEqualsDeclaration = 274,
- ImportDeclaration = 275,
- ImportClause = 276,
- NamespaceImport = 277,
- NamedImports = 278,
- ImportSpecifier = 279,
- ExportAssignment = 280,
- ExportDeclaration = 281,
- NamedExports = 282,
- NamespaceExport = 283,
- ExportSpecifier = 284,
- MissingDeclaration = 285,
- ExternalModuleReference = 286,
- JsxElement = 287,
- JsxSelfClosingElement = 288,
- JsxOpeningElement = 289,
- JsxClosingElement = 290,
- JsxFragment = 291,
- JsxOpeningFragment = 292,
- JsxClosingFragment = 293,
- JsxAttribute = 294,
- JsxAttributes = 295,
- JsxSpreadAttribute = 296,
- JsxExpression = 297,
- CaseClause = 298,
- DefaultClause = 299,
- HeritageClause = 300,
- CatchClause = 301,
- AssertClause = 302,
- AssertEntry = 303,
- ImportTypeAssertionContainer = 304,
- PropertyAssignment = 305,
- ShorthandPropertyAssignment = 306,
- SpreadAssignment = 307,
- EnumMember = 308,
- UnparsedPrologue = 309,
- UnparsedPrepend = 310,
- UnparsedText = 311,
- UnparsedInternalText = 312,
- UnparsedSyntheticReference = 313,
- SourceFile = 314,
- Bundle = 315,
- UnparsedSource = 316,
- InputFiles = 317,
- JSDocTypeExpression = 318,
- JSDocNameReference = 319,
- JSDocMemberName = 320,
- JSDocAllType = 321,
- JSDocUnknownType = 322,
- JSDocNullableType = 323,
- JSDocNonNullableType = 324,
- JSDocOptionalType = 325,
- JSDocFunctionType = 326,
- JSDocVariadicType = 327,
- JSDocNamepathType = 328,
- JSDoc = 329,
+ OverloadKeyword = 164,
+ OfKeyword = 165,
+ QualifiedName = 166,
+ ComputedPropertyName = 167,
+ TypeParameter = 168,
+ Parameter = 169,
+ Decorator = 170,
+ PropertySignature = 171,
+ PropertyDeclaration = 172,
+ AnnotationPropertyDeclaration = 173,
+ OverloadPropertyDeclaration = 174,
+ MethodSignature = 175,
+ MethodDeclaration = 176,
+ ClassStaticBlockDeclaration = 177,
+ Constructor = 178,
+ GetAccessor = 179,
+ SetAccessor = 180,
+ CallSignature = 181,
+ ConstructSignature = 182,
+ IndexSignature = 183,
+ TypePredicate = 184,
+ TypeReference = 185,
+ FunctionType = 186,
+ ConstructorType = 187,
+ TypeQuery = 188,
+ TypeLiteral = 189,
+ ArrayType = 190,
+ TupleType = 191,
+ OptionalType = 192,
+ RestType = 193,
+ UnionType = 194,
+ IntersectionType = 195,
+ ConditionalType = 196,
+ InferType = 197,
+ ParenthesizedType = 198,
+ ThisType = 199,
+ TypeOperator = 200,
+ IndexedAccessType = 201,
+ MappedType = 202,
+ LiteralType = 203,
+ NamedTupleMember = 204,
+ TemplateLiteralType = 205,
+ TemplateLiteralTypeSpan = 206,
+ ImportType = 207,
+ ObjectBindingPattern = 208,
+ ArrayBindingPattern = 209,
+ BindingElement = 210,
+ ArrayLiteralExpression = 211,
+ ObjectLiteralExpression = 212,
+ PropertyAccessExpression = 213,
+ ElementAccessExpression = 214,
+ CallExpression = 215,
+ NewExpression = 216,
+ TaggedTemplateExpression = 217,
+ TypeAssertionExpression = 218,
+ ParenthesizedExpression = 219,
+ FunctionExpression = 220,
+ ArrowFunction = 221,
+ EtsComponentExpression = 222,
+ DeleteExpression = 223,
+ TypeOfExpression = 224,
+ VoidExpression = 225,
+ AwaitExpression = 226,
+ PrefixUnaryExpression = 227,
+ PostfixUnaryExpression = 228,
+ BinaryExpression = 229,
+ ConditionalExpression = 230,
+ TemplateExpression = 231,
+ YieldExpression = 232,
+ SpreadElement = 233,
+ ClassExpression = 234,
+ OmittedExpression = 235,
+ ExpressionWithTypeArguments = 236,
+ AsExpression = 237,
+ NonNullExpression = 238,
+ MetaProperty = 239,
+ SyntheticExpression = 240,
+ SatisfiesExpression = 241,
+ TemplateSpan = 242,
+ SemicolonClassElement = 243,
+ Block = 244,
+ EmptyStatement = 245,
+ VariableStatement = 246,
+ ExpressionStatement = 247,
+ IfStatement = 248,
+ DoStatement = 249,
+ WhileStatement = 250,
+ ForStatement = 251,
+ ForInStatement = 252,
+ ForOfStatement = 253,
+ ContinueStatement = 254,
+ BreakStatement = 255,
+ ReturnStatement = 256,
+ WithStatement = 257,
+ SwitchStatement = 258,
+ LabeledStatement = 259,
+ ThrowStatement = 260,
+ TryStatement = 261,
+ DebuggerStatement = 262,
+ VariableDeclaration = 263,
+ VariableDeclarationList = 264,
+ FunctionDeclaration = 265,
+ ClassDeclaration = 266,
+ StructDeclaration = 267,
+ AnnotationDeclaration = 268,
+ OverloadDeclaration = 269,
+ InterfaceDeclaration = 270,
+ TypeAliasDeclaration = 271,
+ EnumDeclaration = 272,
+ ModuleDeclaration = 273,
+ ModuleBlock = 274,
+ CaseBlock = 275,
+ NamespaceExportDeclaration = 276,
+ ImportEqualsDeclaration = 277,
+ ImportDeclaration = 278,
+ ImportClause = 279,
+ NamespaceImport = 280,
+ NamedImports = 281,
+ ImportSpecifier = 282,
+ ExportAssignment = 283,
+ ExportDeclaration = 284,
+ NamedExports = 285,
+ NamespaceExport = 286,
+ ExportSpecifier = 287,
+ MissingDeclaration = 288,
+ ExternalModuleReference = 289,
+ JsxElement = 290,
+ JsxSelfClosingElement = 291,
+ JsxOpeningElement = 292,
+ JsxClosingElement = 293,
+ JsxFragment = 294,
+ JsxOpeningFragment = 295,
+ JsxClosingFragment = 296,
+ JsxAttribute = 297,
+ JsxAttributes = 298,
+ JsxSpreadAttribute = 299,
+ JsxExpression = 300,
+ CaseClause = 301,
+ DefaultClause = 302,
+ HeritageClause = 303,
+ CatchClause = 304,
+ AssertClause = 305,
+ AssertEntry = 306,
+ ImportTypeAssertionContainer = 307,
+ PropertyAssignment = 308,
+ ShorthandPropertyAssignment = 309,
+ SpreadAssignment = 310,
+ EnumMember = 311,
+ UnparsedPrologue = 312,
+ UnparsedPrepend = 313,
+ UnparsedText = 314,
+ UnparsedInternalText = 315,
+ UnparsedSyntheticReference = 316,
+ SourceFile = 317,
+ Bundle = 318,
+ UnparsedSource = 319,
+ InputFiles = 320,
+ JSDocTypeExpression = 321,
+ JSDocNameReference = 322,
+ JSDocMemberName = 323,
+ JSDocAllType = 324,
+ JSDocUnknownType = 325,
+ JSDocNullableType = 326,
+ JSDocNonNullableType = 327,
+ JSDocOptionalType = 328,
+ JSDocFunctionType = 329,
+ JSDocVariadicType = 330,
+ JSDocNamepathType = 331,
+ JSDoc = 332,
/** @deprecated Use SyntaxKind.JSDoc */
- JSDocComment = 329,
- JSDocText = 330,
- JSDocTypeLiteral = 331,
- JSDocSignature = 332,
- JSDocLink = 333,
- JSDocLinkCode = 334,
- JSDocLinkPlain = 335,
- JSDocTag = 336,
- JSDocAugmentsTag = 337,
- JSDocImplementsTag = 338,
- JSDocAuthorTag = 339,
- JSDocDeprecatedTag = 340,
- JSDocClassTag = 341,
- JSDocPublicTag = 342,
- JSDocPrivateTag = 343,
- JSDocProtectedTag = 344,
- JSDocReadonlyTag = 345,
- JSDocOverrideTag = 346,
- JSDocCallbackTag = 347,
- JSDocEnumTag = 348,
- JSDocParameterTag = 349,
- JSDocReturnTag = 350,
- JSDocThisTag = 351,
- JSDocTypeTag = 352,
- JSDocTemplateTag = 353,
- JSDocTypedefTag = 354,
- JSDocSeeTag = 355,
- JSDocPropertyTag = 356,
- SyntaxList = 357,
- NotEmittedStatement = 358,
- PartiallyEmittedExpression = 359,
- CommaListExpression = 360,
- MergeDeclarationMarker = 361,
- EndOfDeclarationMarker = 362,
- SyntheticReferenceExpression = 363,
- Count = 364,
+ JSDocComment = 332,
+ JSDocText = 333,
+ JSDocTypeLiteral = 334,
+ JSDocSignature = 335,
+ JSDocLink = 336,
+ JSDocLinkCode = 337,
+ JSDocLinkPlain = 338,
+ JSDocTag = 339,
+ JSDocAugmentsTag = 340,
+ JSDocImplementsTag = 341,
+ JSDocAuthorTag = 342,
+ JSDocDeprecatedTag = 343,
+ JSDocClassTag = 344,
+ JSDocPublicTag = 345,
+ JSDocPrivateTag = 346,
+ JSDocProtectedTag = 347,
+ JSDocReadonlyTag = 348,
+ JSDocOverrideTag = 349,
+ JSDocCallbackTag = 350,
+ JSDocEnumTag = 351,
+ JSDocParameterTag = 352,
+ JSDocReturnTag = 353,
+ JSDocThisTag = 354,
+ JSDocTypeTag = 355,
+ JSDocTemplateTag = 356,
+ JSDocTypedefTag = 357,
+ JSDocSeeTag = 358,
+ JSDocPropertyTag = 359,
+ SyntaxList = 360,
+ NotEmittedStatement = 361,
+ PartiallyEmittedExpression = 362,
+ CommaListExpression = 363,
+ MergeDeclarationMarker = 364,
+ EndOfDeclarationMarker = 365,
+ SyntheticReferenceExpression = 366,
+ Count = 367,
FirstAssignment = 63,
LastAssignment = 78,
FirstCompoundAssignment = 64,
@@ -520,15 +523,15 @@ declare namespace ts {
FirstReservedWord = 81,
LastReservedWord = 117,
FirstKeyword = 81,
- LastKeyword = 164,
+ LastKeyword = 165,
FirstFutureReservedWord = 118,
LastFutureReservedWord = 126,
- FirstTypeNode = 182,
- LastTypeNode = 205,
+ FirstTypeNode = 184,
+ LastTypeNode = 207,
FirstPunctuation = 18,
LastPunctuation = 78,
FirstToken = 0,
- LastToken = 164,
+ LastToken = 165,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 8,
@@ -537,19 +540,19 @@ declare namespace ts {
LastTemplateToken = 17,
FirstBinaryOperator = 29,
LastBinaryOperator = 78,
- FirstStatement = 244,
- LastStatement = 260,
- FirstNode = 165,
- FirstJSDocNode = 318,
- LastJSDocNode = 356,
- FirstJSDocTagNode = 336,
- LastJSDocTagNode = 356
+ FirstStatement = 246,
+ LastStatement = 262,
+ FirstNode = 166,
+ FirstJSDocNode = 321,
+ LastJSDocNode = 359,
+ FirstJSDocTagNode = 339,
+ LastJSDocTagNode = 359
}
type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia;
type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;
type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail;
type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken;
- type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.StructKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.LazyKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
+ type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.StructKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.OverloadKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.LazyKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword;
type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword;
type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
@@ -690,14 +693,14 @@ declare namespace ts {
}
interface JSDocContainer {
}
- type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AnnotationPropertyDeclaration | AnnotationDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | CaseClause | EndOfFileToken;
- type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | AnnotationPropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
+ type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AnnotationPropertyDeclaration | OverloadPropertyDeclaration | AnnotationDeclaration | OverloadDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | CaseClause | EndOfFileToken;
+ type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | AnnotationPropertyDeclaration | OverloadPropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | EnumMember;
type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration;
type HasIllegalDecorators = PropertyAssignment | ShorthandPropertyAssignment | FunctionDeclaration | ConstructorDeclaration | IndexSignatureDeclaration | ClassStaticBlockDeclaration | MissingDeclaration | VariableStatement | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportDeclaration | ExportAssignment;
- type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration;
+ type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
interface NodeArray extends ReadonlyArray, ReadonlyTextRange {
readonly hasTrailingComma: boolean;
}
@@ -938,7 +941,7 @@ declare namespace ts {
readonly parent: ObjectLiteralExpression;
readonly expression: Expression;
}
- type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
+ type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | OverloadPropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag;
interface PropertyLikeDeclaration extends NamedDeclaration {
readonly name: PropertyName;
}
@@ -1730,7 +1733,7 @@ declare namespace ts {
type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer {
- readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression | SyntaxKind.StructDeclaration | SyntaxKind.AnnotationDeclaration;
+ readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression | SyntaxKind.StructDeclaration | SyntaxKind.AnnotationDeclaration | SyntaxKind.OverloadDeclaration;
readonly name?: Identifier;
readonly typeParameters?: NodeArray;
readonly heritageClauses?: NodeArray;
@@ -1754,6 +1757,12 @@ declare namespace ts {
readonly name: Identifier;
readonly members: NodeArray;
}
+ interface OverloadDeclaration extends DeclarationStatement, ClassElement, TypeElement {
+ readonly kind: SyntaxKind.OverloadDeclaration;
+ readonly modifiers?: NodeArray;
+ readonly name: Identifier;
+ readonly members: NodeArray;
+ }
interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression {
readonly kind: SyntaxKind.ClassExpression;
readonly modifiers?: NodeArray;
@@ -1767,6 +1776,16 @@ declare namespace ts {
_annnotationElementBrand: any;
readonly name: PropertyName;
}
+ interface OverloadElement extends NamedDeclaration {
+ readonly name: PropertyName;
+ }
+ interface OverloadPropertyDeclaration extends OverloadElement, JSDocContainer {
+ readonly kind: SyntaxKind.OverloadPropertyDeclaration;
+ readonly modifiers?: NodeArray;
+ readonly name: PropertyName;
+ readonly questionToken?: QuestionToken;
+ readonly type?: TypeNode;
+ }
interface TypeElement extends NamedDeclaration {
_typeElementBrand: any;
readonly name?: PropertyName;
@@ -3892,6 +3911,8 @@ declare namespace ts {
updatePropertyDeclaration(node: PropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
createAnnotationPropertyDeclaration(name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
updateAnnotationPropertyDeclaration(node: AnnotationPropertyDeclaration, name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
+ createOverloadPropertyDeclaration(modifiers: readonly ModifierLike[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
+ updateOverloadPropertyDeclaration(node: OverloadPropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature;
createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
@@ -4091,6 +4112,8 @@ declare namespace ts {
updateStructDeclaration(node: StructDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): StructDeclaration;
createAnnotationDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, members: readonly AnnotationElement[]): AnnotationDeclaration;
updateAnnotationDeclaration(node: AnnotationDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly AnnotationElement[]): AnnotationDeclaration;
+ createOverloadDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
+ updateOverloadDeclaration(node: OverloadDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
@@ -5271,6 +5294,7 @@ declare namespace ts {
function isBindingName(node: Node): node is BindingName;
function isFunctionLike(node: Node | undefined): node is SignatureDeclaration;
function isAnnotationElement(node: Node): node is AnnotationElement;
+ function isOverloadElement(node: Node): node is OverloadElement;
function isClassElement(node: Node): node is ClassElement;
function isClassLike(node: Node): node is ClassLikeDeclaration;
function isStruct(node: Node): node is StructDeclaration;
@@ -5441,6 +5465,7 @@ declare namespace ts {
function isDecorator(node: Node): node is Decorator;
function isAnnotation(node: Node): node is Annotation;
function isPropertySignature(node: Node): node is PropertySignature;
+ function isOverloadPropertyDeclaration(node: Node): node is OverloadPropertyDeclaration;
function isPropertyDeclaration(node: Node): node is PropertyDeclaration;
function isAnnotationPropertyDeclaration(node: Node): node is AnnotationPropertyDeclaration;
function isMethodSignature(node: Node): node is MethodSignature;
@@ -5539,6 +5564,7 @@ declare namespace ts {
function isClassDeclaration(node: Node): node is ClassDeclaration;
function isStructDeclaration(node: Node): node is StructDeclaration;
function isAnnotationDeclaration(node: Node): node is AnnotationDeclaration;
+ function isOverloadDeclaration(node: Node): node is OverloadDeclaration;
function isInterfaceDeclaration(node: Node): node is InterfaceDeclaration;
function isTypeAliasDeclaration(node: Node): node is TypeAliasDeclaration;
function isEnumDeclaration(node: Node): node is EnumDeclaration;
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace1.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace1.ets
new file mode 100644
index 0000000000..ffd98aa398
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace1.ets
@@ -0,0 +1,7 @@
+// @declaration: true
+declare namespace myNS {
+ function foo1(): void;
+ function foo2(): void;
+ /** @overload testJSdoc */
+ overload foo {foo1, foo2}
+}
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace2.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace2.ets
new file mode 100644
index 0000000000..7d5d872080
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace2.ets
@@ -0,0 +1,9 @@
+// @declaration: true
+declare namespace myNS {
+ interface I {
+ foo(): void;
+ bar(n?: string): void;
+ /** @overload testJSdoc */
+ overload goo {foo, bar}
+ }
+}
\ No newline at end of file
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace3.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace3.ets
new file mode 100644
index 0000000000..51e63b45b0
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace3.ets
@@ -0,0 +1,9 @@
+// @declaration: true
+declare namespace myNS {
+ class Processor {
+ /** @overload testJSdoc */
+ overload process {process1, process2}
+ process1(n: number): void;
+ process2(s: string): void;
+ }
+}
\ No newline at end of file
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel1.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel1.ets
new file mode 100644
index 0000000000..19d46e4859
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel1.ets
@@ -0,0 +1,5 @@
+// @declaration: true
+declare function foo1(): void;
+declare function foo2(): void;
+/** @overload testJSdoc */
+overload foo {foo1, foo2}
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel2.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel2.ets
new file mode 100644
index 0000000000..e988befb58
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel2.ets
@@ -0,0 +1,7 @@
+// @declaration: true
+declare interface I {
+ foo(): void;
+ bar(n?: string): void;
+ /** @overload testJSdoc */
+ overload goo {foo, bar}
+}
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel3.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel3.ets
new file mode 100644
index 0000000000..71bc653b84
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel3.ets
@@ -0,0 +1,7 @@
+// @declaration: true
+declare class Processor {
+ /** @overload testJSdoc */
+ overload process {process1, process2}
+ process1(n: number): void;
+ process2(s: string): void;
+}
\ No newline at end of file
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets
new file mode 100644
index 0000000000..76347d7dd2
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets
@@ -0,0 +1,5 @@
+// @declaration: true
+export declare function foo1(): void;
+export declare function foo2(): void;
+/** @overload testJSdoc */
+export overload foo {foo1, foo2}
\ No newline at end of file
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithModifier.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithModifier.ets
new file mode 100644
index 0000000000..397b431c94
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithModifier.ets
@@ -0,0 +1,10 @@
+// @declaration: true
+declare class Processor {
+ /** @overload testJSdoc */
+ static overload processOne {process1, process2}
+ async overload processTwo {process3, process4}
+ process1(n: number): void;
+ process2(s: string): void;
+ process3(): void;
+ process4(b: boolean): void;
+}
\ No newline at end of file
--
Gitee
From 4a3087a0ae4f8738ed65630de07519668f9bfac7 Mon Sep 17 00:00:00 2001
From: zju_wyx <22125041@zju.edu.cn>
Date: Thu, 17 Jul 2025 21:19:13 +0800
Subject: [PATCH 03/10] support ambient interface
Signed-off-by: zju_wyx <22125041@zju.edu.cn>
Change-Id: I7e85afac6cbad17507a5ec1d63506ca5f20b2b12
---
lib/tsc.js | 18 +++++++++++++-----
lib/tsserver.js | 18 +++++++++++++-----
lib/tsserverlibrary.js | 18 +++++++++++++-----
lib/typescript.js | 18 +++++++++++++-----
lib/typingsInstaller.js | 11 +++++++----
src/compiler/checker.ts | 3 +++
src/compiler/parser.ts | 13 +++++++++----
src/compiler/transformers/declarations.ts | 4 +++-
.../reference/AmbientInterfaceDeclaration1.js | 15 +++++++++++++++
.../AmbientInterfaceDeclaration1.symbols | 9 +++++++++
.../AmbientInterfaceDeclaration1.types | 7 +++++++
.../reference/AmbientInterfaceDeclaration2.js | 18 ++++++++++++++++++
.../AmbientInterfaceDeclaration2.symbols | 12 ++++++++++++
.../AmbientInterfaceDeclaration2.types | 8 ++++++++
.../AmbientInterfaceDeclaration1.ets | 5 +++++
.../AmbientInterfaceDeclaration2.ets | 7 +++++++
16 files changed, 155 insertions(+), 29 deletions(-)
create mode 100644 tests/baselines/reference/AmbientInterfaceDeclaration1.js
create mode 100644 tests/baselines/reference/AmbientInterfaceDeclaration1.symbols
create mode 100644 tests/baselines/reference/AmbientInterfaceDeclaration1.types
create mode 100644 tests/baselines/reference/AmbientInterfaceDeclaration2.js
create mode 100644 tests/baselines/reference/AmbientInterfaceDeclaration2.symbols
create mode 100644 tests/baselines/reference/AmbientInterfaceDeclaration2.types
create mode 100644 tests/cases/conformance/parser/ets/ambientInterfaceDeclaration/AmbientInterfaceDeclaration1.ets
create mode 100644 tests/cases/conformance/parser/ets/ambientInterfaceDeclaration/AmbientInterfaceDeclaration2.ets
diff --git a/lib/tsc.js b/lib/tsc.js
index 63be854d0b..f557a5f052 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -27302,7 +27302,10 @@ var Parser;
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
- return token() === 84 /* ClassKeyword */ || inEtsContext() && token() === 85 /* StructKeyword */ || token() === 99 /* FunctionKeyword */ || token() === 119 /* InterfaceKeyword */ || token() === 127 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 133 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine);
+ return token() === 84 /* ClassKeyword */ || inEtsContext() && token() === 85 /* StructKeyword */ || token() === 99 /* FunctionKeyword */ || token() === 119 /* InterfaceKeyword */ || token() === 127 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 133 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine) || tokenIsIdentifierOrKeyword(token()) && (parsingContext & 1 << ParsingContext.TypeMembers) !== 0 && lookAhead(() => {
+ nextToken();
+ return token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */;
+ });
}
function isListElement(parsingContext2, inErrorRecovery) {
const node = currentNode(parsingContext2);
@@ -28257,9 +28260,6 @@ var Parser;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
- if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
- parseTokenNode();
- }
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
let node;
@@ -28284,6 +28284,9 @@ var Parser;
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
+ if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
+ return true;
+ }
let idToken = false;
while (isModifierKind(token())) {
idToken = true;
@@ -78276,6 +78279,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (modifier.kind !== 147 /* ReadonlyKeyword */) {
if (node.kind === 171 /* PropertySignature */ || node.kind === 175 /* MethodSignature */) {
+ if (node.kind === 175 /* MethodSignature */ && modifier.kind === 89 /* DefaultKeyword */) {
+ continue;
+ }
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind));
}
if (node.kind === 183 /* IndexSignature */ && (modifier.kind !== 125 /* StaticKeyword */ || !isClassLike(node.parent))) {
@@ -98562,7 +98568,9 @@ function maskModifiers(node, modifierMask, modifierAdditions) {
function maskModifierFlags(node, modifierMask = 258047 /* All */ ^ 4 /* Public */, modifierAdditions = 0 /* None */) {
let flags = getEffectiveModifierFlags(node) & modifierMask | modifierAdditions;
if (flags & 1024 /* Default */ && !(flags & 1 /* Export */)) {
- flags ^= 1 /* Export */;
+ if (node.kind !== 175 /* MethodSignature */) {
+ flags ^= 1 /* Export */;
+ }
}
if (flags & 1024 /* Default */ && flags & 2 /* Ambient */) {
flags ^= 2 /* Ambient */;
diff --git a/lib/tsserver.js b/lib/tsserver.js
index 7f0d91c303..d0449c6ce9 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -29981,7 +29981,10 @@ var Parser;
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
- return token() === 84 /* ClassKeyword */ || inEtsContext() && token() === 85 /* StructKeyword */ || token() === 99 /* FunctionKeyword */ || token() === 119 /* InterfaceKeyword */ || token() === 127 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 133 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine);
+ return token() === 84 /* ClassKeyword */ || inEtsContext() && token() === 85 /* StructKeyword */ || token() === 99 /* FunctionKeyword */ || token() === 119 /* InterfaceKeyword */ || token() === 127 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 133 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine) || tokenIsIdentifierOrKeyword(token()) && (parsingContext & 1 << ParsingContext.TypeMembers) !== 0 && lookAhead(() => {
+ nextToken();
+ return token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */;
+ });
}
function isListElement2(parsingContext2, inErrorRecovery) {
const node = currentNode(parsingContext2);
@@ -30936,9 +30939,6 @@ var Parser;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
- if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
- parseTokenNode();
- }
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
let node;
@@ -30963,6 +30963,9 @@ var Parser;
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
+ if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
+ return true;
+ }
let idToken = false;
while (isModifierKind(token())) {
idToken = true;
@@ -80812,6 +80815,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (modifier.kind !== 147 /* ReadonlyKeyword */) {
if (node.kind === 171 /* PropertySignature */ || node.kind === 175 /* MethodSignature */) {
+ if (node.kind === 175 /* MethodSignature */ && modifier.kind === 89 /* DefaultKeyword */) {
+ continue;
+ }
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind));
}
if (node.kind === 183 /* IndexSignature */ && (modifier.kind !== 125 /* StaticKeyword */ || !isClassLike(node.parent))) {
@@ -100914,7 +100920,9 @@ function maskModifiers(node, modifierMask, modifierAdditions) {
function maskModifierFlags(node, modifierMask = 258047 /* All */ ^ 4 /* Public */, modifierAdditions = 0 /* None */) {
let flags = getEffectiveModifierFlags(node) & modifierMask | modifierAdditions;
if (flags & 1024 /* Default */ && !(flags & 1 /* Export */)) {
- flags ^= 1 /* Export */;
+ if (node.kind !== 175 /* MethodSignature */) {
+ flags ^= 1 /* Export */;
+ }
}
if (flags & 1024 /* Default */ && flags & 2 /* Ambient */) {
flags ^= 2 /* Ambient */;
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index 0f98a88f76..7e2ebed1aa 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -29883,7 +29883,10 @@ var Parser;
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
- return token() === 84 /* ClassKeyword */ || inEtsContext() && token() === 85 /* StructKeyword */ || token() === 99 /* FunctionKeyword */ || token() === 119 /* InterfaceKeyword */ || token() === 127 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 133 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine);
+ return token() === 84 /* ClassKeyword */ || inEtsContext() && token() === 85 /* StructKeyword */ || token() === 99 /* FunctionKeyword */ || token() === 119 /* InterfaceKeyword */ || token() === 127 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 133 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine) || tokenIsIdentifierOrKeyword(token()) && (parsingContext & 1 << ParsingContext.TypeMembers) !== 0 && lookAhead(() => {
+ nextToken();
+ return token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */;
+ });
}
function isListElement2(parsingContext2, inErrorRecovery) {
const node = currentNode(parsingContext2);
@@ -30838,9 +30841,6 @@ var Parser;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
- if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
- parseTokenNode();
- }
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
let node;
@@ -30865,6 +30865,9 @@ var Parser;
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
+ if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
+ return true;
+ }
let idToken = false;
while (isModifierKind(token())) {
idToken = true;
@@ -80714,6 +80717,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (modifier.kind !== 147 /* ReadonlyKeyword */) {
if (node.kind === 171 /* PropertySignature */ || node.kind === 175 /* MethodSignature */) {
+ if (node.kind === 175 /* MethodSignature */ && modifier.kind === 89 /* DefaultKeyword */) {
+ continue;
+ }
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind));
}
if (node.kind === 183 /* IndexSignature */ && (modifier.kind !== 125 /* StaticKeyword */ || !isClassLike(node.parent))) {
@@ -100816,7 +100822,9 @@ function maskModifiers(node, modifierMask, modifierAdditions) {
function maskModifierFlags(node, modifierMask = 258047 /* All */ ^ 4 /* Public */, modifierAdditions = 0 /* None */) {
let flags = getEffectiveModifierFlags(node) & modifierMask | modifierAdditions;
if (flags & 1024 /* Default */ && !(flags & 1 /* Export */)) {
- flags ^= 1 /* Export */;
+ if (node.kind !== 175 /* MethodSignature */) {
+ flags ^= 1 /* Export */;
+ }
}
if (flags & 1024 /* Default */ && flags & 2 /* Ambient */) {
flags ^= 2 /* Ambient */;
diff --git a/lib/typescript.js b/lib/typescript.js
index 54768fecb9..82559df2ab 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -29898,7 +29898,10 @@ var Parser;
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
- return token() === 84 /* ClassKeyword */ || inEtsContext() && token() === 85 /* StructKeyword */ || token() === 99 /* FunctionKeyword */ || token() === 119 /* InterfaceKeyword */ || token() === 127 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 133 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine);
+ return token() === 84 /* ClassKeyword */ || inEtsContext() && token() === 85 /* StructKeyword */ || token() === 99 /* FunctionKeyword */ || token() === 119 /* InterfaceKeyword */ || token() === 127 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 133 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine) || tokenIsIdentifierOrKeyword(token()) && (parsingContext & 1 << ParsingContext.TypeMembers) !== 0 && lookAhead(() => {
+ nextToken();
+ return token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */;
+ });
}
function isListElement2(parsingContext2, inErrorRecovery) {
const node = currentNode(parsingContext2);
@@ -30853,9 +30856,6 @@ var Parser;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
- if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
- parseTokenNode();
- }
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
let node;
@@ -30880,6 +30880,9 @@ var Parser;
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
+ if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
+ return true;
+ }
let idToken = false;
while (isModifierKind(token())) {
idToken = true;
@@ -80872,6 +80875,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
if (modifier.kind !== 147 /* ReadonlyKeyword */) {
if (node.kind === 171 /* PropertySignature */ || node.kind === 175 /* MethodSignature */) {
+ if (node.kind === 175 /* MethodSignature */ && modifier.kind === 89 /* DefaultKeyword */) {
+ continue;
+ }
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind));
}
if (node.kind === 183 /* IndexSignature */ && (modifier.kind !== 125 /* StaticKeyword */ || !isClassLike(node.parent))) {
@@ -101158,7 +101164,9 @@ function maskModifiers(node, modifierMask, modifierAdditions) {
function maskModifierFlags(node, modifierMask = 258047 /* All */ ^ 4 /* Public */, modifierAdditions = 0 /* None */) {
let flags = getEffectiveModifierFlags(node) & modifierMask | modifierAdditions;
if (flags & 1024 /* Default */ && !(flags & 1 /* Export */)) {
- flags ^= 1 /* Export */;
+ if (node.kind !== 175 /* MethodSignature */) {
+ flags ^= 1 /* Export */;
+ }
}
if (flags & 1024 /* Default */ && flags & 2 /* Ambient */) {
flags ^= 2 /* Ambient */;
diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js
index c187443840..e6fb780b7c 100644
--- a/lib/typingsInstaller.js
+++ b/lib/typingsInstaller.js
@@ -20133,7 +20133,10 @@ var Parser;
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
- return token() === 84 /* ClassKeyword */ || inEtsContext() && token() === 85 /* StructKeyword */ || token() === 99 /* FunctionKeyword */ || token() === 119 /* InterfaceKeyword */ || token() === 127 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 133 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine);
+ return token() === 84 /* ClassKeyword */ || inEtsContext() && token() === 85 /* StructKeyword */ || token() === 99 /* FunctionKeyword */ || token() === 119 /* InterfaceKeyword */ || token() === 127 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 133 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine) || tokenIsIdentifierOrKeyword(token()) && (parsingContext & 1 << ParsingContext.TypeMembers) !== 0 && lookAhead(() => {
+ nextToken();
+ return token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */;
+ });
}
function isListElement(parsingContext2, inErrorRecovery) {
const node = currentNode(parsingContext2);
@@ -21088,9 +21091,6 @@ var Parser;
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {
- if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
- parseTokenNode();
- }
const name = parsePropertyName();
const questionToken = parseOptionalToken(57 /* QuestionToken */);
let node;
@@ -21115,6 +21115,9 @@ var Parser;
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
+ if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
+ return true;
+ }
let idToken = false;
while (isModifierKind(token())) {
idToken = true;
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index d0f51eac2d..5c89d8244e 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -47308,6 +47308,9 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
}
if (modifier.kind !== SyntaxKind.ReadonlyKeyword) {
if (node.kind === SyntaxKind.PropertySignature || node.kind === SyntaxKind.MethodSignature) {
+ if (node.kind === SyntaxKind.MethodSignature && modifier.kind === SyntaxKind.DefaultKeyword) {
+ continue;
+ }
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind));
}
if (node.kind === SyntaxKind.IndexSignature && (modifier.kind !== SyntaxKind.StaticKeyword || !isClassLike(node.parent))) {
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index 1d7283b8b9..18973ce18c 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -3036,7 +3036,11 @@ namespace Parser {
return token() === SyntaxKind.ClassKeyword || (inEtsContext() && token() === SyntaxKind.StructKeyword) ||
token() === SyntaxKind.FunctionKeyword || token() === SyntaxKind.InterfaceKeyword ||
(token() === SyntaxKind.AbstractKeyword && lookAhead(nextTokenIsClassKeywordOnSameLine)) ||
- (token() === SyntaxKind.AsyncKeyword && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
+ (token() === SyntaxKind.AsyncKeyword && lookAhead(nextTokenIsFunctionKeywordOnSameLine)) ||
+ (tokenIsIdentifierOrKeyword(token()) && (parsingContext & (1 << ParsingContext.TypeMembers)) !== 0 && lookAhead(() => {
+ nextToken();
+ return token() === SyntaxKind.OpenParenToken || token() === SyntaxKind.LessThanToken;
+ }));
}
// True if positioned at the start of a list element
@@ -4460,9 +4464,6 @@ namespace Parser {
}
function parsePropertyOrMethodSignature(pos: number, hasJSDoc: boolean, modifiers: NodeArray | undefined): PropertySignature | MethodSignature {
- if (token() === SyntaxKind.DefaultKeyword && lookAhead(() => nextTokenIsIdentifier())) {
- parseTokenNode();
- }
const name = parsePropertyName();
const questionToken = parseOptionalToken(SyntaxKind.QuestionToken);
let node: PropertySignature | MethodSignature;
@@ -4499,6 +4500,10 @@ namespace Parser {
return true;
}
+ if (token() === SyntaxKind.DefaultKeyword && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
+ return true;
+ }
+
let idToken = false;
// Eat up all modifiers, but hold on to the last one in case it is actually an identifier
while (isModifierKind(token())) {
diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts
index 1f707ace07..8a9cc97447 100644
--- a/src/compiler/transformers/declarations.ts
+++ b/src/compiler/transformers/declarations.ts
@@ -1821,7 +1821,9 @@ function maskModifierFlags(node: Node, modifierMask: ModifierFlags = ModifierFla
if (flags & ModifierFlags.Default && !(flags & ModifierFlags.Export)) {
// A non-exported default is a nonsequitor - we usually try to remove all export modifiers
// from statements in ambient declarations; but a default export must retain its export modifier to be syntactically valid
- flags ^= ModifierFlags.Export;
+ if (node.kind !== SyntaxKind.MethodSignature) {
+ flags ^= ModifierFlags.Export;
+ }
}
if (flags & ModifierFlags.Default && flags & ModifierFlags.Ambient) {
flags ^= ModifierFlags.Ambient; // `declare` is never required alongside `default` (and would be an error if printed)
diff --git a/tests/baselines/reference/AmbientInterfaceDeclaration1.js b/tests/baselines/reference/AmbientInterfaceDeclaration1.js
new file mode 100644
index 0000000000..ae8d8f7eeb
--- /dev/null
+++ b/tests/baselines/reference/AmbientInterfaceDeclaration1.js
@@ -0,0 +1,15 @@
+//// [AmbientInterfaceDeclaration1.ets]
+declare interface I {
+ /** @since testJSdoc */
+ default foo(): void;
+}
+
+
+//// [AmbientInterfaceDeclaration1.js]
+
+
+//// [AmbientInterfaceDeclaration1.d.ets]
+declare interface I {
+ /** @since testJSdoc */
+ default foo(): void;
+}
diff --git a/tests/baselines/reference/AmbientInterfaceDeclaration1.symbols b/tests/baselines/reference/AmbientInterfaceDeclaration1.symbols
new file mode 100644
index 0000000000..43fab90aa6
--- /dev/null
+++ b/tests/baselines/reference/AmbientInterfaceDeclaration1.symbols
@@ -0,0 +1,9 @@
+=== tests/cases/conformance/parser/ets/ambientInterfaceDeclaration/AmbientInterfaceDeclaration1.ets ===
+declare interface I {
+>I : Symbol(I, Decl(AmbientInterfaceDeclaration1.ets, 0, 0))
+
+ /** @since testJSdoc */
+ default foo(): void;
+>foo : Symbol(I.default, Decl(AmbientInterfaceDeclaration1.ets, 0, 21))
+}
+
diff --git a/tests/baselines/reference/AmbientInterfaceDeclaration1.types b/tests/baselines/reference/AmbientInterfaceDeclaration1.types
new file mode 100644
index 0000000000..a6d038592b
--- /dev/null
+++ b/tests/baselines/reference/AmbientInterfaceDeclaration1.types
@@ -0,0 +1,7 @@
+=== tests/cases/conformance/parser/ets/ambientInterfaceDeclaration/AmbientInterfaceDeclaration1.ets ===
+declare interface I {
+ /** @since testJSdoc */
+ default foo(): void;
+>foo : () => void
+}
+
diff --git a/tests/baselines/reference/AmbientInterfaceDeclaration2.js b/tests/baselines/reference/AmbientInterfaceDeclaration2.js
new file mode 100644
index 0000000000..a6737544d4
--- /dev/null
+++ b/tests/baselines/reference/AmbientInterfaceDeclaration2.js
@@ -0,0 +1,18 @@
+//// [AmbientInterfaceDeclaration2.ets]
+declare namespace myNS {
+ interface I {
+ /** @since testJSdoc */
+ default foo(): void;
+ }
+}
+
+//// [AmbientInterfaceDeclaration2.js]
+
+
+//// [AmbientInterfaceDeclaration2.d.ets]
+declare namespace myNS {
+ interface I {
+ /** @since testJSdoc */
+ default foo(): void;
+ }
+}
diff --git a/tests/baselines/reference/AmbientInterfaceDeclaration2.symbols b/tests/baselines/reference/AmbientInterfaceDeclaration2.symbols
new file mode 100644
index 0000000000..67c7b83b43
--- /dev/null
+++ b/tests/baselines/reference/AmbientInterfaceDeclaration2.symbols
@@ -0,0 +1,12 @@
+=== tests/cases/conformance/parser/ets/ambientInterfaceDeclaration/AmbientInterfaceDeclaration2.ets ===
+declare namespace myNS {
+>myNS : Symbol(myNS, Decl(AmbientInterfaceDeclaration2.ets, 0, 0))
+
+ interface I {
+>I : Symbol(I, Decl(AmbientInterfaceDeclaration2.ets, 0, 24))
+
+ /** @since testJSdoc */
+ default foo(): void;
+>foo : Symbol(I.default, Decl(AmbientInterfaceDeclaration2.ets, 1, 17))
+ }
+}
diff --git a/tests/baselines/reference/AmbientInterfaceDeclaration2.types b/tests/baselines/reference/AmbientInterfaceDeclaration2.types
new file mode 100644
index 0000000000..c5fbebbd03
--- /dev/null
+++ b/tests/baselines/reference/AmbientInterfaceDeclaration2.types
@@ -0,0 +1,8 @@
+=== tests/cases/conformance/parser/ets/ambientInterfaceDeclaration/AmbientInterfaceDeclaration2.ets ===
+declare namespace myNS {
+ interface I {
+ /** @since testJSdoc */
+ default foo(): void;
+>foo : () => void
+ }
+}
diff --git a/tests/cases/conformance/parser/ets/ambientInterfaceDeclaration/AmbientInterfaceDeclaration1.ets b/tests/cases/conformance/parser/ets/ambientInterfaceDeclaration/AmbientInterfaceDeclaration1.ets
new file mode 100644
index 0000000000..d703cf0898
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/ambientInterfaceDeclaration/AmbientInterfaceDeclaration1.ets
@@ -0,0 +1,5 @@
+// @declaration: true
+declare interface I {
+ /** @since testJSdoc */
+ default foo(): void;
+}
diff --git a/tests/cases/conformance/parser/ets/ambientInterfaceDeclaration/AmbientInterfaceDeclaration2.ets b/tests/cases/conformance/parser/ets/ambientInterfaceDeclaration/AmbientInterfaceDeclaration2.ets
new file mode 100644
index 0000000000..b3ee86b577
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/ambientInterfaceDeclaration/AmbientInterfaceDeclaration2.ets
@@ -0,0 +1,7 @@
+// @declaration: true
+declare namespace myNS {
+ interface I {
+ /** @since testJSdoc */
+ default foo(): void;
+ }
+}
\ No newline at end of file
--
Gitee
From 92e71fa44ad0acf192c7b93d149b5483629c9310 Mon Sep 17 00:00:00 2001
From: zju_wyx <22125041@zju.edu.cn>
Date: Thu, 24 Jul 2025 15:21:00 +0800
Subject: [PATCH 04/10] convert autoAdd readOnlyKeyword for prop in struct
Signed-off-by: zju_wyx <22125041@zju.edu.cn>
Change-Id: I62a40aa5b4da37b065134dbd34476f42e21d9c33
---
lib/tsc.js | 28 ++--------------------------
lib/tsserver.js | 28 ++--------------------------
lib/tsserverlibrary.js | 28 ++--------------------------
lib/typescript.js | 28 ++--------------------------
lib/typingsInstaller.js | 28 ++--------------------------
src/compiler/parser.ts | 33 ++-------------------------------
6 files changed, 12 insertions(+), 161 deletions(-)
diff --git a/lib/tsc.js b/lib/tsc.js
index f557a5f052..0831d01824 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -31205,37 +31205,14 @@ var Parser;
setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end);
return decoratorsAndModifiers;
}
- function hasParamAndNoOnceDecorator(decorators) {
- let hasParamDecorator = false;
- let hasOnceDecorator = false;
- decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (!isIdentifier(decorator.expression)) {
- return;
- }
- if (decorator.expression.escapedText === "Param") {
- hasParamDecorator = true;
- } else if (decorator.expression.escapedText === "Once") {
- hasOnceDecorator = true;
- }
- });
- return hasParamDecorator && !hasOnceDecorator;
- }
- function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, shouldAddReadonly) {
+ function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock) {
const pos = getNodePos();
let list, modifier, hasSeenStatic = false;
- let hasReadonly = false;
while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) {
if (modifier.kind === 125 /* StaticKeyword */)
hasSeenStatic = true;
- if (modifier.kind === 147 /* ReadonlyKeyword */) {
- hasReadonly = true;
- }
list = append(list, modifier);
}
- if (shouldAddReadonly && !hasReadonly) {
- const readonlyModifier = finishVirtualNode(factory2.createToken(147 /* ReadonlyKeyword */));
- list = append(list, readonlyModifier);
- }
return list && createNodeArray(list, pos);
}
function parseModifiersForArrowFunction() {
@@ -31256,8 +31233,7 @@ var Parser;
}
const hasJSDoc = hasPrecedingJSDocComment();
const decorators = parseDecorators();
- const shouldAddReadonly = inStructContext() && hasParamAndNoOnceDecorator(decorators);
- const modifiers = parseModifiers(true, true, shouldAddReadonly);
+ const modifiers = parseModifiers(true, true);
if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers);
}
diff --git a/lib/tsserver.js b/lib/tsserver.js
index d0449c6ce9..5ed42e7c27 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -33884,37 +33884,14 @@ var Parser;
setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end);
return decoratorsAndModifiers;
}
- function hasParamAndNoOnceDecorator(decorators) {
- let hasParamDecorator = false;
- let hasOnceDecorator = false;
- decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (!isIdentifier(decorator.expression)) {
- return;
- }
- if (decorator.expression.escapedText === "Param") {
- hasParamDecorator = true;
- } else if (decorator.expression.escapedText === "Once") {
- hasOnceDecorator = true;
- }
- });
- return hasParamDecorator && !hasOnceDecorator;
- }
- function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, shouldAddReadonly) {
+ function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock) {
const pos = getNodePos();
let list, modifier, hasSeenStatic = false;
- let hasReadonly = false;
while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) {
if (modifier.kind === 125 /* StaticKeyword */)
hasSeenStatic = true;
- if (modifier.kind === 147 /* ReadonlyKeyword */) {
- hasReadonly = true;
- }
list = append(list, modifier);
}
- if (shouldAddReadonly && !hasReadonly) {
- const readonlyModifier = finishVirtualNode(factory2.createToken(147 /* ReadonlyKeyword */));
- list = append(list, readonlyModifier);
- }
return list && createNodeArray2(list, pos);
}
function parseModifiersForArrowFunction() {
@@ -33935,8 +33912,7 @@ var Parser;
}
const hasJSDoc = hasPrecedingJSDocComment();
const decorators = parseDecorators();
- const shouldAddReadonly = inStructContext() && hasParamAndNoOnceDecorator(decorators);
- const modifiers = parseModifiers(true, true, shouldAddReadonly);
+ const modifiers = parseModifiers(true, true);
if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers);
}
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index 7e2ebed1aa..31ccd0b046 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -33786,37 +33786,14 @@ var Parser;
setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end);
return decoratorsAndModifiers;
}
- function hasParamAndNoOnceDecorator(decorators) {
- let hasParamDecorator = false;
- let hasOnceDecorator = false;
- decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (!isIdentifier(decorator.expression)) {
- return;
- }
- if (decorator.expression.escapedText === "Param") {
- hasParamDecorator = true;
- } else if (decorator.expression.escapedText === "Once") {
- hasOnceDecorator = true;
- }
- });
- return hasParamDecorator && !hasOnceDecorator;
- }
- function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, shouldAddReadonly) {
+ function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock) {
const pos = getNodePos();
let list, modifier, hasSeenStatic = false;
- let hasReadonly = false;
while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) {
if (modifier.kind === 125 /* StaticKeyword */)
hasSeenStatic = true;
- if (modifier.kind === 147 /* ReadonlyKeyword */) {
- hasReadonly = true;
- }
list = append(list, modifier);
}
- if (shouldAddReadonly && !hasReadonly) {
- const readonlyModifier = finishVirtualNode(factory2.createToken(147 /* ReadonlyKeyword */));
- list = append(list, readonlyModifier);
- }
return list && createNodeArray2(list, pos);
}
function parseModifiersForArrowFunction() {
@@ -33837,8 +33814,7 @@ var Parser;
}
const hasJSDoc = hasPrecedingJSDocComment();
const decorators = parseDecorators();
- const shouldAddReadonly = inStructContext() && hasParamAndNoOnceDecorator(decorators);
- const modifiers = parseModifiers(true, true, shouldAddReadonly);
+ const modifiers = parseModifiers(true, true);
if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers);
}
diff --git a/lib/typescript.js b/lib/typescript.js
index 82559df2ab..20c5a59d94 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -33801,37 +33801,14 @@ var Parser;
setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end);
return decoratorsAndModifiers;
}
- function hasParamAndNoOnceDecorator(decorators) {
- let hasParamDecorator = false;
- let hasOnceDecorator = false;
- decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (!isIdentifier(decorator.expression)) {
- return;
- }
- if (decorator.expression.escapedText === "Param") {
- hasParamDecorator = true;
- } else if (decorator.expression.escapedText === "Once") {
- hasOnceDecorator = true;
- }
- });
- return hasParamDecorator && !hasOnceDecorator;
- }
- function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, shouldAddReadonly) {
+ function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock) {
const pos = getNodePos();
let list, modifier, hasSeenStatic = false;
- let hasReadonly = false;
while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) {
if (modifier.kind === 125 /* StaticKeyword */)
hasSeenStatic = true;
- if (modifier.kind === 147 /* ReadonlyKeyword */) {
- hasReadonly = true;
- }
list = append(list, modifier);
}
- if (shouldAddReadonly && !hasReadonly) {
- const readonlyModifier = finishVirtualNode(factory2.createToken(147 /* ReadonlyKeyword */));
- list = append(list, readonlyModifier);
- }
return list && createNodeArray2(list, pos);
}
function parseModifiersForArrowFunction() {
@@ -33852,8 +33829,7 @@ var Parser;
}
const hasJSDoc = hasPrecedingJSDocComment();
const decorators = parseDecorators();
- const shouldAddReadonly = inStructContext() && hasParamAndNoOnceDecorator(decorators);
- const modifiers = parseModifiers(true, true, shouldAddReadonly);
+ const modifiers = parseModifiers(true, true);
if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers);
}
diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js
index e6fb780b7c..2664c83f99 100644
--- a/lib/typingsInstaller.js
+++ b/lib/typingsInstaller.js
@@ -24036,37 +24036,14 @@ var Parser;
setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end);
return decoratorsAndModifiers;
}
- function hasParamAndNoOnceDecorator(decorators) {
- let hasParamDecorator = false;
- let hasOnceDecorator = false;
- decorators == null ? void 0 : decorators.forEach((decorator) => {
- if (!isIdentifier(decorator.expression)) {
- return;
- }
- if (decorator.expression.escapedText === "Param") {
- hasParamDecorator = true;
- } else if (decorator.expression.escapedText === "Once") {
- hasOnceDecorator = true;
- }
- });
- return hasParamDecorator && !hasOnceDecorator;
- }
- function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, shouldAddReadonly) {
+ function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock) {
const pos = getNodePos();
let list, modifier, hasSeenStatic = false;
- let hasReadonly = false;
while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) {
if (modifier.kind === 125 /* StaticKeyword */)
hasSeenStatic = true;
- if (modifier.kind === 147 /* ReadonlyKeyword */) {
- hasReadonly = true;
- }
list = append(list, modifier);
}
- if (shouldAddReadonly && !hasReadonly) {
- const readonlyModifier = finishVirtualNode(factory2.createToken(147 /* ReadonlyKeyword */));
- list = append(list, readonlyModifier);
- }
return list && createNodeArray(list, pos);
}
function parseModifiersForArrowFunction() {
@@ -24087,8 +24064,7 @@ var Parser;
}
const hasJSDoc = hasPrecedingJSDocComment();
const decorators = parseDecorators();
- const shouldAddReadonly = inStructContext() && hasParamAndNoOnceDecorator(decorators);
- const modifiers = parseModifiers(true, true, shouldAddReadonly);
+ const modifiers = parseModifiers(true, true);
if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) {
return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers);
}
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index 18973ce18c..820cf478ff 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -8529,22 +8529,6 @@ namespace Parser {
return decoratorsAndModifiers;
}
- function hasParamAndNoOnceDecorator(decorators: NodeArray | undefined): boolean {
- let hasParamDecorator = false;
- let hasOnceDecorator = false;
- decorators?.forEach((decorator) => {
- if (!ts.isIdentifier(decorator.expression)) {
- return;
- }
- if (decorator.expression.escapedText === 'Param') {
- hasParamDecorator = true;
- }
- else if (decorator.expression.escapedText === 'Once') {
- hasOnceDecorator = true;
- }
- });
- return (hasParamDecorator && !hasOnceDecorator);
- }
/*
* There are situations in which a modifier like 'const' will appear unexpectedly, such as on a class member.
* In those situations, if we are entirely sure that 'const' is not valid on its own (such as when ASI takes effect
@@ -8555,22 +8539,13 @@ namespace Parser {
function parseModifiers(
permitInvalidConstAsModifier?: boolean,
stopOnStartOfClassStaticBlock?: boolean,
- shouldAddReadonly?: boolean
): NodeArray | undefined {
const pos = getNodePos();
let list, modifier, hasSeenStatic = false;
- let hasReadonly = false;
while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) {
if (modifier.kind === SyntaxKind.StaticKeyword) hasSeenStatic = true;
- if (modifier.kind === SyntaxKind.ReadonlyKeyword) {
- hasReadonly = true;
- }
list = append(list, modifier);
}
- if (shouldAddReadonly && !hasReadonly) {
- const readonlyModifier = finishVirtualNode(factory.createToken(SyntaxKind.ReadonlyKeyword));
- list = append(list, readonlyModifier);
- }
return list && createNodeArray(list, pos);
}
@@ -8594,12 +8569,8 @@ namespace Parser {
const hasJSDoc = hasPrecedingJSDocComment();
const decorators = parseDecorators();
- /*
- * shouldAddReadonly adds readonly modifier when the element in struct has the Param decorator
- * and doesn't have Once decorator.
- */
- const shouldAddReadonly = inStructContext() && hasParamAndNoOnceDecorator(decorators);
- const modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true, /*stopOnStartOfClassStaticBlock*/ true, shouldAddReadonly);
+
+ const modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true, /*stopOnStartOfClassStaticBlock*/ true);
if (token() === SyntaxKind.StaticKeyword && lookAhead(nextTokenIsOpenBrace)) {
return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers);
}
--
Gitee
From 98f2cb2e981e0af885b63c89567213f16c9043db Mon Sep 17 00:00:00 2001
From: zju_wyx <22125041@zju.edu.cn>
Date: Thu, 24 Jul 2025 19:17:37 +0800
Subject: [PATCH 05/10] fix overload constructor
Signed-off-by: zju_wyx <22125041@zju.edu.cn>
Change-Id: I60380037cb5896d10bd46526d3b96dd6ebd968d2
---
lib/tsc.js | 2 +-
lib/tsserver.js | 2 +-
lib/tsserverlibrary.js | 2 +-
lib/typescript.js | 2 +-
src/compiler/checker.ts | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/tsc.js b/lib/tsc.js
index 0831d01824..a990931fee 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -45234,7 +45234,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const declaration = (_a2 = result.declarations) == null ? void 0 : _a2.find(
- (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || d.kind === 272 /* EnumDeclaration */
+ (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || isOverloadDeclaration(d) || d.kind === 272 /* EnumDeclaration */
);
if (declaration === void 0)
return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");
diff --git a/lib/tsserver.js b/lib/tsserver.js
index 5ed42e7c27..dd4638d608 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -47770,7 +47770,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const declaration = (_a2 = result.declarations) == null ? void 0 : _a2.find(
- (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || d.kind === 272 /* EnumDeclaration */
+ (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || isOverloadDeclaration(d) || d.kind === 272 /* EnumDeclaration */
);
if (declaration === void 0)
return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index 31ccd0b046..768e4ed84a 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -47672,7 +47672,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const declaration = (_a2 = result.declarations) == null ? void 0 : _a2.find(
- (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || d.kind === 272 /* EnumDeclaration */
+ (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || isOverloadDeclaration(d) || d.kind === 272 /* EnumDeclaration */
);
if (declaration === void 0)
return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");
diff --git a/lib/typescript.js b/lib/typescript.js
index 20c5a59d94..232a1ec000 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -47830,7 +47830,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return;
}
const declaration = (_a2 = result.declarations) == null ? void 0 : _a2.find(
- (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || d.kind === 272 /* EnumDeclaration */
+ (d) => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || isOverloadDeclaration(d) || d.kind === 272 /* EnumDeclaration */
);
if (declaration === void 0)
return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index 5c89d8244e..5416baccab 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -3784,7 +3784,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
}
// Block-scoped variables cannot be used before their definition
const declaration = result.declarations?.find(
- d => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || (d.kind === SyntaxKind.EnumDeclaration));
+ d => isBlockOrCatchScoped(d) || isClassLike(d) || isAnnotationDeclaration(d) || ts.isOverloadDeclaration(d) || (d.kind === SyntaxKind.EnumDeclaration));
if (declaration === undefined) return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");
--
Gitee
From 6998d17d12ca8f90b06c5a0dc4594df100f42ae0 Mon Sep 17 00:00:00 2001
From: zju_wyx <22125041@zju.edu.cn>
Date: Fri, 25 Jul 2025 15:27:34 +0800
Subject: [PATCH 06/10] support constructor with name
Signed-off-by: zju_wyx <22125041@zju.edu.cn>
Change-Id: I34e02e80d01235ea5377e27688517915740b3016
---
lib/tsc.js | 56 ++++++++----
lib/tsserver.js | 89 ++++++++++++-------
lib/tsserverlibrary.d.ts | 9 +-
lib/tsserverlibrary.js | 89 ++++++++++++-------
lib/typescript.d.ts | 9 +-
lib/typescript.js | 89 ++++++++++++-------
lib/typingsInstaller.js | 28 ++++--
src/compiler/checker.ts | 5 +-
src/compiler/emitter.ts | 4 +
src/compiler/factory/nodeFactory.ts | 12 +--
src/compiler/parser.ts | 12 ++-
src/compiler/transformers/classFields.ts | 5 +-
src/compiler/transformers/declarations.ts | 3 +-
src/compiler/transformers/es2017.ts | 3 +-
src/compiler/transformers/es2018.ts | 3 +-
src/compiler/transformers/legacyDecorators.ts | 3 +-
src/compiler/transformers/ts.ts | 6 +-
src/compiler/types.ts | 5 +-
src/compiler/visitorPublic.ts | 3 +-
.../4.8/mergeDecoratorsAndModifiers.ts | 40 +++++----
.../codefixes/convertFunctionToEs6Class.ts | 4 +-
src/services/navigationBar.ts | 4 +-
.../convertOverloadListToSingleSignature.ts | 3 +-
.../OverloadDeclarationInNameSpace4.js | 24 +++++
.../OverloadDeclarationInNameSpace4.symbols | 17 ++++
.../OverloadDeclarationInNameSpace4.types | 18 ++++
.../OverloadDeclarationInTopLevel4.js | 20 +++++
.../OverloadDeclarationInTopLevel4.symbols | 13 +++
.../OverloadDeclarationInTopLevel4.types | 14 +++
.../reference/api/tsserverlibrary.d.ts | 9 +-
tests/baselines/reference/api/typescript.d.ts | 9 +-
.../OverloadDeclarationInNameSpace4.ets | 9 ++
.../OverloadDeclarationInTopLevel4.ets | 7 ++
33 files changed, 442 insertions(+), 182 deletions(-)
create mode 100644 tests/baselines/reference/OverloadDeclarationInNameSpace4.js
create mode 100644 tests/baselines/reference/OverloadDeclarationInNameSpace4.symbols
create mode 100644 tests/baselines/reference/OverloadDeclarationInNameSpace4.types
create mode 100644 tests/baselines/reference/OverloadDeclarationInTopLevel4.js
create mode 100644 tests/baselines/reference/OverloadDeclarationInTopLevel4.symbols
create mode 100644 tests/baselines/reference/OverloadDeclarationInTopLevel4.types
create mode 100644 tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace4.ets
create mode 100644 tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel4.ets
diff --git a/lib/tsc.js b/lib/tsc.js
index a990931fee..22982b5e02 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -19893,11 +19893,11 @@ function createNodeFactory(flags, baseFactory2) {
}
return update(updated, original);
}
- function createConstructorDeclaration(modifiers, parameters, body) {
+ function createConstructorDeclaration(modifiers, parameters, body, name) {
const node = createBaseFunctionLikeDeclaration(
178 /* Constructor */,
modifiers,
- void 0,
+ name,
void 0,
parameters,
void 0,
@@ -19909,8 +19909,8 @@ function createNodeFactory(flags, baseFactory2) {
node.type = void 0;
return node;
}
- function updateConstructorDeclaration(node, modifiers, parameters, body) {
- return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body), node) : node;
+ function updateConstructorDeclaration(node, modifiers, parameters, body, name) {
+ return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body, name), node) : node;
}
function finishUpdateConstructorDeclaration(updated, original) {
if (updated !== original) {
@@ -22604,7 +22604,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray(array) : void 0;
@@ -30916,11 +30916,15 @@ var Parser;
function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) {
return tryParse(() => {
if (parseConstructorName()) {
+ let name = void 0;
+ if (lookAhead(() => isIdentifier2())) {
+ name = parseIdentifier();
+ }
const typeParameters = parseTypeParameters();
const parameters = parseParameters(0 /* None */);
const type = parseReturnType(58 /* ColonToken */, false);
const body = parseFunctionBlockOrSemicolon(0 /* None */, Diagnostics.or_expected);
- const node = factory2.createConstructorDeclaration(modifiers, parameters, body);
+ const node = factory2.createConstructorDeclaration(modifiers, parameters, body, name);
node.illegalDecorators = decorators;
node.typeParameters = typeParameters;
node.type = type;
@@ -31096,6 +31100,9 @@ var Parser;
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
+ if (token() === 136 /* ConstructorKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
+ return true;
+ }
while (isModifierKind(token())) {
idToken = token();
if (isClassMemberModifier(idToken)) {
@@ -31526,7 +31533,7 @@ var Parser;
)
);
const emptyBody = finishVirtualNode(factory2.createBlock(createNodeArray([], 0, 0)));
- const virtualConstructor = factory2.createConstructorDeclaration(void 0, createNodeArray(parameters, 0, 0), emptyBody);
+ const virtualConstructor = factory2.createConstructorDeclaration(void 0, createNodeArray(parameters, 0, 0), emptyBody, void 0);
virtualStructMembers.unshift(finishVirtualNode(virtualConstructor, pos, pos));
return createNodeArray(virtualStructMembers, structMembers.pos);
}
@@ -47982,7 +47989,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const flags = modifiersToFlags(modifiers);
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
}
- const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
+ const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
if (typeArguments) {
node.typeArguments = factory.createNodeArray(typeArguments);
}
@@ -49343,7 +49350,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
(p) => serializePropertySymbolForClass(p, true, staticBaseType)
);
const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */));
- const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 178 /* Constructor */);
+ const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0, void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 178 /* Constructor */);
const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]);
context.enclosingDeclaration = oldEnclosing;
addResult(setTextRange(factory.createClassDeclaration(
@@ -49718,6 +49725,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return [setTextRange(factory.createConstructorDeclaration(
factory.createModifiersFromModifierFlags(privateProtected),
[],
+ void 0,
void 0
), signatures[0].declaration)];
}
@@ -80037,7 +80045,8 @@ var visitEachChildTable = {
node,
nodesVisitor(node.modifiers, visitor, isModifier),
visitParameterList(node.parameters, visitor, context, nodesVisitor),
- visitFunctionBody(node.body, visitor, context, nodeVisitor)
+ visitFunctionBody(node.body, visitor, context, nodeVisitor),
+ nodeVisitor(node.name, visitor, isIdentifier)
);
},
[179 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
@@ -82987,11 +82996,15 @@ function transformTypeScript(context) {
if (!shouldEmitFunctionLikeDeclaration(node)) {
return void 0;
}
+ if (node.name) {
+ return void 0;
+ }
return factory2.updateConstructorDeclaration(
node,
void 0,
visitParameterList(node.parameters, visitor, context),
- transformConstructorBody(node.body, node)
+ transformConstructorBody(node.body, node),
+ void 0
);
}
function transformConstructorBody(body, constructor) {
@@ -84922,7 +84935,7 @@ function transformClassFields(context) {
}
if (constructor) {
Debug.assert(parameters);
- return factory2.updateConstructorDeclaration(constructor, void 0, parameters, body);
+ return factory2.updateConstructorDeclaration(constructor, void 0, parameters, body, constructor.name);
}
return startOnNewLine(
setOriginalNode(
@@ -84930,7 +84943,8 @@ function transformClassFields(context) {
factory2.createConstructorDeclaration(
void 0,
parameters != null ? parameters : [],
- body
+ body,
+ void 0
),
constructor || container
),
@@ -86137,7 +86151,8 @@ function transformLegacyDecorators(context) {
node,
visitNodes2(node.modifiers, modifierVisitor, isModifier),
visitNodes2(node.parameters, visitor, isParameterDeclaration),
- visitNode(node.body, visitor, isBlock)
+ visitNode(node.body, visitor, isBlock),
+ visitNode(node.name, visitor, isIdentifier)
);
}
function finishClassElement(updated, original) {
@@ -86579,7 +86594,8 @@ function transformES2017(context) {
node,
visitNodes2(node.modifiers, visitor, isModifierLike),
visitParameterList(node.parameters, visitor, context),
- transformMethodBody(node)
+ transformMethodBody(node),
+ node.name
);
}
function visitMethodDeclaration(node) {
@@ -87765,7 +87781,8 @@ function transformES2018(context) {
node,
node.modifiers,
visitParameterList(node.parameters, parameterVisitor, context),
- transformFunctionBody(node)
+ transformFunctionBody(node),
+ node.name
);
enclosingFunctionFlags = savedEnclosingFunctionFlags;
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
@@ -97817,7 +97834,8 @@ function transformDeclarations(context) {
const ctor = factory2.createConstructorDeclaration(
ensureModifiers(input),
updateParamsList(input, input.parameters, 0 /* None */),
- void 0
+ void 0,
+ input.name
);
return cleanup(ctor);
}
@@ -100903,6 +100921,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitConstructor(node) {
emitModifiers(node, node.modifiers);
writeKeyword("constructor");
+ if (node.name) {
+ writeSpace();
+ emit(node.name);
+ }
emitSignatureAndBody(node, emitSignatureHead);
}
function emitAccessorDeclaration(node) {
diff --git a/lib/tsserver.js b/lib/tsserver.js
index dd4638d608..76e7c4a6af 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -22587,11 +22587,11 @@ function createNodeFactory(flags, baseFactory2) {
}
return update(updated, original);
}
- function createConstructorDeclaration(modifiers, parameters, body) {
+ function createConstructorDeclaration(modifiers, parameters, body, name) {
const node = createBaseFunctionLikeDeclaration(
178 /* Constructor */,
modifiers,
- void 0,
+ name,
void 0,
parameters,
void 0,
@@ -22603,8 +22603,8 @@ function createNodeFactory(flags, baseFactory2) {
node.type = void 0;
return node;
}
- function updateConstructorDeclaration(node, modifiers, parameters, body) {
- return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body), node) : node;
+ function updateConstructorDeclaration(node, modifiers, parameters, body, name) {
+ return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body, name), node) : node;
}
function finishUpdateConstructorDeclaration(updated, original) {
if (updated !== original) {
@@ -25298,7 +25298,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray2(array) : void 0;
@@ -33595,11 +33595,15 @@ var Parser;
function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) {
return tryParse(() => {
if (parseConstructorName()) {
+ let name = void 0;
+ if (lookAhead(() => isIdentifier2())) {
+ name = parseIdentifier();
+ }
const typeParameters = parseTypeParameters();
const parameters = parseParameters(0 /* None */);
const type = parseReturnType(58 /* ColonToken */, false);
const body = parseFunctionBlockOrSemicolon(0 /* None */, Diagnostics.or_expected);
- const node = factory2.createConstructorDeclaration(modifiers, parameters, body);
+ const node = factory2.createConstructorDeclaration(modifiers, parameters, body, name);
node.illegalDecorators = decorators;
node.typeParameters = typeParameters;
node.type = type;
@@ -33775,6 +33779,9 @@ var Parser;
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
+ if (token() === 136 /* ConstructorKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
+ return true;
+ }
while (isModifierKind(token())) {
idToken = token();
if (isClassMemberModifier(idToken)) {
@@ -34205,7 +34212,7 @@ var Parser;
)
);
const emptyBody = finishVirtualNode(factory2.createBlock(createNodeArray2([], 0, 0)));
- const virtualConstructor = factory2.createConstructorDeclaration(void 0, createNodeArray2(parameters, 0, 0), emptyBody);
+ const virtualConstructor = factory2.createConstructorDeclaration(void 0, createNodeArray2(parameters, 0, 0), emptyBody, void 0);
virtualStructMembers.unshift(finishVirtualNode(virtualConstructor, pos, pos));
return createNodeArray2(virtualStructMembers, structMembers.pos);
}
@@ -50518,7 +50525,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const flags = modifiersToFlags(modifiers);
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
}
- const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
+ const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
if (typeArguments) {
node.typeArguments = factory.createNodeArray(typeArguments);
}
@@ -51879,7 +51886,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
(p) => serializePropertySymbolForClass(p, true, staticBaseType)
);
const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */));
- const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 178 /* Constructor */);
+ const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0, void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 178 /* Constructor */);
const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]);
context.enclosingDeclaration = oldEnclosing;
addResult(setTextRange(factory.createClassDeclaration(
@@ -52254,6 +52261,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return [setTextRange(factory.createConstructorDeclaration(
factory.createModifiersFromModifierFlags(privateProtected),
[],
+ void 0,
void 0
), signatures[0].declaration)];
}
@@ -82573,7 +82581,8 @@ var visitEachChildTable = {
node,
nodesVisitor(node.modifiers, visitor, isModifier),
visitParameterList(node.parameters, visitor, context, nodesVisitor),
- visitFunctionBody(node.body, visitor, context, nodeVisitor)
+ visitFunctionBody(node.body, visitor, context, nodeVisitor),
+ nodeVisitor(node.name, visitor, isIdentifier)
);
},
[179 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
@@ -85502,11 +85511,15 @@ function transformTypeScript(context) {
if (!shouldEmitFunctionLikeDeclaration(node)) {
return void 0;
}
+ if (node.name) {
+ return void 0;
+ }
return factory2.updateConstructorDeclaration(
node,
void 0,
visitParameterList(node.parameters, visitor, context),
- transformConstructorBody(node.body, node)
+ transformConstructorBody(node.body, node),
+ void 0
);
}
function transformConstructorBody(body, constructor) {
@@ -87424,7 +87437,7 @@ function transformClassFields(context) {
}
if (constructor) {
Debug.assert(parameters);
- return factory2.updateConstructorDeclaration(constructor, void 0, parameters, body);
+ return factory2.updateConstructorDeclaration(constructor, void 0, parameters, body, constructor.name);
}
return startOnNewLine(
setOriginalNode(
@@ -87432,7 +87445,8 @@ function transformClassFields(context) {
factory2.createConstructorDeclaration(
void 0,
parameters != null ? parameters : [],
- body
+ body,
+ void 0
),
constructor || container
),
@@ -88639,7 +88653,8 @@ function transformLegacyDecorators(context) {
node,
visitNodes2(node.modifiers, modifierVisitor, isModifier),
visitNodes2(node.parameters, visitor, isParameterDeclaration),
- visitNode(node.body, visitor, isBlock)
+ visitNode(node.body, visitor, isBlock),
+ visitNode(node.name, visitor, isIdentifier)
);
}
function finishClassElement(updated, original) {
@@ -89072,7 +89087,8 @@ function transformES2017(context) {
node,
visitNodes2(node.modifiers, visitor, isModifierLike),
visitParameterList(node.parameters, visitor, context),
- transformMethodBody(node)
+ transformMethodBody(node),
+ node.name
);
}
function visitMethodDeclaration(node) {
@@ -90238,7 +90254,8 @@ function transformES2018(context) {
node,
node.modifiers,
visitParameterList(node.parameters, parameterVisitor, context),
- transformFunctionBody2(node)
+ transformFunctionBody2(node),
+ node.name
);
enclosingFunctionFlags = savedEnclosingFunctionFlags;
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
@@ -100169,7 +100186,8 @@ function transformDeclarations(context) {
const ctor = factory2.createConstructorDeclaration(
ensureModifiers(input),
updateParamsList(input, input.parameters, 0 /* None */),
- void 0
+ void 0,
+ input.name
);
return cleanup(ctor);
}
@@ -103235,6 +103253,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitConstructor(node) {
emitModifiers(node, node.modifiers);
writeKeyword("constructor");
+ if (node.name) {
+ writeSpace();
+ emit(node.name);
+ }
emitSignatureAndBody(node, emitSignatureHead);
}
function emitAccessorDeclaration(node) {
@@ -125390,7 +125412,7 @@ function tryMergeEs5Class(a, b, bIndex, parent2) {
const ctorFunction = isPossibleConstructor(a.node) ? a.node : isPossibleConstructor(b.node) ? b.node : void 0;
if (ctorFunction !== void 0) {
const ctorNode = setTextRange(
- factory.createConstructorDeclaration(void 0, [], void 0),
+ factory.createConstructorDeclaration(void 0, [], void 0, void 0),
ctorFunction
);
const ctor = emptyNavigationBarNode(ctorNode);
@@ -130895,7 +130917,7 @@ function doChange2(changes, sourceFile, position, checker, preferences, compiler
}
const memberElements = createClassElementsFromSymbol(node.symbol);
if (initializer.body) {
- memberElements.unshift(factory.createConstructorDeclaration(void 0, initializer.parameters, initializer.body));
+ memberElements.unshift(factory.createConstructorDeclaration(void 0, initializer.parameters, initializer.body, void 0));
}
const modifiers = getModifierKindFromSource(node.parent.parent, 94 /* ExportKeyword */);
const cls = factory.createClassDeclaration(
@@ -130910,7 +130932,7 @@ function doChange2(changes, sourceFile, position, checker, preferences, compiler
function createClassFromFunction(node) {
const memberElements = createClassElementsFromSymbol(ctorSymbol);
if (node.body) {
- memberElements.unshift(factory.createConstructorDeclaration(void 0, node.parameters, node.body));
+ memberElements.unshift(factory.createConstructorDeclaration(void 0, node.parameters, node.body, void 0));
}
const modifiers = getModifierKindFromSource(node, 94 /* ExportKeyword */);
const cls = factory.createClassDeclaration(
@@ -147519,7 +147541,8 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
lastDeclaration,
lastDeclaration.modifiers,
getNewParametersForCombinedSignature(signatureDecls),
- lastDeclaration.body
+ lastDeclaration.body,
+ lastDeclaration.name
);
break;
}
@@ -156397,28 +156420,28 @@ function patchNodeFactory4(factory2) {
1: MUST_MERGE
}).finish();
factory2.createConstructorDeclaration = buildOverload("createConstructorDeclaration").overload({
- 0(modifiers, parameters, body) {
- return createConstructorDeclaration(modifiers, parameters, body);
+ 0(modifiers, parameters, body, name) {
+ return createConstructorDeclaration(modifiers, parameters, body, name);
},
- 1(_decorators, modifiers, parameters, body) {
- return createConstructorDeclaration(modifiers, parameters, body);
+ 1(_decorators, modifiers, parameters, body, name) {
+ return createConstructorDeclaration(modifiers, parameters, body, name);
}
}).bind({
- 0: ([modifiers, parameters, body, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)),
- 1: ([decorators, modifiers, parameters, body]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body))
+ 0: ([modifiers, parameters, body, name, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)) && (name === void 0 || !isArray(name)),
+ 1: ([decorators, modifiers, parameters, body, name]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) && (name === void 0 || !isArray(name))
}).deprecate({
1: DISALLOW_DECORATORS
}).finish();
factory2.updateConstructorDeclaration = buildOverload("updateConstructorDeclaration").overload({
- 0(node, modifiers, parameters, body) {
- return updateConstructorDeclaration(node, modifiers, parameters, body);
+ 0(node, modifiers, parameters, body, name) {
+ return updateConstructorDeclaration(node, modifiers, parameters, body, name);
},
- 1(node, _decorators, modifiers, parameters, body) {
- return updateConstructorDeclaration(node, modifiers, parameters, body);
+ 1(node, _decorators, modifiers, parameters, body, name) {
+ return updateConstructorDeclaration(node, modifiers, parameters, body, name);
}
}).bind({
- 0: ([, modifiers, parameters, body, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)),
- 1: ([, decorators, modifiers, parameters, body]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body))
+ 0: ([, modifiers, parameters, body, name, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)) && (name === void 0 || !isArray(name)),
+ 1: ([, decorators, modifiers, parameters, body, name]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) && (name === void 0 || !isArray(name))
}).deprecate({
1: DISALLOW_DECORATORS
}).finish();
diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts
index 99f934254c..554204ead4 100644
--- a/lib/tsserverlibrary.d.ts
+++ b/lib/tsserverlibrary.d.ts
@@ -5002,6 +5002,7 @@ declare namespace ts {
readonly parent: ClassLikeDeclaration;
readonly modifiers?: NodeArray | undefined;
readonly body?: FunctionBody | undefined;
+ readonly name?: Identifier;
}
/** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
interface SemicolonClassElement extends ClassElement {
@@ -7920,8 +7921,8 @@ declare namespace ts {
updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature;
createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
updateMethodDeclaration(node: MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
- createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
- updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
+ updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
createGetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
updateGetAccessorDeclaration(node: GetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
createSetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
@@ -8373,11 +8374,11 @@ declare namespace ts {
/**
* @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter.
*/
- createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
/**
* @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter.
*/
- updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
/**
* @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
*/
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index 768e4ed84a..b92508948f 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -22489,11 +22489,11 @@ function createNodeFactory(flags, baseFactory2) {
}
return update(updated, original);
}
- function createConstructorDeclaration(modifiers, parameters, body) {
+ function createConstructorDeclaration(modifiers, parameters, body, name) {
const node = createBaseFunctionLikeDeclaration(
178 /* Constructor */,
modifiers,
- void 0,
+ name,
void 0,
parameters,
void 0,
@@ -22505,8 +22505,8 @@ function createNodeFactory(flags, baseFactory2) {
node.type = void 0;
return node;
}
- function updateConstructorDeclaration(node, modifiers, parameters, body) {
- return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body), node) : node;
+ function updateConstructorDeclaration(node, modifiers, parameters, body, name) {
+ return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body, name), node) : node;
}
function finishUpdateConstructorDeclaration(updated, original) {
if (updated !== original) {
@@ -25200,7 +25200,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray2(array) : void 0;
@@ -33497,11 +33497,15 @@ var Parser;
function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) {
return tryParse(() => {
if (parseConstructorName()) {
+ let name = void 0;
+ if (lookAhead(() => isIdentifier2())) {
+ name = parseIdentifier();
+ }
const typeParameters = parseTypeParameters();
const parameters = parseParameters(0 /* None */);
const type = parseReturnType(58 /* ColonToken */, false);
const body = parseFunctionBlockOrSemicolon(0 /* None */, Diagnostics.or_expected);
- const node = factory2.createConstructorDeclaration(modifiers, parameters, body);
+ const node = factory2.createConstructorDeclaration(modifiers, parameters, body, name);
node.illegalDecorators = decorators;
node.typeParameters = typeParameters;
node.type = type;
@@ -33677,6 +33681,9 @@ var Parser;
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
+ if (token() === 136 /* ConstructorKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
+ return true;
+ }
while (isModifierKind(token())) {
idToken = token();
if (isClassMemberModifier(idToken)) {
@@ -34107,7 +34114,7 @@ var Parser;
)
);
const emptyBody = finishVirtualNode(factory2.createBlock(createNodeArray2([], 0, 0)));
- const virtualConstructor = factory2.createConstructorDeclaration(void 0, createNodeArray2(parameters, 0, 0), emptyBody);
+ const virtualConstructor = factory2.createConstructorDeclaration(void 0, createNodeArray2(parameters, 0, 0), emptyBody, void 0);
virtualStructMembers.unshift(finishVirtualNode(virtualConstructor, pos, pos));
return createNodeArray2(virtualStructMembers, structMembers.pos);
}
@@ -50420,7 +50427,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const flags = modifiersToFlags(modifiers);
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
}
- const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
+ const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
if (typeArguments) {
node.typeArguments = factory.createNodeArray(typeArguments);
}
@@ -51781,7 +51788,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
(p) => serializePropertySymbolForClass(p, true, staticBaseType)
);
const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */));
- const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 178 /* Constructor */);
+ const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0, void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 178 /* Constructor */);
const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]);
context.enclosingDeclaration = oldEnclosing;
addResult(setTextRange(factory.createClassDeclaration(
@@ -52156,6 +52163,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return [setTextRange(factory.createConstructorDeclaration(
factory.createModifiersFromModifierFlags(privateProtected),
[],
+ void 0,
void 0
), signatures[0].declaration)];
}
@@ -82475,7 +82483,8 @@ var visitEachChildTable = {
node,
nodesVisitor(node.modifiers, visitor, isModifier),
visitParameterList(node.parameters, visitor, context, nodesVisitor),
- visitFunctionBody(node.body, visitor, context, nodeVisitor)
+ visitFunctionBody(node.body, visitor, context, nodeVisitor),
+ nodeVisitor(node.name, visitor, isIdentifier)
);
},
[179 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
@@ -85404,11 +85413,15 @@ function transformTypeScript(context) {
if (!shouldEmitFunctionLikeDeclaration(node)) {
return void 0;
}
+ if (node.name) {
+ return void 0;
+ }
return factory2.updateConstructorDeclaration(
node,
void 0,
visitParameterList(node.parameters, visitor, context),
- transformConstructorBody(node.body, node)
+ transformConstructorBody(node.body, node),
+ void 0
);
}
function transformConstructorBody(body, constructor) {
@@ -87326,7 +87339,7 @@ function transformClassFields(context) {
}
if (constructor) {
Debug.assert(parameters);
- return factory2.updateConstructorDeclaration(constructor, void 0, parameters, body);
+ return factory2.updateConstructorDeclaration(constructor, void 0, parameters, body, constructor.name);
}
return startOnNewLine(
setOriginalNode(
@@ -87334,7 +87347,8 @@ function transformClassFields(context) {
factory2.createConstructorDeclaration(
void 0,
parameters != null ? parameters : [],
- body
+ body,
+ void 0
),
constructor || container
),
@@ -88541,7 +88555,8 @@ function transformLegacyDecorators(context) {
node,
visitNodes2(node.modifiers, modifierVisitor, isModifier),
visitNodes2(node.parameters, visitor, isParameterDeclaration),
- visitNode(node.body, visitor, isBlock)
+ visitNode(node.body, visitor, isBlock),
+ visitNode(node.name, visitor, isIdentifier)
);
}
function finishClassElement(updated, original) {
@@ -88974,7 +88989,8 @@ function transformES2017(context) {
node,
visitNodes2(node.modifiers, visitor, isModifierLike),
visitParameterList(node.parameters, visitor, context),
- transformMethodBody(node)
+ transformMethodBody(node),
+ node.name
);
}
function visitMethodDeclaration(node) {
@@ -90140,7 +90156,8 @@ function transformES2018(context) {
node,
node.modifiers,
visitParameterList(node.parameters, parameterVisitor, context),
- transformFunctionBody2(node)
+ transformFunctionBody2(node),
+ node.name
);
enclosingFunctionFlags = savedEnclosingFunctionFlags;
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
@@ -100071,7 +100088,8 @@ function transformDeclarations(context) {
const ctor = factory2.createConstructorDeclaration(
ensureModifiers(input),
updateParamsList(input, input.parameters, 0 /* None */),
- void 0
+ void 0,
+ input.name
);
return cleanup(ctor);
}
@@ -103137,6 +103155,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitConstructor(node) {
emitModifiers(node, node.modifiers);
writeKeyword("constructor");
+ if (node.name) {
+ writeSpace();
+ emit(node.name);
+ }
emitSignatureAndBody(node, emitSignatureHead);
}
function emitAccessorDeclaration(node) {
@@ -122611,7 +122633,7 @@ function tryMergeEs5Class(a, b, bIndex, parent2) {
const ctorFunction = isPossibleConstructor(a.node) ? a.node : isPossibleConstructor(b.node) ? b.node : void 0;
if (ctorFunction !== void 0) {
const ctorNode = setTextRange(
- factory.createConstructorDeclaration(void 0, [], void 0),
+ factory.createConstructorDeclaration(void 0, [], void 0, void 0),
ctorFunction
);
const ctor = emptyNavigationBarNode(ctorNode);
@@ -128116,7 +128138,7 @@ function doChange2(changes, sourceFile, position, checker, preferences, compiler
}
const memberElements = createClassElementsFromSymbol(node.symbol);
if (initializer.body) {
- memberElements.unshift(factory.createConstructorDeclaration(void 0, initializer.parameters, initializer.body));
+ memberElements.unshift(factory.createConstructorDeclaration(void 0, initializer.parameters, initializer.body, void 0));
}
const modifiers = getModifierKindFromSource(node.parent.parent, 94 /* ExportKeyword */);
const cls = factory.createClassDeclaration(
@@ -128131,7 +128153,7 @@ function doChange2(changes, sourceFile, position, checker, preferences, compiler
function createClassFromFunction(node) {
const memberElements = createClassElementsFromSymbol(ctorSymbol);
if (node.body) {
- memberElements.unshift(factory.createConstructorDeclaration(void 0, node.parameters, node.body));
+ memberElements.unshift(factory.createConstructorDeclaration(void 0, node.parameters, node.body, void 0));
}
const modifiers = getModifierKindFromSource(node, 94 /* ExportKeyword */);
const cls = factory.createClassDeclaration(
@@ -144740,7 +144762,8 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
lastDeclaration,
lastDeclaration.modifiers,
getNewParametersForCombinedSignature(signatureDecls),
- lastDeclaration.body
+ lastDeclaration.body,
+ lastDeclaration.name
);
break;
}
@@ -156208,28 +156231,28 @@ function patchNodeFactory4(factory2) {
1: MUST_MERGE
}).finish();
factory2.createConstructorDeclaration = buildOverload("createConstructorDeclaration").overload({
- 0(modifiers, parameters, body) {
- return createConstructorDeclaration(modifiers, parameters, body);
+ 0(modifiers, parameters, body, name) {
+ return createConstructorDeclaration(modifiers, parameters, body, name);
},
- 1(_decorators, modifiers, parameters, body) {
- return createConstructorDeclaration(modifiers, parameters, body);
+ 1(_decorators, modifiers, parameters, body, name) {
+ return createConstructorDeclaration(modifiers, parameters, body, name);
}
}).bind({
- 0: ([modifiers, parameters, body, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)),
- 1: ([decorators, modifiers, parameters, body]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body))
+ 0: ([modifiers, parameters, body, name, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)) && (name === void 0 || !isArray(name)),
+ 1: ([decorators, modifiers, parameters, body, name]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) && (name === void 0 || !isArray(name))
}).deprecate({
1: DISALLOW_DECORATORS
}).finish();
factory2.updateConstructorDeclaration = buildOverload("updateConstructorDeclaration").overload({
- 0(node, modifiers, parameters, body) {
- return updateConstructorDeclaration(node, modifiers, parameters, body);
+ 0(node, modifiers, parameters, body, name) {
+ return updateConstructorDeclaration(node, modifiers, parameters, body, name);
},
- 1(node, _decorators, modifiers, parameters, body) {
- return updateConstructorDeclaration(node, modifiers, parameters, body);
+ 1(node, _decorators, modifiers, parameters, body, name) {
+ return updateConstructorDeclaration(node, modifiers, parameters, body, name);
}
}).bind({
- 0: ([, modifiers, parameters, body, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)),
- 1: ([, decorators, modifiers, parameters, body]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body))
+ 0: ([, modifiers, parameters, body, name, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)) && (name === void 0 || !isArray(name)),
+ 1: ([, decorators, modifiers, parameters, body, name]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) && (name === void 0 || !isArray(name))
}).deprecate({
1: DISALLOW_DECORATORS
}).finish();
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
index 4d30f91028..3482f90040 100644
--- a/lib/typescript.d.ts
+++ b/lib/typescript.d.ts
@@ -999,6 +999,7 @@ declare namespace ts {
readonly parent: ClassLikeDeclaration;
readonly modifiers?: NodeArray | undefined;
readonly body?: FunctionBody | undefined;
+ readonly name?: Identifier;
}
/** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
interface SemicolonClassElement extends ClassElement {
@@ -3917,8 +3918,8 @@ declare namespace ts {
updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature;
createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
updateMethodDeclaration(node: MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
- createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
- updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
+ updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
createGetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
updateGetAccessorDeclaration(node: GetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
createSetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
@@ -4370,11 +4371,11 @@ declare namespace ts {
/**
* @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter.
*/
- createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
/**
* @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter.
*/
- updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
/**
* @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
*/
diff --git a/lib/typescript.js b/lib/typescript.js
index 232a1ec000..ba6ff8001a 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -22489,11 +22489,11 @@ function createNodeFactory(flags, baseFactory2) {
}
return update(updated, original);
}
- function createConstructorDeclaration(modifiers, parameters, body) {
+ function createConstructorDeclaration(modifiers, parameters, body, name) {
const node = createBaseFunctionLikeDeclaration(
178 /* Constructor */,
modifiers,
- void 0,
+ name,
void 0,
parameters,
void 0,
@@ -22505,8 +22505,8 @@ function createNodeFactory(flags, baseFactory2) {
node.type = void 0;
return node;
}
- function updateConstructorDeclaration(node, modifiers, parameters, body) {
- return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body), node) : node;
+ function updateConstructorDeclaration(node, modifiers, parameters, body, name) {
+ return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body, name), node) : node;
}
function finishUpdateConstructorDeclaration(updated, original) {
if (updated !== original) {
@@ -25200,7 +25200,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray2(array) : void 0;
@@ -33512,11 +33512,15 @@ var Parser;
function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) {
return tryParse(() => {
if (parseConstructorName()) {
+ let name = void 0;
+ if (lookAhead(() => isIdentifier2())) {
+ name = parseIdentifier();
+ }
const typeParameters = parseTypeParameters();
const parameters = parseParameters(0 /* None */);
const type = parseReturnType(58 /* ColonToken */, false);
const body = parseFunctionBlockOrSemicolon(0 /* None */, Diagnostics.or_expected);
- const node = factory2.createConstructorDeclaration(modifiers, parameters, body);
+ const node = factory2.createConstructorDeclaration(modifiers, parameters, body, name);
node.illegalDecorators = decorators;
node.typeParameters = typeParameters;
node.type = type;
@@ -33692,6 +33696,9 @@ var Parser;
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
+ if (token() === 136 /* ConstructorKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
+ return true;
+ }
while (isModifierKind(token())) {
idToken = token();
if (isClassMemberModifier(idToken)) {
@@ -34122,7 +34129,7 @@ var Parser;
)
);
const emptyBody = finishVirtualNode(factory2.createBlock(createNodeArray2([], 0, 0)));
- const virtualConstructor = factory2.createConstructorDeclaration(void 0, createNodeArray2(parameters, 0, 0), emptyBody);
+ const virtualConstructor = factory2.createConstructorDeclaration(void 0, createNodeArray2(parameters, 0, 0), emptyBody, void 0);
virtualStructMembers.unshift(finishVirtualNode(virtualConstructor, pos, pos));
return createNodeArray2(virtualStructMembers, structMembers.pos);
}
@@ -50578,7 +50585,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const flags = modifiersToFlags(modifiers);
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
}
- const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
+ const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
if (typeArguments) {
node.typeArguments = factory.createNodeArray(typeArguments);
}
@@ -51939,7 +51946,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
(p) => serializePropertySymbolForClass(p, true, staticBaseType)
);
const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */));
- const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 178 /* Constructor */);
+ const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(8 /* Private */), [], void 0, void 0)] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 178 /* Constructor */);
const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]);
context.enclosingDeclaration = oldEnclosing;
addResult(setTextRange(factory.createClassDeclaration(
@@ -52314,6 +52321,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return [setTextRange(factory.createConstructorDeclaration(
factory.createModifiersFromModifierFlags(privateProtected),
[],
+ void 0,
void 0
), signatures[0].declaration)];
}
@@ -82633,7 +82641,8 @@ var visitEachChildTable = {
node,
nodesVisitor(node.modifiers, visitor, isModifier),
visitParameterList(node.parameters, visitor, context, nodesVisitor),
- visitFunctionBody(node.body, visitor, context, nodeVisitor)
+ visitFunctionBody(node.body, visitor, context, nodeVisitor),
+ nodeVisitor(node.name, visitor, isIdentifier)
);
},
[179 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
@@ -85583,11 +85592,15 @@ function transformTypeScript(context) {
if (!shouldEmitFunctionLikeDeclaration(node)) {
return void 0;
}
+ if (node.name) {
+ return void 0;
+ }
return factory2.updateConstructorDeclaration(
node,
void 0,
visitParameterList(node.parameters, visitor, context),
- transformConstructorBody(node.body, node)
+ transformConstructorBody(node.body, node),
+ void 0
);
}
function transformConstructorBody(body, constructor) {
@@ -87518,7 +87531,7 @@ function transformClassFields(context) {
}
if (constructor) {
Debug.assert(parameters);
- return factory2.updateConstructorDeclaration(constructor, void 0, parameters, body);
+ return factory2.updateConstructorDeclaration(constructor, void 0, parameters, body, constructor.name);
}
return startOnNewLine(
setOriginalNode(
@@ -87526,7 +87539,8 @@ function transformClassFields(context) {
factory2.createConstructorDeclaration(
void 0,
parameters != null ? parameters : [],
- body
+ body,
+ void 0
),
constructor || container
),
@@ -88733,7 +88747,8 @@ function transformLegacyDecorators(context) {
node,
visitNodes2(node.modifiers, modifierVisitor, isModifier),
visitNodes2(node.parameters, visitor, isParameterDeclaration),
- visitNode(node.body, visitor, isBlock)
+ visitNode(node.body, visitor, isBlock),
+ visitNode(node.name, visitor, isIdentifier)
);
}
function finishClassElement(updated, original) {
@@ -89175,7 +89190,8 @@ function transformES2017(context) {
node,
visitNodes2(node.modifiers, visitor, isModifierLike),
visitParameterList(node.parameters, visitor, context),
- transformMethodBody(node)
+ transformMethodBody(node),
+ node.name
);
}
function visitMethodDeclaration(node) {
@@ -90361,7 +90377,8 @@ function transformES2018(context) {
node,
node.modifiers,
visitParameterList(node.parameters, parameterVisitor, context),
- transformFunctionBody2(node)
+ transformFunctionBody2(node),
+ node.name
);
enclosingFunctionFlags = savedEnclosingFunctionFlags;
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
@@ -100413,7 +100430,8 @@ function transformDeclarations(context) {
const ctor = factory2.createConstructorDeclaration(
ensureModifiers(input),
updateParamsList(input, input.parameters, 0 /* None */),
- void 0
+ void 0,
+ input.name
);
return cleanup(ctor);
}
@@ -103499,6 +103517,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitConstructor(node) {
emitModifiers(node, node.modifiers);
writeKeyword("constructor");
+ if (node.name) {
+ writeSpace();
+ emit(node.name);
+ }
emitSignatureAndBody(node, emitSignatureHead);
}
function emitAccessorDeclaration(node) {
@@ -123013,7 +123035,7 @@ function tryMergeEs5Class(a, b, bIndex, parent2) {
const ctorFunction = isPossibleConstructor(a.node) ? a.node : isPossibleConstructor(b.node) ? b.node : void 0;
if (ctorFunction !== void 0) {
const ctorNode = setTextRange(
- factory.createConstructorDeclaration(void 0, [], void 0),
+ factory.createConstructorDeclaration(void 0, [], void 0, void 0),
ctorFunction
);
const ctor = emptyNavigationBarNode(ctorNode);
@@ -128518,7 +128540,7 @@ function doChange2(changes, sourceFile, position, checker, preferences, compiler
}
const memberElements = createClassElementsFromSymbol(node.symbol);
if (initializer.body) {
- memberElements.unshift(factory.createConstructorDeclaration(void 0, initializer.parameters, initializer.body));
+ memberElements.unshift(factory.createConstructorDeclaration(void 0, initializer.parameters, initializer.body, void 0));
}
const modifiers = getModifierKindFromSource(node.parent.parent, 94 /* ExportKeyword */);
const cls = factory.createClassDeclaration(
@@ -128533,7 +128555,7 @@ function doChange2(changes, sourceFile, position, checker, preferences, compiler
function createClassFromFunction(node) {
const memberElements = createClassElementsFromSymbol(ctorSymbol);
if (node.body) {
- memberElements.unshift(factory.createConstructorDeclaration(void 0, node.parameters, node.body));
+ memberElements.unshift(factory.createConstructorDeclaration(void 0, node.parameters, node.body, void 0));
}
const modifiers = getModifierKindFromSource(node, 94 /* ExportKeyword */);
const cls = factory.createClassDeclaration(
@@ -145180,7 +145202,8 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context) {
lastDeclaration,
lastDeclaration.modifiers,
getNewParametersForCombinedSignature(signatureDecls),
- lastDeclaration.body
+ lastDeclaration.body,
+ lastDeclaration.name
);
break;
}
@@ -154085,28 +154108,28 @@ function patchNodeFactory4(factory2) {
1: MUST_MERGE
}).finish();
factory2.createConstructorDeclaration = buildOverload("createConstructorDeclaration").overload({
- 0(modifiers, parameters, body) {
- return createConstructorDeclaration(modifiers, parameters, body);
+ 0(modifiers, parameters, body, name) {
+ return createConstructorDeclaration(modifiers, parameters, body, name);
},
- 1(_decorators, modifiers, parameters, body) {
- return createConstructorDeclaration(modifiers, parameters, body);
+ 1(_decorators, modifiers, parameters, body, name) {
+ return createConstructorDeclaration(modifiers, parameters, body, name);
}
}).bind({
- 0: ([modifiers, parameters, body, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)),
- 1: ([decorators, modifiers, parameters, body]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body))
+ 0: ([modifiers, parameters, body, name, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)) && (name === void 0 || !isArray(name)),
+ 1: ([decorators, modifiers, parameters, body, name]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) && (name === void 0 || !isArray(name))
}).deprecate({
1: DISALLOW_DECORATORS
}).finish();
factory2.updateConstructorDeclaration = buildOverload("updateConstructorDeclaration").overload({
- 0(node, modifiers, parameters, body) {
- return updateConstructorDeclaration(node, modifiers, parameters, body);
+ 0(node, modifiers, parameters, body, name) {
+ return updateConstructorDeclaration(node, modifiers, parameters, body, name);
},
- 1(node, _decorators, modifiers, parameters, body) {
- return updateConstructorDeclaration(node, modifiers, parameters, body);
+ 1(node, _decorators, modifiers, parameters, body, name) {
+ return updateConstructorDeclaration(node, modifiers, parameters, body, name);
}
}).bind({
- 0: ([, modifiers, parameters, body, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)),
- 1: ([, decorators, modifiers, parameters, body]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body))
+ 0: ([, modifiers, parameters, body, name, other]) => other === void 0 && (modifiers === void 0 || !some(modifiers, isDecorator)) && (parameters === void 0 || !some(parameters, isModifier)) && (body === void 0 || !isArray(body)) && (name === void 0 || !isArray(name)),
+ 1: ([, decorators, modifiers, parameters, body, name]) => (decorators === void 0 || !some(decorators, isModifier)) && (modifiers === void 0 || !some(modifiers, isParameter)) && (parameters === void 0 || isArray(parameters)) && (body === void 0 || isBlock(body)) && (name === void 0 || !isArray(name))
}).deprecate({
1: DISALLOW_DECORATORS
}).finish();
diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js
index 2664c83f99..2ca0e548e5 100644
--- a/lib/typingsInstaller.js
+++ b/lib/typingsInstaller.js
@@ -14585,11 +14585,11 @@ function createNodeFactory(flags, baseFactory2) {
}
return update(updated, original);
}
- function createConstructorDeclaration(modifiers, parameters, body) {
+ function createConstructorDeclaration(modifiers, parameters, body, name) {
const node = createBaseFunctionLikeDeclaration(
178 /* Constructor */,
modifiers,
- void 0,
+ name,
void 0,
parameters,
void 0,
@@ -14601,8 +14601,8 @@ function createNodeFactory(flags, baseFactory2) {
node.type = void 0;
return node;
}
- function updateConstructorDeclaration(node, modifiers, parameters, body) {
- return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body), node) : node;
+ function updateConstructorDeclaration(node, modifiers, parameters, body, name) {
+ return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body, name), node) : node;
}
function finishUpdateConstructorDeclaration(updated, original) {
if (updated !== original) {
@@ -17296,7 +17296,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray(array) : void 0;
@@ -23747,11 +23747,15 @@ var Parser;
function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) {
return tryParse(() => {
if (parseConstructorName()) {
+ let name = void 0;
+ if (lookAhead(() => isIdentifier2())) {
+ name = parseIdentifier();
+ }
const typeParameters = parseTypeParameters();
const parameters = parseParameters(0 /* None */);
const type = parseReturnType(58 /* ColonToken */, false);
const body = parseFunctionBlockOrSemicolon(0 /* None */, Diagnostics.or_expected);
- const node = factory2.createConstructorDeclaration(modifiers, parameters, body);
+ const node = factory2.createConstructorDeclaration(modifiers, parameters, body, name);
node.illegalDecorators = decorators;
node.typeParameters = typeParameters;
node.type = type;
@@ -23927,6 +23931,9 @@ var Parser;
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
return true;
}
+ if (token() === 136 /* ConstructorKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
+ return true;
+ }
while (isModifierKind(token())) {
idToken = token();
if (isClassMemberModifier(idToken)) {
@@ -24357,7 +24364,7 @@ var Parser;
)
);
const emptyBody = finishVirtualNode(factory2.createBlock(createNodeArray([], 0, 0)));
- const virtualConstructor = factory2.createConstructorDeclaration(void 0, createNodeArray(parameters, 0, 0), emptyBody);
+ const virtualConstructor = factory2.createConstructorDeclaration(void 0, createNodeArray(parameters, 0, 0), emptyBody, void 0);
virtualStructMembers.unshift(finishVirtualNode(virtualConstructor, pos, pos));
return createNodeArray(virtualStructMembers, structMembers.pos);
}
@@ -32926,7 +32933,8 @@ var visitEachChildTable = {
node,
nodesVisitor(node.modifiers, visitor, isModifier),
visitParameterList(node.parameters, visitor, context, nodesVisitor),
- visitFunctionBody(node.body, visitor, context, nodeVisitor)
+ visitFunctionBody(node.body, visitor, context, nodeVisitor),
+ nodeVisitor(node.name, visitor, isIdentifier)
);
},
[179 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
@@ -35320,6 +35328,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitConstructor(node) {
emitModifiers(node, node.modifiers);
writeKeyword("constructor");
+ if (node.name) {
+ writeSpace();
+ emit(node.name);
+ }
emitSignatureAndBody(node, emitSignatureHead);
}
function emitAccessorDeclaration(node) {
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index 5416baccab..64fcb55db9 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -7334,7 +7334,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
kind === SyntaxKind.ConstructSignature ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) :
kind === SyntaxKind.MethodSignature ? factory.createMethodSignature(modifiers, options?.name ?? factory.createIdentifier(""), options?.questionToken, typeParameters, parameters, returnTypeNode) :
kind === SyntaxKind.MethodDeclaration ? factory.createMethodDeclaration(modifiers, /*asteriskToken*/ undefined, options?.name ?? factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) :
- kind === SyntaxKind.Constructor ? factory.createConstructorDeclaration(modifiers, parameters, /*body*/ undefined) :
+ kind === SyntaxKind.Constructor ? factory.createConstructorDeclaration(modifiers, parameters, /*body*/ undefined, undefined) :
kind === SyntaxKind.GetAccessor ? factory.createGetAccessorDeclaration(modifiers, options?.name ?? factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) :
kind === SyntaxKind.SetAccessor ? factory.createSetAccessorDeclaration(modifiers, options?.name ?? factory.createIdentifier(""), parameters, /*body*/ undefined) :
kind === SyntaxKind.IndexSignature ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) :
@@ -9063,7 +9063,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
isInJSFile(symbol.valueDeclaration) &&
!some(getSignaturesOfType(staticType, SignatureKind.Construct));
const constructors = isNonConstructableClassLikeInJsFile ?
- [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(ModifierFlags.Private), [], /*body*/ undefined)] :
+ [factory.createConstructorDeclaration(factory.createModifiersFromModifierFlags(ModifierFlags.Private), [], /*body*/ undefined, undefined)] :
serializeSignatures(SignatureKind.Construct, staticType, staticBaseType, SyntaxKind.Constructor) as ConstructorDeclaration[];
const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]);
context.enclosingDeclaration = oldEnclosing;
@@ -9557,6 +9557,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
factory.createModifiersFromModifierFlags(privateProtected),
/*parameters*/ [],
/*body*/ undefined,
+ undefined
), signatures[0].declaration)];
}
}
diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts
index 32a32be4f4..785aacb34e 100644
--- a/src/compiler/emitter.ts
+++ b/src/compiler/emitter.ts
@@ -2312,6 +2312,10 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
function emitConstructor(node: ConstructorDeclaration) {
emitModifiers(node, node.modifiers);
writeKeyword("constructor");
+ if (node.name) {
+ writeSpace();
+ emit(node.name);
+ }
emitSignatureAndBody(node, emitSignatureHead);
}
diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts
index d5780c51d9..bd369ebfda 100644
--- a/src/compiler/factory/nodeFactory.ts
+++ b/src/compiler/factory/nodeFactory.ts
@@ -1691,12 +1691,13 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
function createConstructorDeclaration(
modifiers: readonly Modifier[] | undefined,
parameters: readonly ParameterDeclaration[],
- body: Block | undefined
+ body: Block | undefined,
+ name: Identifier | undefined
) {
const node = createBaseFunctionLikeDeclaration(
SyntaxKind.Constructor,
modifiers,
- /*name*/ undefined,
+ name,
/*typeParameters*/ undefined,
parameters,
/*type*/ undefined,
@@ -1716,12 +1717,13 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
node: ConstructorDeclaration,
modifiers: readonly Modifier[] | undefined,
parameters: readonly ParameterDeclaration[],
- body: Block | undefined
+ body: Block | undefined,
+ name: Identifier | undefined
) {
return node.modifiers !== modifiers
|| node.parameters !== parameters
|| node.body !== body
- ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body), node)
+ ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body, name), node)
: node;
}
@@ -6640,7 +6642,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) :
isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) :
isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) :
- isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) :
+ isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) :
isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) :
isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) :
isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) :
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index 820cf478ff..bcb5a376f0 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -8133,11 +8133,15 @@ namespace Parser {
function tryParseConstructorDeclaration(pos: number, hasJSDoc: boolean, decorators: NodeArray | undefined, modifiers: NodeArray | undefined): ConstructorDeclaration | undefined {
return tryParse(() => {
if (parseConstructorName()) {
+ let name: Identifier | undefined = undefined;
+ if (lookAhead(() => isIdentifier())) {
+ name = parseIdentifier();
+ }
const typeParameters = parseTypeParameters();
const parameters = parseParameters(SignatureFlags.None);
const type = parseReturnType(SyntaxKind.ColonToken, /*isType*/ false);
const body = parseFunctionBlockOrSemicolon(SignatureFlags.None, Diagnostics.or_expected);
- const node = factory.createConstructorDeclaration(modifiers, parameters, body);
+ const node = factory.createConstructorDeclaration(modifiers, parameters, body, name);
// Attach invalid nodes if they exist so that we can report them in the grammar checker.
(node as Mutable).illegalDecorators = decorators;
@@ -8376,6 +8380,10 @@ namespace Parser {
return true;
}
+ if (token() === SyntaxKind.ConstructorKeyword && lookAhead(() => nextTokenIsIdentifier())) {
+ return true;
+ }
+
// Eat up all modifiers, but hold on to the last one in case it is actually an identifier.
while (isModifierKind(token())) {
idToken = token();
@@ -8900,7 +8908,7 @@ namespace Parser {
)
);
const emptyBody = finishVirtualNode(factory.createBlock(createNodeArray([], 0, 0)));
- const virtualConstructor = factory.createConstructorDeclaration(/*modifier*/ undefined, createNodeArray(parameters, 0, 0), emptyBody);
+ const virtualConstructor = factory.createConstructorDeclaration(/*modifier*/ undefined, createNodeArray(parameters, 0, 0), emptyBody, undefined);
virtualStructMembers.unshift(finishVirtualNode(virtualConstructor, pos, pos));
diff --git a/src/compiler/transformers/classFields.ts b/src/compiler/transformers/classFields.ts
index 51fb30f321..4e75a4cc3a 100644
--- a/src/compiler/transformers/classFields.ts
+++ b/src/compiler/transformers/classFields.ts
@@ -1531,7 +1531,7 @@ export function transformClassFields(context: TransformationContext): (x: Source
if (constructor) {
Debug.assert(parameters);
- return factory.updateConstructorDeclaration(constructor, /*modifiers*/ undefined, parameters, body);
+ return factory.updateConstructorDeclaration(constructor, /*modifiers*/ undefined, parameters, body, constructor.name);
}
return startOnNewLine(
@@ -1540,7 +1540,8 @@ export function transformClassFields(context: TransformationContext): (x: Source
factory.createConstructorDeclaration(
/*modifiers*/ undefined,
parameters ?? [],
- body
+ body,
+ undefined
),
constructor || container
),
diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts
index 8a9cc97447..429126c41a 100644
--- a/src/compiler/transformers/declarations.ts
+++ b/src/compiler/transformers/declarations.ts
@@ -1025,7 +1025,8 @@ export function transformDeclarations(context: TransformationContext) {
const ctor = factory.createConstructorDeclaration(
/*modifiers*/ ensureModifiers(input),
updateParamsList(input, input.parameters, ModifierFlags.None),
- /*body*/ undefined
+ /*body*/ undefined,
+ input.name
);
return cleanup(ctor);
}
diff --git a/src/compiler/transformers/es2017.ts b/src/compiler/transformers/es2017.ts
index d9cb9de299..80c9905033 100644
--- a/src/compiler/transformers/es2017.ts
+++ b/src/compiler/transformers/es2017.ts
@@ -304,7 +304,8 @@ export function transformES2017(context: TransformationContext): (x: SourceFile
node,
visitNodes(node.modifiers, visitor, isModifierLike),
visitParameterList(node.parameters, visitor, context),
- transformMethodBody(node)
+ transformMethodBody(node),
+ node.name
);
}
diff --git a/src/compiler/transformers/es2018.ts b/src/compiler/transformers/es2018.ts
index 195ed4ffe0..461ee0dfb6 100644
--- a/src/compiler/transformers/es2018.ts
+++ b/src/compiler/transformers/es2018.ts
@@ -893,7 +893,8 @@ export function transformES2018(context: TransformationContext): (x: SourceFile
node,
node.modifiers,
visitParameterList(node.parameters, parameterVisitor, context),
- transformFunctionBody(node)
+ transformFunctionBody(node),
+ node.name
);
enclosingFunctionFlags = savedEnclosingFunctionFlags;
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
diff --git a/src/compiler/transformers/legacyDecorators.ts b/src/compiler/transformers/legacyDecorators.ts
index d2cd6744f8..5c571c33a0 100644
--- a/src/compiler/transformers/legacyDecorators.ts
+++ b/src/compiler/transformers/legacyDecorators.ts
@@ -318,7 +318,8 @@ export function transformLegacyDecorators(context: TransformationContext): (x: S
node,
visitNodes(node.modifiers, modifierVisitor, isModifier),
visitNodes(node.parameters, visitor, isParameterDeclaration),
- visitNode(node.body, visitor, isBlock));
+ visitNode(node.body, visitor, isBlock),
+ visitNode(node.name, visitor, isIdentifier));
}
function finishClassElement(updated: ClassElement, original: ClassElement) {
diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts
index 5b22bbd070..6349ba30aa 100644
--- a/src/compiler/transformers/ts.ts
+++ b/src/compiler/transformers/ts.ts
@@ -1109,12 +1109,16 @@ export function transformTypeScript(context: TransformationContext) {
if (!shouldEmitFunctionLikeDeclaration(node)) {
return undefined;
}
+ if (node.name) {
+ return undefined;
+ }
return factory.updateConstructorDeclaration(
node,
/*modifiers*/ undefined,
visitParameterList(node.parameters, visitor, context),
- transformConstructorBody(node.body, node)
+ transformConstructorBody(node.body, node),
+ undefined
);
}
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index 2f129ef32c..4655eef251 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -1906,6 +1906,7 @@ export interface ConstructorDeclaration extends FunctionLikeDeclarationBase, Cla
readonly parent: ClassLikeDeclaration;
readonly modifiers?: NodeArray | undefined;
readonly body?: FunctionBody | undefined;
+ readonly name?: Identifier;
// The following properties are used only to report grammar errors
/** @internal */ readonly illegalDecorators?: NodeArray | undefined; // A constructor cannot have decorators
@@ -8150,8 +8151,8 @@ export interface NodeFactory {
updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature;
createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
updateMethodDeclaration(node: MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
- createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
- updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
+ updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
createGetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
updateGetAccessorDeclaration(node: GetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
createSetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
diff --git a/src/compiler/visitorPublic.ts b/src/compiler/visitorPublic.ts
index c524691747..6721057bdc 100644
--- a/src/compiler/visitorPublic.ts
+++ b/src/compiler/visitorPublic.ts
@@ -541,7 +541,8 @@ const visitEachChildTable: VisitEachChildTable = {
return context.factory.updateConstructorDeclaration(node,
nodesVisitor(node.modifiers, visitor, isModifier),
visitParameterList(node.parameters, visitor, context, nodesVisitor),
- visitFunctionBody(node.body!, visitor, context, nodeVisitor));
+ visitFunctionBody(node.body!, visitor, context, nodeVisitor),
+ nodeVisitor(node.name, visitor, isIdentifier));
},
[SyntaxKind.GetAccessor]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
diff --git a/src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts b/src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts
index 66b163c92d..429f83b2d2 100644
--- a/src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts
+++ b/src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts
@@ -118,11 +118,11 @@ declare module "../../compiler/types" {
/**
* @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter.
*/
- createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
/**
* @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter.
*/
- updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
/**
* @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
*/
@@ -489,26 +489,28 @@ function patchNodeFactory(factory: NodeFactory) {
factory.createConstructorDeclaration = buildOverload("createConstructorDeclaration")
.overload({
- 0(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration {
- return createConstructorDeclaration(modifiers, parameters, body);
+ 0(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration {
+ return createConstructorDeclaration(modifiers, parameters, body, name);
},
- 1(_decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration {
- return createConstructorDeclaration(modifiers, parameters, body);
+ 1(_decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration {
+ return createConstructorDeclaration(modifiers, parameters, body, name);
},
})
.bind({
- 0: ([modifiers, parameters, body, other]) =>
+ 0: ([modifiers, parameters, body, name, other]) =>
(other === undefined) &&
(modifiers === undefined || !some(modifiers, isDecorator)) &&
(parameters === undefined || !some(parameters, isModifier)) &&
- (body === undefined || !isArray(body)),
+ (body === undefined || !isArray(body)) &&
+ (name === undefined || !isArray(name)),
- 1: ([decorators, modifiers, parameters, body]) =>
+ 1: ([decorators, modifiers, parameters, body, name]) =>
(decorators === undefined || !some(decorators, isModifier)) &&
(modifiers === undefined || !some(modifiers, isParameter)) &&
(parameters === undefined || isArray(parameters)) &&
- (body === undefined || isBlock(body)),
+ (body === undefined || isBlock(body)) &&
+ (name === undefined || !isArray(name)),
})
.deprecate({
1: DISALLOW_DECORATORS
@@ -517,26 +519,28 @@ function patchNodeFactory(factory: NodeFactory) {
factory.updateConstructorDeclaration = buildOverload("updateConstructorDeclaration")
.overload({
- 0(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration {
- return updateConstructorDeclaration(node, modifiers, parameters, body);
+ 0(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration {
+ return updateConstructorDeclaration(node, modifiers, parameters, body, name);
},
- 1(node: ConstructorDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration {
- return updateConstructorDeclaration(node, modifiers, parameters, body);
+ 1(node: ConstructorDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration {
+ return updateConstructorDeclaration(node, modifiers, parameters, body, name);
},
})
.bind({
- 0: ([, modifiers, parameters, body, other]) =>
+ 0: ([, modifiers, parameters, body, name, other]) =>
(other === undefined) &&
(modifiers === undefined || !some(modifiers, isDecorator)) &&
(parameters === undefined || !some(parameters, isModifier)) &&
- (body === undefined || !isArray(body)),
+ (body === undefined || !isArray(body)) &&
+ (name === undefined || !isArray(name)),
- 1: ([, decorators, modifiers, parameters, body]) =>
+ 1: ([, decorators, modifiers, parameters, body, name]) =>
(decorators === undefined || !some(decorators, isModifier)) &&
(modifiers === undefined || !some(modifiers, isParameter)) &&
(parameters === undefined || isArray(parameters)) &&
- (body === undefined || isBlock(body)),
+ (body === undefined || isBlock(body)) &&
+ (name === undefined || !isArray(name)),
})
.deprecate({
1: DISALLOW_DECORATORS
diff --git a/src/services/codefixes/convertFunctionToEs6Class.ts b/src/services/codefixes/convertFunctionToEs6Class.ts
index ce585b6a1c..1fe4321d9c 100644
--- a/src/services/codefixes/convertFunctionToEs6Class.ts
+++ b/src/services/codefixes/convertFunctionToEs6Class.ts
@@ -235,7 +235,7 @@ function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, po
const memberElements = createClassElementsFromSymbol(node.symbol);
if (initializer.body) {
- memberElements.unshift(factory.createConstructorDeclaration(/*modifiers*/ undefined, initializer.parameters, initializer.body));
+ memberElements.unshift(factory.createConstructorDeclaration(/*modifiers*/ undefined, initializer.parameters, initializer.body, undefined));
}
const modifiers = getModifierKindFromSource(node.parent.parent, SyntaxKind.ExportKeyword);
@@ -248,7 +248,7 @@ function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, po
function createClassFromFunction(node: FunctionDeclaration | FunctionExpression): ClassDeclaration {
const memberElements = createClassElementsFromSymbol(ctorSymbol);
if (node.body) {
- memberElements.unshift(factory.createConstructorDeclaration(/*modifiers*/ undefined, node.parameters, node.body));
+ memberElements.unshift(factory.createConstructorDeclaration(/*modifiers*/ undefined, node.parameters, node.body, undefined));
}
const modifiers = getModifierKindFromSource(node, SyntaxKind.ExportKeyword);
diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts
index 161f994652..0431eb2b44 100644
--- a/src/services/navigationBar.ts
+++ b/src/services/navigationBar.ts
@@ -570,8 +570,8 @@ function tryMergeEs5Class(a: NavigationBarNode, b: NavigationBarNode, bIndex: nu
if (ctorFunction !== undefined) {
const ctorNode = setTextRange(
- factory.createConstructorDeclaration(/* modifiers */ undefined, [], /* body */ undefined),
- ctorFunction);
+ factory.createConstructorDeclaration(/* modifiers */ undefined, [], /* body */ undefined, undefined),
+ ctorFunction,);
const ctor = emptyNavigationBarNode(ctorNode);
ctor.indent = a.indent + 1;
ctor.children = a.node === ctorFunction ? a.children : b.children;
diff --git a/src/services/refactors/convertOverloadListToSingleSignature.ts b/src/services/refactors/convertOverloadListToSingleSignature.ts
index ebe0535e00..c99cd48fe8 100644
--- a/src/services/refactors/convertOverloadListToSingleSignature.ts
+++ b/src/services/refactors/convertOverloadListToSingleSignature.ts
@@ -84,7 +84,8 @@ function getRefactorEditsToConvertOverloadsToOneSignature(context: RefactorConte
lastDeclaration,
lastDeclaration.modifiers,
getNewParametersForCombinedSignature(signatureDecls),
- lastDeclaration.body
+ lastDeclaration.body,
+ lastDeclaration.name
);
break;
}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace4.js b/tests/baselines/reference/OverloadDeclarationInNameSpace4.js
new file mode 100644
index 0000000000..cacdf43cd3
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace4.js
@@ -0,0 +1,24 @@
+//// [OverloadDeclarationInNameSpace4.ets]
+declare namespace myNS {
+ class BigFloat {
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+ overload constructor {fromString};
+ }
+}
+
+//// [OverloadDeclarationInNameSpace4.js]
+
+
+//// [OverloadDeclarationInNameSpace4.d.ets]
+declare namespace myNS {
+ class BigFloat {
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+ overload constructor {
+ fromString
+ }
+ }
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace4.symbols b/tests/baselines/reference/OverloadDeclarationInNameSpace4.symbols
new file mode 100644
index 0000000000..bf3a40d915
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace4.symbols
@@ -0,0 +1,17 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace4.ets ===
+declare namespace myNS {
+>myNS : Symbol(myNS, Decl(OverloadDeclarationInNameSpace4.ets, 0, 0))
+
+ class BigFloat {
+>BigFloat : Symbol(BigFloat, Decl(OverloadDeclarationInNameSpace4.ets, 0, 24))
+
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+>fromString : Symbol(BigFloat.fromString, Decl(OverloadDeclarationInNameSpace4.ets, 2, 22))
+>s : Symbol(s, Decl(OverloadDeclarationInNameSpace4.ets, 4, 31))
+
+ overload constructor {fromString};
+>fromString : Symbol(constructor.fromString, Decl(OverloadDeclarationInNameSpace4.ets, 5, 30))
+ }
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace4.types b/tests/baselines/reference/OverloadDeclarationInNameSpace4.types
new file mode 100644
index 0000000000..fb7eb19ecf
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace4.types
@@ -0,0 +1,18 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace4.ets ===
+declare namespace myNS {
+>myNS : typeof myNS
+
+ class BigFloat {
+>BigFloat : BigFloat
+
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+>fromString : error
+>s : string
+
+ overload constructor {fromString};
+>constructor : error
+>fromString : any
+ }
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel4.js b/tests/baselines/reference/OverloadDeclarationInTopLevel4.js
new file mode 100644
index 0000000000..0e0ae4171f
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel4.js
@@ -0,0 +1,20 @@
+//// [OverloadDeclarationInTopLevel4.ets]
+declare class BigFloat {
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+ overload constructor {fromString};
+}
+
+//// [OverloadDeclarationInTopLevel4.js]
+
+
+//// [OverloadDeclarationInTopLevel4.d.ets]
+declare class BigFloat {
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+ overload constructor {
+ fromString
+ }
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel4.symbols b/tests/baselines/reference/OverloadDeclarationInTopLevel4.symbols
new file mode 100644
index 0000000000..1da5f282de
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel4.symbols
@@ -0,0 +1,13 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel4.ets ===
+declare class BigFloat {
+>BigFloat : Symbol(BigFloat, Decl(OverloadDeclarationInTopLevel4.ets, 0, 0))
+
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+>fromString : Symbol(BigFloat.fromString, Decl(OverloadDeclarationInTopLevel4.ets, 1, 18))
+>s : Symbol(s, Decl(OverloadDeclarationInTopLevel4.ets, 3, 27))
+
+ overload constructor {fromString};
+>fromString : Symbol(constructor.fromString, Decl(OverloadDeclarationInTopLevel4.ets, 4, 26))
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel4.types b/tests/baselines/reference/OverloadDeclarationInTopLevel4.types
new file mode 100644
index 0000000000..129bf747e2
--- /dev/null
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel4.types
@@ -0,0 +1,14 @@
+=== tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel4.ets ===
+declare class BigFloat {
+>BigFloat : BigFloat
+
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+>fromString : error
+>s : string
+
+ overload constructor {fromString};
+>constructor : error
+>fromString : any
+}
diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts
index 99f934254c..554204ead4 100644
--- a/tests/baselines/reference/api/tsserverlibrary.d.ts
+++ b/tests/baselines/reference/api/tsserverlibrary.d.ts
@@ -5002,6 +5002,7 @@ declare namespace ts {
readonly parent: ClassLikeDeclaration;
readonly modifiers?: NodeArray | undefined;
readonly body?: FunctionBody | undefined;
+ readonly name?: Identifier;
}
/** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
interface SemicolonClassElement extends ClassElement {
@@ -7920,8 +7921,8 @@ declare namespace ts {
updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature;
createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
updateMethodDeclaration(node: MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
- createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
- updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
+ updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
createGetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
updateGetAccessorDeclaration(node: GetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
createSetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
@@ -8373,11 +8374,11 @@ declare namespace ts {
/**
* @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter.
*/
- createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
/**
* @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter.
*/
- updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
/**
* @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
*/
diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts
index 4d30f91028..3482f90040 100644
--- a/tests/baselines/reference/api/typescript.d.ts
+++ b/tests/baselines/reference/api/typescript.d.ts
@@ -999,6 +999,7 @@ declare namespace ts {
readonly parent: ClassLikeDeclaration;
readonly modifiers?: NodeArray | undefined;
readonly body?: FunctionBody | undefined;
+ readonly name?: Identifier;
}
/** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
interface SemicolonClassElement extends ClassElement {
@@ -3917,8 +3918,8 @@ declare namespace ts {
updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature;
createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
updateMethodDeclaration(node: MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
- createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
- updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
+ updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
createGetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
updateGetAccessorDeclaration(node: GetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
createSetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
@@ -4370,11 +4371,11 @@ declare namespace ts {
/**
* @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter.
*/
- createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ createConstructorDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
/**
* @deprecated This node does not support Decorators. Callers should use an overload that does not accept a `decorators` parameter.
*/
- updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
+ updateConstructorDeclaration(node: ConstructorDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
/**
* @deprecated Decorators have been combined with modifiers. Callers should use an overload that does not accept a `decorators` parameter.
*/
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace4.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace4.ets
new file mode 100644
index 0000000000..e17f72cb39
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace4.ets
@@ -0,0 +1,9 @@
+// @declaration: true
+declare namespace myNS {
+ class BigFloat {
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+ overload constructor {fromString};
+ }
+}
\ No newline at end of file
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel4.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel4.ets
new file mode 100644
index 0000000000..05a1d590b7
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel4.ets
@@ -0,0 +1,7 @@
+// @declaration: true
+declare class BigFloat {
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+ overload constructor {fromString};
+}
\ No newline at end of file
--
Gitee
From 539ec9706636db24fe0d768dd319b4b628088ae8 Mon Sep 17 00:00:00 2001
From: zju_wyx <22125041@zju.edu.cn>
Date: Fri, 1 Aug 2025 11:56:13 +0800
Subject: [PATCH 07/10] parse semicolon after overloadDeclaration
Signed-off-by: zju_wyx <22125041@zju.edu.cn>
Change-Id: I012bc4a60ab73096e50739a79e2ad496a0cd41b0
---
lib/tsc.js | 2 ++
lib/tsserver.js | 2 ++
lib/tsserverlibrary.js | 2 ++
lib/typescript.js | 2 ++
lib/typingsInstaller.js | 2 ++
src/compiler/emitter.ts | 3 ++-
src/compiler/parser.ts | 1 +
.../reference/OverloadDeclarationInNameSpace1.js | 9 ++++++++-
.../OverloadDeclarationInNameSpace1.symbols | 5 +++++
.../OverloadDeclarationInNameSpace1.types | 6 ++++++
.../reference/OverloadDeclarationInNameSpace2.js | 9 ++++++++-
.../OverloadDeclarationInNameSpace2.symbols | 5 +++++
.../OverloadDeclarationInNameSpace2.types | 6 ++++++
.../reference/OverloadDeclarationInNameSpace3.js | 11 +++++++++--
.../OverloadDeclarationInNameSpace3.symbols | 15 ++++++++++-----
.../OverloadDeclarationInNameSpace3.types | 8 +++++++-
.../reference/OverloadDeclarationInNameSpace4.js | 16 +++++++++++++++-
.../OverloadDeclarationInNameSpace4.symbols | 14 +++++++++++++-
.../OverloadDeclarationInNameSpace4.types | 13 +++++++++++++
.../reference/OverloadDeclarationInTopLevel1.js | 11 +++++++++--
.../OverloadDeclarationInTopLevel1.symbols | 7 ++++++-
.../OverloadDeclarationInTopLevel1.types | 8 +++++++-
.../reference/OverloadDeclarationInTopLevel2.js | 9 ++++++++-
.../OverloadDeclarationInTopLevel2.symbols | 5 +++++
.../OverloadDeclarationInTopLevel2.types | 6 ++++++
.../reference/OverloadDeclarationInTopLevel3.js | 11 +++++++++--
.../OverloadDeclarationInTopLevel3.symbols | 15 ++++++++++-----
.../OverloadDeclarationInTopLevel3.types | 8 +++++++-
.../reference/OverloadDeclarationInTopLevel4.js | 16 +++++++++++++++-
.../OverloadDeclarationInTopLevel4.symbols | 12 ++++++++++++
.../OverloadDeclarationInTopLevel4.types | 13 +++++++++++++
.../reference/OverloadDeclarationWithExport.js | 11 +++++++++--
.../OverloadDeclarationWithExport.symbols | 7 ++++++-
.../OverloadDeclarationWithExport.types | 8 +++++++-
.../reference/OverloadDeclarationWithModifier.js | 16 ++++++++++++++--
.../OverloadDeclarationWithModifier.symbols | 9 +++++++++
.../OverloadDeclarationWithModifier.types | 11 +++++++++++
.../overload/OverloadDeclarationInNameSpace1.ets | 2 ++
.../overload/OverloadDeclarationInNameSpace2.ets | 2 ++
.../overload/OverloadDeclarationInNameSpace3.ets | 4 +++-
.../overload/OverloadDeclarationInNameSpace4.ets | 6 ++++++
.../overload/OverloadDeclarationInTopLevel1.ets | 4 +++-
.../overload/OverloadDeclarationInTopLevel2.ets | 2 ++
.../overload/OverloadDeclarationInTopLevel3.ets | 4 +++-
.../overload/OverloadDeclarationInTopLevel4.ets | 6 ++++++
.../overload/OverloadDeclarationWithExport.ets | 4 +++-
.../overload/OverloadDeclarationWithModifier.ets | 3 +++
47 files changed, 314 insertions(+), 37 deletions(-)
diff --git a/lib/tsc.js b/lib/tsc.js
index 22982b5e02..2a1e208049 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -30608,6 +30608,7 @@ var Parser;
} else {
members = createMissingList();
}
+ tryParseSemicolon();
const node = factory2.createOverloadDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
@@ -101933,6 +101934,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
writePunctuation("{");
emitList(node, node.members, 145 /* EnumMembers */);
writePunctuation("}");
+ writeTrailingSemicolon();
if (indentedFlag) {
decreaseIndent();
}
diff --git a/lib/tsserver.js b/lib/tsserver.js
index 76e7c4a6af..7425344c33 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -33287,6 +33287,7 @@ var Parser;
} else {
members = createMissingList();
}
+ tryParseSemicolon();
const node = factory2.createOverloadDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
@@ -104265,6 +104266,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
writePunctuation("{");
emitList(node, node.members, 145 /* EnumMembers */);
writePunctuation("}");
+ writeTrailingSemicolon();
if (indentedFlag) {
decreaseIndent();
}
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index b92508948f..a7d1b33f22 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -33189,6 +33189,7 @@ var Parser;
} else {
members = createMissingList();
}
+ tryParseSemicolon();
const node = factory2.createOverloadDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
@@ -104167,6 +104168,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
writePunctuation("{");
emitList(node, node.members, 145 /* EnumMembers */);
writePunctuation("}");
+ writeTrailingSemicolon();
if (indentedFlag) {
decreaseIndent();
}
diff --git a/lib/typescript.js b/lib/typescript.js
index ba6ff8001a..762084d370 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -33204,6 +33204,7 @@ var Parser;
} else {
members = createMissingList();
}
+ tryParseSemicolon();
const node = factory2.createOverloadDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
@@ -104529,6 +104530,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
writePunctuation("{");
emitList(node, node.members, 145 /* EnumMembers */);
writePunctuation("}");
+ writeTrailingSemicolon();
if (indentedFlag) {
decreaseIndent();
}
diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js
index 2ca0e548e5..032fab704f 100644
--- a/lib/typingsInstaller.js
+++ b/lib/typingsInstaller.js
@@ -23439,6 +23439,7 @@ var Parser;
} else {
members = createMissingList();
}
+ tryParseSemicolon();
const node = factory2.createOverloadDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
@@ -36340,6 +36341,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
writePunctuation("{");
emitList(node, node.members, 145 /* EnumMembers */);
writePunctuation("}");
+ writeTrailingSemicolon();
if (indentedFlag) {
decreaseIndent();
}
diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts
index 785aacb34e..431e9e01ab 100644
--- a/src/compiler/emitter.ts
+++ b/src/compiler/emitter.ts
@@ -3369,7 +3369,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
function emitSignatureAndBody(node: FunctionLikeDeclaration, emitSignatureHead: (node: SignatureDeclaration) => void) {
const body = node.body;
- if (body) {
+ if (body) {
if (isBlock(body)) {
const indentedFlag = getEmitFlags(node) & EmitFlags.Indented;
if (indentedFlag) {
@@ -3573,6 +3573,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
writePunctuation("{");
emitList(node, node.members, ListFormat.EnumMembers);
writePunctuation("}");
+ writeTrailingSemicolon();
if (indentedFlag) {
decreaseIndent();
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index bcb5a376f0..46246e2771 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -7776,6 +7776,7 @@ namespace Parser {
else {
members = createMissingList();
}
+ tryParseSemicolon();
const node = factory.createOverloadDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace1.js b/tests/baselines/reference/OverloadDeclarationInNameSpace1.js
index 514b841ab1..411e9b66c5 100644
--- a/tests/baselines/reference/OverloadDeclarationInNameSpace1.js
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace1.js
@@ -4,6 +4,8 @@ declare namespace myNS {
function foo2(): void;
/** @overload testJSdoc */
overload foo {foo1, foo2}
+ /** @overload testJSdoc */
+ overload foo3 {foo1, foo2};
}
@@ -18,5 +20,10 @@ declare namespace myNS {
overload foo {
foo1,
foo2
- }
+ };
+ /** @overload testJSdoc */
+ overload foo3 {
+ foo1,
+ foo2
+ };
}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace1.symbols b/tests/baselines/reference/OverloadDeclarationInNameSpace1.symbols
index adfb76dd40..ac61d4aa2f 100644
--- a/tests/baselines/reference/OverloadDeclarationInNameSpace1.symbols
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace1.symbols
@@ -12,5 +12,10 @@ declare namespace myNS {
overload foo {foo1, foo2}
>foo1 : Symbol(foo.foo1, Decl(OverloadDeclarationInNameSpace1.ets, 4, 18))
>foo2 : Symbol(foo.foo2, Decl(OverloadDeclarationInNameSpace1.ets, 4, 23))
+
+ /** @overload testJSdoc */
+ overload foo3 {foo1, foo2};
+>foo1 : Symbol(foo3.foo1, Decl(OverloadDeclarationInNameSpace1.ets, 6, 19))
+>foo2 : Symbol(foo3.foo2, Decl(OverloadDeclarationInNameSpace1.ets, 6, 24))
}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace1.types b/tests/baselines/reference/OverloadDeclarationInNameSpace1.types
index e0955b3f94..7e9c563103 100644
--- a/tests/baselines/reference/OverloadDeclarationInNameSpace1.types
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace1.types
@@ -12,6 +12,12 @@ declare namespace myNS {
overload foo {foo1, foo2}
>foo : error
>foo1 : any
+>foo2 : any
+
+ /** @overload testJSdoc */
+ overload foo3 {foo1, foo2};
+>foo3 : error
+>foo1 : any
>foo2 : any
}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace2.js b/tests/baselines/reference/OverloadDeclarationInNameSpace2.js
index 6a038b247c..6dc975b2f8 100644
--- a/tests/baselines/reference/OverloadDeclarationInNameSpace2.js
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace2.js
@@ -5,6 +5,8 @@ declare namespace myNS {
bar(n?: string): void;
/** @overload testJSdoc */
overload goo {foo, bar}
+ /** @overload testJSdoc */
+ overload goo1 {foo, bar};
}
}
@@ -20,6 +22,11 @@ declare namespace myNS {
overload goo {
foo,
bar
- }
+ };
+ /** @overload testJSdoc */
+ overload goo1 {
+ foo,
+ bar
+ };
}
}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace2.symbols b/tests/baselines/reference/OverloadDeclarationInNameSpace2.symbols
index c94649bd63..a3042be237 100644
--- a/tests/baselines/reference/OverloadDeclarationInNameSpace2.symbols
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace2.symbols
@@ -16,5 +16,10 @@ declare namespace myNS {
overload goo {foo, bar}
>foo : Symbol(goo.foo, Decl(OverloadDeclarationInNameSpace2.ets, 5, 22))
>bar : Symbol(goo.bar, Decl(OverloadDeclarationInNameSpace2.ets, 5, 26))
+
+ /** @overload testJSdoc */
+ overload goo1 {foo, bar};
+>foo : Symbol(goo1.foo, Decl(OverloadDeclarationInNameSpace2.ets, 7, 23))
+>bar : Symbol(goo1.bar, Decl(OverloadDeclarationInNameSpace2.ets, 7, 27))
}
}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace2.types b/tests/baselines/reference/OverloadDeclarationInNameSpace2.types
index d6506c892d..d7f6c9e710 100644
--- a/tests/baselines/reference/OverloadDeclarationInNameSpace2.types
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace2.types
@@ -12,6 +12,12 @@ declare namespace myNS {
overload goo {foo, bar}
>goo : error
>foo : any
+>bar : any
+
+ /** @overload testJSdoc */
+ overload goo1 {foo, bar};
+>goo1 : error
+>foo : any
>bar : any
}
}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace3.js b/tests/baselines/reference/OverloadDeclarationInNameSpace3.js
index 0d8b22097a..8bbe9c828f 100644
--- a/tests/baselines/reference/OverloadDeclarationInNameSpace3.js
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace3.js
@@ -2,7 +2,9 @@
declare namespace myNS {
class Processor {
/** @overload testJSdoc */
- overload process {process1, process2}
+ overload process {process1, process2};
+ /** @overload testJSdoc */
+ overload process3 {process1, process2}
process1(n: number): void;
process2(s: string): void;
}
@@ -18,7 +20,12 @@ declare namespace myNS {
overload process {
process1,
process2
- }
+ };
+ /** @overload testJSdoc */
+ overload process3 {
+ process1,
+ process2
+ };
process1(n: number): void;
process2(s: string): void;
}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace3.symbols b/tests/baselines/reference/OverloadDeclarationInNameSpace3.symbols
index a8e10c4f62..910b943584 100644
--- a/tests/baselines/reference/OverloadDeclarationInNameSpace3.symbols
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace3.symbols
@@ -6,16 +6,21 @@ declare namespace myNS {
>Processor : Symbol(Processor, Decl(OverloadDeclarationInNameSpace3.ets, 0, 24))
/** @overload testJSdoc */
- overload process {process1, process2}
+ overload process {process1, process2};
>process1 : Symbol(process.process1, Decl(OverloadDeclarationInNameSpace3.ets, 3, 26))
>process2 : Symbol(process.process2, Decl(OverloadDeclarationInNameSpace3.ets, 3, 35))
+ /** @overload testJSdoc */
+ overload process3 {process1, process2}
+>process1 : Symbol(process3.process1, Decl(OverloadDeclarationInNameSpace3.ets, 5, 27))
+>process2 : Symbol(process3.process2, Decl(OverloadDeclarationInNameSpace3.ets, 5, 36))
+
process1(n: number): void;
->process1 : Symbol(Processor.process1, Decl(OverloadDeclarationInNameSpace3.ets, 3, 45))
->n : Symbol(n, Decl(OverloadDeclarationInNameSpace3.ets, 4, 17))
+>process1 : Symbol(Processor.process1, Decl(OverloadDeclarationInNameSpace3.ets, 5, 46))
+>n : Symbol(n, Decl(OverloadDeclarationInNameSpace3.ets, 6, 17))
process2(s: string): void;
->process2 : Symbol(Processor.process2, Decl(OverloadDeclarationInNameSpace3.ets, 4, 34))
->s : Symbol(s, Decl(OverloadDeclarationInNameSpace3.ets, 5, 17))
+>process2 : Symbol(Processor.process2, Decl(OverloadDeclarationInNameSpace3.ets, 6, 34))
+>s : Symbol(s, Decl(OverloadDeclarationInNameSpace3.ets, 7, 17))
}
}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace3.types b/tests/baselines/reference/OverloadDeclarationInNameSpace3.types
index 7675f2b52a..3724cf3322 100644
--- a/tests/baselines/reference/OverloadDeclarationInNameSpace3.types
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace3.types
@@ -6,9 +6,15 @@ declare namespace myNS {
>Processor : Processor
/** @overload testJSdoc */
- overload process {process1, process2}
+ overload process {process1, process2};
>process : error
>process1 : any
+>process2 : any
+
+ /** @overload testJSdoc */
+ overload process3 {process1, process2}
+>process3 : error
+>process1 : any
>process2 : any
process1(n: number): void;
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace4.js b/tests/baselines/reference/OverloadDeclarationInNameSpace4.js
index cacdf43cd3..55f080f977 100644
--- a/tests/baselines/reference/OverloadDeclarationInNameSpace4.js
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace4.js
@@ -1,6 +1,12 @@
//// [OverloadDeclarationInNameSpace4.ets]
declare namespace myNS {
class BigFloat {
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+ overload constructor {fromString}
+ }
+ class BigFloat1 {
constructor();
/** @overload testJSdoc */
constructor fromString(s: string);
@@ -19,6 +25,14 @@ declare namespace myNS {
constructor fromString(s: string);
overload constructor {
fromString
- }
+ };
+ }
+ class BigFloat1 {
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+ overload constructor {
+ fromString
+ };
}
}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace4.symbols b/tests/baselines/reference/OverloadDeclarationInNameSpace4.symbols
index bf3a40d915..089854928f 100644
--- a/tests/baselines/reference/OverloadDeclarationInNameSpace4.symbols
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace4.symbols
@@ -11,7 +11,19 @@ declare namespace myNS {
>fromString : Symbol(BigFloat.fromString, Decl(OverloadDeclarationInNameSpace4.ets, 2, 22))
>s : Symbol(s, Decl(OverloadDeclarationInNameSpace4.ets, 4, 31))
- overload constructor {fromString};
+ overload constructor {fromString}
>fromString : Symbol(constructor.fromString, Decl(OverloadDeclarationInNameSpace4.ets, 5, 30))
}
+ class BigFloat1 {
+>BigFloat1 : Symbol(BigFloat1, Decl(OverloadDeclarationInNameSpace4.ets, 6, 5))
+
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+>fromString : Symbol(BigFloat1.fromString, Decl(OverloadDeclarationInNameSpace4.ets, 8, 22))
+>s : Symbol(s, Decl(OverloadDeclarationInNameSpace4.ets, 10, 31))
+
+ overload constructor {fromString};
+>fromString : Symbol(constructor.fromString, Decl(OverloadDeclarationInNameSpace4.ets, 11, 30))
+ }
}
diff --git a/tests/baselines/reference/OverloadDeclarationInNameSpace4.types b/tests/baselines/reference/OverloadDeclarationInNameSpace4.types
index fb7eb19ecf..04852dd962 100644
--- a/tests/baselines/reference/OverloadDeclarationInNameSpace4.types
+++ b/tests/baselines/reference/OverloadDeclarationInNameSpace4.types
@@ -9,6 +9,19 @@ declare namespace myNS {
/** @overload testJSdoc */
constructor fromString(s: string);
>fromString : error
+>s : string
+
+ overload constructor {fromString}
+>constructor : error
+>fromString : any
+ }
+ class BigFloat1 {
+>BigFloat1 : BigFloat1
+
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+>fromString : error
>s : string
overload constructor {fromString};
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel1.js b/tests/baselines/reference/OverloadDeclarationInTopLevel1.js
index 7378187858..d81383af0b 100644
--- a/tests/baselines/reference/OverloadDeclarationInTopLevel1.js
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel1.js
@@ -2,7 +2,9 @@
declare function foo1(): void;
declare function foo2(): void;
/** @overload testJSdoc */
-overload foo {foo1, foo2}
+overload foo {foo1, foo2};
+/** @overload testJSdoc */
+overload foo3 {foo1, foo2}
//// [OverloadDeclarationInTopLevel1.js]
@@ -15,4 +17,9 @@ declare function foo2(): void;
overload foo {
foo1,
foo2
-}
+};
+/** @overload testJSdoc */
+overload foo3 {
+ foo1,
+ foo2
+};
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel1.symbols b/tests/baselines/reference/OverloadDeclarationInTopLevel1.symbols
index 4378dc3a93..92ed12ab07 100644
--- a/tests/baselines/reference/OverloadDeclarationInTopLevel1.symbols
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel1.symbols
@@ -6,7 +6,12 @@ declare function foo2(): void;
>foo2 : Symbol(foo2, Decl(OverloadDeclarationInTopLevel1.ets, 0, 30))
/** @overload testJSdoc */
-overload foo {foo1, foo2}
+overload foo {foo1, foo2};
>foo1 : Symbol(foo.foo1, Decl(OverloadDeclarationInTopLevel1.ets, 3, 14))
>foo2 : Symbol(foo.foo2, Decl(OverloadDeclarationInTopLevel1.ets, 3, 19))
+/** @overload testJSdoc */
+overload foo3 {foo1, foo2}
+>foo1 : Symbol(foo3.foo1, Decl(OverloadDeclarationInTopLevel1.ets, 5, 15))
+>foo2 : Symbol(foo3.foo2, Decl(OverloadDeclarationInTopLevel1.ets, 5, 20))
+
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel1.types b/tests/baselines/reference/OverloadDeclarationInTopLevel1.types
index f7a763156c..307ee4a681 100644
--- a/tests/baselines/reference/OverloadDeclarationInTopLevel1.types
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel1.types
@@ -6,8 +6,14 @@ declare function foo2(): void;
>foo2 : () => void
/** @overload testJSdoc */
-overload foo {foo1, foo2}
+overload foo {foo1, foo2};
>foo : error
>foo1 : any
>foo2 : any
+/** @overload testJSdoc */
+overload foo3 {foo1, foo2}
+>foo3 : error
+>foo1 : any
+>foo2 : any
+
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel2.js b/tests/baselines/reference/OverloadDeclarationInTopLevel2.js
index f144d0bef5..335146d446 100644
--- a/tests/baselines/reference/OverloadDeclarationInTopLevel2.js
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel2.js
@@ -4,6 +4,8 @@ declare interface I {
bar(n?: string): void;
/** @overload testJSdoc */
overload goo {foo, bar}
+ /** @overload testJSdoc */
+ overload goo1 {foo, bar};
}
@@ -18,5 +20,10 @@ declare interface I {
overload goo {
foo,
bar
- }
+ };
+ /** @overload testJSdoc */
+ overload goo1 {
+ foo,
+ bar
+ };
}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel2.symbols b/tests/baselines/reference/OverloadDeclarationInTopLevel2.symbols
index 954e728fd1..f6f48a7cb4 100644
--- a/tests/baselines/reference/OverloadDeclarationInTopLevel2.symbols
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel2.symbols
@@ -13,5 +13,10 @@ declare interface I {
overload goo {foo, bar}
>foo : Symbol(goo.foo, Decl(OverloadDeclarationInTopLevel2.ets, 4, 18))
>bar : Symbol(goo.bar, Decl(OverloadDeclarationInTopLevel2.ets, 4, 22))
+
+ /** @overload testJSdoc */
+ overload goo1 {foo, bar};
+>foo : Symbol(goo1.foo, Decl(OverloadDeclarationInTopLevel2.ets, 6, 19))
+>bar : Symbol(goo1.bar, Decl(OverloadDeclarationInTopLevel2.ets, 6, 23))
}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel2.types b/tests/baselines/reference/OverloadDeclarationInTopLevel2.types
index 197c21311a..0d267a73d2 100644
--- a/tests/baselines/reference/OverloadDeclarationInTopLevel2.types
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel2.types
@@ -11,6 +11,12 @@ declare interface I {
overload goo {foo, bar}
>goo : error
>foo : any
+>bar : any
+
+ /** @overload testJSdoc */
+ overload goo1 {foo, bar};
+>goo1 : error
+>foo : any
>bar : any
}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel3.js b/tests/baselines/reference/OverloadDeclarationInTopLevel3.js
index b42cac7a0b..e60c61e70b 100644
--- a/tests/baselines/reference/OverloadDeclarationInTopLevel3.js
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel3.js
@@ -1,7 +1,9 @@
//// [OverloadDeclarationInTopLevel3.ets]
declare class Processor {
/** @overload testJSdoc */
- overload process {process1, process2}
+ overload process {process1, process2};
+ /** @overload testJSdoc */
+ overload process3 {process1, process2}
process1(n: number): void;
process2(s: string): void;
}
@@ -15,7 +17,12 @@ declare class Processor {
overload process {
process1,
process2
- }
+ };
+ /** @overload testJSdoc */
+ overload process3 {
+ process1,
+ process2
+ };
process1(n: number): void;
process2(s: string): void;
}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel3.symbols b/tests/baselines/reference/OverloadDeclarationInTopLevel3.symbols
index 2ddc4cb68a..15e3821cae 100644
--- a/tests/baselines/reference/OverloadDeclarationInTopLevel3.symbols
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel3.symbols
@@ -3,15 +3,20 @@ declare class Processor {
>Processor : Symbol(Processor, Decl(OverloadDeclarationInTopLevel3.ets, 0, 0))
/** @overload testJSdoc */
- overload process {process1, process2}
+ overload process {process1, process2};
>process1 : Symbol(process.process1, Decl(OverloadDeclarationInTopLevel3.ets, 2, 22))
>process2 : Symbol(process.process2, Decl(OverloadDeclarationInTopLevel3.ets, 2, 31))
+ /** @overload testJSdoc */
+ overload process3 {process1, process2}
+>process1 : Symbol(process3.process1, Decl(OverloadDeclarationInTopLevel3.ets, 4, 23))
+>process2 : Symbol(process3.process2, Decl(OverloadDeclarationInTopLevel3.ets, 4, 32))
+
process1(n: number): void;
->process1 : Symbol(Processor.process1, Decl(OverloadDeclarationInTopLevel3.ets, 2, 41))
->n : Symbol(n, Decl(OverloadDeclarationInTopLevel3.ets, 3, 13))
+>process1 : Symbol(Processor.process1, Decl(OverloadDeclarationInTopLevel3.ets, 4, 42))
+>n : Symbol(n, Decl(OverloadDeclarationInTopLevel3.ets, 5, 13))
process2(s: string): void;
->process2 : Symbol(Processor.process2, Decl(OverloadDeclarationInTopLevel3.ets, 3, 30))
->s : Symbol(s, Decl(OverloadDeclarationInTopLevel3.ets, 4, 13))
+>process2 : Symbol(Processor.process2, Decl(OverloadDeclarationInTopLevel3.ets, 5, 30))
+>s : Symbol(s, Decl(OverloadDeclarationInTopLevel3.ets, 6, 13))
}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel3.types b/tests/baselines/reference/OverloadDeclarationInTopLevel3.types
index d95cd9a86e..7a332e9120 100644
--- a/tests/baselines/reference/OverloadDeclarationInTopLevel3.types
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel3.types
@@ -3,9 +3,15 @@ declare class Processor {
>Processor : Processor
/** @overload testJSdoc */
- overload process {process1, process2}
+ overload process {process1, process2};
>process : error
>process1 : any
+>process2 : any
+
+ /** @overload testJSdoc */
+ overload process3 {process1, process2}
+>process3 : error
+>process1 : any
>process2 : any
process1(n: number): void;
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel4.js b/tests/baselines/reference/OverloadDeclarationInTopLevel4.js
index 0e0ae4171f..9ccb0b5350 100644
--- a/tests/baselines/reference/OverloadDeclarationInTopLevel4.js
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel4.js
@@ -4,6 +4,12 @@ declare class BigFloat {
/** @overload testJSdoc */
constructor fromString(s: string);
overload constructor {fromString};
+}
+declare class BigFloat1 {
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string)
+ overload constructor {fromString}
}
//// [OverloadDeclarationInTopLevel4.js]
@@ -16,5 +22,13 @@ declare class BigFloat {
constructor fromString(s: string);
overload constructor {
fromString
- }
+ };
+}
+declare class BigFloat1 {
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+ overload constructor {
+ fromString
+ };
}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel4.symbols b/tests/baselines/reference/OverloadDeclarationInTopLevel4.symbols
index 1da5f282de..1c7b4da92f 100644
--- a/tests/baselines/reference/OverloadDeclarationInTopLevel4.symbols
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel4.symbols
@@ -11,3 +11,15 @@ declare class BigFloat {
overload constructor {fromString};
>fromString : Symbol(constructor.fromString, Decl(OverloadDeclarationInTopLevel4.ets, 4, 26))
}
+declare class BigFloat1 {
+>BigFloat1 : Symbol(BigFloat1, Decl(OverloadDeclarationInTopLevel4.ets, 5, 1))
+
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string)
+>fromString : Symbol(BigFloat1.fromString, Decl(OverloadDeclarationInTopLevel4.ets, 7, 18))
+>s : Symbol(s, Decl(OverloadDeclarationInTopLevel4.ets, 9, 27))
+
+ overload constructor {fromString}
+>fromString : Symbol(constructor.fromString, Decl(OverloadDeclarationInTopLevel4.ets, 10, 26))
+}
diff --git a/tests/baselines/reference/OverloadDeclarationInTopLevel4.types b/tests/baselines/reference/OverloadDeclarationInTopLevel4.types
index 129bf747e2..e039c5da1a 100644
--- a/tests/baselines/reference/OverloadDeclarationInTopLevel4.types
+++ b/tests/baselines/reference/OverloadDeclarationInTopLevel4.types
@@ -12,3 +12,16 @@ declare class BigFloat {
>constructor : error
>fromString : any
}
+declare class BigFloat1 {
+>BigFloat1 : BigFloat1
+
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string)
+>fromString : error
+>s : string
+
+ overload constructor {fromString}
+>constructor : error
+>fromString : any
+}
diff --git a/tests/baselines/reference/OverloadDeclarationWithExport.js b/tests/baselines/reference/OverloadDeclarationWithExport.js
index 73bd19a1e7..94043a616d 100644
--- a/tests/baselines/reference/OverloadDeclarationWithExport.js
+++ b/tests/baselines/reference/OverloadDeclarationWithExport.js
@@ -2,7 +2,9 @@
export declare function foo1(): void;
export declare function foo2(): void;
/** @overload testJSdoc */
-export overload foo {foo1, foo2}
+export overload foo {foo1, foo2};
+/** @overload testJSdoc */
+export overload foo3 {foo1, foo2}
//// [OverloadDeclarationWithExport.js]
"use strict";
@@ -16,4 +18,9 @@ export declare function foo2(): void;
export overload foo {
foo1,
foo2
-}
+};
+/** @overload testJSdoc */
+export overload foo3 {
+ foo1,
+ foo2
+};
diff --git a/tests/baselines/reference/OverloadDeclarationWithExport.symbols b/tests/baselines/reference/OverloadDeclarationWithExport.symbols
index b10f499be7..8d66db1c5a 100644
--- a/tests/baselines/reference/OverloadDeclarationWithExport.symbols
+++ b/tests/baselines/reference/OverloadDeclarationWithExport.symbols
@@ -6,7 +6,12 @@ export declare function foo2(): void;
>foo2 : Symbol(foo2, Decl(OverloadDeclarationWithExport.ets, 0, 37))
/** @overload testJSdoc */
-export overload foo {foo1, foo2}
+export overload foo {foo1, foo2};
>foo1 : Symbol(foo.foo1, Decl(OverloadDeclarationWithExport.ets, 3, 21))
>foo2 : Symbol(foo.foo2, Decl(OverloadDeclarationWithExport.ets, 3, 26))
+/** @overload testJSdoc */
+export overload foo3 {foo1, foo2}
+>foo1 : Symbol(foo3.foo1, Decl(OverloadDeclarationWithExport.ets, 5, 22))
+>foo2 : Symbol(foo3.foo2, Decl(OverloadDeclarationWithExport.ets, 5, 27))
+
diff --git a/tests/baselines/reference/OverloadDeclarationWithExport.types b/tests/baselines/reference/OverloadDeclarationWithExport.types
index 42465783fb..21b193549b 100644
--- a/tests/baselines/reference/OverloadDeclarationWithExport.types
+++ b/tests/baselines/reference/OverloadDeclarationWithExport.types
@@ -6,8 +6,14 @@ export declare function foo2(): void;
>foo2 : () => void
/** @overload testJSdoc */
-export overload foo {foo1, foo2}
+export overload foo {foo1, foo2};
>foo : error
>foo1 : any
>foo2 : any
+/** @overload testJSdoc */
+export overload foo3 {foo1, foo2}
+>foo3 : error
+>foo1 : any
+>foo2 : any
+
diff --git a/tests/baselines/reference/OverloadDeclarationWithModifier.js b/tests/baselines/reference/OverloadDeclarationWithModifier.js
index 0c3b53d22d..a1420f3515 100644
--- a/tests/baselines/reference/OverloadDeclarationWithModifier.js
+++ b/tests/baselines/reference/OverloadDeclarationWithModifier.js
@@ -7,6 +7,9 @@ declare class Processor {
process2(s: string): void;
process3(): void;
process4(b: boolean): void;
+ /** @overload testJSdoc */
+ static overload processThree {process1, process2};
+ async overload processFour {process3, process4};
}
//// [OverloadDeclarationWithModifier.js]
@@ -18,13 +21,22 @@ declare class Processor {
static overload processOne {
process1,
process2
- }
+ };
async overload processTwo {
process3,
process4
- }
+ };
process1(n: number): void;
process2(s: string): void;
process3(): void;
process4(b: boolean): void;
+ /** @overload testJSdoc */
+ static overload processThree {
+ process1,
+ process2
+ };
+ async overload processFour {
+ process3,
+ process4
+ };
}
diff --git a/tests/baselines/reference/OverloadDeclarationWithModifier.symbols b/tests/baselines/reference/OverloadDeclarationWithModifier.symbols
index 9aec569c47..3b25c71bd0 100644
--- a/tests/baselines/reference/OverloadDeclarationWithModifier.symbols
+++ b/tests/baselines/reference/OverloadDeclarationWithModifier.symbols
@@ -25,4 +25,13 @@ declare class Processor {
process4(b: boolean): void;
>process4 : Symbol(Processor.process4, Decl(OverloadDeclarationWithModifier.ets, 6, 21))
>b : Symbol(b, Decl(OverloadDeclarationWithModifier.ets, 7, 13))
+
+ /** @overload testJSdoc */
+ static overload processThree {process1, process2};
+>process1 : Symbol(processThree.process1, Decl(OverloadDeclarationWithModifier.ets, 9, 34))
+>process2 : Symbol(processThree.process2, Decl(OverloadDeclarationWithModifier.ets, 9, 43))
+
+ async overload processFour {process3, process4};
+>process3 : Symbol(processFour.process3, Decl(OverloadDeclarationWithModifier.ets, 10, 32))
+>process4 : Symbol(processFour.process4, Decl(OverloadDeclarationWithModifier.ets, 10, 41))
}
diff --git a/tests/baselines/reference/OverloadDeclarationWithModifier.types b/tests/baselines/reference/OverloadDeclarationWithModifier.types
index 937e46a050..1075785ef2 100644
--- a/tests/baselines/reference/OverloadDeclarationWithModifier.types
+++ b/tests/baselines/reference/OverloadDeclarationWithModifier.types
@@ -27,4 +27,15 @@ declare class Processor {
process4(b: boolean): void;
>process4 : (b: boolean) => void
>b : boolean
+
+ /** @overload testJSdoc */
+ static overload processThree {process1, process2};
+>processThree : error
+>process1 : any
+>process2 : any
+
+ async overload processFour {process3, process4};
+>processFour : error
+>process3 : any
+>process4 : any
}
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace1.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace1.ets
index ffd98aa398..649fe7e601 100644
--- a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace1.ets
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace1.ets
@@ -4,4 +4,6 @@ declare namespace myNS {
function foo2(): void;
/** @overload testJSdoc */
overload foo {foo1, foo2}
+ /** @overload testJSdoc */
+ overload foo3 {foo1, foo2};
}
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace2.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace2.ets
index 7d5d872080..5491f5b9fd 100644
--- a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace2.ets
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace2.ets
@@ -5,5 +5,7 @@ declare namespace myNS {
bar(n?: string): void;
/** @overload testJSdoc */
overload goo {foo, bar}
+ /** @overload testJSdoc */
+ overload goo1 {foo, bar};
}
}
\ No newline at end of file
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace3.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace3.ets
index 51e63b45b0..824ef83b12 100644
--- a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace3.ets
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace3.ets
@@ -2,7 +2,9 @@
declare namespace myNS {
class Processor {
/** @overload testJSdoc */
- overload process {process1, process2}
+ overload process {process1, process2};
+ /** @overload testJSdoc */
+ overload process3 {process1, process2}
process1(n: number): void;
process2(s: string): void;
}
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace4.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace4.ets
index e17f72cb39..05e6211f8c 100644
--- a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace4.ets
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInNameSpace4.ets
@@ -1,6 +1,12 @@
// @declaration: true
declare namespace myNS {
class BigFloat {
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string);
+ overload constructor {fromString}
+ }
+ class BigFloat1 {
constructor();
/** @overload testJSdoc */
constructor fromString(s: string);
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel1.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel1.ets
index 19d46e4859..54e00f9065 100644
--- a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel1.ets
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel1.ets
@@ -2,4 +2,6 @@
declare function foo1(): void;
declare function foo2(): void;
/** @overload testJSdoc */
-overload foo {foo1, foo2}
+overload foo {foo1, foo2};
+/** @overload testJSdoc */
+overload foo3 {foo1, foo2}
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel2.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel2.ets
index e988befb58..d46be5fd2c 100644
--- a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel2.ets
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel2.ets
@@ -4,4 +4,6 @@ declare interface I {
bar(n?: string): void;
/** @overload testJSdoc */
overload goo {foo, bar}
+ /** @overload testJSdoc */
+ overload goo1 {foo, bar};
}
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel3.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel3.ets
index 71bc653b84..0e4d9cc56d 100644
--- a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel3.ets
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel3.ets
@@ -1,7 +1,9 @@
// @declaration: true
declare class Processor {
/** @overload testJSdoc */
- overload process {process1, process2}
+ overload process {process1, process2};
+ /** @overload testJSdoc */
+ overload process3 {process1, process2}
process1(n: number): void;
process2(s: string): void;
}
\ No newline at end of file
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel4.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel4.ets
index 05a1d590b7..b0e5ed1f90 100644
--- a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel4.ets
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationInTopLevel4.ets
@@ -4,4 +4,10 @@ declare class BigFloat {
/** @overload testJSdoc */
constructor fromString(s: string);
overload constructor {fromString};
+}
+declare class BigFloat1 {
+ constructor();
+ /** @overload testJSdoc */
+ constructor fromString(s: string)
+ overload constructor {fromString}
}
\ No newline at end of file
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets
index 76347d7dd2..cd2b302fe8 100644
--- a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets
@@ -2,4 +2,6 @@
export declare function foo1(): void;
export declare function foo2(): void;
/** @overload testJSdoc */
-export overload foo {foo1, foo2}
\ No newline at end of file
+export overload foo {foo1, foo2};
+/** @overload testJSdoc */
+export overload foo3 {foo1, foo2}
\ No newline at end of file
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithModifier.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithModifier.ets
index 397b431c94..048f7d6a8a 100644
--- a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithModifier.ets
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithModifier.ets
@@ -7,4 +7,7 @@ declare class Processor {
process2(s: string): void;
process3(): void;
process4(b: boolean): void;
+ /** @overload testJSdoc */
+ static overload processThree {process1, process2};
+ async overload processFour {process3, process4};
}
\ No newline at end of file
--
Gitee
From 834c6630e707f351602ff56b76c200d150e09119 Mon Sep 17 00:00:00 2001
From: zju_wyx <22125041@zju.edu.cn>
Date: Mon, 4 Aug 2025 20:07:25 +0800
Subject: [PATCH 08/10] fix overload name confict with reserved name
Signed-off-by: zju_wyx <22125041@zju.edu.cn>
Change-Id: I91a87ad02b2bbb2edab02af435f1d1989eb749e1
---
lib/tsc.js | 18 +++++++++---------
lib/tsserver.js | 18 +++++++++---------
lib/tsserverlibrary.js | 18 +++++++++---------
lib/typescript.js | 18 +++++++++---------
lib/typingsInstaller.js | 18 +++++++++---------
src/compiler/parser.ts | 18 +++++++++---------
.../reference/OverloadDeclarationWithExport.js | 7 ++++++-
.../OverloadDeclarationWithExport.symbols | 4 ++++
.../OverloadDeclarationWithExport.types | 5 +++++
.../overload/OverloadDeclarationWithExport.ets | 3 ++-
10 files changed, 71 insertions(+), 56 deletions(-)
diff --git a/lib/tsc.js b/lib/tsc.js
index 2a1e208049..c1416aab0f 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -27271,7 +27271,7 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
return canFollowExportModifier();
@@ -27298,7 +27298,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine()) || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword()) || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -28281,7 +28281,7 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
@@ -28323,7 +28323,7 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
}
return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
@@ -30395,7 +30395,7 @@ var Parser;
case 59 /* AtToken */:
return inAllowAnnotationContext() && nextToken() === 119 /* InterfaceKeyword */;
case 164 /* OverloadKeyword */:
- return nextTokenIsIdentifierOnSameLine();
+ return nextTokenIsIdentifierOrKeyword();
case 119 /* InterfaceKeyword */:
case 155 /* TypeKeyword */:
return nextTokenIsIdentifierOnSameLine();
@@ -30600,7 +30600,7 @@ var Parser;
}
function parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers) {
parseExpected(164 /* OverloadKeyword */);
- const name = createIdentifier(isBindingIdentifier());
+ const name = createIdentifier(true);
let members;
if (parseExpected(18 /* OpenBraceToken */)) {
members = parseOverloadMembers();
@@ -30682,7 +30682,7 @@ var Parser;
}
return parseDeclarationDefault(pos, decorators, modifiers);
case 164 /* OverloadKeyword */:
- if (lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
return parseDeclarationDefault(pos, decorators, modifiers);
@@ -31098,7 +31098,7 @@ var Parser;
}
return true;
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
if (token() === 136 /* ConstructorKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
@@ -31260,7 +31260,7 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) {
diff --git a/lib/tsserver.js b/lib/tsserver.js
index 7425344c33..01f15bf9c3 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -29950,7 +29950,7 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
return canFollowExportModifier();
@@ -29977,7 +29977,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine()) || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword()) || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -30960,7 +30960,7 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
@@ -31002,7 +31002,7 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
}
return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
@@ -33074,7 +33074,7 @@ var Parser;
case 59 /* AtToken */:
return inAllowAnnotationContext() && nextToken() === 119 /* InterfaceKeyword */;
case 164 /* OverloadKeyword */:
- return nextTokenIsIdentifierOnSameLine();
+ return nextTokenIsIdentifierOrKeyword();
case 119 /* InterfaceKeyword */:
case 155 /* TypeKeyword */:
return nextTokenIsIdentifierOnSameLine();
@@ -33279,7 +33279,7 @@ var Parser;
}
function parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers) {
parseExpected(164 /* OverloadKeyword */);
- const name = createIdentifier3(isBindingIdentifier());
+ const name = createIdentifier3(true);
let members;
if (parseExpected(18 /* OpenBraceToken */)) {
members = parseOverloadMembers();
@@ -33361,7 +33361,7 @@ var Parser;
}
return parseDeclarationDefault(pos, decorators, modifiers);
case 164 /* OverloadKeyword */:
- if (lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
return parseDeclarationDefault(pos, decorators, modifiers);
@@ -33777,7 +33777,7 @@ var Parser;
}
return true;
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
if (token() === 136 /* ConstructorKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
@@ -33939,7 +33939,7 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) {
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index a7d1b33f22..f5e81b8c0a 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -29852,7 +29852,7 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
return canFollowExportModifier();
@@ -29879,7 +29879,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine()) || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword()) || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -30862,7 +30862,7 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
@@ -30904,7 +30904,7 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
}
return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
@@ -32976,7 +32976,7 @@ var Parser;
case 59 /* AtToken */:
return inAllowAnnotationContext() && nextToken() === 119 /* InterfaceKeyword */;
case 164 /* OverloadKeyword */:
- return nextTokenIsIdentifierOnSameLine();
+ return nextTokenIsIdentifierOrKeyword();
case 119 /* InterfaceKeyword */:
case 155 /* TypeKeyword */:
return nextTokenIsIdentifierOnSameLine();
@@ -33181,7 +33181,7 @@ var Parser;
}
function parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers) {
parseExpected(164 /* OverloadKeyword */);
- const name = createIdentifier3(isBindingIdentifier());
+ const name = createIdentifier3(true);
let members;
if (parseExpected(18 /* OpenBraceToken */)) {
members = parseOverloadMembers();
@@ -33263,7 +33263,7 @@ var Parser;
}
return parseDeclarationDefault(pos, decorators, modifiers);
case 164 /* OverloadKeyword */:
- if (lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
return parseDeclarationDefault(pos, decorators, modifiers);
@@ -33679,7 +33679,7 @@ var Parser;
}
return true;
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
if (token() === 136 /* ConstructorKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
@@ -33841,7 +33841,7 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) {
diff --git a/lib/typescript.js b/lib/typescript.js
index 762084d370..9fe99aab36 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -29867,7 +29867,7 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
return canFollowExportModifier();
@@ -29894,7 +29894,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine()) || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword()) || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -30877,7 +30877,7 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
@@ -30919,7 +30919,7 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
}
return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
@@ -32991,7 +32991,7 @@ var Parser;
case 59 /* AtToken */:
return inAllowAnnotationContext() && nextToken() === 119 /* InterfaceKeyword */;
case 164 /* OverloadKeyword */:
- return nextTokenIsIdentifierOnSameLine();
+ return nextTokenIsIdentifierOrKeyword();
case 119 /* InterfaceKeyword */:
case 155 /* TypeKeyword */:
return nextTokenIsIdentifierOnSameLine();
@@ -33196,7 +33196,7 @@ var Parser;
}
function parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers) {
parseExpected(164 /* OverloadKeyword */);
- const name = createIdentifier3(isBindingIdentifier());
+ const name = createIdentifier3(true);
let members;
if (parseExpected(18 /* OpenBraceToken */)) {
members = parseOverloadMembers();
@@ -33278,7 +33278,7 @@ var Parser;
}
return parseDeclarationDefault(pos, decorators, modifiers);
case 164 /* OverloadKeyword */:
- if (lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
return parseDeclarationDefault(pos, decorators, modifiers);
@@ -33694,7 +33694,7 @@ var Parser;
}
return true;
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
if (token() === 136 /* ConstructorKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
@@ -33856,7 +33856,7 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) {
diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js
index 032fab704f..07c09528a6 100644
--- a/lib/typingsInstaller.js
+++ b/lib/typingsInstaller.js
@@ -20102,7 +20102,7 @@ var Parser;
if (inAllowAnnotationContext() && token() === 59 /* AtToken */) {
return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
return canFollowExportModifier();
@@ -20129,7 +20129,7 @@ var Parser;
return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine()) || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword()) || isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
@@ -21112,7 +21112,7 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
if (token() === 89 /* DefaultKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
@@ -21154,7 +21154,7 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
}
return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
@@ -23226,7 +23226,7 @@ var Parser;
case 59 /* AtToken */:
return inAllowAnnotationContext() && nextToken() === 119 /* InterfaceKeyword */;
case 164 /* OverloadKeyword */:
- return nextTokenIsIdentifierOnSameLine();
+ return nextTokenIsIdentifierOrKeyword();
case 119 /* InterfaceKeyword */:
case 155 /* TypeKeyword */:
return nextTokenIsIdentifierOnSameLine();
@@ -23431,7 +23431,7 @@ var Parser;
}
function parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers) {
parseExpected(164 /* OverloadKeyword */);
- const name = createIdentifier(isBindingIdentifier());
+ const name = createIdentifier(true);
let members;
if (parseExpected(18 /* OpenBraceToken */)) {
members = parseOverloadMembers();
@@ -23513,7 +23513,7 @@ var Parser;
}
return parseDeclarationDefault(pos, decorators, modifiers);
case 164 /* OverloadKeyword */:
- if (lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
return parseDeclarationDefault(pos, decorators, modifiers);
@@ -23929,7 +23929,7 @@ var Parser;
}
return true;
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
if (token() === 136 /* ConstructorKeyword */ && lookAhead(() => nextTokenIsIdentifier())) {
@@ -24091,7 +24091,7 @@ var Parser;
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
- if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) {
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index 46246e2771..2773ad79e4 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -2988,7 +2988,7 @@ namespace Parser {
if (inAllowAnnotationContext() && token() === SyntaxKind.AtToken) {
return lookAhead(() => nextToken() === SyntaxKind.InterfaceKeyword);
}
- if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
return canFollowExportModifier();
@@ -3027,7 +3027,7 @@ namespace Parser {
|| token() === SyntaxKind.AsteriskToken
|| token() === SyntaxKind.DotDotDotToken
|| token() === SyntaxKind.AtToken && inAllowAnnotationContext() && lookAhead(() => nextToken() === SyntaxKind.InterfaceKeyword)
- || token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOnSameLine())
+ || token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOrKeyword())
|| isLiteralPropertyName();
}
@@ -4496,7 +4496,7 @@ namespace Parser {
return true;
}
- if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
@@ -4554,7 +4554,7 @@ namespace Parser {
return parseIndexSignatureDeclaration(pos, hasJSDoc, /*decorators*/ undefined, modifiers);
}
- if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, /*decorators*/ undefined, modifiers);
}
@@ -7504,7 +7504,7 @@ namespace Parser {
case SyntaxKind.AtToken:
return inAllowAnnotationContext() && nextToken() === SyntaxKind.InterfaceKeyword;
case SyntaxKind.OverloadKeyword:
- return nextTokenIsIdentifierOnSameLine();
+ return nextTokenIsIdentifierOrKeyword();
// 'declare', 'module', 'namespace', 'interface'* and 'type' are all legal JavaScript identifiers;
// however, an identifier cannot be followed by another identifier on the same line. This is what we
// count on to parse out the respective declarations. For instance, we exploit this to say that
@@ -7767,7 +7767,7 @@ namespace Parser {
modifiers: NodeArray | undefined): OverloadDeclaration {
parseExpected(SyntaxKind.OverloadKeyword);
- const name = createIdentifier(isBindingIdentifier());
+ const name = createIdentifier(/*isIdentifier*/ true);
let members;
if (parseExpected(SyntaxKind.OpenBraceToken)) {
members = parseOverloadMembers();
@@ -7862,7 +7862,7 @@ namespace Parser {
}
return parseDeclarationDefault(pos, decorators, modifiers);
case SyntaxKind.OverloadKeyword:
- if (lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
return parseDeclarationDefault(pos, decorators, modifiers);
@@ -8377,7 +8377,7 @@ namespace Parser {
return true;
}
- if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
@@ -8603,7 +8603,7 @@ namespace Parser {
return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
- if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOnSameLine())) {
+ if (token() === SyntaxKind.OverloadKeyword && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
diff --git a/tests/baselines/reference/OverloadDeclarationWithExport.js b/tests/baselines/reference/OverloadDeclarationWithExport.js
index 94043a616d..47ec00291a 100644
--- a/tests/baselines/reference/OverloadDeclarationWithExport.js
+++ b/tests/baselines/reference/OverloadDeclarationWithExport.js
@@ -4,7 +4,8 @@ export declare function foo2(): void;
/** @overload testJSdoc */
export overload foo {foo1, foo2};
/** @overload testJSdoc */
-export overload foo3 {foo1, foo2}
+export overload foo3 {foo1, foo2}
+export overload true {foo1, foo2};
//// [OverloadDeclarationWithExport.js]
"use strict";
@@ -24,3 +25,7 @@ export overload foo3 {
foo1,
foo2
};
+export overload true {
+ foo1,
+ foo2
+};
diff --git a/tests/baselines/reference/OverloadDeclarationWithExport.symbols b/tests/baselines/reference/OverloadDeclarationWithExport.symbols
index 8d66db1c5a..85dabc51e4 100644
--- a/tests/baselines/reference/OverloadDeclarationWithExport.symbols
+++ b/tests/baselines/reference/OverloadDeclarationWithExport.symbols
@@ -15,3 +15,7 @@ export overload foo3 {foo1, foo2}
>foo1 : Symbol(foo3.foo1, Decl(OverloadDeclarationWithExport.ets, 5, 22))
>foo2 : Symbol(foo3.foo2, Decl(OverloadDeclarationWithExport.ets, 5, 27))
+export overload true {foo1, foo2};
+>foo1 : Symbol(true.foo1, Decl(OverloadDeclarationWithExport.ets, 6, 22))
+>foo2 : Symbol(true.foo2, Decl(OverloadDeclarationWithExport.ets, 6, 27))
+
diff --git a/tests/baselines/reference/OverloadDeclarationWithExport.types b/tests/baselines/reference/OverloadDeclarationWithExport.types
index 21b193549b..1e25ecacbf 100644
--- a/tests/baselines/reference/OverloadDeclarationWithExport.types
+++ b/tests/baselines/reference/OverloadDeclarationWithExport.types
@@ -17,3 +17,8 @@ export overload foo3 {foo1, foo2}
>foo1 : any
>foo2 : any
+export overload true {foo1, foo2};
+>true : error
+>foo1 : any
+>foo2 : any
+
diff --git a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets
index cd2b302fe8..2aa00c7246 100644
--- a/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets
+++ b/tests/cases/conformance/parser/ets/overload/OverloadDeclarationWithExport.ets
@@ -4,4 +4,5 @@ export declare function foo2(): void;
/** @overload testJSdoc */
export overload foo {foo1, foo2};
/** @overload testJSdoc */
-export overload foo3 {foo1, foo2}
\ No newline at end of file
+export overload foo3 {foo1, foo2}
+export overload true {foo1, foo2};
\ No newline at end of file
--
Gitee
From dba00419d0e8e06a763a8aad4411117c1209639d Mon Sep 17 00:00:00 2001
From: zju_wyx <22125041@zju.edu.cn>
Date: Sun, 17 Aug 2025 19:33:52 +0800
Subject: [PATCH 09/10] support parse decorator on typeAliasDeclaration and
functionType
Signed-off-by: zju_wyx <22125041@zju.edu.cn>
Change-Id: I40610930201dc115bcec2a1a7012c85a532cf21a
---
lib/tsc.js | 101 +++++++++-----
lib/tsserver.js | 110 ++++++++++-----
lib/tsserverlibrary.d.ts | 23 ++--
lib/tsserverlibrary.js | 110 ++++++++++-----
lib/typescript.d.ts | 23 ++--
lib/typescript.js | 109 ++++++++++-----
lib/typingsInstaller.js | 84 ++++++++----
src/compiler/checker.ts | 7 +-
src/compiler/emitter.ts | 11 +-
src/compiler/factory/nodeFactory.ts | 19 +--
src/compiler/factory/nodeTests.ts | 5 +
src/compiler/factory/utilitiesPublic.ts | 5 +-
src/compiler/parser.ts | 59 +++++---
src/compiler/transformers/declarations.ts | 13 +-
src/compiler/types.ts | 21 +--
src/compiler/utilities.ts | 2 +
src/compiler/visitorPublic.ts | 1 +
.../4.2/abstractConstructorTypes.ts | 6 +-
.../4.8/mergeDecoratorsAndModifiers.ts | 10 +-
src/harness/harnessUtils.ts | 5 +-
.../codefixes/annotateWithTypeFromJSDoc.ts | 2 +-
src/testRunner/unittests/printer.ts | 6 +
.../reference/DecoratorInTypeDeclaration.js | 26 ++++
.../DecoratorInTypeDeclaration.symbols | 19 +++
.../DecoratorInTypeDeclaration.types | 31 +++++
.../DecoratorInTypeDeclarationExport.js | 28 ++++
.../DecoratorInTypeDeclarationExport.symbols | 19 +++
.../DecoratorInTypeDeclarationExport.types | 31 +++++
.../reference/DecoratorOnFunctionType.js | 30 +++++
.../reference/DecoratorOnFunctionType.symbols | 25 ++++
.../reference/DecoratorOnFunctionType.types | 46 +++++++
.../DecoratorOnFunctionTypeExport.js | 32 +++++
.../DecoratorOnFunctionTypeExport.symbols | 25 ++++
.../DecoratorOnFunctionTypeExport.types | 46 +++++++
.../reference/DecoratorOnTypeDeclaration.js | 26 ++++
.../DecoratorOnTypeDeclaration.symbols | 19 +++
.../DecoratorOnTypeDeclaration.types | 31 +++++
.../DecoratorOnTypeDeclarationExport.js | 28 ++++
.../DecoratorOnTypeDeclarationExport.symbols | 19 +++
.../DecoratorOnTypeDeclarationExport.types | 31 +++++
.../reference/api/tsserverlibrary.d.ts | 23 ++--
tests/baselines/reference/api/typescript.d.ts | 23 ++--
...completionsCommentsCommentParsing.baseline | 126 ------------------
.../reference/decoratorOnTypeAlias.errors.txt | 10 --
...docParameterParsingInfiniteLoop.errors.txt | 9 +-
.../jsdocParameterParsingInfiniteLoop.types | 2 +-
.../quickInfoCommentsCommentParsing.baseline | 22 +--
...gnatureHelpCommentsCommentParsing.baseline | 45 -------
.../ets/decorator/DecoratorOnFunctionType.ets | 13 ++
.../DecoratorOnFunctionTypeExport.ets | 13 ++
.../decorator/DecoratorOnTypeDeclaration.ets | 11 ++
.../DecoratorOnTypeDeclarationExport.ets | 11 ++
52 files changed, 1083 insertions(+), 469 deletions(-)
create mode 100644 tests/baselines/reference/DecoratorInTypeDeclaration.js
create mode 100644 tests/baselines/reference/DecoratorInTypeDeclaration.symbols
create mode 100644 tests/baselines/reference/DecoratorInTypeDeclaration.types
create mode 100644 tests/baselines/reference/DecoratorInTypeDeclarationExport.js
create mode 100644 tests/baselines/reference/DecoratorInTypeDeclarationExport.symbols
create mode 100644 tests/baselines/reference/DecoratorInTypeDeclarationExport.types
create mode 100644 tests/baselines/reference/DecoratorOnFunctionType.js
create mode 100644 tests/baselines/reference/DecoratorOnFunctionType.symbols
create mode 100644 tests/baselines/reference/DecoratorOnFunctionType.types
create mode 100644 tests/baselines/reference/DecoratorOnFunctionTypeExport.js
create mode 100644 tests/baselines/reference/DecoratorOnFunctionTypeExport.symbols
create mode 100644 tests/baselines/reference/DecoratorOnFunctionTypeExport.types
create mode 100644 tests/baselines/reference/DecoratorOnTypeDeclaration.js
create mode 100644 tests/baselines/reference/DecoratorOnTypeDeclaration.symbols
create mode 100644 tests/baselines/reference/DecoratorOnTypeDeclaration.types
create mode 100644 tests/baselines/reference/DecoratorOnTypeDeclarationExport.js
create mode 100644 tests/baselines/reference/DecoratorOnTypeDeclarationExport.symbols
create mode 100644 tests/baselines/reference/DecoratorOnTypeDeclarationExport.types
delete mode 100644 tests/baselines/reference/decoratorOnTypeAlias.errors.txt
create mode 100644 tests/cases/conformance/parser/ets/decorator/DecoratorOnFunctionType.ets
create mode 100644 tests/cases/conformance/parser/ets/decorator/DecoratorOnFunctionTypeExport.ets
create mode 100644 tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeDeclaration.ets
create mode 100644 tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeDeclarationExport.ets
diff --git a/lib/tsc.js b/lib/tsc.js
index c1416aab0f..1c097478bb 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -13954,6 +13954,8 @@ function nodeCanBeDecorated(node, parent, grandparent, compilerOptions) {
switch (node.kind) {
case 266 /* ClassDeclaration */:
case 267 /* StructDeclaration */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return true;
case 172 /* PropertyDeclaration */:
return parent.kind === 266 /* ClassDeclaration */ || parent.kind === 267 /* StructDeclaration */;
@@ -20045,21 +20047,21 @@ function createNodeFactory(flags, baseFactory2) {
function updateTypeReferenceNode(node, typeName, typeArguments) {
return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node;
}
- function createFunctionTypeNode(typeParameters, parameters, type) {
+ function createFunctionTypeNode(modifiers, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
186 /* FunctionType */,
- void 0,
+ modifiers,
void 0,
typeParameters,
parameters,
type
);
node.transformFlags = 1 /* ContainsTypeScript */;
- node.modifiers = void 0;
+ node.modifiers = asNodeArray(modifiers);
return node;
}
- function updateFunctionTypeNode(node, typeParameters, parameters, type) {
- return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode(typeParameters, parameters, type), node) : node;
+ function updateFunctionTypeNode(node, modifiers, typeParameters, parameters, type) {
+ return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode(modifiers, typeParameters, parameters, type), node) : node;
}
function finishUpdateFunctionTypeNode(updated, original) {
if (updated !== original) {
@@ -22604,7 +22606,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isFunctionTypeNode(node) ? updateFunctionTypeNode(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray(array) : void 0;
@@ -24127,6 +24129,10 @@ function isDecorator(node) {
function isAnnotation(node) {
return node.kind === 170 /* Decorator */ && node.annotationDeclaration !== void 0;
}
+function isSendableDecorator(node) {
+ const nameExpr = node.expression;
+ return isIdentifier(nameExpr) && nameExpr.escapedText.toString() === "Sendable";
+}
function isPropertySignature(node) {
return node.kind === 171 /* PropertySignature */;
}
@@ -25574,11 +25580,11 @@ function setTextRange(range, location) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */;
}
// src/compiler/parser.ts
@@ -26711,15 +26717,15 @@ var Parser;
}
return func();
}
- function doInsideOfContext(context, func) {
+ function doInsideOfContext(context, func, isType) {
const contextFlagsToSet = context & ~contextFlags;
if (contextFlagsToSet) {
setContextFlag(true, contextFlagsToSet);
- const result = func();
+ const result = func(isType);
setContextFlag(false, contextFlagsToSet);
return result;
}
- return func();
+ return func(isType);
}
function allowInAnd(func) {
return doOutsideOfContext(4096 /* DisallowInContext */, func);
@@ -26772,6 +26778,12 @@ var Parser;
function inDisallowInContext() {
return inContext(4096 /* DisallowInContext */);
}
+ function inTypeContext() {
+ return inContext(134217728 /* TypeCached */);
+ }
+ function inJsDocContext() {
+ return inContext(8388608 /* JSDoc */);
+ }
function inDisallowConditionalTypesContext() {
return inContext(65536 /* DisallowConditionalTypesContext */);
}
@@ -28448,10 +28460,10 @@ var Parser;
pos
);
}
- function parseParenthesizedType() {
+ function parseParenthesizedType(decorators) {
const pos = getNodePos();
parseExpected(20 /* OpenParenToken */);
- const type = parseType();
+ const type = parseType(decorators);
parseExpected(21 /* CloseParenToken */);
return finishNode(factory2.createParenthesizedType(type), pos);
}
@@ -28465,7 +28477,7 @@ var Parser;
}
return modifiers;
}
- function parseFunctionOrConstructorType() {
+ function parseFunctionOrConstructorType(decorators) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
const modifiers = parseModifiersForConstructorType();
@@ -28473,9 +28485,7 @@ var Parser;
const typeParameters = parseTypeParameters();
const parameters = parseParameters(4 /* Type */);
const type = parseReturnType(38 /* EqualsGreaterThanToken */, false);
- const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
- if (!isConstructorType)
- node.modifiers = modifiers;
+ const node = isConstructorType ? factory2.createConstructorTypeNode(combineDecoratorsAndModifiers(decorators, modifiers), typeParameters, parameters, type) : factory2.createFunctionTypeNode(combineDecoratorsAndModifiers(decorators, modifiers), typeParameters, parameters, type);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseKeywordAndNoDot() {
@@ -28536,7 +28546,7 @@ var Parser;
nextToken();
return token() === 8 /* NumericLiteral */ || token() === 9 /* BigIntLiteral */;
}
- function parseNonArrayType() {
+ function parseNonArrayType(decorators) {
switch (token()) {
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
@@ -28588,7 +28598,7 @@ var Parser;
case 22 /* OpenBracketToken */:
return parseTupleType();
case 20 /* OpenParenToken */:
- return parseParenthesizedType();
+ return parseParenthesizedType(decorators);
case 101 /* ImportKeyword */:
return parseImportType();
case 130 /* AssertsKeyword */:
@@ -28654,7 +28664,8 @@ var Parser;
}
function parsePostfixTypeOrHigher() {
const pos = getNodePos();
- let type = parseNonArrayType();
+ const decorators = parseDecorators();
+ let type = parseNonArrayType(decorators);
while (!scanner.hasPrecedingLineBreak()) {
switch (token()) {
case 53 /* ExclamationToken */:
@@ -28826,12 +28837,12 @@ var Parser;
const type = parseOptional(141 /* IsKeyword */) ? parseType() : void 0;
return finishNode(factory2.createTypePredicateNode(assertsModifier, parameterName, type), pos);
}
- function parseType() {
+ function parseType(decorators) {
if (contextFlags & 40960 /* TypeExcludesFlags */) {
return doOutsideOfContext(40960 /* TypeExcludesFlags */, parseType);
}
if (isStartOfFunctionTypeOrConstructorType()) {
- return parseFunctionOrConstructorType();
+ return parseFunctionOrConstructorType(decorators);
}
const pos = getNodePos();
const type = parseUnionTypeOrHigher();
@@ -29861,6 +29872,12 @@ var Parser;
setSyntaxComponentContext(true);
setFirstArgumentExpression(true);
}
+ if (inTypeContext() && !inJsDocContext() && inDecoratorContext() && lookAhead(() => {
+ nextToken();
+ return token() === 20 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType);
+ })) {
+ break;
+ }
const argumentList = parseArgumentList();
const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createCallChain(expression, questionDotToken, typeArguments, argumentList) : factory2.createCallExpression(expression, typeArguments, argumentList);
expression = finishNode(callExpr, pos);
@@ -31556,10 +31573,21 @@ var Parser;
const name = parseIdentifier();
const typeParameters = parseTypeParameters();
parseExpected(63 /* EqualsToken */);
+ setContextFlag(true, 134217728 /* TypeCached */);
const type = token() === 140 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();
+ setContextFlag(false, 134217728 /* TypeCached */);
parseSemicolon();
- const node = factory2.createTypeAliasDeclaration(modifiers, name, typeParameters, type);
- node.illegalDecorators = decorators;
+ let reserveDecorators;
+ let hasOnlySendableDecorator = decorators && decorators.length === 1 && isSendableDecorator(decorators[0]) ? true : false;
+ if (hasOnlySendableDecorator) {
+ reserveDecorators = modifiers;
+ } else {
+ reserveDecorators = combineDecoratorsAndModifiers(decorators, modifiers);
+ }
+ const node = factory2.createTypeAliasDeclaration(reserveDecorators, name, typeParameters, type);
+ if (hasOnlySendableDecorator) {
+ node.illegalDecorators = decorators;
+ }
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseEnumMember() {
@@ -47990,7 +48018,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const flags = modifiersToFlags(modifiers);
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
}
- const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
+ const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
if (typeArguments) {
node.typeArguments = factory.createNodeArray(typeArguments);
}
@@ -48697,6 +48725,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
);
} else {
return factory.createFunctionTypeNode(
+ void 0,
visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols),
map(node.parameters, (p, i) => factory.createParameterDeclaration(
void 0,
@@ -67805,6 +67834,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const typeSymbol = exports && getSymbol(exports, JsxNames.Element, 788968 /* Type */);
const returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968 /* Type */, node);
const declaration = factory.createFunctionTypeNode(
+ void 0,
void 0,
[factory.createParameterDeclaration(void 0, void 0, "props", void 0, nodeBuilder.typeToTypeNode(result, node))],
returnNode ? factory.createTypeReferenceNode(returnNode, void 0) : factory.createKeywordTypeNode(132 /* AnyKeyword */)
@@ -78521,13 +78551,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 220 /* FunctionExpression */:
case 221 /* ArrowFunction */:
case 169 /* Parameter */:
+ case 186 /* FunctionType */:
case 168 /* TypeParameter */:
return false;
case 177 /* ClassStaticBlockDeclaration */:
case 308 /* PropertyAssignment */:
case 309 /* ShorthandPropertyAssignment */:
case 276 /* NamespaceExportDeclaration */:
- case 186 /* FunctionType */:
case 288 /* MissingDeclaration */:
return true;
default:
@@ -80140,6 +80170,7 @@ var visitEachChildTable = {
[186 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateFunctionTypeNode(
node,
+ nodesVisitor(node.modifiers, visitor, isModifierLike),
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
nodesVisitor(node.parameters, visitor, isParameterDeclaration),
nodeVisitor(node.type, visitor, isTypeNode)
@@ -97991,10 +98022,12 @@ function transformDeclarations(context) {
return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
}
case 186 /* FunctionType */: {
- return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
+ const decorators = getDecorators(input);
+ return cleanup(factory2.updateFunctionTypeNode(input, concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
case 187 /* ConstructorType */: {
- return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
+ const decorators = getDecorators(input);
+ return cleanup(factory2.updateConstructorTypeNode(input, concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
case 207 /* ImportType */: {
if (!isLiteralImportTypeNode(input))
@@ -98126,9 +98159,10 @@ function transformDeclarations(context) {
switch (input.kind) {
case 271 /* TypeAliasDeclaration */: {
needsDeclare = false;
+ let decorators = getDecorators(input);
const clean2 = cleanup(factory2.updateTypeAliasDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)),
input.name,
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
visitNode(input.type, visitDeclarationSubtree, isTypeNode)
@@ -101013,7 +101047,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitConstructorType(node) {
pushNameGenerationScope(node);
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
writeKeyword("new");
writeSpace();
emitTypeParameters(node, node.typeParameters);
@@ -101090,6 +101124,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(node.typeParameter);
}
function emitParenthesizedType(node) {
+ if (isFunctionTypeNode(node.type)) {
+ emitModifiers(node.type, node.type.modifiers);
+ }
writePunctuation("(");
emit(node.type);
writePunctuation(")");
@@ -101942,8 +101979,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitTypeAliasDeclaration(node) {
if (isSendableFunctionOrType(node, true)) {
emitDecorators(node, node.illegalDecorators);
+ emitModifiers(node, node.modifiers);
+ } else {
+ emitDecoratorsAndModifiers(node, node.modifiers);
}
- emitModifiers(node, node.modifiers);
writeKeyword("type");
writeSpace();
emit(node.name);
diff --git a/lib/tsserver.js b/lib/tsserver.js
index 01f15bf9c3..92a32adccb 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -1900,6 +1900,7 @@ __export(server_exports, {
isSatisfiesExpression: () => isSatisfiesExpression,
isScopeMarker: () => isScopeMarker,
isSemicolonClassElement: () => isSemicolonClassElement,
+ isSendableDecorator: () => isSendableDecorator,
isSendableFunctionOrType: () => isSendableFunctionOrType,
isSetAccessor: () => isSetAccessor,
isSetAccessorDeclaration: () => isSetAccessorDeclaration,
@@ -16648,6 +16649,8 @@ function nodeCanBeDecorated(node, parent2, grandparent, compilerOptions) {
switch (node.kind) {
case 266 /* ClassDeclaration */:
case 267 /* StructDeclaration */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return true;
case 172 /* PropertyDeclaration */:
return parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */;
@@ -22739,21 +22742,21 @@ function createNodeFactory(flags, baseFactory2) {
function updateTypeReferenceNode2(node, typeName, typeArguments) {
return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode2(typeName, typeArguments), node) : node;
}
- function createFunctionTypeNode2(typeParameters, parameters, type) {
+ function createFunctionTypeNode2(modifiers, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
186 /* FunctionType */,
- void 0,
+ modifiers,
void 0,
typeParameters,
parameters,
type
);
node.transformFlags = 1 /* ContainsTypeScript */;
- node.modifiers = void 0;
+ node.modifiers = asNodeArray(modifiers);
return node;
}
- function updateFunctionTypeNode2(node, typeParameters, parameters, type) {
- return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode2(typeParameters, parameters, type), node) : node;
+ function updateFunctionTypeNode2(node, modifiers, typeParameters, parameters, type) {
+ return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode2(modifiers, typeParameters, parameters, type), node) : node;
}
function finishUpdateFunctionTypeNode(updated, original) {
if (updated !== original) {
@@ -25298,7 +25301,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isFunctionTypeNode(node) ? updateFunctionTypeNode2(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray2(array) : void 0;
@@ -26821,6 +26824,10 @@ function isDecorator(node) {
function isAnnotation(node) {
return node.kind === 170 /* Decorator */ && node.annotationDeclaration !== void 0;
}
+function isSendableDecorator(node) {
+ const nameExpr = node.expression;
+ return isIdentifier(nameExpr) && nameExpr.escapedText.toString() === "Sendable";
+}
function isPropertySignature(node) {
return node.kind === 171 /* PropertySignature */;
}
@@ -28268,11 +28275,11 @@ function setTextRange(range, location2) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */;
}
// src/compiler/parser.ts
@@ -29390,15 +29397,15 @@ var Parser;
}
return func();
}
- function doInsideOfContext(context, func) {
+ function doInsideOfContext(context, func, isType3) {
const contextFlagsToSet = context & ~contextFlags;
if (contextFlagsToSet) {
setContextFlag(true, contextFlagsToSet);
- const result = func();
+ const result = func(isType3);
setContextFlag(false, contextFlagsToSet);
return result;
}
- return func();
+ return func(isType3);
}
function allowInAnd(func) {
return doOutsideOfContext(4096 /* DisallowInContext */, func);
@@ -29451,6 +29458,12 @@ var Parser;
function inDisallowInContext() {
return inContext(4096 /* DisallowInContext */);
}
+ function inTypeContext() {
+ return inContext(134217728 /* TypeCached */);
+ }
+ function inJsDocContext() {
+ return inContext(8388608 /* JSDoc */);
+ }
function inDisallowConditionalTypesContext() {
return inContext(65536 /* DisallowConditionalTypesContext */);
}
@@ -31127,10 +31140,10 @@ var Parser;
pos
);
}
- function parseParenthesizedType() {
+ function parseParenthesizedType(decorators) {
const pos = getNodePos();
parseExpected(20 /* OpenParenToken */);
- const type = parseType();
+ const type = parseType(decorators);
parseExpected(21 /* CloseParenToken */);
return finishNode(factory2.createParenthesizedType(type), pos);
}
@@ -31144,7 +31157,7 @@ var Parser;
}
return modifiers;
}
- function parseFunctionOrConstructorType() {
+ function parseFunctionOrConstructorType(decorators) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
const modifiers = parseModifiersForConstructorType();
@@ -31152,9 +31165,7 @@ var Parser;
const typeParameters = parseTypeParameters();
const parameters = parseParameters(4 /* Type */);
const type = parseReturnType(38 /* EqualsGreaterThanToken */, false);
- const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
- if (!isConstructorType)
- node.modifiers = modifiers;
+ const node = isConstructorType ? factory2.createConstructorTypeNode(combineDecoratorsAndModifiers(decorators, modifiers), typeParameters, parameters, type) : factory2.createFunctionTypeNode(combineDecoratorsAndModifiers(decorators, modifiers), typeParameters, parameters, type);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseKeywordAndNoDot() {
@@ -31215,7 +31226,7 @@ var Parser;
nextToken();
return token() === 8 /* NumericLiteral */ || token() === 9 /* BigIntLiteral */;
}
- function parseNonArrayType() {
+ function parseNonArrayType(decorators) {
switch (token()) {
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
@@ -31267,7 +31278,7 @@ var Parser;
case 22 /* OpenBracketToken */:
return parseTupleType();
case 20 /* OpenParenToken */:
- return parseParenthesizedType();
+ return parseParenthesizedType(decorators);
case 101 /* ImportKeyword */:
return parseImportType();
case 130 /* AssertsKeyword */:
@@ -31333,7 +31344,8 @@ var Parser;
}
function parsePostfixTypeOrHigher() {
const pos = getNodePos();
- let type = parseNonArrayType();
+ const decorators = parseDecorators();
+ let type = parseNonArrayType(decorators);
while (!scanner2.hasPrecedingLineBreak()) {
switch (token()) {
case 53 /* ExclamationToken */:
@@ -31505,12 +31517,12 @@ var Parser;
const type = parseOptional(141 /* IsKeyword */) ? parseType() : void 0;
return finishNode(factory2.createTypePredicateNode(assertsModifier, parameterName, type), pos);
}
- function parseType() {
+ function parseType(decorators) {
if (contextFlags & 40960 /* TypeExcludesFlags */) {
return doOutsideOfContext(40960 /* TypeExcludesFlags */, parseType);
}
if (isStartOfFunctionTypeOrConstructorType()) {
- return parseFunctionOrConstructorType();
+ return parseFunctionOrConstructorType(decorators);
}
const pos = getNodePos();
const type = parseUnionTypeOrHigher();
@@ -32540,6 +32552,12 @@ var Parser;
setSyntaxComponentContext(true);
setFirstArgumentExpression(true);
}
+ if (inTypeContext() && !inJsDocContext() && inDecoratorContext() && lookAhead(() => {
+ nextToken();
+ return token() === 20 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType);
+ })) {
+ break;
+ }
const argumentList = parseArgumentList();
const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createCallChain(expression, questionDotToken, typeArguments, argumentList) : factory2.createCallExpression(expression, typeArguments, argumentList);
expression = finishNode(callExpr, pos);
@@ -34235,10 +34253,21 @@ var Parser;
const name = parseIdentifier();
const typeParameters = parseTypeParameters();
parseExpected(63 /* EqualsToken */);
+ setContextFlag(true, 134217728 /* TypeCached */);
const type = token() === 140 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();
+ setContextFlag(false, 134217728 /* TypeCached */);
parseSemicolon();
- const node = factory2.createTypeAliasDeclaration(modifiers, name, typeParameters, type);
- node.illegalDecorators = decorators;
+ let reserveDecorators;
+ let hasOnlySendableDecorator = decorators && decorators.length === 1 && isSendableDecorator(decorators[0]) ? true : false;
+ if (hasOnlySendableDecorator) {
+ reserveDecorators = modifiers;
+ } else {
+ reserveDecorators = combineDecoratorsAndModifiers(decorators, modifiers);
+ }
+ const node = factory2.createTypeAliasDeclaration(reserveDecorators, name, typeParameters, type);
+ if (hasOnlySendableDecorator) {
+ node.illegalDecorators = decorators;
+ }
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseEnumMember() {
@@ -50526,7 +50555,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const flags = modifiersToFlags(modifiers);
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
}
- const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
+ const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
if (typeArguments) {
node.typeArguments = factory.createNodeArray(typeArguments);
}
@@ -51233,6 +51262,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
);
} else {
return factory.createFunctionTypeNode(
+ void 0,
visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols),
map(node.parameters, (p, i) => factory.createParameterDeclaration(
void 0,
@@ -70341,6 +70371,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const typeSymbol = exports && getSymbol2(exports, JsxNames.Element, 788968 /* Type */);
const returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968 /* Type */, node);
const declaration = factory.createFunctionTypeNode(
+ void 0,
void 0,
[factory.createParameterDeclaration(void 0, void 0, "props", void 0, nodeBuilder.typeToTypeNode(result, node))],
returnNode ? factory.createTypeReferenceNode(returnNode, void 0) : factory.createKeywordTypeNode(132 /* AnyKeyword */)
@@ -81057,13 +81088,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 220 /* FunctionExpression */:
case 221 /* ArrowFunction */:
case 169 /* Parameter */:
+ case 186 /* FunctionType */:
case 168 /* TypeParameter */:
return false;
case 177 /* ClassStaticBlockDeclaration */:
case 308 /* PropertyAssignment */:
case 309 /* ShorthandPropertyAssignment */:
case 276 /* NamespaceExportDeclaration */:
- case 186 /* FunctionType */:
case 288 /* MissingDeclaration */:
return true;
default:
@@ -82676,6 +82707,7 @@ var visitEachChildTable = {
[186 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateFunctionTypeNode(
node,
+ nodesVisitor(node.modifiers, visitor, isModifierLike),
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
nodesVisitor(node.parameters, visitor, isParameterDeclaration),
nodeVisitor(node.type, visitor, isTypeNode)
@@ -100343,10 +100375,12 @@ function transformDeclarations(context) {
return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
}
case 186 /* FunctionType */: {
- return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
+ const decorators = getDecorators(input);
+ return cleanup(factory2.updateFunctionTypeNode(input, concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
case 187 /* ConstructorType */: {
- return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
+ const decorators = getDecorators(input);
+ return cleanup(factory2.updateConstructorTypeNode(input, concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
case 207 /* ImportType */: {
if (!isLiteralImportTypeNode(input))
@@ -100478,9 +100512,10 @@ function transformDeclarations(context) {
switch (input.kind) {
case 271 /* TypeAliasDeclaration */: {
needsDeclare = false;
+ let decorators = getDecorators(input);
const clean2 = cleanup(factory2.updateTypeAliasDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)),
input.name,
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
visitNode(input.type, visitDeclarationSubtree, isTypeNode)
@@ -103345,7 +103380,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitConstructorType(node) {
pushNameGenerationScope(node);
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
writeKeyword("new");
writeSpace();
emitTypeParameters(node, node.typeParameters);
@@ -103422,6 +103457,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(node.typeParameter);
}
function emitParenthesizedType(node) {
+ if (isFunctionTypeNode(node.type)) {
+ emitModifiers(node.type, node.type.modifiers);
+ }
writePunctuation("(");
emit(node.type);
writePunctuation(")");
@@ -104274,8 +104312,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitTypeAliasDeclaration(node) {
if (isSendableFunctionOrType(node, true)) {
emitDecorators(node, node.illegalDecorators);
+ emitModifiers(node, node.modifiers);
+ } else {
+ emitDecoratorsAndModifiers(node, node.modifiers);
}
- emitModifiers(node, node.modifiers);
writeKeyword("type");
writeSpace();
emit(node.name);
@@ -118239,6 +118279,7 @@ __export(ts_exports3, {
isSatisfiesExpression: () => isSatisfiesExpression,
isScopeMarker: () => isScopeMarker,
isSemicolonClassElement: () => isSemicolonClassElement,
+ isSendableDecorator: () => isSendableDecorator,
isSendableFunctionOrType: () => isSendableFunctionOrType,
isSetAccessor: () => isSetAccessor,
isSetAccessorDeclaration: () => isSetAccessorDeclaration,
@@ -130669,7 +130710,7 @@ function transformJSDocVariadicType(node) {
}
function transformJSDocFunctionType(node) {
var _a2;
- return factory.createFunctionTypeNode(emptyArray, node.parameters.map(transformJSDocParameter), (_a2 = node.type) != null ? _a2 : factory.createKeywordTypeNode(132 /* AnyKeyword */));
+ return factory.createFunctionTypeNode(void 0, emptyArray, node.parameters.map(transformJSDocParameter), (_a2 = node.type) != null ? _a2 : factory.createKeywordTypeNode(132 /* AnyKeyword */));
}
function transformJSDocParameter(node) {
const index = node.parent.parameters.indexOf(node);
@@ -156663,7 +156704,7 @@ function patchNodeFactory4(factory2) {
return createTypeAliasDeclaration2(modifiers, name, typeParameters, type);
}
}).bind({
- 0: ([modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)),
+ 0: ([modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)),
1: ([decorators, modifiers, name, typeParameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || isTypeNode(type))
}).deprecate({
1: DISALLOW_DECORATORS
@@ -156676,7 +156717,7 @@ function patchNodeFactory4(factory2) {
return updateTypeAliasDeclaration2(node, modifiers, name, typeParameters, type);
}
}).bind({
- 0: ([, modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)),
+ 0: ([, modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)),
1: ([, decorators, modifiers, name, typeParameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || isTypeNode(type))
}).deprecate({
1: DISALLOW_DECORATORS
@@ -178976,6 +179017,7 @@ if (typeof process !== "undefined") {
isSatisfiesExpression,
isScopeMarker,
isSemicolonClassElement,
+ isSendableDecorator,
isSendableFunctionOrType,
isSetAccessor,
isSetAccessorDeclaration,
diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts
index 554204ead4..2b31552aa1 100644
--- a/lib/tsserverlibrary.d.ts
+++ b/lib/tsserverlibrary.d.ts
@@ -4701,9 +4701,9 @@ declare namespace ts {
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | EnumMember;
- type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration;
+ type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration | TypeAliasDeclaration | FunctionOrConstructorTypeNode;
type HasIllegalDecorators = PropertyAssignment | ShorthandPropertyAssignment | FunctionDeclaration | ConstructorDeclaration | IndexSignatureDeclaration | ClassStaticBlockDeclaration | MissingDeclaration | VariableStatement | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportDeclaration | ExportAssignment;
- type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
+ type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | FunctionTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
interface NodeArray extends ReadonlyArray, ReadonlyTextRange {
readonly hasTrailingComma: boolean;
}
@@ -5067,11 +5067,11 @@ declare namespace ts {
}
interface FunctionTypeNode {
/** @deprecated A function type cannot have modifiers */
- readonly modifiers?: NodeArray | undefined;
+ readonly modifiers?: NodeArray | undefined;
}
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
readonly kind: SyntaxKind.ConstructorType;
- readonly modifiers?: NodeArray;
+ readonly modifiers?: NodeArray;
}
interface NodeWithTypeArguments extends TypeNode {
readonly typeArguments?: NodeArray;
@@ -5811,7 +5811,7 @@ declare namespace ts {
}
interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer {
readonly kind: SyntaxKind.TypeAliasDeclaration;
- readonly modifiers?: NodeArray;
+ readonly modifiers?: NodeArray;
readonly name: Identifier;
readonly typeParameters?: NodeArray;
readonly type: TypeNode;
@@ -7942,10 +7942,10 @@ declare namespace ts {
updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode;
createTypeReferenceNode(typeName: string | EntityName, typeArguments?: readonly TypeNode[]): TypeReferenceNode;
updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray | undefined): TypeReferenceNode;
- createFunctionTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
- updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): FunctionTypeNode;
- createConstructorTypeNode(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
- updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly Modifier[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): ConstructorTypeNode;
+ createFunctionTypeNode(modifiers: readonly ModifierLike[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
+ updateFunctionTypeNode(node: FunctionTypeNode, modifiers: readonly ModifierLike[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): FunctionTypeNode;
+ createConstructorTypeNode(modifiers: readonly ModifierLike[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
+ updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly ModifierLike[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): ConstructorTypeNode;
createTypeQueryNode(exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode;
@@ -8120,8 +8120,8 @@ declare namespace ts {
updateOverloadDeclaration(node: OverloadDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
- createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
- updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
+ createTypeAliasDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
+ updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
createEnumDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
createModuleDeclaration(modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration;
@@ -9468,6 +9468,7 @@ declare namespace ts {
function isDecoratorOrAnnotation(node: Node): node is Decorator;
function isDecorator(node: Node): node is Decorator;
function isAnnotation(node: Node): node is Annotation;
+ function isSendableDecorator(node: Decorator): node is Decorator;
function isPropertySignature(node: Node): node is PropertySignature;
function isOverloadPropertyDeclaration(node: Node): node is OverloadPropertyDeclaration;
function isPropertyDeclaration(node: Node): node is PropertyDeclaration;
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index f5e81b8c0a..6f7df2d1a4 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -1900,6 +1900,7 @@ __export(tsserverlibrary_exports, {
isSatisfiesExpression: () => isSatisfiesExpression,
isScopeMarker: () => isScopeMarker,
isSemicolonClassElement: () => isSemicolonClassElement,
+ isSendableDecorator: () => isSendableDecorator,
isSendableFunctionOrType: () => isSendableFunctionOrType,
isSetAccessor: () => isSetAccessor,
isSetAccessorDeclaration: () => isSetAccessorDeclaration,
@@ -16550,6 +16551,8 @@ function nodeCanBeDecorated(node, parent2, grandparent, compilerOptions) {
switch (node.kind) {
case 266 /* ClassDeclaration */:
case 267 /* StructDeclaration */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return true;
case 172 /* PropertyDeclaration */:
return parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */;
@@ -22641,21 +22644,21 @@ function createNodeFactory(flags, baseFactory2) {
function updateTypeReferenceNode2(node, typeName, typeArguments) {
return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode2(typeName, typeArguments), node) : node;
}
- function createFunctionTypeNode2(typeParameters, parameters, type) {
+ function createFunctionTypeNode2(modifiers, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
186 /* FunctionType */,
- void 0,
+ modifiers,
void 0,
typeParameters,
parameters,
type
);
node.transformFlags = 1 /* ContainsTypeScript */;
- node.modifiers = void 0;
+ node.modifiers = asNodeArray(modifiers);
return node;
}
- function updateFunctionTypeNode2(node, typeParameters, parameters, type) {
- return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode2(typeParameters, parameters, type), node) : node;
+ function updateFunctionTypeNode2(node, modifiers, typeParameters, parameters, type) {
+ return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode2(modifiers, typeParameters, parameters, type), node) : node;
}
function finishUpdateFunctionTypeNode(updated, original) {
if (updated !== original) {
@@ -25200,7 +25203,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isFunctionTypeNode(node) ? updateFunctionTypeNode2(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray2(array) : void 0;
@@ -26723,6 +26726,10 @@ function isDecorator(node) {
function isAnnotation(node) {
return node.kind === 170 /* Decorator */ && node.annotationDeclaration !== void 0;
}
+function isSendableDecorator(node) {
+ const nameExpr = node.expression;
+ return isIdentifier(nameExpr) && nameExpr.escapedText.toString() === "Sendable";
+}
function isPropertySignature(node) {
return node.kind === 171 /* PropertySignature */;
}
@@ -28170,11 +28177,11 @@ function setTextRange(range, location) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */;
}
// src/compiler/parser.ts
@@ -29292,15 +29299,15 @@ var Parser;
}
return func();
}
- function doInsideOfContext(context, func) {
+ function doInsideOfContext(context, func, isType3) {
const contextFlagsToSet = context & ~contextFlags;
if (contextFlagsToSet) {
setContextFlag(true, contextFlagsToSet);
- const result = func();
+ const result = func(isType3);
setContextFlag(false, contextFlagsToSet);
return result;
}
- return func();
+ return func(isType3);
}
function allowInAnd(func) {
return doOutsideOfContext(4096 /* DisallowInContext */, func);
@@ -29353,6 +29360,12 @@ var Parser;
function inDisallowInContext() {
return inContext(4096 /* DisallowInContext */);
}
+ function inTypeContext() {
+ return inContext(134217728 /* TypeCached */);
+ }
+ function inJsDocContext() {
+ return inContext(8388608 /* JSDoc */);
+ }
function inDisallowConditionalTypesContext() {
return inContext(65536 /* DisallowConditionalTypesContext */);
}
@@ -31029,10 +31042,10 @@ var Parser;
pos
);
}
- function parseParenthesizedType() {
+ function parseParenthesizedType(decorators) {
const pos = getNodePos();
parseExpected(20 /* OpenParenToken */);
- const type = parseType();
+ const type = parseType(decorators);
parseExpected(21 /* CloseParenToken */);
return finishNode(factory2.createParenthesizedType(type), pos);
}
@@ -31046,7 +31059,7 @@ var Parser;
}
return modifiers;
}
- function parseFunctionOrConstructorType() {
+ function parseFunctionOrConstructorType(decorators) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
const modifiers = parseModifiersForConstructorType();
@@ -31054,9 +31067,7 @@ var Parser;
const typeParameters = parseTypeParameters();
const parameters = parseParameters(4 /* Type */);
const type = parseReturnType(38 /* EqualsGreaterThanToken */, false);
- const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
- if (!isConstructorType)
- node.modifiers = modifiers;
+ const node = isConstructorType ? factory2.createConstructorTypeNode(combineDecoratorsAndModifiers(decorators, modifiers), typeParameters, parameters, type) : factory2.createFunctionTypeNode(combineDecoratorsAndModifiers(decorators, modifiers), typeParameters, parameters, type);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseKeywordAndNoDot() {
@@ -31117,7 +31128,7 @@ var Parser;
nextToken();
return token() === 8 /* NumericLiteral */ || token() === 9 /* BigIntLiteral */;
}
- function parseNonArrayType() {
+ function parseNonArrayType(decorators) {
switch (token()) {
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
@@ -31169,7 +31180,7 @@ var Parser;
case 22 /* OpenBracketToken */:
return parseTupleType();
case 20 /* OpenParenToken */:
- return parseParenthesizedType();
+ return parseParenthesizedType(decorators);
case 101 /* ImportKeyword */:
return parseImportType();
case 130 /* AssertsKeyword */:
@@ -31235,7 +31246,8 @@ var Parser;
}
function parsePostfixTypeOrHigher() {
const pos = getNodePos();
- let type = parseNonArrayType();
+ const decorators = parseDecorators();
+ let type = parseNonArrayType(decorators);
while (!scanner2.hasPrecedingLineBreak()) {
switch (token()) {
case 53 /* ExclamationToken */:
@@ -31407,12 +31419,12 @@ var Parser;
const type = parseOptional(141 /* IsKeyword */) ? parseType() : void 0;
return finishNode(factory2.createTypePredicateNode(assertsModifier, parameterName, type), pos);
}
- function parseType() {
+ function parseType(decorators) {
if (contextFlags & 40960 /* TypeExcludesFlags */) {
return doOutsideOfContext(40960 /* TypeExcludesFlags */, parseType);
}
if (isStartOfFunctionTypeOrConstructorType()) {
- return parseFunctionOrConstructorType();
+ return parseFunctionOrConstructorType(decorators);
}
const pos = getNodePos();
const type = parseUnionTypeOrHigher();
@@ -32442,6 +32454,12 @@ var Parser;
setSyntaxComponentContext(true);
setFirstArgumentExpression(true);
}
+ if (inTypeContext() && !inJsDocContext() && inDecoratorContext() && lookAhead(() => {
+ nextToken();
+ return token() === 20 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType);
+ })) {
+ break;
+ }
const argumentList = parseArgumentList();
const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createCallChain(expression, questionDotToken, typeArguments, argumentList) : factory2.createCallExpression(expression, typeArguments, argumentList);
expression = finishNode(callExpr, pos);
@@ -34137,10 +34155,21 @@ var Parser;
const name = parseIdentifier();
const typeParameters = parseTypeParameters();
parseExpected(63 /* EqualsToken */);
+ setContextFlag(true, 134217728 /* TypeCached */);
const type = token() === 140 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();
+ setContextFlag(false, 134217728 /* TypeCached */);
parseSemicolon();
- const node = factory2.createTypeAliasDeclaration(modifiers, name, typeParameters, type);
- node.illegalDecorators = decorators;
+ let reserveDecorators;
+ let hasOnlySendableDecorator = decorators && decorators.length === 1 && isSendableDecorator(decorators[0]) ? true : false;
+ if (hasOnlySendableDecorator) {
+ reserveDecorators = modifiers;
+ } else {
+ reserveDecorators = combineDecoratorsAndModifiers(decorators, modifiers);
+ }
+ const node = factory2.createTypeAliasDeclaration(reserveDecorators, name, typeParameters, type);
+ if (hasOnlySendableDecorator) {
+ node.illegalDecorators = decorators;
+ }
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseEnumMember() {
@@ -50428,7 +50457,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const flags = modifiersToFlags(modifiers);
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
}
- const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
+ const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
if (typeArguments) {
node.typeArguments = factory.createNodeArray(typeArguments);
}
@@ -51135,6 +51164,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
);
} else {
return factory.createFunctionTypeNode(
+ void 0,
visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols),
map(node.parameters, (p, i) => factory.createParameterDeclaration(
void 0,
@@ -70243,6 +70273,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const typeSymbol = exports && getSymbol2(exports, JsxNames.Element, 788968 /* Type */);
const returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968 /* Type */, node);
const declaration = factory.createFunctionTypeNode(
+ void 0,
void 0,
[factory.createParameterDeclaration(void 0, void 0, "props", void 0, nodeBuilder.typeToTypeNode(result, node))],
returnNode ? factory.createTypeReferenceNode(returnNode, void 0) : factory.createKeywordTypeNode(132 /* AnyKeyword */)
@@ -80959,13 +80990,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 220 /* FunctionExpression */:
case 221 /* ArrowFunction */:
case 169 /* Parameter */:
+ case 186 /* FunctionType */:
case 168 /* TypeParameter */:
return false;
case 177 /* ClassStaticBlockDeclaration */:
case 308 /* PropertyAssignment */:
case 309 /* ShorthandPropertyAssignment */:
case 276 /* NamespaceExportDeclaration */:
- case 186 /* FunctionType */:
case 288 /* MissingDeclaration */:
return true;
default:
@@ -82578,6 +82609,7 @@ var visitEachChildTable = {
[186 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateFunctionTypeNode(
node,
+ nodesVisitor(node.modifiers, visitor, isModifierLike),
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
nodesVisitor(node.parameters, visitor, isParameterDeclaration),
nodeVisitor(node.type, visitor, isTypeNode)
@@ -100245,10 +100277,12 @@ function transformDeclarations(context) {
return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
}
case 186 /* FunctionType */: {
- return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
+ const decorators = getDecorators(input);
+ return cleanup(factory2.updateFunctionTypeNode(input, concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
case 187 /* ConstructorType */: {
- return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
+ const decorators = getDecorators(input);
+ return cleanup(factory2.updateConstructorTypeNode(input, concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
case 207 /* ImportType */: {
if (!isLiteralImportTypeNode(input))
@@ -100380,9 +100414,10 @@ function transformDeclarations(context) {
switch (input.kind) {
case 271 /* TypeAliasDeclaration */: {
needsDeclare = false;
+ let decorators = getDecorators(input);
const clean2 = cleanup(factory2.updateTypeAliasDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)),
input.name,
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
visitNode(input.type, visitDeclarationSubtree, isTypeNode)
@@ -103247,7 +103282,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitConstructorType(node) {
pushNameGenerationScope(node);
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
writeKeyword("new");
writeSpace();
emitTypeParameters(node, node.typeParameters);
@@ -103324,6 +103359,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(node.typeParameter);
}
function emitParenthesizedType(node) {
+ if (isFunctionTypeNode(node.type)) {
+ emitModifiers(node.type, node.type.modifiers);
+ }
writePunctuation("(");
emit(node.type);
writePunctuation(")");
@@ -104176,8 +104214,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitTypeAliasDeclaration(node) {
if (isSendableFunctionOrType(node, true)) {
emitDecorators(node, node.illegalDecorators);
+ emitModifiers(node, node.modifiers);
+ } else {
+ emitDecoratorsAndModifiers(node, node.modifiers);
}
- emitModifiers(node, node.modifiers);
writeKeyword("type");
writeSpace();
emit(node.name);
@@ -127890,7 +127930,7 @@ function transformJSDocVariadicType(node) {
}
function transformJSDocFunctionType(node) {
var _a2;
- return factory.createFunctionTypeNode(emptyArray, node.parameters.map(transformJSDocParameter), (_a2 = node.type) != null ? _a2 : factory.createKeywordTypeNode(132 /* AnyKeyword */));
+ return factory.createFunctionTypeNode(void 0, emptyArray, node.parameters.map(transformJSDocParameter), (_a2 = node.type) != null ? _a2 : factory.createKeywordTypeNode(132 /* AnyKeyword */));
}
function transformJSDocParameter(node) {
const index = node.parent.parameters.indexOf(node);
@@ -154706,6 +154746,7 @@ __export(ts_exports3, {
isSatisfiesExpression: () => isSatisfiesExpression,
isScopeMarker: () => isScopeMarker,
isSemicolonClassElement: () => isSemicolonClassElement,
+ isSendableDecorator: () => isSendableDecorator,
isSendableFunctionOrType: () => isSendableFunctionOrType,
isSetAccessor: () => isSetAccessor,
isSetAccessorDeclaration: () => isSetAccessorDeclaration,
@@ -156474,7 +156515,7 @@ function patchNodeFactory4(factory2) {
return createTypeAliasDeclaration2(modifiers, name, typeParameters, type);
}
}).bind({
- 0: ([modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)),
+ 0: ([modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)),
1: ([decorators, modifiers, name, typeParameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || isTypeNode(type))
}).deprecate({
1: DISALLOW_DECORATORS
@@ -156487,7 +156528,7 @@ function patchNodeFactory4(factory2) {
return updateTypeAliasDeclaration2(node, modifiers, name, typeParameters, type);
}
}).bind({
- 0: ([, modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)),
+ 0: ([, modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)),
1: ([, decorators, modifiers, name, typeParameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || isTypeNode(type))
}).deprecate({
1: DISALLOW_DECORATORS
@@ -177973,6 +178014,7 @@ __export(ts_server_exports3, {
isSatisfiesExpression,
isScopeMarker,
isSemicolonClassElement,
+ isSendableDecorator,
isSendableFunctionOrType,
isSetAccessor,
isSetAccessorDeclaration,
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
index 3482f90040..1e0b6a1400 100644
--- a/lib/typescript.d.ts
+++ b/lib/typescript.d.ts
@@ -698,9 +698,9 @@ declare namespace ts {
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | EnumMember;
- type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration;
+ type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration | TypeAliasDeclaration | FunctionOrConstructorTypeNode;
type HasIllegalDecorators = PropertyAssignment | ShorthandPropertyAssignment | FunctionDeclaration | ConstructorDeclaration | IndexSignatureDeclaration | ClassStaticBlockDeclaration | MissingDeclaration | VariableStatement | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportDeclaration | ExportAssignment;
- type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
+ type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | FunctionTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
interface NodeArray extends ReadonlyArray, ReadonlyTextRange {
readonly hasTrailingComma: boolean;
}
@@ -1064,11 +1064,11 @@ declare namespace ts {
}
interface FunctionTypeNode {
/** @deprecated A function type cannot have modifiers */
- readonly modifiers?: NodeArray | undefined;
+ readonly modifiers?: NodeArray | undefined;
}
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
readonly kind: SyntaxKind.ConstructorType;
- readonly modifiers?: NodeArray;
+ readonly modifiers?: NodeArray;
}
interface NodeWithTypeArguments extends TypeNode {
readonly typeArguments?: NodeArray;
@@ -1808,7 +1808,7 @@ declare namespace ts {
}
interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer {
readonly kind: SyntaxKind.TypeAliasDeclaration;
- readonly modifiers?: NodeArray;
+ readonly modifiers?: NodeArray;
readonly name: Identifier;
readonly typeParameters?: NodeArray;
readonly type: TypeNode;
@@ -3939,10 +3939,10 @@ declare namespace ts {
updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode;
createTypeReferenceNode(typeName: string | EntityName, typeArguments?: readonly TypeNode[]): TypeReferenceNode;
updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray | undefined): TypeReferenceNode;
- createFunctionTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
- updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): FunctionTypeNode;
- createConstructorTypeNode(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
- updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly Modifier[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): ConstructorTypeNode;
+ createFunctionTypeNode(modifiers: readonly ModifierLike[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
+ updateFunctionTypeNode(node: FunctionTypeNode, modifiers: readonly ModifierLike[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): FunctionTypeNode;
+ createConstructorTypeNode(modifiers: readonly ModifierLike[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
+ updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly ModifierLike[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): ConstructorTypeNode;
createTypeQueryNode(exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode;
@@ -4117,8 +4117,8 @@ declare namespace ts {
updateOverloadDeclaration(node: OverloadDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
- createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
- updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
+ createTypeAliasDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
+ updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
createEnumDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
createModuleDeclaration(modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration;
@@ -5465,6 +5465,7 @@ declare namespace ts {
function isDecoratorOrAnnotation(node: Node): node is Decorator;
function isDecorator(node: Node): node is Decorator;
function isAnnotation(node: Node): node is Annotation;
+ function isSendableDecorator(node: Decorator): node is Decorator;
function isPropertySignature(node: Node): node is PropertySignature;
function isOverloadPropertyDeclaration(node: Node): node is OverloadPropertyDeclaration;
function isPropertyDeclaration(node: Node): node is PropertyDeclaration;
diff --git a/lib/typescript.js b/lib/typescript.js
index 9fe99aab36..f48fda6fb2 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -1900,6 +1900,7 @@ __export(typescript_exports, {
isSatisfiesExpression: () => isSatisfiesExpression,
isScopeMarker: () => isScopeMarker,
isSemicolonClassElement: () => isSemicolonClassElement,
+ isSendableDecorator: () => isSendableDecorator,
isSendableFunctionOrType: () => isSendableFunctionOrType,
isSetAccessor: () => isSetAccessor,
isSetAccessorDeclaration: () => isSetAccessorDeclaration,
@@ -16550,6 +16551,8 @@ function nodeCanBeDecorated(node, parent2, grandparent, compilerOptions) {
switch (node.kind) {
case 266 /* ClassDeclaration */:
case 267 /* StructDeclaration */:
+ case 186 /* FunctionType */:
+ case 187 /* ConstructorType */:
return true;
case 172 /* PropertyDeclaration */:
return parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */;
@@ -22641,21 +22644,21 @@ function createNodeFactory(flags, baseFactory2) {
function updateTypeReferenceNode2(node, typeName, typeArguments) {
return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode2(typeName, typeArguments), node) : node;
}
- function createFunctionTypeNode2(typeParameters, parameters, type) {
+ function createFunctionTypeNode2(modifiers, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
186 /* FunctionType */,
- void 0,
+ modifiers,
void 0,
typeParameters,
parameters,
type
);
node.transformFlags = 1 /* ContainsTypeScript */;
- node.modifiers = void 0;
+ node.modifiers = asNodeArray(modifiers);
return node;
}
- function updateFunctionTypeNode2(node, typeParameters, parameters, type) {
- return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode2(typeParameters, parameters, type), node) : node;
+ function updateFunctionTypeNode2(node, modifiers, typeParameters, parameters, type) {
+ return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode2(modifiers, typeParameters, parameters, type), node) : node;
}
function finishUpdateFunctionTypeNode(updated, original) {
if (updated !== original) {
@@ -25200,7 +25203,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration2(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isFunctionTypeNode(node) ? updateFunctionTypeNode2(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature3(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature3(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature2(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction3(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression3(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement2(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration2(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration2(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration2(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration2(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration2(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration2(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration2(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment2(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration3(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray2(array) : void 0;
@@ -26723,6 +26726,10 @@ function isDecorator(node) {
function isAnnotation(node) {
return node.kind === 170 /* Decorator */ && node.annotationDeclaration !== void 0;
}
+function isSendableDecorator(node) {
+ const nameExpr = node.expression;
+ return isIdentifier(nameExpr) && nameExpr.escapedText.toString() === "Sendable";
+}
function isPropertySignature(node) {
return node.kind === 171 /* PropertySignature */;
}
@@ -28170,11 +28177,11 @@ function setTextRange(range, location) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */;
}
// src/compiler/parser.ts
@@ -29307,15 +29314,15 @@ var Parser;
}
return func();
}
- function doInsideOfContext(context, func) {
+ function doInsideOfContext(context, func, isType3) {
const contextFlagsToSet = context & ~contextFlags;
if (contextFlagsToSet) {
setContextFlag(true, contextFlagsToSet);
- const result = func();
+ const result = func(isType3);
setContextFlag(false, contextFlagsToSet);
return result;
}
- return func();
+ return func(isType3);
}
function allowInAnd(func) {
return doOutsideOfContext(4096 /* DisallowInContext */, func);
@@ -29368,6 +29375,12 @@ var Parser;
function inDisallowInContext() {
return inContext(4096 /* DisallowInContext */);
}
+ function inTypeContext() {
+ return inContext(134217728 /* TypeCached */);
+ }
+ function inJsDocContext() {
+ return inContext(8388608 /* JSDoc */);
+ }
function inDisallowConditionalTypesContext() {
return inContext(65536 /* DisallowConditionalTypesContext */);
}
@@ -31044,10 +31057,10 @@ var Parser;
pos
);
}
- function parseParenthesizedType() {
+ function parseParenthesizedType(decorators) {
const pos = getNodePos();
parseExpected(20 /* OpenParenToken */);
- const type = parseType();
+ const type = parseType(decorators);
parseExpected(21 /* CloseParenToken */);
return finishNode(factory2.createParenthesizedType(type), pos);
}
@@ -31061,7 +31074,7 @@ var Parser;
}
return modifiers;
}
- function parseFunctionOrConstructorType() {
+ function parseFunctionOrConstructorType(decorators) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
const modifiers = parseModifiersForConstructorType();
@@ -31069,9 +31082,7 @@ var Parser;
const typeParameters = parseTypeParameters();
const parameters = parseParameters(4 /* Type */);
const type = parseReturnType(38 /* EqualsGreaterThanToken */, false);
- const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
- if (!isConstructorType)
- node.modifiers = modifiers;
+ const node = isConstructorType ? factory2.createConstructorTypeNode(combineDecoratorsAndModifiers(decorators, modifiers), typeParameters, parameters, type) : factory2.createFunctionTypeNode(combineDecoratorsAndModifiers(decorators, modifiers), typeParameters, parameters, type);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseKeywordAndNoDot() {
@@ -31132,7 +31143,7 @@ var Parser;
nextToken();
return token() === 8 /* NumericLiteral */ || token() === 9 /* BigIntLiteral */;
}
- function parseNonArrayType() {
+ function parseNonArrayType(decorators) {
switch (token()) {
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
@@ -31184,7 +31195,7 @@ var Parser;
case 22 /* OpenBracketToken */:
return parseTupleType();
case 20 /* OpenParenToken */:
- return parseParenthesizedType();
+ return parseParenthesizedType(decorators);
case 101 /* ImportKeyword */:
return parseImportType();
case 130 /* AssertsKeyword */:
@@ -31250,7 +31261,8 @@ var Parser;
}
function parsePostfixTypeOrHigher() {
const pos = getNodePos();
- let type = parseNonArrayType();
+ const decorators = parseDecorators();
+ let type = parseNonArrayType(decorators);
while (!scanner2.hasPrecedingLineBreak()) {
switch (token()) {
case 53 /* ExclamationToken */:
@@ -31422,12 +31434,12 @@ var Parser;
const type = parseOptional(141 /* IsKeyword */) ? parseType() : void 0;
return finishNode(factory2.createTypePredicateNode(assertsModifier, parameterName, type), pos);
}
- function parseType() {
+ function parseType(decorators) {
if (contextFlags & 40960 /* TypeExcludesFlags */) {
return doOutsideOfContext(40960 /* TypeExcludesFlags */, parseType);
}
if (isStartOfFunctionTypeOrConstructorType()) {
- return parseFunctionOrConstructorType();
+ return parseFunctionOrConstructorType(decorators);
}
const pos = getNodePos();
const type = parseUnionTypeOrHigher();
@@ -32457,6 +32469,12 @@ var Parser;
setSyntaxComponentContext(true);
setFirstArgumentExpression(true);
}
+ if (inTypeContext() && !inJsDocContext() && inDecoratorContext() && lookAhead(() => {
+ nextToken();
+ return token() === 20 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType);
+ })) {
+ break;
+ }
const argumentList = parseArgumentList();
const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createCallChain(expression, questionDotToken, typeArguments, argumentList) : factory2.createCallExpression(expression, typeArguments, argumentList);
expression = finishNode(callExpr, pos);
@@ -34152,10 +34170,21 @@ var Parser;
const name = parseIdentifier();
const typeParameters = parseTypeParameters();
parseExpected(63 /* EqualsToken */);
+ setContextFlag(true, 134217728 /* TypeCached */);
const type = token() === 140 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();
+ setContextFlag(false, 134217728 /* TypeCached */);
parseSemicolon();
- const node = factory2.createTypeAliasDeclaration(modifiers, name, typeParameters, type);
- node.illegalDecorators = decorators;
+ let reserveDecorators;
+ let hasOnlySendableDecorator = decorators && decorators.length === 1 && isSendableDecorator(decorators[0]) ? true : false;
+ if (hasOnlySendableDecorator) {
+ reserveDecorators = modifiers;
+ } else {
+ reserveDecorators = combineDecoratorsAndModifiers(decorators, modifiers);
+ }
+ const node = factory2.createTypeAliasDeclaration(reserveDecorators, name, typeParameters, type);
+ if (hasOnlySendableDecorator) {
+ node.illegalDecorators = decorators;
+ }
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseEnumMember() {
@@ -50586,7 +50615,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const flags = modifiersToFlags(modifiers);
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
}
- const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
+ const node = kind === 181 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 182 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 175 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 176 /* MethodDeclaration */ ? factory.createMethodDeclaration(modifiers, void 0, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), void 0, typeParameters, parameters, returnTypeNode, void 0) : kind === 178 /* Constructor */ ? factory.createConstructorDeclaration(modifiers, parameters, void 0, void 0) : kind === 179 /* GetAccessor */ ? factory.createGetAccessorDeclaration(modifiers, (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""), parameters, returnTypeNode, void 0) : kind === 180 /* SetAccessor */ ? factory.createSetAccessorDeclaration(modifiers, (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""), parameters, void 0) : kind === 183 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 329 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 186 /* FunctionType */ ? factory.createFunctionTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 187 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode != null ? returnTypeNode : factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 265 /* FunctionDeclaration */ ? factory.createFunctionDeclaration(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, void 0) : kind === 220 /* FunctionExpression */ ? factory.createFunctionExpression(modifiers, void 0, (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) : kind === 221 /* ArrowFunction */ ? factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, void 0, factory.createBlock([])) : Debug.assertNever(kind);
if (typeArguments) {
node.typeArguments = factory.createNodeArray(typeArguments);
}
@@ -51293,6 +51322,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
);
} else {
return factory.createFunctionTypeNode(
+ void 0,
visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols),
map(node.parameters, (p, i) => factory.createParameterDeclaration(
void 0,
@@ -70401,6 +70431,7 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
const typeSymbol = exports && getSymbol2(exports, JsxNames.Element, 788968 /* Type */);
const returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968 /* Type */, node);
const declaration = factory.createFunctionTypeNode(
+ void 0,
void 0,
[factory.createParameterDeclaration(void 0, void 0, "props", void 0, nodeBuilder.typeToTypeNode(result, node))],
returnNode ? factory.createTypeReferenceNode(returnNode, void 0) : factory.createKeywordTypeNode(132 /* AnyKeyword */)
@@ -81117,13 +81148,13 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
case 220 /* FunctionExpression */:
case 221 /* ArrowFunction */:
case 169 /* Parameter */:
+ case 186 /* FunctionType */:
case 168 /* TypeParameter */:
return false;
case 177 /* ClassStaticBlockDeclaration */:
case 308 /* PropertyAssignment */:
case 309 /* ShorthandPropertyAssignment */:
case 276 /* NamespaceExportDeclaration */:
- case 186 /* FunctionType */:
case 288 /* MissingDeclaration */:
return true;
default:
@@ -82736,6 +82767,7 @@ var visitEachChildTable = {
[186 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateFunctionTypeNode(
node,
+ nodesVisitor(node.modifiers, visitor, isModifierLike),
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
nodesVisitor(node.parameters, visitor, isParameterDeclaration),
nodeVisitor(node.type, visitor, isTypeNode)
@@ -100587,10 +100619,12 @@ function transformDeclarations(context) {
return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
}
case 186 /* FunctionType */: {
- return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
+ const decorators = getDecorators(input);
+ return cleanup(factory2.updateFunctionTypeNode(input, concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
case 187 /* ConstructorType */: {
- return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
+ const decorators = getDecorators(input);
+ return cleanup(factory2.updateConstructorTypeNode(input, concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)), visitNodes2(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
case 207 /* ImportType */: {
if (!isLiteralImportTypeNode(input))
@@ -100722,9 +100756,10 @@ function transformDeclarations(context) {
switch (input.kind) {
case 271 /* TypeAliasDeclaration */: {
needsDeclare = false;
+ let decorators = getDecorators(input);
const clean2 = cleanup(factory2.updateTypeAliasDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)),
input.name,
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
visitNode(input.type, visitDeclarationSubtree, isTypeNode)
@@ -103609,7 +103644,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitConstructorType(node) {
pushNameGenerationScope(node);
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
writeKeyword("new");
writeSpace();
emitTypeParameters(node, node.typeParameters);
@@ -103686,6 +103721,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(node.typeParameter);
}
function emitParenthesizedType(node) {
+ if (isFunctionTypeNode(node.type)) {
+ emitModifiers(node.type, node.type.modifiers);
+ }
writePunctuation("(");
emit(node.type);
writePunctuation(")");
@@ -104538,8 +104576,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitTypeAliasDeclaration(node) {
if (isSendableFunctionOrType(node, true)) {
emitDecorators(node, node.illegalDecorators);
+ emitModifiers(node, node.modifiers);
+ } else {
+ emitDecoratorsAndModifiers(node, node.modifiers);
}
- emitModifiers(node, node.modifiers);
writeKeyword("type");
writeSpace();
emit(node.name);
@@ -128292,7 +128332,7 @@ function transformJSDocVariadicType(node) {
}
function transformJSDocFunctionType(node) {
var _a2;
- return factory.createFunctionTypeNode(emptyArray, node.parameters.map(transformJSDocParameter), (_a2 = node.type) != null ? _a2 : factory.createKeywordTypeNode(132 /* AnyKeyword */));
+ return factory.createFunctionTypeNode(void 0, emptyArray, node.parameters.map(transformJSDocParameter), (_a2 = node.type) != null ? _a2 : factory.createKeywordTypeNode(132 /* AnyKeyword */));
}
function transformJSDocParameter(node) {
const index = node.parent.parameters.indexOf(node);
@@ -154351,7 +154391,7 @@ function patchNodeFactory4(factory2) {
return createTypeAliasDeclaration2(modifiers, name, typeParameters, type);
}
}).bind({
- 0: ([modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)),
+ 0: ([modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)),
1: ([decorators, modifiers, name, typeParameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || isTypeNode(type))
}).deprecate({
1: DISALLOW_DECORATORS
@@ -154364,7 +154404,7 @@ function patchNodeFactory4(factory2) {
return updateTypeAliasDeclaration2(node, modifiers, name, typeParameters, type);
}
}).bind({
- 0: ([, modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)),
+ 0: ([, modifiers, name, typeParameters, type, other]) => other === void 0 && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || !isArray(type)),
1: ([, decorators, modifiers, name, typeParameters, type]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (type === void 0 || isTypeNode(type))
}).deprecate({
1: DISALLOW_DECORATORS
@@ -166199,6 +166239,7 @@ if (typeof console !== "undefined") {
isSatisfiesExpression,
isScopeMarker,
isSemicolonClassElement,
+ isSendableDecorator,
isSendableFunctionOrType,
isSetAccessor,
isSetAccessorDeclaration,
diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js
index 07c09528a6..8958451761 100644
--- a/lib/typingsInstaller.js
+++ b/lib/typingsInstaller.js
@@ -14737,21 +14737,21 @@ function createNodeFactory(flags, baseFactory2) {
function updateTypeReferenceNode(node, typeName, typeArguments) {
return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node;
}
- function createFunctionTypeNode(typeParameters, parameters, type) {
+ function createFunctionTypeNode(modifiers, typeParameters, parameters, type) {
const node = createBaseSignatureDeclaration(
186 /* FunctionType */,
- void 0,
+ modifiers,
void 0,
typeParameters,
parameters,
type
);
node.transformFlags = 1 /* ContainsTypeScript */;
- node.modifiers = void 0;
+ node.modifiers = asNodeArray(modifiers);
return node;
}
- function updateFunctionTypeNode(node, typeParameters, parameters, type) {
- return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode(typeParameters, parameters, type), node) : node;
+ function updateFunctionTypeNode(node, modifiers, typeParameters, parameters, type) {
+ return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode(modifiers, typeParameters, parameters, type), node) : node;
}
function finishUpdateFunctionTypeNode(updated, original) {
if (updated !== original) {
@@ -17296,7 +17296,7 @@ function createNodeFactory(flags, baseFactory2) {
} else {
modifierArray = modifiers;
}
- return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
+ return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isFunctionTypeNode(node) ? updateFunctionTypeNode(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body, node.name) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isOverloadDeclaration(node) ? updateOverloadDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
}
function asNodeArray(array) {
return array ? createNodeArray(array) : void 0;
@@ -17765,6 +17765,10 @@ function isParameter(node) {
function isDecoratorOrAnnotation(node) {
return node.kind === 170 /* Decorator */;
}
+function isSendableDecorator(node) {
+ const nameExpr = node.expression;
+ return isIdentifier(nameExpr) && nameExpr.escapedText.toString() === "Sendable";
+}
function isPropertySignature(node) {
return node.kind === 171 /* PropertySignature */;
}
@@ -18472,11 +18476,11 @@ function setTextRange(range, location) {
}
function canHaveModifiers(node) {
const kind = node.kind;
- return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
+ return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 175 /* MethodSignature */ || kind === 176 /* MethodDeclaration */ || kind === 178 /* Constructor */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 183 /* IndexSignature */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */ || kind === 220 /* FunctionExpression */ || kind === 221 /* ArrowFunction */ || kind === 234 /* ClassExpression */ || kind === 267 /* StructDeclaration */ || kind === 268 /* AnnotationDeclaration */ || kind === 246 /* VariableStatement */ || kind === 265 /* FunctionDeclaration */ || kind === 266 /* ClassDeclaration */ || kind === 270 /* InterfaceDeclaration */ || kind === 271 /* TypeAliasDeclaration */ || kind === 272 /* EnumDeclaration */ || kind === 273 /* ModuleDeclaration */ || kind === 277 /* ImportEqualsDeclaration */ || kind === 278 /* ImportDeclaration */ || kind === 283 /* ExportAssignment */ || kind === 284 /* ExportDeclaration */ || kind === 269 /* OverloadDeclaration */;
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */;
}
// src/compiler/parser.ts
@@ -19542,15 +19546,15 @@ var Parser;
}
return func();
}
- function doInsideOfContext(context, func) {
+ function doInsideOfContext(context, func, isType) {
const contextFlagsToSet = context & ~contextFlags;
if (contextFlagsToSet) {
setContextFlag(true, contextFlagsToSet);
- const result = func();
+ const result = func(isType);
setContextFlag(false, contextFlagsToSet);
return result;
}
- return func();
+ return func(isType);
}
function allowInAnd(func) {
return doOutsideOfContext(4096 /* DisallowInContext */, func);
@@ -19603,6 +19607,12 @@ var Parser;
function inDisallowInContext() {
return inContext(4096 /* DisallowInContext */);
}
+ function inTypeContext() {
+ return inContext(134217728 /* TypeCached */);
+ }
+ function inJsDocContext() {
+ return inContext(8388608 /* JSDoc */);
+ }
function inDisallowConditionalTypesContext() {
return inContext(65536 /* DisallowConditionalTypesContext */);
}
@@ -21279,10 +21289,10 @@ var Parser;
pos
);
}
- function parseParenthesizedType() {
+ function parseParenthesizedType(decorators) {
const pos = getNodePos();
parseExpected(20 /* OpenParenToken */);
- const type = parseType();
+ const type = parseType(decorators);
parseExpected(21 /* CloseParenToken */);
return finishNode(factory2.createParenthesizedType(type), pos);
}
@@ -21296,7 +21306,7 @@ var Parser;
}
return modifiers;
}
- function parseFunctionOrConstructorType() {
+ function parseFunctionOrConstructorType(decorators) {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
const modifiers = parseModifiersForConstructorType();
@@ -21304,9 +21314,7 @@ var Parser;
const typeParameters = parseTypeParameters();
const parameters = parseParameters(4 /* Type */);
const type = parseReturnType(38 /* EqualsGreaterThanToken */, false);
- const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
- if (!isConstructorType)
- node.modifiers = modifiers;
+ const node = isConstructorType ? factory2.createConstructorTypeNode(combineDecoratorsAndModifiers(decorators, modifiers), typeParameters, parameters, type) : factory2.createFunctionTypeNode(combineDecoratorsAndModifiers(decorators, modifiers), typeParameters, parameters, type);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseKeywordAndNoDot() {
@@ -21367,7 +21375,7 @@ var Parser;
nextToken();
return token() === 8 /* NumericLiteral */ || token() === 9 /* BigIntLiteral */;
}
- function parseNonArrayType() {
+ function parseNonArrayType(decorators) {
switch (token()) {
case 132 /* AnyKeyword */:
case 159 /* UnknownKeyword */:
@@ -21419,7 +21427,7 @@ var Parser;
case 22 /* OpenBracketToken */:
return parseTupleType();
case 20 /* OpenParenToken */:
- return parseParenthesizedType();
+ return parseParenthesizedType(decorators);
case 101 /* ImportKeyword */:
return parseImportType();
case 130 /* AssertsKeyword */:
@@ -21485,7 +21493,8 @@ var Parser;
}
function parsePostfixTypeOrHigher() {
const pos = getNodePos();
- let type = parseNonArrayType();
+ const decorators = parseDecorators();
+ let type = parseNonArrayType(decorators);
while (!scanner.hasPrecedingLineBreak()) {
switch (token()) {
case 53 /* ExclamationToken */:
@@ -21657,12 +21666,12 @@ var Parser;
const type = parseOptional(141 /* IsKeyword */) ? parseType() : void 0;
return finishNode(factory2.createTypePredicateNode(assertsModifier, parameterName, type), pos);
}
- function parseType() {
+ function parseType(decorators) {
if (contextFlags & 40960 /* TypeExcludesFlags */) {
return doOutsideOfContext(40960 /* TypeExcludesFlags */, parseType);
}
if (isStartOfFunctionTypeOrConstructorType()) {
- return parseFunctionOrConstructorType();
+ return parseFunctionOrConstructorType(decorators);
}
const pos = getNodePos();
const type = parseUnionTypeOrHigher();
@@ -22692,6 +22701,12 @@ var Parser;
setSyntaxComponentContext(true);
setFirstArgumentExpression(true);
}
+ if (inTypeContext() && !inJsDocContext() && inDecoratorContext() && lookAhead(() => {
+ nextToken();
+ return token() === 20 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType);
+ })) {
+ break;
+ }
const argumentList = parseArgumentList();
const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createCallChain(expression, questionDotToken, typeArguments, argumentList) : factory2.createCallExpression(expression, typeArguments, argumentList);
expression = finishNode(callExpr, pos);
@@ -24387,10 +24402,21 @@ var Parser;
const name = parseIdentifier();
const typeParameters = parseTypeParameters();
parseExpected(63 /* EqualsToken */);
+ setContextFlag(true, 134217728 /* TypeCached */);
const type = token() === 140 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();
+ setContextFlag(false, 134217728 /* TypeCached */);
parseSemicolon();
- const node = factory2.createTypeAliasDeclaration(modifiers, name, typeParameters, type);
- node.illegalDecorators = decorators;
+ let reserveDecorators;
+ let hasOnlySendableDecorator = decorators && decorators.length === 1 && isSendableDecorator(decorators[0]) ? true : false;
+ if (hasOnlySendableDecorator) {
+ reserveDecorators = modifiers;
+ } else {
+ reserveDecorators = combineDecoratorsAndModifiers(decorators, modifiers);
+ }
+ const node = factory2.createTypeAliasDeclaration(reserveDecorators, name, typeParameters, type);
+ if (hasOnlySendableDecorator) {
+ node.illegalDecorators = decorators;
+ }
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseEnumMember() {
@@ -33028,6 +33054,7 @@ var visitEachChildTable = {
[186 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateFunctionTypeNode(
node,
+ nodesVisitor(node.modifiers, visitor, isModifierLike),
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
nodesVisitor(node.parameters, visitor, isParameterDeclaration),
nodeVisitor(node.type, visitor, isTypeNode)
@@ -35420,7 +35447,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitConstructorType(node) {
pushNameGenerationScope(node);
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
writeKeyword("new");
writeSpace();
emitTypeParameters(node, node.typeParameters);
@@ -35497,6 +35524,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emit(node.typeParameter);
}
function emitParenthesizedType(node) {
+ if (isFunctionTypeNode(node.type)) {
+ emitModifiers(node.type, node.type.modifiers);
+ }
writePunctuation("(");
emit(node.type);
writePunctuation(")");
@@ -36349,8 +36379,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
function emitTypeAliasDeclaration(node) {
if (isSendableFunctionOrType(node, true)) {
emitDecorators(node, node.illegalDecorators);
+ emitModifiers(node, node.modifiers);
+ } else {
+ emitDecoratorsAndModifiers(node, node.modifiers);
}
- emitModifiers(node, node.modifiers);
writeKeyword("type");
writeSpace();
emit(node.name);
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index 64fcb55db9..2c16a70380 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -7339,7 +7339,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
kind === SyntaxKind.SetAccessor ? factory.createSetAccessorDeclaration(modifiers, options?.name ?? factory.createIdentifier(""), parameters, /*body*/ undefined) :
kind === SyntaxKind.IndexSignature ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) :
kind === SyntaxKind.JSDocFunctionType ? factory.createJSDocFunctionType(parameters, returnTypeNode) :
- kind === SyntaxKind.FunctionType ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) :
+ kind === SyntaxKind.FunctionType ? factory.createFunctionTypeNode(modifiers, typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) :
kind === SyntaxKind.ConstructorType ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) :
kind === SyntaxKind.FunctionDeclaration ? factory.createFunctionDeclaration(modifiers, /*asteriskToken*/ undefined, options?.name ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) :
kind === SyntaxKind.FunctionExpression ? factory.createFunctionExpression(modifiers, /*asteriskToken*/ undefined, options?.name ? cast(options.name, isIdentifier) : factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, factory.createBlock([])) :
@@ -8191,6 +8191,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
}
else {
return factory.createFunctionTypeNode(
+ /*modifiers*/ undefined,
visitNodes(node.typeParameters, visitExistingNodeTreeSymbols),
map(node.parameters, (p, i) => factory.createParameterDeclaration(
/*modifiers*/ undefined,
@@ -33646,7 +33647,7 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
// file would probably be preferable.
const typeSymbol = exports && getSymbol(exports, JsxNames.Element, SymbolFlags.Type);
const returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, SymbolFlags.Type, node);
- const declaration = factory.createFunctionTypeNode(/*typeParameters*/ undefined,
+ const declaration = factory.createFunctionTypeNode(/*modifiers*/ undefined, /*typeParameters*/ undefined,
[factory.createParameterDeclaration(/*modifiers*/ undefined, /*dotdotdot*/ undefined, "props", /*questionMark*/ undefined, nodeBuilder.typeToTypeNode(result, node))],
returnNode ? factory.createTypeReferenceNode(returnNode, /*typeArguments*/ undefined) : factory.createKeywordTypeNode(SyntaxKind.AnyKeyword)
);
@@ -47636,13 +47637,13 @@ export function createTypeChecker(host: TypeCheckerHost, isTypeCheckerForLinter:
case SyntaxKind.FunctionExpression:
case SyntaxKind.ArrowFunction:
case SyntaxKind.Parameter:
+ case SyntaxKind.FunctionType:
case SyntaxKind.TypeParameter:
return false;
case SyntaxKind.ClassStaticBlockDeclaration:
case SyntaxKind.PropertyAssignment:
case SyntaxKind.ShorthandPropertyAssignment:
case SyntaxKind.NamespaceExportDeclaration:
- case SyntaxKind.FunctionType:
case SyntaxKind.MissingDeclaration:
return true;
default:
diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts
index 431e9e01ab..4afe29d57a 100644
--- a/src/compiler/emitter.ts
+++ b/src/compiler/emitter.ts
@@ -38,7 +38,7 @@ import {
ImportTypeNode, IndexedAccessTypeNode, IndexSignatureDeclaration, InferTypeNode, InterfaceDeclaration,
IntersectionTypeNode, isAccessExpression, isArray, isArrowFunction, isBinaryExpression, isBindingPattern, isBlock,
isBundle, isBundleFileTextLike, isDeclaration, isDeclarationFileName, isDecoratorOrAnnotation, isEmptyStatement,
- isEtsComponentExpression, isExportAssignment, isExportSpecifier, isExpression, isFunctionDeclaration,
+ isEtsComponentExpression, isExportAssignment, isExportSpecifier, isExpression, isFunctionDeclaration, isFunctionTypeNode,
isFunctionLike, isGeneratedIdentifier, isGeneratedPrivateIdentifier, isIdentifier, isIncrementalCompilation,
isInEtsFile, isInEtsFileWithOriginal, isInJsonFile, isInternalDeclaration, isJSDocLikeText, isJsonSourceFile,
isJsxClosingElement, isJsxOpeningElement, isKeyword, isLet, isLiteralExpression, isMemberName, isModifier,
@@ -2422,7 +2422,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
function emitConstructorType(node: ConstructorTypeNode) {
pushNameGenerationScope(node);
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
writeKeyword("new");
writeSpace();
emitTypeParameters(node, node.typeParameters);
@@ -2511,6 +2511,9 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
}
function emitParenthesizedType(node: ParenthesizedTypeNode) {
+ if (isFunctionTypeNode(node.type)) {
+ emitModifiers(node.type, node.type.modifiers as NodeArray);
+ }
writePunctuation("(");
emit(node.type);
writePunctuation(")");
@@ -3583,8 +3586,10 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
function emitTypeAliasDeclaration(node: TypeAliasDeclaration) {
if (isSendableFunctionOrType(node, /*maybeNotOriginalNode*/ true)) {
emitDecorators(node, node.illegalDecorators);
+ emitModifiers(node, node.modifiers as NodeArray);
+ } else {
+ emitDecoratorsAndModifiers(node, node.modifiers);
}
- emitModifiers(node, node.modifiers);
writeKeyword("type");
writeSpace();
emit(node.name);
diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts
index bd369ebfda..1719171cb3 100644
--- a/src/compiler/factory/nodeFactory.ts
+++ b/src/compiler/factory/nodeFactory.ts
@@ -29,7 +29,7 @@ import {
isCallChain, isClassDeclaration, isClassExpression, isCommaListExpression, isCommaToken, isComputedPropertyName,
isConstructorDeclaration, isConstructorTypeNode, isCustomPrologue, isElementAccessChain, isElementAccessExpression,
isEnumDeclaration, isExclamationToken, isExportAssignment, isExportDeclaration, isExternalModuleReference,
- isFunctionDeclaration, isFunctionExpression, isGeneratedIdentifier, isGetAccessorDeclaration, isHoistedFunction,
+ isFunctionDeclaration, isFunctionExpression, isFunctionTypeNode, isGeneratedIdentifier, isGetAccessorDeclaration, isHoistedFunction,
isHoistedVariableStatement, isIdentifier, isImportDeclaration, isImportEqualsDeclaration, isImportKeyword,
isIndexSignatureDeclaration, isInterfaceDeclaration, isLabeledStatement, isLocalName,
isLogicalOrCoalescingAssignmentOperator, isMemberName, isMethodDeclaration, isMethodSignature, isModuleDeclaration,
@@ -1991,13 +1991,14 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
// @api
function createFunctionTypeNode(
+ modifiers: readonly ModifierLike[] | undefined,
typeParameters: readonly TypeParameterDeclaration[] | undefined,
parameters: readonly ParameterDeclaration[],
type: TypeNode | undefined
): FunctionTypeNode {
const node = createBaseSignatureDeclaration(
SyntaxKind.FunctionType,
- /*modifiers*/ undefined,
+ modifiers,
/*name*/ undefined,
typeParameters,
parameters,
@@ -2006,13 +2007,14 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
node.transformFlags = TransformFlags.ContainsTypeScript;
// The following properties are used only to report grammar errors
- node.modifiers = undefined;
+ node.modifiers = asNodeArray(modifiers);
return node;
}
// @api
function updateFunctionTypeNode(
node: FunctionTypeNode,
+ modifiers: readonly ModifierLike[] | undefined,
typeParameters: NodeArray | undefined,
parameters: NodeArray,
type: TypeNode | undefined
@@ -2020,7 +2022,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
return node.typeParameters !== typeParameters
|| node.parameters !== parameters
|| node.type !== type
- ? finishUpdateFunctionTypeNode(createFunctionTypeNode(typeParameters, parameters, type), node)
+ ? finishUpdateFunctionTypeNode(createFunctionTypeNode(modifiers, typeParameters, parameters, type), node)
: node;
}
@@ -2039,7 +2041,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
}
function createConstructorTypeNode1(
- modifiers: readonly Modifier[] | undefined,
+ modifiers: readonly ModifierLike[] | undefined,
typeParameters: readonly TypeParameterDeclaration[] | undefined,
parameters: readonly ParameterDeclaration[],
type: TypeNode | undefined
@@ -2074,7 +2076,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
function updateConstructorTypeNode1(
node: ConstructorTypeNode,
- modifiers: readonly Modifier[] | undefined,
+ modifiers: readonly ModifierLike[] | undefined,
typeParameters: NodeArray | undefined,
parameters: NodeArray,
type: TypeNode | undefined
@@ -4185,7 +4187,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
// @api
function createTypeAliasDeclaration(
- modifiers: readonly Modifier[] | undefined,
+ modifiers: readonly ModifierLike[] | undefined,
name: string | Identifier,
typeParameters: readonly TypeParameterDeclaration[] | undefined,
type: TypeNode
@@ -4207,7 +4209,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
// @api
function updateTypeAliasDeclaration(
node: TypeAliasDeclaration,
- modifiers: readonly Modifier[] | undefined,
+ modifiers: readonly ModifierLike[] | undefined,
name: Identifier,
typeParameters: readonly TypeParameterDeclaration[] | undefined,
type: TypeNode
@@ -6637,6 +6639,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) :
isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) :
isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) :
+ isFunctionTypeNode(node) ? updateFunctionTypeNode(node, modifierArray, node.typeParameters, node.parameters, node.type) :
isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) :
isOverloadPropertyDeclaration(node) ? updateOverloadPropertyDeclaration(node, modifierArray, node.name, node.questionToken, node.type) :
isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) :
diff --git a/src/compiler/factory/nodeTests.ts b/src/compiler/factory/nodeTests.ts
index 6c8724ad54..795f4452bc 100644
--- a/src/compiler/factory/nodeTests.ts
+++ b/src/compiler/factory/nodeTests.ts
@@ -227,6 +227,11 @@ export function isAnnotation(node: Node): node is Annotation {
return node.kind === SyntaxKind.Decorator && (node as Annotation).annotationDeclaration !== undefined;
}
+export function isSendableDecorator(node: Decorator): node is Decorator {
+ const nameExpr = node.expression;
+ return isIdentifier(nameExpr) && nameExpr.escapedText.toString() === 'Sendable';
+}
+
// TypeMember
export function isPropertySignature(node: Node): node is PropertySignature {
diff --git a/src/compiler/factory/utilitiesPublic.ts b/src/compiler/factory/utilitiesPublic.ts
index 0db356a68d..0ae20d78bf 100644
--- a/src/compiler/factory/utilitiesPublic.ts
+++ b/src/compiler/factory/utilitiesPublic.ts
@@ -17,6 +17,7 @@ export function canHaveModifiers(node: Node): node is HasModifiers {
|| kind === SyntaxKind.SetAccessor
|| kind === SyntaxKind.IndexSignature
|| kind === SyntaxKind.ConstructorType
+ || kind === SyntaxKind.FunctionType
|| kind === SyntaxKind.FunctionExpression
|| kind === SyntaxKind.ArrowFunction
|| kind === SyntaxKind.ClassExpression
@@ -45,5 +46,7 @@ export function canHaveDecorators(node: Node): node is HasDecorators {
|| kind === SyntaxKind.SetAccessor
|| kind === SyntaxKind.ClassExpression
|| kind === SyntaxKind.ClassDeclaration
- || kind === SyntaxKind.StructDeclaration;
+ || kind === SyntaxKind.StructDeclaration
+ || kind === SyntaxKind.ConstructorType
+ || kind === SyntaxKind.FunctionType;
}
\ No newline at end of file
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index 2773ad79e4..9671867af4 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -175,6 +175,7 @@ import {
isNonNullExpression,
isPrivateIdentifier,
isPropertyAccessExpression,
+ isSendableDecorator,
isSetAccessorDeclaration,
isStringOrNumericLiteralLike,
isTaggedTemplateExpression,
@@ -2177,7 +2178,7 @@ namespace Parser {
return func();
}
- function doInsideOfContext(context: NodeFlags, func: () => T): T {
+ function doInsideOfContext(context: NodeFlags, func: (isType?: boolean) => T, isType?: boolean): T {
// contextFlagsToSet will contain only the context flags that
// are not currently set that we need to temporarily enable.
// We don't just blindly reset to the previous flags to ensure
@@ -2188,14 +2189,14 @@ namespace Parser {
if (contextFlagsToSet) {
// set the requested context flags
setContextFlag(/*val*/ true, contextFlagsToSet);
- const result = func();
+ const result = func(isType);
// reset the context flags we just set
setContextFlag(/*val*/ false, contextFlagsToSet);
return result;
}
// no need to do anything special as we are already in all of the requested contexts
- return func();
+ return func(isType);
}
function allowInAnd(func: () => T): T {
@@ -2264,6 +2265,14 @@ namespace Parser {
return inContext(NodeFlags.DisallowInContext);
}
+ function inTypeContext() {
+ return inContext(NodeFlags.TypeCached);
+ }
+
+ function inJsDocContext() {
+ return inContext(NodeFlags.JSDoc);
+ }
+
function inDisallowConditionalTypesContext() {
return inContext(NodeFlags.DisallowConditionalTypesContext);
}
@@ -4696,10 +4705,10 @@ namespace Parser {
);
}
- function parseParenthesizedType(): TypeNode {
+ function parseParenthesizedType(decorators?: NodeArray | undefined): TypeNode {
const pos = getNodePos();
parseExpected(SyntaxKind.OpenParenToken);
- const type = parseType();
+ const type = parseType(decorators);
parseExpected(SyntaxKind.CloseParenToken);
return finishNode(factory.createParenthesizedType(type), pos);
}
@@ -4715,7 +4724,7 @@ namespace Parser {
return modifiers;
}
- function parseFunctionOrConstructorType(): TypeNode {
+ function parseFunctionOrConstructorType(decorators?: NodeArray | undefined): TypeNode {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
const modifiers = parseModifiersForConstructorType();
@@ -4724,9 +4733,8 @@ namespace Parser {
const parameters = parseParameters(SignatureFlags.Type);
const type = parseReturnType(SyntaxKind.EqualsGreaterThanToken, /*isType*/ false);
const node = isConstructorType
- ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, type)
- : factory.createFunctionTypeNode(typeParameters, parameters, type);
- if (!isConstructorType) (node as Mutable).modifiers = modifiers;
+ ? factory.createConstructorTypeNode(combineDecoratorsAndModifiers(decorators, modifiers), typeParameters, parameters, type)
+ : factory.createFunctionTypeNode(combineDecoratorsAndModifiers(decorators, modifiers), typeParameters, parameters, type);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
@@ -4797,7 +4805,7 @@ namespace Parser {
return token() === SyntaxKind.NumericLiteral || token() === SyntaxKind.BigIntLiteral;
}
- function parseNonArrayType(): TypeNode {
+ function parseNonArrayType(decorators?: NodeArray | undefined): TypeNode {
switch (token()) {
case SyntaxKind.AnyKeyword:
case SyntaxKind.UnknownKeyword:
@@ -4855,7 +4863,7 @@ namespace Parser {
case SyntaxKind.OpenBracketToken:
return parseTupleType();
case SyntaxKind.OpenParenToken:
- return parseParenthesizedType();
+ return parseParenthesizedType(decorators);
case SyntaxKind.ImportKeyword:
return parseImportType();
case SyntaxKind.AssertsKeyword:
@@ -4926,7 +4934,8 @@ namespace Parser {
function parsePostfixTypeOrHigher(): TypeNode {
const pos = getNodePos();
- let type = parseNonArrayType();
+ const decorators = parseDecorators();
+ let type = parseNonArrayType(decorators);
while (!scanner.hasPrecedingLineBreak()) {
switch (token()) {
case SyntaxKind.ExclamationToken:
@@ -5147,13 +5156,12 @@ namespace Parser {
return finishNode(factory.createTypePredicateNode(assertsModifier, parameterName, type), pos);
}
- function parseType(): TypeNode {
+ function parseType(decorators?: NodeArray | undefined): TypeNode {
if (contextFlags & NodeFlags.TypeExcludesFlags) {
return doOutsideOfContext(NodeFlags.TypeExcludesFlags, parseType);
}
-
if (isStartOfFunctionTypeOrConstructorType()) {
- return parseFunctionOrConstructorType();
+ return parseFunctionOrConstructorType(decorators);
}
const pos = getNodePos();
const type = parseUnionTypeOrHigher();
@@ -6815,6 +6823,12 @@ namespace Parser {
setSyntaxComponentContext(true);
setFirstArgumentExpression(true);
}
+ if (inTypeContext() && !inJsDocContext() && inDecoratorContext() && lookAhead(() => {
+ nextToken();
+ return token() === SyntaxKind.OpenParenToken && lookAhead(isUnambiguouslyStartOfFunctionType);
+ })) {
+ break;
+ }
const argumentList = parseArgumentList();
const callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
@@ -8936,10 +8950,21 @@ namespace Parser {
const name = parseIdentifier();
const typeParameters = parseTypeParameters();
parseExpected(SyntaxKind.EqualsToken);
+ setContextFlag(true, NodeFlags.TypeCached);
const type = token() === SyntaxKind.IntrinsicKeyword && tryParse(parseKeywordAndNoDot) || parseType();
+ setContextFlag(false, NodeFlags.TypeCached);
parseSemicolon();
- const node = factory.createTypeAliasDeclaration(modifiers, name, typeParameters, type);
- (node as Mutable).illegalDecorators = decorators;
+ let reserveDecorators: NodeArray | undefined;
+ let hasOnlySendableDecorator: boolean = decorators && decorators.length === 1 && isSendableDecorator(decorators[0]) ? true : false;
+ if (hasOnlySendableDecorator) {
+ reserveDecorators = modifiers;
+ } else {
+ reserveDecorators = combineDecoratorsAndModifiers(decorators, modifiers);
+ }
+ const node = factory.createTypeAliasDeclaration(reserveDecorators, name, typeParameters, type);
+ if (hasOnlySendableDecorator) {
+ (node as Mutable).illegalDecorators = decorators;
+ }
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts
index 429126c41a..c3e7ceefd0 100644
--- a/src/compiler/transformers/declarations.ts
+++ b/src/compiler/transformers/declarations.ts
@@ -9,7 +9,7 @@ import {
declarationNameToString, Decorator, Diagnostics, DiagnosticWithLocation, EmitFlags, EmitHost, EmitResolver, emptyArray,
ensureEtsDecorators, EntityNameOrEntityNameExpression, EnumDeclaration, ESMap, ExportAssignment, ExportDeclaration,
ExpressionWithTypeArguments, factory, FileReference, filter, flatMap, flatten, forEach, FunctionDeclaration,
- FunctionTypeNode, GeneratedIdentifierFlags, GetAccessorDeclaration, getAnnotations, getCommentRange, getDirectoryPath,
+ FunctionTypeNode, GeneratedIdentifierFlags, GetAccessorDeclaration, getAnnotations, getCommentRange, getDecorators, getDirectoryPath,
getEffectiveBaseTypeNode, getEffectiveDecorators, getEffectiveModifierFlags,
getExternalModuleImportEqualsDeclarationExpression, getExternalModuleNameFromDeclaration,
getFirstConstructorWithBody, getLeadingCommentRanges, getLeadingCommentRangesOfNode, getLineAndCharacterOfPosition,
@@ -42,7 +42,7 @@ import {
TypeReferenceNode, unescapeLeadingUnderscores, UnparsedSource, VariableDeclaration, VariableStatement, visitArray,
visitEachChild, visitNode, visitNodes, VisitResult, isOverloadDeclaration,
OverloadPropertyDeclaration,
- OverloadDeclaration
+ OverloadDeclaration,
} from "../_namespaces/ts";
import * as moduleSpecifiers from "../_namespaces/ts.moduleSpecifiers";
@@ -1183,10 +1183,12 @@ export function transformDeclarations(context: TransformationContext) {
return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
}
case SyntaxKind.FunctionType: {
- return cleanup(factory.updateFunctionTypeNode(input, visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
+ const decorators = getDecorators(input);
+ return cleanup(factory.updateFunctionTypeNode(input, concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)), visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
case SyntaxKind.ConstructorType: {
- return cleanup(factory.updateConstructorTypeNode(input, ensureModifiers(input), visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
+ const decorators = getDecorators(input);
+ return cleanup(factory.updateConstructorTypeNode(input, concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)), visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), visitNode(input.type, visitDeclarationSubtree)));
}
case SyntaxKind.ImportType: {
if (!isLiteralImportTypeNode(input)) return cleanup(input);
@@ -1335,9 +1337,10 @@ export function transformDeclarations(context: TransformationContext) {
switch (input.kind) {
case SyntaxKind.TypeAliasDeclaration: {
needsDeclare = false;
+ let decorators = getDecorators(input);
const clean = cleanup(factory.updateTypeAliasDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)),
input.name,
visitNodes(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
visitNode(input.type, visitDeclarationSubtree, isTypeNode)
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index 4655eef251..7a8b92bb1f 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -1270,6 +1270,8 @@ export type HasDecorators =
| ClassDeclaration
| StructDeclaration
| FunctionDeclaration
+ | TypeAliasDeclaration
+ | FunctionOrConstructorTypeNode
;
// NOTE: Changing the following list requires changes to:
@@ -1301,6 +1303,7 @@ export type HasModifiers =
| TypeParameterDeclaration
| ParameterDeclaration
| ConstructorTypeNode
+ | FunctionTypeNode
| PropertySignature
| PropertyDeclaration
| MethodSignature
@@ -2018,12 +2021,12 @@ export interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase {
readonly kind: SyntaxKind.FunctionType;
// The following properties are used only to report grammar errors
- /** @internal */ readonly modifiers?: NodeArray | undefined;
+ /** @internal */ readonly modifiers?: NodeArray | undefined;
}
export interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
readonly kind: SyntaxKind.ConstructorType;
- readonly modifiers?: NodeArray;
+ readonly modifiers?: NodeArray;
}
export interface NodeWithTypeArguments extends TypeNode {
@@ -3426,7 +3429,7 @@ export interface HeritageClause extends Node {
export interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer {
readonly kind: SyntaxKind.TypeAliasDeclaration;
- readonly modifiers?: NodeArray;
+ readonly modifiers?: NodeArray;
readonly name: Identifier;
readonly typeParameters?: NodeArray;
readonly type: TypeNode;
@@ -8178,10 +8181,10 @@ export interface NodeFactory {
updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode;
createTypeReferenceNode(typeName: string | EntityName, typeArguments?: readonly TypeNode[]): TypeReferenceNode;
updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray | undefined): TypeReferenceNode;
- createFunctionTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
- updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): FunctionTypeNode;
- createConstructorTypeNode(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
- updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly Modifier[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): ConstructorTypeNode;
+ createFunctionTypeNode(modifiers: readonly ModifierLike[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
+ updateFunctionTypeNode(node: FunctionTypeNode, modifiers: readonly ModifierLike[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): FunctionTypeNode;
+ createConstructorTypeNode(modifiers: readonly ModifierLike[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
+ updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly ModifierLike[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): ConstructorTypeNode;
createTypeQueryNode(exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode;
@@ -8382,8 +8385,8 @@ export interface NodeFactory {
createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
- createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
- updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
+ createTypeAliasDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
+ updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
createEnumDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
createModuleDeclaration(modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration;
diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts
index f3c49f182d..0dbca1922d 100644
--- a/src/compiler/utilities.ts
+++ b/src/compiler/utilities.ts
@@ -2260,6 +2260,8 @@ export function nodeCanBeDecorated(node: Node, parent?: Node, grandparent?: Node
switch (node.kind) {
case SyntaxKind.ClassDeclaration:
case SyntaxKind.StructDeclaration:
+ case SyntaxKind.FunctionType:
+ case SyntaxKind.ConstructorType:
// classes are valid targets
return true;
diff --git a/src/compiler/visitorPublic.ts b/src/compiler/visitorPublic.ts
index 6721057bdc..ffce42ace2 100644
--- a/src/compiler/visitorPublic.ts
+++ b/src/compiler/visitorPublic.ts
@@ -625,6 +625,7 @@ const visitEachChildTable: VisitEachChildTable = {
[SyntaxKind.FunctionType]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateFunctionTypeNode(node,
+ nodesVisitor(node.modifiers, visitor, isModifierLike),
nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration),
nodesVisitor(node.parameters, visitor, isParameterDeclaration),
nodeVisitor(node.type, visitor, isTypeNode));
diff --git a/src/deprecatedCompat/4.2/abstractConstructorTypes.ts b/src/deprecatedCompat/4.2/abstractConstructorTypes.ts
index 93a305656d..8284e91051 100644
--- a/src/deprecatedCompat/4.2/abstractConstructorTypes.ts
+++ b/src/deprecatedCompat/4.2/abstractConstructorTypes.ts
@@ -1,5 +1,5 @@
import {
- addNodeFactoryPatcher, buildOverload, ConstructorTypeNode, factory, Modifier, NodeArray, NodeFactory,
+ addNodeFactoryPatcher, buildOverload, ConstructorTypeNode, factory, ModifierLike, NodeArray, NodeFactory,
ParameterDeclaration, TypeNode, TypeParameterDeclaration,
} from "../_namespaces/ts";
@@ -27,7 +27,7 @@ function patchNodeFactory(factory: NodeFactory) {
factory.createConstructorTypeNode = buildOverload("createConstructorTypeNode")
.overload({
- 0(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode {
+ 0(modifiers: readonly ModifierLike[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode {
return createConstructorTypeNode(modifiers, typeParameters, parameters, type);
},
@@ -46,7 +46,7 @@ function patchNodeFactory(factory: NodeFactory) {
factory.updateConstructorTypeNode = buildOverload("updateConstructorTypeNode")
.overload({
- 0(node: ConstructorTypeNode, modifiers: readonly Modifier[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode) {
+ 0(node: ConstructorTypeNode, modifiers: readonly ModifierLike[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode) {
return updateConstructorTypeNode(node, modifiers, typeParameters, parameters, type);
},
diff --git a/src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts b/src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts
index 429f83b2d2..a1d5775839 100644
--- a/src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts
+++ b/src/deprecatedCompat/4.8/mergeDecoratorsAndModifiers.ts
@@ -84,7 +84,7 @@ declare module "../../compiler/types" {
// Module transform: converted from interface augmentation
export interface FunctionTypeNode {
/** @deprecated A function type cannot have modifiers */
- readonly modifiers?: NodeArray | undefined;
+ readonly modifiers?: NodeArray | undefined;
}
}
@@ -1020,7 +1020,7 @@ function patchNodeFactory(factory: NodeFactory) {
factory.createTypeAliasDeclaration = buildOverload("createTypeAliasDeclaration")
.overload({
- 0(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration {
+ 0(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration {
return createTypeAliasDeclaration(modifiers, name, typeParameters, type);
},
@@ -1031,7 +1031,7 @@ function patchNodeFactory(factory: NodeFactory) {
.bind({
0: ([modifiers, name, typeParameters, type, other]) =>
(other === undefined) &&
- (modifiers === undefined || every(modifiers, isModifier)) &&
+ (modifiers === undefined || isArray(modifiers)) &&
(name === undefined || !isArray(name)) &&
(typeParameters === undefined || isArray(typeParameters)) &&
(type === undefined || !isArray(type)),
@@ -1050,7 +1050,7 @@ function patchNodeFactory(factory: NodeFactory) {
factory.updateTypeAliasDeclaration = buildOverload("updateTypeAliasDeclaration")
.overload({
- 0(node: TypeAliasDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration {
+ 0(node: TypeAliasDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration {
return updateTypeAliasDeclaration(node, modifiers, name, typeParameters, type);
},
@@ -1061,7 +1061,7 @@ function patchNodeFactory(factory: NodeFactory) {
.bind({
0: ([, modifiers, name, typeParameters, type, other]) =>
(other === undefined) &&
- (modifiers === undefined || every(modifiers, isModifier)) &&
+ (modifiers === undefined || isArray(modifiers)) &&
(name === undefined || !isArray(name)) &&
(typeParameters === undefined || isArray(typeParameters)) &&
(type === undefined || !isArray(type)),
diff --git a/src/harness/harnessUtils.ts b/src/harness/harnessUtils.ts
index 7251afc719..7bfb19fcdc 100644
--- a/src/harness/harnessUtils.ts
+++ b/src/harness/harnessUtils.ts
@@ -78,7 +78,7 @@ export function assertInvariants(node: ts.Node | undefined, parent: ts.Node | un
}
function assertInvariantsWorker(node: ts.Node | undefined, parent: ts.Node | undefined): void {
- if (node) {
+ if (node && !ts.isFunctionTypeNode(node)) {
assert.isFalse(node.pos < 0, "node.pos < 0");
assert.isFalse(node.end < 0, "node.end < 0");
assert.isFalse(node.end < node.pos, "node.end < node.pos");
@@ -112,7 +112,8 @@ export function assertInvariants(node: ts.Node | undefined, parent: ts.Node | un
}
currentPos = array.end;
- });
+ }
+ );
const childNodesAndArrays: any[] = [];
ts.forEachChild(node, child => {
diff --git a/src/services/codefixes/annotateWithTypeFromJSDoc.ts b/src/services/codefixes/annotateWithTypeFromJSDoc.ts
index 8220c43714..d61bd54ed1 100644
--- a/src/services/codefixes/annotateWithTypeFromJSDoc.ts
+++ b/src/services/codefixes/annotateWithTypeFromJSDoc.ts
@@ -123,7 +123,7 @@ function transformJSDocVariadicType(node: JSDocVariadicType) {
function transformJSDocFunctionType(node: JSDocFunctionType) {
// TODO: This does not properly handle `function(new:C, string)` per https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System#the-javascript-type-language
// however we do handle it correctly in `serializeTypeForDeclaration` in checker.ts
- return factory.createFunctionTypeNode(emptyArray, node.parameters.map(transformJSDocParameter), node.type ?? factory.createKeywordTypeNode(SyntaxKind.AnyKeyword));
+ return factory.createFunctionTypeNode(undefined, emptyArray, node.parameters.map(transformJSDocParameter), node.type ?? factory.createKeywordTypeNode(SyntaxKind.AnyKeyword));
}
function transformJSDocParameter(node: ParameterDeclaration) {
diff --git a/src/testRunner/unittests/printer.ts b/src/testRunner/unittests/printer.ts
index 103c0e69da..cccd5c2d84 100644
--- a/src/testRunner/unittests/printer.ts
+++ b/src/testRunner/unittests/printer.ts
@@ -254,6 +254,7 @@ describe("unittests:: PrinterAPI", () => {
ts.EmitHint.Unspecified,
ts.setEmitFlags(ts.factory.createTupleTypeNode([
ts.factory.createFunctionTypeNode(
+ /*modifiers*/ undefined,
/*typeArguments*/ undefined,
[ts.factory.createParameterDeclaration(
/*modifiers*/ undefined,
@@ -263,6 +264,7 @@ describe("unittests:: PrinterAPI", () => {
ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)
),
ts.factory.createFunctionTypeNode(
+ /*modifiers*/ undefined,
[ts.factory.createTypeParameterDeclaration(/*modifiers*/ undefined, "T")],
[ts.factory.createParameterDeclaration(
/*modifiers*/ undefined,
@@ -272,6 +274,7 @@ describe("unittests:: PrinterAPI", () => {
ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)
),
ts.factory.createFunctionTypeNode(
+ /*modifiers*/ undefined,
/*typeArguments*/ undefined,
[ts.factory.createParameterDeclaration(
/*modifiers*/ undefined,
@@ -281,6 +284,7 @@ describe("unittests:: PrinterAPI", () => {
ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)
),
ts.factory.createFunctionTypeNode(
+ /*modifiers*/ undefined,
/*typeArguments*/ undefined,
[ts.factory.createParameterDeclaration(
/*modifiers*/ undefined,
@@ -291,6 +295,7 @@ describe("unittests:: PrinterAPI", () => {
ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)
),
ts.factory.createFunctionTypeNode(
+ /*modifiers*/ undefined,
/*typeArguments*/ undefined,
[ts.factory.createParameterDeclaration(
/*modifiers*/ undefined,
@@ -302,6 +307,7 @@ describe("unittests:: PrinterAPI", () => {
ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)
),
ts.factory.createFunctionTypeNode(
+ /*modifiers*/ undefined,
/*typeArguments*/ undefined,
[ts.factory.createParameterDeclaration(
/*modifiers*/ undefined,
diff --git a/tests/baselines/reference/DecoratorInTypeDeclaration.js b/tests/baselines/reference/DecoratorInTypeDeclaration.js
new file mode 100644
index 0000000000..870a33bb52
--- /dev/null
+++ b/tests/baselines/reference/DecoratorInTypeDeclaration.js
@@ -0,0 +1,26 @@
+//// [DecoratorInTypeDeclaration.ets]
+@xxxx1
+declare type testType1 = string;
+@Sendable
+declare type testType2 = () => void;
+@xxxx2
+@Sendable
+declare type testType3 = number | string;
+@Sendable
+@xxxx3
+declare type testType4 = number | string;
+
+//// [DecoratorInTypeDeclaration.js]
+
+
+//// [DecoratorInTypeDeclaration.d.ets]
+@xxxx1
+declare type testType1 = string;
+@Sendable
+declare type testType2 = () => void;
+@xxxx2
+@Sendable
+declare type testType3 = number | string;
+@Sendable
+@xxxx3
+declare type testType4 = number | string;
diff --git a/tests/baselines/reference/DecoratorInTypeDeclaration.symbols b/tests/baselines/reference/DecoratorInTypeDeclaration.symbols
new file mode 100644
index 0000000000..854385c14e
--- /dev/null
+++ b/tests/baselines/reference/DecoratorInTypeDeclaration.symbols
@@ -0,0 +1,19 @@
+=== tests/cases/conformance/parser/ets/decorator/DecoratorInTypeDeclaration.ets ===
+@xxxx1
+declare type testType1 = string;
+>testType1 : Symbol(testType1, Decl(DecoratorInTypeDeclaration.ets, 0, 0))
+
+@Sendable
+declare type testType2 = () => void;
+>testType2 : Symbol(testType2, Decl(DecoratorInTypeDeclaration.ets, 1, 32))
+
+@xxxx2
+@Sendable
+declare type testType3 = number | string;
+>testType3 : Symbol(testType3, Decl(DecoratorInTypeDeclaration.ets, 3, 36))
+
+@Sendable
+@xxxx3
+declare type testType4 = number | string;
+>testType4 : Symbol(testType4, Decl(DecoratorInTypeDeclaration.ets, 6, 41))
+
diff --git a/tests/baselines/reference/DecoratorInTypeDeclaration.types b/tests/baselines/reference/DecoratorInTypeDeclaration.types
new file mode 100644
index 0000000000..6c5ec6dce9
--- /dev/null
+++ b/tests/baselines/reference/DecoratorInTypeDeclaration.types
@@ -0,0 +1,31 @@
+=== tests/cases/conformance/parser/ets/decorator/DecoratorInTypeDeclaration.ets ===
+@xxxx1
+>xxxx1 : error
+
+declare type testType1 = string;
+>testType1 : string
+
+@Sendable
+>Sendable : error
+
+declare type testType2 = () => void;
+>testType2 : () => void
+
+@xxxx2
+>xxxx2 : error
+
+@Sendable
+>Sendable : error
+
+declare type testType3 = number | string;
+>testType3 : string | number
+
+@Sendable
+>Sendable : error
+
+@xxxx3
+>xxxx3 : error
+
+declare type testType4 = number | string;
+>testType4 : string | number
+
diff --git a/tests/baselines/reference/DecoratorInTypeDeclarationExport.js b/tests/baselines/reference/DecoratorInTypeDeclarationExport.js
new file mode 100644
index 0000000000..88f6a2de0c
--- /dev/null
+++ b/tests/baselines/reference/DecoratorInTypeDeclarationExport.js
@@ -0,0 +1,28 @@
+//// [DecoratorInTypeDeclarationExport.ets]
+@xxxx1
+export declare type testType1 = string;
+@Sendable
+export declare type testType2 = () => void;
+@xxxx2
+@Sendable
+export declare type testType3 = number | string;
+@Sendable
+@xxxx3
+export declare type testType4 = number | string;
+
+//// [DecoratorInTypeDeclarationExport.js]
+"use strict";
+exports.__esModule = true;
+
+
+//// [DecoratorInTypeDeclarationExport.d.ets]
+@xxxx1
+export declare type testType1 = string;
+@Sendable
+export declare type testType2 = () => void;
+@xxxx2
+@Sendable
+export declare type testType3 = number | string;
+@Sendable
+@xxxx3
+export declare type testType4 = number | string;
diff --git a/tests/baselines/reference/DecoratorInTypeDeclarationExport.symbols b/tests/baselines/reference/DecoratorInTypeDeclarationExport.symbols
new file mode 100644
index 0000000000..bd743db592
--- /dev/null
+++ b/tests/baselines/reference/DecoratorInTypeDeclarationExport.symbols
@@ -0,0 +1,19 @@
+=== tests/cases/conformance/parser/ets/decorator/DecoratorInTypeDeclarationExport.ets ===
+@xxxx1
+export declare type testType1 = string;
+>testType1 : Symbol(testType1, Decl(DecoratorInTypeDeclarationExport.ets, 0, 0))
+
+@Sendable
+export declare type testType2 = () => void;
+>testType2 : Symbol(testType2, Decl(DecoratorInTypeDeclarationExport.ets, 1, 39))
+
+@xxxx2
+@Sendable
+export declare type testType3 = number | string;
+>testType3 : Symbol(testType3, Decl(DecoratorInTypeDeclarationExport.ets, 3, 43))
+
+@Sendable
+@xxxx3
+export declare type testType4 = number | string;
+>testType4 : Symbol(testType4, Decl(DecoratorInTypeDeclarationExport.ets, 6, 48))
+
diff --git a/tests/baselines/reference/DecoratorInTypeDeclarationExport.types b/tests/baselines/reference/DecoratorInTypeDeclarationExport.types
new file mode 100644
index 0000000000..bac2d2e580
--- /dev/null
+++ b/tests/baselines/reference/DecoratorInTypeDeclarationExport.types
@@ -0,0 +1,31 @@
+=== tests/cases/conformance/parser/ets/decorator/DecoratorInTypeDeclarationExport.ets ===
+@xxxx1
+>xxxx1 : error
+
+export declare type testType1 = string;
+>testType1 : string
+
+@Sendable
+>Sendable : error
+
+export declare type testType2 = () => void;
+>testType2 : () => void
+
+@xxxx2
+>xxxx2 : error
+
+@Sendable
+>Sendable : error
+
+export declare type testType3 = number | string;
+>testType3 : string | number
+
+@Sendable
+>Sendable : error
+
+@xxxx3
+>xxxx3 : error
+
+export declare type testType4 = number | string;
+>testType4 : string | number
+
diff --git a/tests/baselines/reference/DecoratorOnFunctionType.js b/tests/baselines/reference/DecoratorOnFunctionType.js
new file mode 100644
index 0000000000..5577c1e4dd
--- /dev/null
+++ b/tests/baselines/reference/DecoratorOnFunctionType.js
@@ -0,0 +1,30 @@
+//// [DecoratorOnFunctionType.ets]
+@xxxx1
+declare type testType1 = @xxxx2 (() => void);
+@xxxx3
+declare type testType2 = @xxxx4 (() => void) | number;
+@xxxx5
+declare type testType3 = @xxxx6 (() => void) | (() => string);
+@xxxx7
+declare type testType4 = @xxxx8 (() => void) | @xxxx9 (() => string);
+@xxxx10
+declare type testType5 = @xxxx9 (() => void) | @xxxx10 (() => string);
+@xxxx11
+declare type testType6 = @xxxx11() (() => number);
+
+//// [DecoratorOnFunctionType.js]
+
+
+//// [DecoratorOnFunctionType.d.ets]
+@xxxx1
+declare type testType1 = @xxxx2 (() => void);
+@xxxx3
+declare type testType2 = @xxxx4 (() => void) | number;
+@xxxx5
+declare type testType3 = @xxxx6 (() => void) | (() => string);
+@xxxx7
+declare type testType4 = @xxxx8 (() => void) | @xxxx9 (() => string);
+@xxxx10
+declare type testType5 = @xxxx9 (() => void) | @xxxx10 (() => string);
+@xxxx11
+declare type testType6 = @xxxx11() (() => number);
diff --git a/tests/baselines/reference/DecoratorOnFunctionType.symbols b/tests/baselines/reference/DecoratorOnFunctionType.symbols
new file mode 100644
index 0000000000..cc3b84648c
--- /dev/null
+++ b/tests/baselines/reference/DecoratorOnFunctionType.symbols
@@ -0,0 +1,25 @@
+=== tests/cases/conformance/parser/ets/decorator/DecoratorOnFunctionType.ets ===
+@xxxx1
+declare type testType1 = @xxxx2 (() => void);
+>testType1 : Symbol(testType1, Decl(DecoratorOnFunctionType.ets, 0, 0))
+
+@xxxx3
+declare type testType2 = @xxxx4 (() => void) | number;
+>testType2 : Symbol(testType2, Decl(DecoratorOnFunctionType.ets, 1, 45))
+
+@xxxx5
+declare type testType3 = @xxxx6 (() => void) | (() => string);
+>testType3 : Symbol(testType3, Decl(DecoratorOnFunctionType.ets, 3, 54))
+
+@xxxx7
+declare type testType4 = @xxxx8 (() => void) | @xxxx9 (() => string);
+>testType4 : Symbol(testType4, Decl(DecoratorOnFunctionType.ets, 5, 62))
+
+@xxxx10
+declare type testType5 = @xxxx9 (() => void) | @xxxx10 (() => string);
+>testType5 : Symbol(testType5, Decl(DecoratorOnFunctionType.ets, 7, 69))
+
+@xxxx11
+declare type testType6 = @xxxx11() (() => number);
+>testType6 : Symbol(testType6, Decl(DecoratorOnFunctionType.ets, 9, 70))
+
diff --git a/tests/baselines/reference/DecoratorOnFunctionType.types b/tests/baselines/reference/DecoratorOnFunctionType.types
new file mode 100644
index 0000000000..d2ba71f2f5
--- /dev/null
+++ b/tests/baselines/reference/DecoratorOnFunctionType.types
@@ -0,0 +1,46 @@
+=== tests/cases/conformance/parser/ets/decorator/DecoratorOnFunctionType.ets ===
+@xxxx1
+>xxxx1 : error
+
+declare type testType1 = @xxxx2 (() => void);
+>testType1 : () => void
+>xxxx2 : error
+
+@xxxx3
+>xxxx3 : error
+
+declare type testType2 = @xxxx4 (() => void) | number;
+>testType2 : number | (() => void)
+>xxxx4 : error
+
+@xxxx5
+>xxxx5 : error
+
+declare type testType3 = @xxxx6 (() => void) | (() => string);
+>testType3 : (() => void) | (() => string)
+>xxxx6 : error
+
+@xxxx7
+>xxxx7 : error
+
+declare type testType4 = @xxxx8 (() => void) | @xxxx9 (() => string);
+>testType4 : (() => void) | (() => string)
+>xxxx8 : error
+>xxxx9 : error
+
+@xxxx10
+>xxxx10 : error
+
+declare type testType5 = @xxxx9 (() => void) | @xxxx10 (() => string);
+>testType5 : (() => void) | (() => string)
+>xxxx9 : error
+>xxxx10 : error
+
+@xxxx11
+>xxxx11 : error
+
+declare type testType6 = @xxxx11() (() => number);
+>testType6 : () => number
+>xxxx11() : error
+>xxxx11 : error
+
diff --git a/tests/baselines/reference/DecoratorOnFunctionTypeExport.js b/tests/baselines/reference/DecoratorOnFunctionTypeExport.js
new file mode 100644
index 0000000000..05d456d2f5
--- /dev/null
+++ b/tests/baselines/reference/DecoratorOnFunctionTypeExport.js
@@ -0,0 +1,32 @@
+//// [DecoratorOnFunctionTypeExport.ets]
+@xxxx1
+export declare type testType1 = @xxxx2 (() => void);
+@xxxx3
+export declare type testType2 = @xxxx4 (() => void) | number;
+@xxxx5
+export declare type testType3 = @xxxx6 (() => void) | (() => string);
+@xxxx7
+export declare type testType4 = @xxxx8 (() => void) | @xxxx9 (() => string);
+@xxxx10
+export declare type testType5 = @xxxx9 (() => void) | @xxxx10 (() => string);
+@xxxx11
+export declare type testType6 = @xxxx11() (() => number);
+
+//// [DecoratorOnFunctionTypeExport.js]
+"use strict";
+exports.__esModule = true;
+
+
+//// [DecoratorOnFunctionTypeExport.d.ets]
+@xxxx1
+export declare type testType1 = @xxxx2 (() => void);
+@xxxx3
+export declare type testType2 = @xxxx4 (() => void) | number;
+@xxxx5
+export declare type testType3 = @xxxx6 (() => void) | (() => string);
+@xxxx7
+export declare type testType4 = @xxxx8 (() => void) | @xxxx9 (() => string);
+@xxxx10
+export declare type testType5 = @xxxx9 (() => void) | @xxxx10 (() => string);
+@xxxx11
+export declare type testType6 = @xxxx11() (() => number);
diff --git a/tests/baselines/reference/DecoratorOnFunctionTypeExport.symbols b/tests/baselines/reference/DecoratorOnFunctionTypeExport.symbols
new file mode 100644
index 0000000000..08722498cb
--- /dev/null
+++ b/tests/baselines/reference/DecoratorOnFunctionTypeExport.symbols
@@ -0,0 +1,25 @@
+=== tests/cases/conformance/parser/ets/decorator/DecoratorOnFunctionTypeExport.ets ===
+@xxxx1
+export declare type testType1 = @xxxx2 (() => void);
+>testType1 : Symbol(testType1, Decl(DecoratorOnFunctionTypeExport.ets, 0, 0))
+
+@xxxx3
+export declare type testType2 = @xxxx4 (() => void) | number;
+>testType2 : Symbol(testType2, Decl(DecoratorOnFunctionTypeExport.ets, 1, 52))
+
+@xxxx5
+export declare type testType3 = @xxxx6 (() => void) | (() => string);
+>testType3 : Symbol(testType3, Decl(DecoratorOnFunctionTypeExport.ets, 3, 61))
+
+@xxxx7
+export declare type testType4 = @xxxx8 (() => void) | @xxxx9 (() => string);
+>testType4 : Symbol(testType4, Decl(DecoratorOnFunctionTypeExport.ets, 5, 69))
+
+@xxxx10
+export declare type testType5 = @xxxx9 (() => void) | @xxxx10 (() => string);
+>testType5 : Symbol(testType5, Decl(DecoratorOnFunctionTypeExport.ets, 7, 76))
+
+@xxxx11
+export declare type testType6 = @xxxx11() (() => number);
+>testType6 : Symbol(testType6, Decl(DecoratorOnFunctionTypeExport.ets, 9, 77))
+
diff --git a/tests/baselines/reference/DecoratorOnFunctionTypeExport.types b/tests/baselines/reference/DecoratorOnFunctionTypeExport.types
new file mode 100644
index 0000000000..4381b21b05
--- /dev/null
+++ b/tests/baselines/reference/DecoratorOnFunctionTypeExport.types
@@ -0,0 +1,46 @@
+=== tests/cases/conformance/parser/ets/decorator/DecoratorOnFunctionTypeExport.ets ===
+@xxxx1
+>xxxx1 : error
+
+export declare type testType1 = @xxxx2 (() => void);
+>testType1 : () => void
+>xxxx2 : error
+
+@xxxx3
+>xxxx3 : error
+
+export declare type testType2 = @xxxx4 (() => void) | number;
+>testType2 : number | (() => void)
+>xxxx4 : error
+
+@xxxx5
+>xxxx5 : error
+
+export declare type testType3 = @xxxx6 (() => void) | (() => string);
+>testType3 : (() => void) | (() => string)
+>xxxx6 : error
+
+@xxxx7
+>xxxx7 : error
+
+export declare type testType4 = @xxxx8 (() => void) | @xxxx9 (() => string);
+>testType4 : (() => void) | (() => string)
+>xxxx8 : error
+>xxxx9 : error
+
+@xxxx10
+>xxxx10 : error
+
+export declare type testType5 = @xxxx9 (() => void) | @xxxx10 (() => string);
+>testType5 : (() => void) | (() => string)
+>xxxx9 : error
+>xxxx10 : error
+
+@xxxx11
+>xxxx11 : error
+
+export declare type testType6 = @xxxx11() (() => number);
+>testType6 : () => number
+>xxxx11() : error
+>xxxx11 : error
+
diff --git a/tests/baselines/reference/DecoratorOnTypeDeclaration.js b/tests/baselines/reference/DecoratorOnTypeDeclaration.js
new file mode 100644
index 0000000000..6db134f57a
--- /dev/null
+++ b/tests/baselines/reference/DecoratorOnTypeDeclaration.js
@@ -0,0 +1,26 @@
+//// [DecoratorOnTypeDeclaration.ets]
+@xxxx1
+declare type testType1 = string;
+@Sendable
+declare type testType2 = () => void;
+@xxxx2
+@Sendable
+declare type testType3 = number | string;
+@Sendable
+@xxxx3
+declare type testType4 = number | string;
+
+//// [DecoratorOnTypeDeclaration.js]
+
+
+//// [DecoratorOnTypeDeclaration.d.ets]
+@xxxx1
+declare type testType1 = string;
+@Sendable
+declare type testType2 = () => void;
+@xxxx2
+@Sendable
+declare type testType3 = number | string;
+@Sendable
+@xxxx3
+declare type testType4 = number | string;
diff --git a/tests/baselines/reference/DecoratorOnTypeDeclaration.symbols b/tests/baselines/reference/DecoratorOnTypeDeclaration.symbols
new file mode 100644
index 0000000000..c1982d6b95
--- /dev/null
+++ b/tests/baselines/reference/DecoratorOnTypeDeclaration.symbols
@@ -0,0 +1,19 @@
+=== tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeDeclaration.ets ===
+@xxxx1
+declare type testType1 = string;
+>testType1 : Symbol(testType1, Decl(DecoratorOnTypeDeclaration.ets, 0, 0))
+
+@Sendable
+declare type testType2 = () => void;
+>testType2 : Symbol(testType2, Decl(DecoratorOnTypeDeclaration.ets, 1, 32))
+
+@xxxx2
+@Sendable
+declare type testType3 = number | string;
+>testType3 : Symbol(testType3, Decl(DecoratorOnTypeDeclaration.ets, 3, 36))
+
+@Sendable
+@xxxx3
+declare type testType4 = number | string;
+>testType4 : Symbol(testType4, Decl(DecoratorOnTypeDeclaration.ets, 6, 41))
+
diff --git a/tests/baselines/reference/DecoratorOnTypeDeclaration.types b/tests/baselines/reference/DecoratorOnTypeDeclaration.types
new file mode 100644
index 0000000000..5c5539ddf1
--- /dev/null
+++ b/tests/baselines/reference/DecoratorOnTypeDeclaration.types
@@ -0,0 +1,31 @@
+=== tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeDeclaration.ets ===
+@xxxx1
+>xxxx1 : error
+
+declare type testType1 = string;
+>testType1 : string
+
+@Sendable
+>Sendable : error
+
+declare type testType2 = () => void;
+>testType2 : () => void
+
+@xxxx2
+>xxxx2 : error
+
+@Sendable
+>Sendable : error
+
+declare type testType3 = number | string;
+>testType3 : string | number
+
+@Sendable
+>Sendable : error
+
+@xxxx3
+>xxxx3 : error
+
+declare type testType4 = number | string;
+>testType4 : string | number
+
diff --git a/tests/baselines/reference/DecoratorOnTypeDeclarationExport.js b/tests/baselines/reference/DecoratorOnTypeDeclarationExport.js
new file mode 100644
index 0000000000..5a4546acaa
--- /dev/null
+++ b/tests/baselines/reference/DecoratorOnTypeDeclarationExport.js
@@ -0,0 +1,28 @@
+//// [DecoratorOnTypeDeclarationExport.ets]
+@xxxx1
+export declare type testType1 = string;
+@Sendable
+export declare type testType2 = () => void;
+@xxxx2
+@Sendable
+export declare type testType3 = number | string;
+@Sendable
+@xxxx3
+export declare type testType4 = number | string;
+
+//// [DecoratorOnTypeDeclarationExport.js]
+"use strict";
+exports.__esModule = true;
+
+
+//// [DecoratorOnTypeDeclarationExport.d.ets]
+@xxxx1
+export declare type testType1 = string;
+@Sendable
+export declare type testType2 = () => void;
+@xxxx2
+@Sendable
+export declare type testType3 = number | string;
+@Sendable
+@xxxx3
+export declare type testType4 = number | string;
diff --git a/tests/baselines/reference/DecoratorOnTypeDeclarationExport.symbols b/tests/baselines/reference/DecoratorOnTypeDeclarationExport.symbols
new file mode 100644
index 0000000000..085b831a95
--- /dev/null
+++ b/tests/baselines/reference/DecoratorOnTypeDeclarationExport.symbols
@@ -0,0 +1,19 @@
+=== tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeDeclarationExport.ets ===
+@xxxx1
+export declare type testType1 = string;
+>testType1 : Symbol(testType1, Decl(DecoratorOnTypeDeclarationExport.ets, 0, 0))
+
+@Sendable
+export declare type testType2 = () => void;
+>testType2 : Symbol(testType2, Decl(DecoratorOnTypeDeclarationExport.ets, 1, 39))
+
+@xxxx2
+@Sendable
+export declare type testType3 = number | string;
+>testType3 : Symbol(testType3, Decl(DecoratorOnTypeDeclarationExport.ets, 3, 43))
+
+@Sendable
+@xxxx3
+export declare type testType4 = number | string;
+>testType4 : Symbol(testType4, Decl(DecoratorOnTypeDeclarationExport.ets, 6, 48))
+
diff --git a/tests/baselines/reference/DecoratorOnTypeDeclarationExport.types b/tests/baselines/reference/DecoratorOnTypeDeclarationExport.types
new file mode 100644
index 0000000000..ce86444a74
--- /dev/null
+++ b/tests/baselines/reference/DecoratorOnTypeDeclarationExport.types
@@ -0,0 +1,31 @@
+=== tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeDeclarationExport.ets ===
+@xxxx1
+>xxxx1 : error
+
+export declare type testType1 = string;
+>testType1 : string
+
+@Sendable
+>Sendable : error
+
+export declare type testType2 = () => void;
+>testType2 : () => void
+
+@xxxx2
+>xxxx2 : error
+
+@Sendable
+>Sendable : error
+
+export declare type testType3 = number | string;
+>testType3 : string | number
+
+@Sendable
+>Sendable : error
+
+@xxxx3
+>xxxx3 : error
+
+export declare type testType4 = number | string;
+>testType4 : string | number
+
diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts
index 554204ead4..2b31552aa1 100644
--- a/tests/baselines/reference/api/tsserverlibrary.d.ts
+++ b/tests/baselines/reference/api/tsserverlibrary.d.ts
@@ -4701,9 +4701,9 @@ declare namespace ts {
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | EnumMember;
- type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration;
+ type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration | TypeAliasDeclaration | FunctionOrConstructorTypeNode;
type HasIllegalDecorators = PropertyAssignment | ShorthandPropertyAssignment | FunctionDeclaration | ConstructorDeclaration | IndexSignatureDeclaration | ClassStaticBlockDeclaration | MissingDeclaration | VariableStatement | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportDeclaration | ExportAssignment;
- type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
+ type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | FunctionTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
interface NodeArray extends ReadonlyArray, ReadonlyTextRange {
readonly hasTrailingComma: boolean;
}
@@ -5067,11 +5067,11 @@ declare namespace ts {
}
interface FunctionTypeNode {
/** @deprecated A function type cannot have modifiers */
- readonly modifiers?: NodeArray | undefined;
+ readonly modifiers?: NodeArray | undefined;
}
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
readonly kind: SyntaxKind.ConstructorType;
- readonly modifiers?: NodeArray;
+ readonly modifiers?: NodeArray;
}
interface NodeWithTypeArguments extends TypeNode {
readonly typeArguments?: NodeArray;
@@ -5811,7 +5811,7 @@ declare namespace ts {
}
interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer {
readonly kind: SyntaxKind.TypeAliasDeclaration;
- readonly modifiers?: NodeArray;
+ readonly modifiers?: NodeArray;
readonly name: Identifier;
readonly typeParameters?: NodeArray;
readonly type: TypeNode;
@@ -7942,10 +7942,10 @@ declare namespace ts {
updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode;
createTypeReferenceNode(typeName: string | EntityName, typeArguments?: readonly TypeNode[]): TypeReferenceNode;
updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray | undefined): TypeReferenceNode;
- createFunctionTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
- updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): FunctionTypeNode;
- createConstructorTypeNode(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
- updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly Modifier[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): ConstructorTypeNode;
+ createFunctionTypeNode(modifiers: readonly ModifierLike[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
+ updateFunctionTypeNode(node: FunctionTypeNode, modifiers: readonly ModifierLike[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): FunctionTypeNode;
+ createConstructorTypeNode(modifiers: readonly ModifierLike[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
+ updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly ModifierLike[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): ConstructorTypeNode;
createTypeQueryNode(exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode;
@@ -8120,8 +8120,8 @@ declare namespace ts {
updateOverloadDeclaration(node: OverloadDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
- createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
- updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
+ createTypeAliasDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
+ updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
createEnumDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
createModuleDeclaration(modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration;
@@ -9468,6 +9468,7 @@ declare namespace ts {
function isDecoratorOrAnnotation(node: Node): node is Decorator;
function isDecorator(node: Node): node is Decorator;
function isAnnotation(node: Node): node is Annotation;
+ function isSendableDecorator(node: Decorator): node is Decorator;
function isPropertySignature(node: Node): node is PropertySignature;
function isOverloadPropertyDeclaration(node: Node): node is OverloadPropertyDeclaration;
function isPropertyDeclaration(node: Node): node is PropertyDeclaration;
diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts
index 3482f90040..1e0b6a1400 100644
--- a/tests/baselines/reference/api/typescript.d.ts
+++ b/tests/baselines/reference/api/typescript.d.ts
@@ -698,9 +698,9 @@ declare namespace ts {
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | EnumMember;
- type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration;
+ type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration | TypeAliasDeclaration | FunctionOrConstructorTypeNode;
type HasIllegalDecorators = PropertyAssignment | ShorthandPropertyAssignment | FunctionDeclaration | ConstructorDeclaration | IndexSignatureDeclaration | ClassStaticBlockDeclaration | MissingDeclaration | VariableStatement | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportDeclaration | ExportAssignment;
- type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
+ type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | FunctionTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
interface NodeArray extends ReadonlyArray, ReadonlyTextRange {
readonly hasTrailingComma: boolean;
}
@@ -1064,11 +1064,11 @@ declare namespace ts {
}
interface FunctionTypeNode {
/** @deprecated A function type cannot have modifiers */
- readonly modifiers?: NodeArray | undefined;
+ readonly modifiers?: NodeArray | undefined;
}
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
readonly kind: SyntaxKind.ConstructorType;
- readonly modifiers?: NodeArray;
+ readonly modifiers?: NodeArray;
}
interface NodeWithTypeArguments extends TypeNode {
readonly typeArguments?: NodeArray;
@@ -1808,7 +1808,7 @@ declare namespace ts {
}
interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer {
readonly kind: SyntaxKind.TypeAliasDeclaration;
- readonly modifiers?: NodeArray;
+ readonly modifiers?: NodeArray;
readonly name: Identifier;
readonly typeParameters?: NodeArray;
readonly type: TypeNode;
@@ -3939,10 +3939,10 @@ declare namespace ts {
updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode;
createTypeReferenceNode(typeName: string | EntityName, typeArguments?: readonly TypeNode[]): TypeReferenceNode;
updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray | undefined): TypeReferenceNode;
- createFunctionTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
- updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): FunctionTypeNode;
- createConstructorTypeNode(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
- updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly Modifier[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): ConstructorTypeNode;
+ createFunctionTypeNode(modifiers: readonly ModifierLike[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode;
+ updateFunctionTypeNode(node: FunctionTypeNode, modifiers: readonly ModifierLike[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): FunctionTypeNode;
+ createConstructorTypeNode(modifiers: readonly ModifierLike[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode;
+ updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly ModifierLike[] | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode): ConstructorTypeNode;
createTypeQueryNode(exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode;
createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode;
@@ -4117,8 +4117,8 @@ declare namespace ts {
updateOverloadDeclaration(node: OverloadDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
- createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
- updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
+ createTypeAliasDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
+ updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
createEnumDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
createModuleDeclaration(modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration;
@@ -5465,6 +5465,7 @@ declare namespace ts {
function isDecoratorOrAnnotation(node: Node): node is Decorator;
function isDecorator(node: Node): node is Decorator;
function isAnnotation(node: Node): node is Annotation;
+ function isSendableDecorator(node: Decorator): node is Decorator;
function isPropertySignature(node: Node): node is PropertySignature;
function isOverloadPropertyDeclaration(node: Node): node is OverloadPropertyDeclaration;
function isPropertyDeclaration(node: Node): node is PropertyDeclaration;
diff --git a/tests/baselines/reference/completionsCommentsCommentParsing.baseline b/tests/baselines/reference/completionsCommentsCommentParsing.baseline
index 8ebe56c5dc..e5af44aef0 100644
--- a/tests/baselines/reference/completionsCommentsCommentParsing.baseline
+++ b/tests/baselines/reference/completionsCommentsCommentParsing.baseline
@@ -1722,15 +1722,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -1964,15 +1955,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -7932,15 +7914,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -8174,15 +8147,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -15191,15 +15155,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -15433,15 +15388,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -21481,15 +21427,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -21723,15 +21660,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -28211,15 +28139,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -28453,15 +28372,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -34421,15 +34331,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -34663,15 +34564,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -41594,15 +41486,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -41836,15 +41719,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
diff --git a/tests/baselines/reference/decoratorOnTypeAlias.errors.txt b/tests/baselines/reference/decoratorOnTypeAlias.errors.txt
deleted file mode 100644
index 6d76a0b30d..0000000000
--- a/tests/baselines/reference/decoratorOnTypeAlias.errors.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-tests/cases/conformance/decorators/invalid/decoratorOnTypeAlias.ts(3,1): error TS1206: Decorators are not valid here.
-
-
-==== tests/cases/conformance/decorators/invalid/decoratorOnTypeAlias.ts (1 errors) ====
- declare function dec(target: T): T;
-
- @dec
- ~
-!!! error TS1206: Decorators are not valid here.
- type T = number;
\ No newline at end of file
diff --git a/tests/baselines/reference/jsdocParameterParsingInfiniteLoop.errors.txt b/tests/baselines/reference/jsdocParameterParsingInfiniteLoop.errors.txt
index e5bc7502d2..c95966879d 100644
--- a/tests/baselines/reference/jsdocParameterParsingInfiniteLoop.errors.txt
+++ b/tests/baselines/reference/jsdocParameterParsingInfiniteLoop.errors.txt
@@ -1,17 +1,14 @@
tests/cases/compiler/example.js(3,11): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type.
-tests/cases/compiler/example.js(3,20): error TS1110: Type expected.
-tests/cases/compiler/example.js(3,21): error TS2304: Cannot find name 'foo'.
+tests/cases/compiler/example.js(3,24): error TS1110: Type expected.
-==== tests/cases/compiler/example.js (3 errors) ====
+==== tests/cases/compiler/example.js (2 errors) ====
// @ts-check
/**
* @type {function(@foo)}
~~~~~~~~~~~~~~
!!! error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type.
- ~
+ ~
!!! error TS1110: Type expected.
- ~~~
-!!! error TS2304: Cannot find name 'foo'.
*/
let x;
\ No newline at end of file
diff --git a/tests/baselines/reference/jsdocParameterParsingInfiniteLoop.types b/tests/baselines/reference/jsdocParameterParsingInfiniteLoop.types
index 54c89d3749..4490007e7c 100644
--- a/tests/baselines/reference/jsdocParameterParsingInfiniteLoop.types
+++ b/tests/baselines/reference/jsdocParameterParsingInfiniteLoop.types
@@ -4,5 +4,5 @@
* @type {function(@foo)}
*/
let x;
->x : (arg0: any, arg1: foo) => any
+>x : (arg0: any) => any
diff --git a/tests/baselines/reference/quickInfoCommentsCommentParsing.baseline b/tests/baselines/reference/quickInfoCommentsCommentParsing.baseline
index d6e13b4e70..af6c635bc0 100644
--- a/tests/baselines/reference/quickInfoCommentsCommentParsing.baseline
+++ b/tests/baselines/reference/quickInfoCommentsCommentParsing.baseline
@@ -1266,18 +1266,7 @@
"kind": "keyword"
}
],
- "documentation": [],
- "tags": [
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- }
- ]
+ "documentation": []
}
},
{
@@ -1576,15 +1565,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
diff --git a/tests/baselines/reference/signatureHelpCommentsCommentParsing.baseline b/tests/baselines/reference/signatureHelpCommentsCommentParsing.baseline
index 7e9750044e..506aa87d05 100644
--- a/tests/baselines/reference/signatureHelpCommentsCommentParsing.baseline
+++ b/tests/baselines/reference/signatureHelpCommentsCommentParsing.baseline
@@ -1477,15 +1477,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -1764,15 +1755,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -2051,15 +2033,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -2338,15 +2311,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
@@ -2625,15 +2589,6 @@
}
]
},
- {
- "name": "param",
- "text": [
- {
- "text": "d",
- "kind": "text"
- }
- ]
- },
{
"name": "anotherTag"
},
diff --git a/tests/cases/conformance/parser/ets/decorator/DecoratorOnFunctionType.ets b/tests/cases/conformance/parser/ets/decorator/DecoratorOnFunctionType.ets
new file mode 100644
index 0000000000..23bddd4d36
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/decorator/DecoratorOnFunctionType.ets
@@ -0,0 +1,13 @@
+// @declaration: true
+@xxxx1
+declare type testType1 = @xxxx2 (() => void);
+@xxxx3
+declare type testType2 = @xxxx4 (() => void) | number;
+@xxxx5
+declare type testType3 = @xxxx6 (() => void) | (() => string);
+@xxxx7
+declare type testType4 = @xxxx8 (() => void) | @xxxx9 (() => string);
+@xxxx10
+declare type testType5 = @xxxx9 (() => void) | @xxxx10 (() => string);
+@xxxx11
+declare type testType6 = @xxxx11() (() => number);
\ No newline at end of file
diff --git a/tests/cases/conformance/parser/ets/decorator/DecoratorOnFunctionTypeExport.ets b/tests/cases/conformance/parser/ets/decorator/DecoratorOnFunctionTypeExport.ets
new file mode 100644
index 0000000000..cfcccd976b
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/decorator/DecoratorOnFunctionTypeExport.ets
@@ -0,0 +1,13 @@
+// @declaration: true
+@xxxx1
+export declare type testType1 = @xxxx2 (() => void);
+@xxxx3
+export declare type testType2 = @xxxx4 (() => void) | number;
+@xxxx5
+export declare type testType3 = @xxxx6 (() => void) | (() => string);
+@xxxx7
+export declare type testType4 = @xxxx8 (() => void) | @xxxx9 (() => string);
+@xxxx10
+export declare type testType5 = @xxxx9 (() => void) | @xxxx10 (() => string);
+@xxxx11
+export declare type testType6 = @xxxx11() (() => number);
\ No newline at end of file
diff --git a/tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeDeclaration.ets b/tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeDeclaration.ets
new file mode 100644
index 0000000000..566d353276
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeDeclaration.ets
@@ -0,0 +1,11 @@
+// @declaration: true
+@xxxx1
+declare type testType1 = string;
+@Sendable
+declare type testType2 = () => void;
+@xxxx2
+@Sendable
+declare type testType3 = number | string;
+@Sendable
+@xxxx3
+declare type testType4 = number | string;
\ No newline at end of file
diff --git a/tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeDeclarationExport.ets b/tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeDeclarationExport.ets
new file mode 100644
index 0000000000..acc7ce2090
--- /dev/null
+++ b/tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeDeclarationExport.ets
@@ -0,0 +1,11 @@
+// @declaration: true
+@xxxx1
+export declare type testType1 = string;
+@Sendable
+export declare type testType2 = () => void;
+@xxxx2
+@Sendable
+export declare type testType3 = number | string;
+@Sendable
+@xxxx3
+export declare type testType4 = number | string;
\ No newline at end of file
--
Gitee
From 5165f2f98adcf533c3b7e40c17761cdb231b6e47 Mon Sep 17 00:00:00 2001
From: zju_wyx <22125041@zju.edu.cn>
Date: Tue, 19 Aug 2025 21:30:54 +0800
Subject: [PATCH 10/10] support decorator on typeMember
Signed-off-by: zju_wyx <22125041@zju.edu.cn>
Change-Id: Ic15f25c7de2d954f4e58b36f89d7e57a9c2d9825
---
lib/tsc.js | 93 ++++++++++--------
lib/tsserver.js | 97 ++++++++++---------
lib/tsserverlibrary.d.ts | 14 +--
lib/tsserverlibrary.js | 97 ++++++++++---------
lib/typescript.d.ts | 14 +--
lib/typescript.js | 97 ++++++++++---------
lib/typingsInstaller.js | 25 ++---
src/compiler/checker.ts | 25 ++---
src/compiler/emitter.ts | 6 +-
src/compiler/factory/nodeFactory.ts | 4 +-
src/compiler/factory/utilitiesPublic.ts | 5 +-
src/compiler/parser.ts | 20 ++--
src/compiler/transformers/declarations.ts | 16 ++-
src/compiler/types.ts | 16 +--
src/compiler/utilities.ts | 7 +-
.../4.8/mergeDecoratorsAndModifiers.ts | 8 +-
.../reference/DecoratorOnTypeMembers.js | 45 +++++++++
.../reference/DecoratorOnTypeMembers.symbols | 37 +++++++
.../reference/DecoratorOnTypeMembers.types | 52 ++++++++++
.../reference/DecoratorOnTypeMembersExport.js | 47 +++++++++
.../DecoratorOnTypeMembersExport.symbols | 37 +++++++
.../DecoratorOnTypeMembersExport.types | 52 ++++++++++
.../reference/api/tsserverlibrary.d.ts | 14 +--
tests/baselines/reference/api/typescript.d.ts | 14 +--
.../decoratorOnClassAccessor7.errors.txt | 41 --------
.../reference/decoratorOnInterface.errors.txt | 11 ---
.../ets/decorator/DecoratorOnTypeMembers.ets | 19 ++++
.../DecoratorOnTypeMembersExport.ets | 19 ++++
28 files changed, 616 insertions(+), 316 deletions(-)
create mode 100644 tests/baselines/reference/DecoratorOnTypeMembers.js
create mode 100644 tests/baselines/reference/DecoratorOnTypeMembers.symbols
create mode 100644 tests/baselines/reference/DecoratorOnTypeMembers.types
create mode 100644 tests/baselines/reference/DecoratorOnTypeMembersExport.js
create mode 100644 tests/baselines/reference/DecoratorOnTypeMembersExport.symbols
create mode 100644 tests/baselines/reference/DecoratorOnTypeMembersExport.types
delete mode 100644 tests/baselines/reference/decoratorOnClassAccessor7.errors.txt
delete mode 100644 tests/baselines/reference/decoratorOnInterface.errors.txt
create mode 100644 tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeMembers.ets
create mode 100644 tests/cases/conformance/parser/ets/decorator/DecoratorOnTypeMembersExport.ets
diff --git a/lib/tsc.js b/lib/tsc.js
index 1c097478bb..9c83182e51 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -13954,13 +13954,16 @@ function nodeCanBeDecorated(node, parent, grandparent, compilerOptions) {
switch (node.kind) {
case 266 /* ClassDeclaration */:
case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
case 186 /* FunctionType */:
case 187 /* ConstructorType */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 171 /* PropertySignature */:
+ case 175 /* MethodSignature */:
return true;
case 172 /* PropertyDeclaration */:
return parent.kind === 266 /* ClassDeclaration */ || parent.kind === 267 /* StructDeclaration */;
- case 179 /* GetAccessor */:
- case 180 /* SetAccessor */:
case 176 /* MethodDeclaration */:
return node.body !== void 0 && (parent.kind === 266 /* ClassDeclaration */ || parent.kind === 267 /* StructDeclaration */);
case 169 /* Parameter */:
@@ -25584,7 +25587,7 @@ function canHaveModifiers(node) {
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */ || kind === 270 /* InterfaceDeclaration */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */;
}
// src/compiler/parser.ts
@@ -28293,6 +28296,9 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
+ if (token() === 59 /* AtToken */) {
+ return true;
+ }
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
@@ -28325,20 +28331,21 @@ var Parser;
}
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
+ const decorators = parseDecorators();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 179 /* GetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 4 /* Type */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 180 /* SetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 4 /* Type */);
}
if (isIndexSignature()) {
- return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
+ return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
- return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
- return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
+ return parsePropertyOrMethodSignature(pos, hasJSDoc, combineDecoratorsAndModifiers(decorators, modifiers));
}
function nextTokenIsOpenParenOrLessThan() {
nextToken();
@@ -31564,8 +31571,7 @@ var Parser;
const typeParameters = parseTypeParameters();
const heritageClauses = parseHeritageClauses();
const members = parseObjectTypeMembers();
- const node = factory2.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members);
- node.illegalDecorators = decorators;
+ const node = factory2.createInterfaceDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) {
@@ -72824,21 +72830,24 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type.symbol.declarations[0];
}
function checkDecorators(node) {
+ let skipAnnotationAndDecoratosCheck = (isPropertySignature(node) || isMethodSignature(node) || isAccessor(node)) && isInterfaceDeclaration(node.parent);
let atLeastOneDecorator = false;
- getAllDecorators(node).forEach((item) => {
- if (isIdentifier(item.expression)) {
- const symbol = getResolvedSymbol(item.expression);
- if (symbol !== unknownSymbol) {
- checkIdentifierJsDoc(item.expression, symbol);
+ if (!skipAnnotationAndDecoratosCheck) {
+ getAllDecorators(node).forEach((item) => {
+ if (isIdentifier(item.expression)) {
+ const symbol = getResolvedSymbol(item.expression);
+ if (symbol !== unknownSymbol) {
+ checkIdentifierJsDoc(item.expression, symbol);
+ }
}
- }
- const annotationDecl = getAnnotationDeclaration(item);
- if (annotationDecl) {
- item.annotationDeclaration = annotationDecl;
- } else {
- atLeastOneDecorator = true;
- }
- });
+ const annotationDecl = getAnnotationDeclaration(item);
+ if (annotationDecl) {
+ item.annotationDeclaration = annotationDecl;
+ } else {
+ atLeastOneDecorator = true;
+ }
+ });
+ }
if (!canHaveDecorators(node) || !hasDecorators(node) && !hasAnnotations(node) || !node.modifiers || !nodeCanBeDecorated(node, node.parent, node.parent.parent)) {
return;
}
@@ -72894,9 +72903,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
}
- for (const modifier of node.modifiers) {
- if (isDecorator(modifier)) {
- checkDecorator(modifier);
+ if (!skipAnnotationAndDecoratosCheck) {
+ for (const modifier of node.modifiers) {
+ if (isDecorator(modifier)) {
+ checkDecorator(modifier);
+ }
}
}
}
@@ -78253,6 +78264,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
}
+ if (isPropertySignature(node) || isMethodSignature(node)) {
+ return false;
+ }
if (isMethodDeclaration(node) && hasSyntacticModifier(node, 256 /* Abstract */)) {
for (const decorator of decorators) {
const annotatedDecl = decorator.parent;
@@ -78273,11 +78287,6 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
return true;
- } else if (node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */) {
- const accessors = getAllAccessorDeclarations(node.parent.members, node);
- if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) {
- return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
- }
}
return false;
}
@@ -97896,7 +97905,7 @@ function transformDeclarations(context) {
const accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input));
return cleanup(factory2.updateGetAccessorDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
updateAccessorParamsList(input, hasEffectiveModifier(input, 8 /* Private */)),
ensureType(input, accessorType),
@@ -97909,7 +97918,7 @@ function transformDeclarations(context) {
}
return cleanup(factory2.updateSetAccessorDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
updateAccessorParamsList(input, hasEffectiveModifier(input, 8 /* Private */)),
void 0
@@ -97941,18 +97950,17 @@ function transformDeclarations(context) {
}
return cleanup(factory2.updatePropertySignature(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
input.questionToken,
ensureType(input, input.type)
));
case 269 /* OverloadDeclaration */:
- const modifiers = factory2.createNodeArray(ensureModifiers(input));
const memberNodes = visitNodes2(input.members, visitDeclarationSubtree);
const members = factory2.createNodeArray(memberNodes);
return cleanup(factory2.updateOverloadDeclaration(
input,
- modifiers,
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
members
));
@@ -97973,7 +97981,7 @@ function transformDeclarations(context) {
}
return cleanup(factory2.updateMethodSignature(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
input.questionToken,
ensureTypeParams(input, input.typeParameters),
@@ -98159,10 +98167,9 @@ function transformDeclarations(context) {
switch (input.kind) {
case 271 /* TypeAliasDeclaration */: {
needsDeclare = false;
- let decorators = getDecorators(input);
const clean2 = cleanup(factory2.updateTypeAliasDeclaration(
input,
- concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
visitNode(input.type, visitDeclarationSubtree, isTypeNode)
@@ -98176,7 +98183,7 @@ function transformDeclarations(context) {
case 270 /* InterfaceDeclaration */: {
return cleanup(factory2.updateInterfaceDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
ensureTypeParams(input, input.typeParameters),
transformHeritageClauses(input.heritageClauses),
@@ -100905,7 +100912,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess);
}
function emitPropertySignature(node) {
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
emitNodeWithWriter(node.name, writeProperty);
emit(node.questionToken);
emitTypeAnnotation(node.type);
@@ -100933,7 +100940,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitMethodSignature(node) {
pushNameGenerationScope(node);
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
emit(node.name);
emit(node.questionToken);
emitTypeParameters(node, node.typeParameters);
@@ -101926,7 +101933,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
}
function emitInterfaceDeclaration(node) {
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
writeKeyword("interface");
writeSpace();
emit(node.name);
diff --git a/lib/tsserver.js b/lib/tsserver.js
index 92a32adccb..534f5c66a3 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -16649,13 +16649,16 @@ function nodeCanBeDecorated(node, parent2, grandparent, compilerOptions) {
switch (node.kind) {
case 266 /* ClassDeclaration */:
case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
case 186 /* FunctionType */:
case 187 /* ConstructorType */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 171 /* PropertySignature */:
+ case 175 /* MethodSignature */:
return true;
case 172 /* PropertyDeclaration */:
return parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */;
- case 179 /* GetAccessor */:
- case 180 /* SetAccessor */:
case 176 /* MethodDeclaration */:
return node.body !== void 0 && (parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */);
case 169 /* Parameter */:
@@ -28279,7 +28282,7 @@ function canHaveModifiers(node) {
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */ || kind === 270 /* InterfaceDeclaration */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */;
}
// src/compiler/parser.ts
@@ -30973,6 +30976,9 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
+ if (token() === 59 /* AtToken */) {
+ return true;
+ }
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
@@ -31005,20 +31011,21 @@ var Parser;
}
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
+ const decorators = parseDecorators();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 179 /* GetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 4 /* Type */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 180 /* SetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 4 /* Type */);
}
if (isIndexSignature()) {
- return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
+ return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
- return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
- return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
+ return parsePropertyOrMethodSignature(pos, hasJSDoc, combineDecoratorsAndModifiers(decorators, modifiers));
}
function nextTokenIsOpenParenOrLessThan() {
nextToken();
@@ -34244,8 +34251,7 @@ var Parser;
const typeParameters = parseTypeParameters();
const heritageClauses = parseHeritageClauses();
const members = parseObjectTypeMembers();
- const node = factory2.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members);
- node.illegalDecorators = decorators;
+ const node = factory2.createInterfaceDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) {
@@ -75361,21 +75367,24 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type.symbol.declarations[0];
}
function checkDecorators(node) {
+ let skipAnnotationAndDecoratosCheck = (isPropertySignature(node) || isMethodSignature(node) || isAccessor(node)) && isInterfaceDeclaration(node.parent);
let atLeastOneDecorator = false;
- getAllDecorators(node).forEach((item) => {
- if (isIdentifier(item.expression)) {
- const symbol = getResolvedSymbol(item.expression);
- if (symbol !== unknownSymbol) {
- checkIdentifierJsDoc(item.expression, symbol);
+ if (!skipAnnotationAndDecoratosCheck) {
+ getAllDecorators(node).forEach((item) => {
+ if (isIdentifier(item.expression)) {
+ const symbol = getResolvedSymbol(item.expression);
+ if (symbol !== unknownSymbol) {
+ checkIdentifierJsDoc(item.expression, symbol);
+ }
}
- }
- const annotationDecl = getAnnotationDeclaration(item);
- if (annotationDecl) {
- item.annotationDeclaration = annotationDecl;
- } else {
- atLeastOneDecorator = true;
- }
- });
+ const annotationDecl = getAnnotationDeclaration(item);
+ if (annotationDecl) {
+ item.annotationDeclaration = annotationDecl;
+ } else {
+ atLeastOneDecorator = true;
+ }
+ });
+ }
if (!canHaveDecorators(node) || !hasDecorators(node) && !hasAnnotations(node) || !node.modifiers || !nodeCanBeDecorated(node, node.parent, node.parent.parent)) {
return;
}
@@ -75431,9 +75440,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
}
- for (const modifier of node.modifiers) {
- if (isDecorator(modifier)) {
- checkDecorator(modifier);
+ if (!skipAnnotationAndDecoratosCheck) {
+ for (const modifier of node.modifiers) {
+ if (isDecorator(modifier)) {
+ checkDecorator(modifier);
+ }
}
}
}
@@ -80790,6 +80801,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
}
+ if (isPropertySignature(node) || isMethodSignature(node)) {
+ return false;
+ }
if (isMethodDeclaration(node) && hasSyntacticModifier(node, 256 /* Abstract */)) {
for (const decorator of decorators) {
const annotatedDecl = decorator.parent;
@@ -80810,11 +80824,6 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
return true;
- } else if (node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */) {
- const accessors = getAllAccessorDeclarations(node.parent.members, node);
- if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) {
- return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
- }
}
return false;
}
@@ -100249,7 +100258,7 @@ function transformDeclarations(context) {
const accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input));
return cleanup(factory2.updateGetAccessorDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
updateAccessorParamsList(input, hasEffectiveModifier(input, 8 /* Private */)),
ensureType(input, accessorType),
@@ -100262,7 +100271,7 @@ function transformDeclarations(context) {
}
return cleanup(factory2.updateSetAccessorDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
updateAccessorParamsList(input, hasEffectiveModifier(input, 8 /* Private */)),
void 0
@@ -100294,18 +100303,17 @@ function transformDeclarations(context) {
}
return cleanup(factory2.updatePropertySignature(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
input.questionToken,
ensureType(input, input.type)
));
case 269 /* OverloadDeclaration */:
- const modifiers = factory2.createNodeArray(ensureModifiers(input));
const memberNodes = visitNodes2(input.members, visitDeclarationSubtree);
const members = factory2.createNodeArray(memberNodes);
return cleanup(factory2.updateOverloadDeclaration(
input,
- modifiers,
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
members
));
@@ -100326,7 +100334,7 @@ function transformDeclarations(context) {
}
return cleanup(factory2.updateMethodSignature(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
input.questionToken,
ensureTypeParams(input, input.typeParameters),
@@ -100512,10 +100520,9 @@ function transformDeclarations(context) {
switch (input.kind) {
case 271 /* TypeAliasDeclaration */: {
needsDeclare = false;
- let decorators = getDecorators(input);
const clean2 = cleanup(factory2.updateTypeAliasDeclaration(
input,
- concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
visitNode(input.type, visitDeclarationSubtree, isTypeNode)
@@ -100529,7 +100536,7 @@ function transformDeclarations(context) {
case 270 /* InterfaceDeclaration */: {
return cleanup(factory2.updateInterfaceDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
ensureTypeParams(input, input.typeParameters),
transformHeritageClauses(input.heritageClauses),
@@ -103238,7 +103245,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess);
}
function emitPropertySignature(node) {
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
emitNodeWithWriter(node.name, writeProperty);
emit(node.questionToken);
emitTypeAnnotation(node.type);
@@ -103266,7 +103273,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitMethodSignature(node) {
pushNameGenerationScope(node);
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
emit(node.name);
emit(node.questionToken);
emitTypeParameters(node, node.typeParameters);
@@ -104259,7 +104266,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
}
function emitInterfaceDeclaration(node) {
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
writeKeyword("interface");
writeSpace();
emit(node.name);
@@ -156678,7 +156685,7 @@ function patchNodeFactory4(factory2) {
return createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members);
}
}).bind({
- 0: ([modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)),
+ 0: ([modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)),
1: ([decorators, modifiers, name, typeParameters, heritageClauses, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement))
}).deprecate({
1: DISALLOW_DECORATORS
@@ -156691,7 +156698,7 @@ function patchNodeFactory4(factory2) {
return updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members);
}
}).bind({
- 0: ([, modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)),
+ 0: ([, modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)),
1: ([, decorators, modifiers, name, typeParameters, heritageClauses, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement))
}).deprecate({
1: DISALLOW_DECORATORS
diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts
index 2b31552aa1..99429e20bb 100644
--- a/lib/tsserverlibrary.d.ts
+++ b/lib/tsserverlibrary.d.ts
@@ -4701,7 +4701,7 @@ declare namespace ts {
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | EnumMember;
- type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration | TypeAliasDeclaration | FunctionOrConstructorTypeNode;
+ type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration | TypeAliasDeclaration | FunctionOrConstructorTypeNode | InterfaceDeclaration | PropertySignature | MethodSignature | OverloadDeclaration;
type HasIllegalDecorators = PropertyAssignment | ShorthandPropertyAssignment | FunctionDeclaration | ConstructorDeclaration | IndexSignatureDeclaration | ClassStaticBlockDeclaration | MissingDeclaration | VariableStatement | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportDeclaration | ExportAssignment;
type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | FunctionTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
interface NodeArray extends ReadonlyArray, ReadonlyTextRange {
@@ -7909,16 +7909,16 @@ declare namespace ts {
updateParameterDeclaration(node: ParameterDeclaration, modifiers: readonly ModifierLike[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration;
createDecorator(expression: Expression, annotationDeclaration?: AnnotationDeclaration): Decorator;
updateDecorator(node: Decorator, expression: Expression, annotationDeclaration?: AnnotationDeclaration): Decorator;
- createPropertySignature(modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
- updatePropertySignature(node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
+ createPropertySignature(modifiers: readonly ModifierLike[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
+ updatePropertySignature(node: PropertySignature, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
createPropertyDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
updatePropertyDeclaration(node: PropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
createAnnotationPropertyDeclaration(name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
updateAnnotationPropertyDeclaration(node: AnnotationPropertyDeclaration, name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
createOverloadPropertyDeclaration(modifiers: readonly ModifierLike[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
updateOverloadPropertyDeclaration(node: OverloadPropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
- createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
- updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature;
+ createMethodSignature(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
+ updateMethodSignature(node: MethodSignature, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): MethodSignature;
createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
updateMethodDeclaration(node: MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined, name: Identifier | undefined): ConstructorDeclaration;
@@ -8118,8 +8118,8 @@ declare namespace ts {
updateAnnotationDeclaration(node: AnnotationDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly AnnotationElement[]): AnnotationDeclaration;
createOverloadDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
updateOverloadDeclaration(node: OverloadDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, members: readonly OverloadElement[]): OverloadDeclaration;
- createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
- updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
+ createInterfaceDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
+ updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
createTypeAliasDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
createEnumDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index 6f7df2d1a4..2f8e9b26b7 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -16551,13 +16551,16 @@ function nodeCanBeDecorated(node, parent2, grandparent, compilerOptions) {
switch (node.kind) {
case 266 /* ClassDeclaration */:
case 267 /* StructDeclaration */:
+ case 270 /* InterfaceDeclaration */:
case 186 /* FunctionType */:
case 187 /* ConstructorType */:
+ case 179 /* GetAccessor */:
+ case 180 /* SetAccessor */:
+ case 171 /* PropertySignature */:
+ case 175 /* MethodSignature */:
return true;
case 172 /* PropertyDeclaration */:
return parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */;
- case 179 /* GetAccessor */:
- case 180 /* SetAccessor */:
case 176 /* MethodDeclaration */:
return node.body !== void 0 && (parent2.kind === 266 /* ClassDeclaration */ || parent2.kind === 267 /* StructDeclaration */);
case 169 /* Parameter */:
@@ -28181,7 +28184,7 @@ function canHaveModifiers(node) {
}
function canHaveDecorators(node) {
const kind = node.kind;
- return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */;
+ return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 176 /* MethodDeclaration */ || kind === 179 /* GetAccessor */ || kind === 180 /* SetAccessor */ || kind === 234 /* ClassExpression */ || kind === 266 /* ClassDeclaration */ || kind === 267 /* StructDeclaration */ || kind === 187 /* ConstructorType */ || kind === 186 /* FunctionType */ || kind === 270 /* InterfaceDeclaration */ || kind === 171 /* PropertySignature */ || kind === 175 /* MethodSignature */;
}
// src/compiler/parser.ts
@@ -30875,6 +30878,9 @@ var Parser;
if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) {
return true;
}
+ if (token() === 59 /* AtToken */) {
+ return true;
+ }
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
return true;
}
@@ -30907,20 +30913,21 @@ var Parser;
}
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
+ const decorators = parseDecorators();
const modifiers = parseModifiers();
if (parseContextualModifier(138 /* GetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 179 /* GetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 179 /* GetAccessor */, 4 /* Type */);
}
if (parseContextualModifier(152 /* SetKeyword */)) {
- return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 180 /* SetAccessor */, 4 /* Type */);
+ return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 180 /* SetAccessor */, 4 /* Type */);
}
if (isIndexSignature()) {
- return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers);
+ return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);
}
if (token() === 164 /* OverloadKeyword */ && lookAhead(() => nextTokenIsIdentifierOrKeyword())) {
- return parseOverloadDeclaration(pos, hasJSDoc, void 0, modifiers);
+ return parseOverloadDeclaration(pos, hasJSDoc, decorators, modifiers);
}
- return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);
+ return parsePropertyOrMethodSignature(pos, hasJSDoc, combineDecoratorsAndModifiers(decorators, modifiers));
}
function nextTokenIsOpenParenOrLessThan() {
nextToken();
@@ -34146,8 +34153,7 @@ var Parser;
const typeParameters = parseTypeParameters();
const heritageClauses = parseHeritageClauses();
const members = parseObjectTypeMembers();
- const node = factory2.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members);
- node.illegalDecorators = decorators;
+ const node = factory2.createInterfaceDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) {
@@ -75263,21 +75269,24 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return type.symbol.declarations[0];
}
function checkDecorators(node) {
+ let skipAnnotationAndDecoratosCheck = (isPropertySignature(node) || isMethodSignature(node) || isAccessor(node)) && isInterfaceDeclaration(node.parent);
let atLeastOneDecorator = false;
- getAllDecorators(node).forEach((item) => {
- if (isIdentifier(item.expression)) {
- const symbol = getResolvedSymbol(item.expression);
- if (symbol !== unknownSymbol) {
- checkIdentifierJsDoc(item.expression, symbol);
+ if (!skipAnnotationAndDecoratosCheck) {
+ getAllDecorators(node).forEach((item) => {
+ if (isIdentifier(item.expression)) {
+ const symbol = getResolvedSymbol(item.expression);
+ if (symbol !== unknownSymbol) {
+ checkIdentifierJsDoc(item.expression, symbol);
+ }
}
- }
- const annotationDecl = getAnnotationDeclaration(item);
- if (annotationDecl) {
- item.annotationDeclaration = annotationDecl;
- } else {
- atLeastOneDecorator = true;
- }
- });
+ const annotationDecl = getAnnotationDeclaration(item);
+ if (annotationDecl) {
+ item.annotationDeclaration = annotationDecl;
+ } else {
+ atLeastOneDecorator = true;
+ }
+ });
+ }
if (!canHaveDecorators(node) || !hasDecorators(node) && !hasAnnotations(node) || !node.modifiers || !nodeCanBeDecorated(node, node.parent, node.parent.parent)) {
return;
}
@@ -75333,9 +75342,11 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
break;
}
}
- for (const modifier of node.modifiers) {
- if (isDecorator(modifier)) {
- checkDecorator(modifier);
+ if (!skipAnnotationAndDecoratosCheck) {
+ for (const modifier of node.modifiers) {
+ if (isDecorator(modifier)) {
+ checkDecorator(modifier);
+ }
}
}
}
@@ -80692,6 +80703,9 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
return true;
}
}
+ if (isPropertySignature(node) || isMethodSignature(node)) {
+ return false;
+ }
if (isMethodDeclaration(node) && hasSyntacticModifier(node, 256 /* Abstract */)) {
for (const decorator of decorators) {
const annotatedDecl = decorator.parent;
@@ -80712,11 +80726,6 @@ function createTypeChecker(host, isTypeCheckerForLinter = false) {
}
}
return true;
- } else if (node.kind === 179 /* GetAccessor */ || node.kind === 180 /* SetAccessor */) {
- const accessors = getAllAccessorDeclarations(node.parent.members, node);
- if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) {
- return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
- }
}
return false;
}
@@ -100151,7 +100160,7 @@ function transformDeclarations(context) {
const accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input));
return cleanup(factory2.updateGetAccessorDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
updateAccessorParamsList(input, hasEffectiveModifier(input, 8 /* Private */)),
ensureType(input, accessorType),
@@ -100164,7 +100173,7 @@ function transformDeclarations(context) {
}
return cleanup(factory2.updateSetAccessorDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
updateAccessorParamsList(input, hasEffectiveModifier(input, 8 /* Private */)),
void 0
@@ -100196,18 +100205,17 @@ function transformDeclarations(context) {
}
return cleanup(factory2.updatePropertySignature(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
input.questionToken,
ensureType(input, input.type)
));
case 269 /* OverloadDeclaration */:
- const modifiers = factory2.createNodeArray(ensureModifiers(input));
const memberNodes = visitNodes2(input.members, visitDeclarationSubtree);
const members = factory2.createNodeArray(memberNodes);
return cleanup(factory2.updateOverloadDeclaration(
input,
- modifiers,
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
members
));
@@ -100228,7 +100236,7 @@ function transformDeclarations(context) {
}
return cleanup(factory2.updateMethodSignature(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
input.questionToken,
ensureTypeParams(input, input.typeParameters),
@@ -100414,10 +100422,9 @@ function transformDeclarations(context) {
switch (input.kind) {
case 271 /* TypeAliasDeclaration */: {
needsDeclare = false;
- let decorators = getDecorators(input);
const clean2 = cleanup(factory2.updateTypeAliasDeclaration(
input,
- concatenateDecoratorsAndModifiers(decorators, ensureModifiers(input)),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
visitNode(input.type, visitDeclarationSubtree, isTypeNode)
@@ -100431,7 +100438,7 @@ function transformDeclarations(context) {
case 270 /* InterfaceDeclaration */: {
return cleanup(factory2.updateInterfaceDeclaration(
input,
- ensureModifiers(input),
+ concatenateDecoratorsAndModifiers(getDecorators(input), ensureModifiers(input)),
input.name,
ensureTypeParams(input, input.typeParameters),
transformHeritageClauses(input.heritageClauses),
@@ -103140,7 +103147,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess);
}
function emitPropertySignature(node) {
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
emitNodeWithWriter(node.name, writeProperty);
emit(node.questionToken);
emitTypeAnnotation(node.type);
@@ -103168,7 +103175,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
function emitMethodSignature(node) {
pushNameGenerationScope(node);
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
emit(node.name);
emit(node.questionToken);
emitTypeParameters(node, node.typeParameters);
@@ -104161,7 +104168,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
}
}
function emitInterfaceDeclaration(node) {
- emitModifiers(node, node.modifiers);
+ emitDecoratorsAndModifiers(node, node.modifiers);
writeKeyword("interface");
writeSpace();
emit(node.name);
@@ -156489,7 +156496,7 @@ function patchNodeFactory4(factory2) {
return createInterfaceDeclaration2(modifiers, name, typeParameters, heritageClauses, members);
}
}).bind({
- 0: ([modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)),
+ 0: ([modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)),
1: ([decorators, modifiers, name, typeParameters, heritageClauses, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement))
}).deprecate({
1: DISALLOW_DECORATORS
@@ -156502,7 +156509,7 @@ function patchNodeFactory4(factory2) {
return updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members);
}
}).bind({
- 0: ([, modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || every(modifiers, isModifier)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)),
+ 0: ([, modifiers, name, typeParameters, heritageClauses, members, other]) => other === void 0 && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || isArray(typeParameters)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement)),
1: ([, decorators, modifiers, name, typeParameters, heritageClauses, members]) => (decorators === void 0 || every(decorators, isDecorator)) && (modifiers === void 0 || isArray(modifiers)) && (name === void 0 || !isArray(name)) && (typeParameters === void 0 || every(typeParameters, isTypeParameterDeclaration)) && (heritageClauses === void 0 || every(heritageClauses, isHeritageClause)) && (members === void 0 || every(members, isTypeElement))
}).deprecate({
1: DISALLOW_DECORATORS
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
index 1e0b6a1400..7254744f77 100644
--- a/lib/typescript.d.ts
+++ b/lib/typescript.d.ts
@@ -698,7 +698,7 @@ declare namespace ts {
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | AnnotationPropertyDeclaration | PropertyAssignment | EnumMember;
- type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration | TypeAliasDeclaration | FunctionOrConstructorTypeNode;
+ type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration | StructDeclaration | FunctionDeclaration | TypeAliasDeclaration | FunctionOrConstructorTypeNode | InterfaceDeclaration | PropertySignature | MethodSignature | OverloadDeclaration;
type HasIllegalDecorators = PropertyAssignment | ShorthandPropertyAssignment | FunctionDeclaration | ConstructorDeclaration | IndexSignatureDeclaration | ClassStaticBlockDeclaration | MissingDeclaration | VariableStatement | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportDeclaration | ExportAssignment;
type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | FunctionTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | StructDeclaration | AnnotationDeclaration | OverloadDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration | OverloadPropertyDeclaration;
interface NodeArray extends ReadonlyArray, ReadonlyTextRange {
@@ -3906,16 +3906,16 @@ declare namespace ts {
updateParameterDeclaration(node: ParameterDeclaration, modifiers: readonly ModifierLike[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration;
createDecorator(expression: Expression, annotationDeclaration?: AnnotationDeclaration): Decorator;
updateDecorator(node: Decorator, expression: Expression, annotationDeclaration?: AnnotationDeclaration): Decorator;
- createPropertySignature(modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
- updatePropertySignature(node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
+ createPropertySignature(modifiers: readonly ModifierLike[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
+ updatePropertySignature(node: PropertySignature, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature;
createPropertyDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
updatePropertyDeclaration(node: PropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration;
createAnnotationPropertyDeclaration(name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
updateAnnotationPropertyDeclaration(node: AnnotationPropertyDeclaration, name: string | PropertyName, type: TypeNode | undefined, initializer: Expression | undefined): AnnotationPropertyDeclaration;
createOverloadPropertyDeclaration(modifiers: readonly ModifierLike[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
updateOverloadPropertyDeclaration(node: OverloadPropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): OverloadPropertyDeclaration;
- createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature;
- updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray